How raghurammrsd/code_graph_mcp works
CodeGraph MCP is a local repository-intelligence engine for AI coding agents. Its main workflow is an agent request through the MCP server, which compiles a task into bounded, evidence-backed context from indexed code, search, and graph relationships. The product also exposes database and framework intelligence, runtime observations, Git freshness and impact analysis, and refactoring tools. The map follows README descriptions and SOURCE INDEX references; unsampled subsystems are included where documented, but their internal call paths are not guessed.
Main entry points: indexer.py Incremental indexer · context.py Context compiler · server.py MCP tools · renamer.py Safe refactoring
Components 25
Agent interfaces
- MCP tools
src/codegraph/mcp/server.py - Web dashboard
src/codegraph/ui/server.py - VS Code extension
vscode-extension/src/extension.ts
Repository intelligence
- Context compiler
src/codegraph/context.py - Task specification
src/codegraph/task.py - Incremental indexer
src/codegraph/indexing/indexer.py - AST parsers
src/codegraph/indexing/parser.py - Index models
src/codegraph/indexing/models.py - File classifier
src/codegraph/indexing/classifier.py - Hybrid search
src/codegraph/search/hybrid.py - Graph traversal
src/codegraph/graph/traversal.py - Target resolver
src/codegraph/target_resolver.py
Evidence and state
- Evidence contracts
src/codegraph/evidence_contract.py - Index freshness
src/codegraph/freshness.py - Path and secret safety
src/codegraph/security/paths.py
Domain intelligence
- Framework routes
src/codegraph/frameworks.py - Database intelligence
src/codegraph/database/extractor.py - Schema drift
src/codegraph/database/schema_drift.py - Runtime observation
src/codegraph/runtime/ingestor.py - Workspace boundaries
src/codegraph/monorepo.py
Runtime and changes
- Change impact
src/codegraph/change_impact.py - Safe refactoring
src/codegraph/refactor/renamer.py - Refactor models
src/codegraph/refactor/models.py - Git intelligence
src/codegraph/git.py
Other components
- AI coding agent
Connections 27
- AI coding agent → MCP tools: queries via MCP
README.md - MCP tools → Context compiler: requests context
src/codegraph/mcp/server.py - Context compiler → Task specification: normalizes task
src/codegraph/context.py - Context compiler → Target resolver: resolves targets
src/codegraph/context.py - Context compiler → Hybrid search: retrieves matches
src/codegraph/context.py - Context compiler → Graph traversal: retrieves relationships
src/codegraph/context.py - Context compiler → Evidence contracts: grounds results
src/codegraph/context.py - Incremental indexer → AST parsers: parses source
src/codegraph/indexing/indexer.py - Incremental indexer → File classifier: classifies files
src/codegraph/indexing/indexer.py - Incremental indexer → Index models: stores parsed records
src/codegraph/indexing/indexer.py - Incremental indexer → Framework routes: analyzes frameworks
src/codegraph/indexing/indexer.py - Incremental indexer → Evidence contracts: checks evidence
src/codegraph/indexing/indexer.py - Incremental indexer → Path and secret safety: redacts indexed data
src/codegraph/indexing/indexer.py - Incremental indexer → Index freshness: tracks index state
src/codegraph/indexing/indexer.py - MCP tools → Incremental indexer: serves index queries
src/codegraph/mcp/server.py - MCP tools → Database intelligence: serves database tools
src/codegraph/mcp/server.py - MCP tools → Runtime observation: serves runtime tools
src/codegraph/mcp/server.py - Database intelligence → Schema drift: supports drift analysis
- Web dashboard → Incremental indexer: uses indexing
src/codegraph/ui/server.py - Web dashboard → Change impact: requests impact analysis
src/codegraph/ui/server.py - Graph traversal → Change impact: feeds impact analysis
src/codegraph/change_impact.py - Change impact → Workspace boundaries: uses workspace boundaries
src/codegraph/change_impact.py - Safe refactoring → Incremental indexer: reindexes after changes
src/codegraph/refactor/renamer.py - Safe refactoring → Refactor models: uses refactor models
src/codegraph/refactor/renamer.py - Safe refactoring → Path and secret safety: validates paths
src/codegraph/refactor/renamer.py - Index freshness → Git intelligence: checks repository state
- AI coding agent → VS Code extension: initiates extension requests