The MCP server at src/thothctl/mcp/server.py and src/thothctl/services/mcp/service.py currently exposes a subset of ThothCTL commands (init, list, scan, inventory, generate, document, check environment/project).
But three of the most differentiated IDP features are not available as MCP tools:
- Cost analysis (
thothctl check --cost) — src/thothctl/services/check/project/cost/cost_analyzer.py
- Drift detection (
thothctl check --drift) — src/thothctl/services/check/project/drift/
- AI review (
thothctl ai-review) — src/thothctl/services/ai_review/
Adding these as MCP tools would let AI coding assistants (Claude Code, Copilot, etc.) call them directly during development workflows — e.g., "check costs before I add this resource" or "drift-check my current branch."
The implementation pattern already exists in _handle_execute_request in server.py — each new tool would follow the same subprocess-based pattern used by the scan and inventory tools.
Suggested approach:
- Add
thothctl_cost_analyze, thothctl_drift_detect, thothctl_ai_review tool definitions in _get_available_tools()
- Add corresponding execution branches in
_handle_execute_request()
- Add to both
server.py (HTTP) and service.py (stdio/MCP SDK) to keep them in sync
Evidence: Both server files already follow the same pattern. The scan tool at server.py lines 80-95 shows the established subprocess wiring pattern.
The MCP server at
src/thothctl/mcp/server.pyandsrc/thothctl/services/mcp/service.pycurrently exposes a subset of ThothCTL commands (init, list, scan, inventory, generate, document, check environment/project).But three of the most differentiated IDP features are not available as MCP tools:
thothctl check --cost) —src/thothctl/services/check/project/cost/cost_analyzer.pythothctl check --drift) —src/thothctl/services/check/project/drift/thothctl ai-review) —src/thothctl/services/ai_review/Adding these as MCP tools would let AI coding assistants (Claude Code, Copilot, etc.) call them directly during development workflows — e.g., "check costs before I add this resource" or "drift-check my current branch."
The implementation pattern already exists in
_handle_execute_requestinserver.py— each new tool would follow the same subprocess-based pattern used by thescanandinventorytools.Suggested approach:
thothctl_cost_analyze,thothctl_drift_detect,thothctl_ai_reviewtool definitions in_get_available_tools()_handle_execute_request()server.py(HTTP) andservice.py(stdio/MCP SDK) to keep them in syncEvidence: Both server files already follow the same pattern. The
scantool atserver.pylines 80-95 shows the established subprocess wiring pattern.