Coverage for gco_mcp/tools/config.py: 100.00%
11 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-30 21:22 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-30 21:22 +0000
1"""CLI configuration MCP tools (read-only)."""
3import asyncio
5import cli_runner
6from audit import audit_logged
7from server import mcp
10@mcp.tool(tags={"safe", "config"})
11@audit_logged
12async def config_get(key: str | None = None) -> str:
13 """`gco config-cmd get` — read a CLI configuration value.
15 Args:
16 key: Configuration key to read (dotted paths allowed). If omitted,
17 returns the full config.
18 """
19 args = ["config-cmd", "get"]
20 if key:
21 args.append(key)
22 return await asyncio.to_thread(cli_runner._run_cli, *args)