How bibinkvr/codebase-memory-mcp works
codebase-memory-mcp indexes local repositories into a persistent structural knowledge graph, then exposes code-intelligence tools to coding agents and a built-in graph UI. The main workflow is repository indexing: language parsing and extraction, semantic resolution, and graph persistence, with incremental repair when files change. Separate branches cover agent-facing MCP access, daemon-managed sessions and jobs, and graph visualization. The README documents broader query and infrastructure-indexing capabilities; where source was not sampled, paths or wiring are omitted rather than inferred.
Main entry points: pipeline.c Index Pipeline · App.tsx Graph UI · pipeline_incremental.c Incremental Repair · rpc.ts UI RPC
Components 22
Indexing
- Index Pipeline
src/pipeline/pipeline.c - Incremental Repair
src/pipeline/pipeline_incremental.c - Delta Staging
src/pipeline/pipeline_delta.c - Language Grammars
internal/cbm/lang_specs.c - Code Extraction
internal/cbm/extract_unified.c - Semantic Resolution
internal/cbm/lsp_all.c - Service Patterns
internal/cbm/service_patterns.c
Graph Data
- Graph Store
internal/cbm/sqlite_writer.c - Graph Queries
Agent Access
- Server Entry
src/main.c - MCP Tools
Daemon Operations
- Session Manager
src/daemon/application.c - Agent Adapters
src/cli/agent_clients.c
Visualization
- Graph UI
graph-ui/src/App.tsx - Project Loading
graph-ui/src/hooks/useProjects.ts - Graph Data Hook
graph-ui/src/hooks/useGraphData.ts - UI RPC
graph-ui/src/api/rpc.ts - 3D Graph View
graph-ui/src/components/GraphScene.tsx - Stats View
graph-ui/src/components/StatsTab.tsx - Control View
graph-ui/src/components/ControlTab.tsx
Other components
- Developer
- Coding Agent
Connections 24
- Developer → Coding Agent: requests indexing
- Coding Agent → Server Entry: starts server
- Server Entry → MCP Tools: dispatches tools
- MCP Tools → Index Pipeline: runs indexing
- Index Pipeline → Language Grammars: parses languages
- Index Pipeline → Code Extraction: extracts structure
- Index Pipeline → Semantic Resolution: resolves symbols
- Index Pipeline → Service Patterns: classifies links
- Index Pipeline → Graph Store: writes graph
- Index Pipeline → Incremental Repair: selects repair
- Incremental Repair → Delta Staging: stages changes
- Incremental Repair → Graph Store: updates graph
- MCP Tools → Graph Queries: runs queries
- Graph Queries → Graph Store: reads graph
- Session Manager → MCP Tools: owns sessions
- Agent Adapters → Coding Agent: configures clients
- Developer → Graph UI: opens graph UI
- Graph UI → Project Loading: loads projects
- Graph UI → Graph Data Hook: loads graph
- Project Loading → UI RPC: requests project data
- Graph Data Hook → UI RPC: requests graph data
- UI RPC → 3D Graph View: supplies graph data
- Graph UI → Stats View: renders stats
- Graph UI → Control View: renders controls