AI agents & MCP
Role of MCP
Codegenome runs a local MCP server that exposes graph queries as tools. Agents call these tools instead of guessing structure from partial file reads.
Setup flow
- Build the graph —
codegenome analyze . - Start MCP —
codegenome mcp-startor HTTP via legacy CLI - Install client config —
python -m codegenome.installer … - Generate rules —
codegenome rules --client cursor . - Restart your editor
Example tools
search_nodes— find symbols by name or pathget_neighbors— imports, callers, calleesget_entry_points,get_dead_code,get_circular_depsget_god_nodes,get_complexity,get_churn
Full list: MCP tools reference.
Agent rules
Templates in the repository extensions/templates/ teach agents when to call MCP tools. Install with:
codegenome rules --client cursor --port 7331 . codegenome rules --client all --dry-run .