How gurdeepsinghiet/codebase-memory-mcp works
codebase-memory-mcp indexes local repositories into a persistent code knowledge graph and exposes structural analysis to coding agents through MCP, with a built-in graph UI. The main workflow is an agent request to index a repository, followed by parsing, semantic enrichment, and graph persistence; later queries return structural insights. The README also documents incremental indexing, infrastructure-as-code coverage, cross-service links, and agent-client setup. Several backend subsystems are documented but their implementation wiring was not sampled, so those links are shown only where supported by the README or excerpts.
Main entry points: pipeline.c Index orchestrator · App.tsx Graph UI · main.c MCP server · pipeline_incremental.c Incremental indexing
Components 20
Agent and UI
- MCP server
src/main.c - Client setup
src/cli/agent_clients.c - Session daemon
src/daemon/application.c - Local UI API
src
Indexing pipeline
- Index orchestrator
src/pipeline/pipeline.c - Incremental indexing
src/pipeline/pipeline_incremental.c - Delta repair
src/pipeline/pipeline_delta.c - Language grammars
internal/cbm/grammar_typescript.c - Fact extraction
internal/cbm/extract_unified.c
Graph intelligence
- Hybrid LSP
internal/cbm/lsp_all.c - Service linking
internal/cbm/service_patterns.c - Persistent graph
internal/cbm/sqlite_writer.c - Analysis tools
src/main.c
Graph exploration
- Graph UI
graph-ui/src/App.tsx - UI RPC client
graph-ui/src/api/rpc.ts - Graph visualization
graph-ui/src/components/GraphScene.tsx - Project statistics
graph-ui/src/components/StatsTab.tsx - Graph controls
graph-ui/src/components/ControlTab.tsx
Other components
- Coding agent
- Local repository
Connections 21
- Coding agent → MCP server: sends requests
- Client setup → Coding agent: configures client
- MCP server → Session daemon: opens sessions
- Session daemon → Index orchestrator: starts index jobs
- Index orchestrator → Local repository: reads source
- Index orchestrator → Language grammars: parses languages
- Index orchestrator → Fact extraction: extracts facts
- Index orchestrator → Hybrid LSP: resolves symbols
- Index orchestrator → Service linking: classifies calls
- Index orchestrator → Persistent graph: writes graph
- Index orchestrator → Incremental indexing: uses stored hashes
- Incremental indexing → Delta repair: stages repairs
- Incremental indexing → Persistent graph: updates graph
- MCP server → Analysis tools: dispatches tools
- Analysis tools → Persistent graph: queries graph
- Coding agent → Graph UI: opens visualization
- Graph UI → UI RPC client: requests data
- UI RPC client → Local UI API: calls local API
- Graph UI → Graph visualization: renders graph
- Graph UI → Project statistics: shows statistics
- Graph UI → Graph controls: shows controls