How deusdata/codebase-memory-mcp works
codebase-memory-mcp is a local code-intelligence service: an agent or CLI client requests repository context, the native server indexes source and surrounding configuration into a persistent graph, and MCP tools return focused search, relationship, and impact results. CBM Lens is the visual companion for reading source and exploring that graph. The main flow is documented in the README and supported by the source index; finer wiring for unsampled server and UI modules is left out or identified as documented rather than inferred.
Main entry points: App.tsx Lens Workspace · pipeline.c Index Pipeline · main.c Native Entry · mcp.h MCP Tools
Components 20
Agent Access
- Native Entry
src/main.c - Daemon Sessions
src/daemon/application.c - MCP Tools
src/mcp/mcp.h
Repository Indexing
- File Discovery
src/discover/discover.h - Index Pipeline
src/pipeline/pipeline.c - Incremental Indexing
src/pipeline/pipeline_incremental.c - Language Analysis
internal/cbm
Graph and Queries
- Persistent Graph
src/store/store.c - Graph Queries
src/cypher/cypher.c
CBM Lens
- Lens Workspace
graph-ui/src/App.tsx - Source Reader
graph-ui/src/reader/MonacoReader.tsx - Architecture Maps
graph-ui/src/architecture/ArchitecturePanel.tsx - Galaxy Explorer
graph-ui/src/galaxy/GalaxyPanel.tsx - Change Impact
graph-ui/src/impact/ChangeAnalysisWorkspace.tsx - Local Code Chat
graph-ui/src/browser-ai/BrowserChatDock.tsx - Architecture Decisions
graph-ui/src/adr/AdrWorkspace.tsx
Client Setup
- Client Integration
src/cli/agent_clients.c
Other components
- Coding Agent
- CLI Client
- On-device Model
Connections 20
- Coding Agent → Native Entry: starts server
- CLI Client → Native Entry: runs tools
src/main.c - Native Entry → Daemon Sessions: starts sessions
src/main.c - Daemon Sessions → MCP Tools: serves requests
src/daemon/application.c - MCP Tools → Index Pipeline: requests indexing
- Index Pipeline → File Discovery: discovers files
src/pipeline/pipeline.c - Index Pipeline → Language Analysis: extracts structure
src/pipeline/pipeline.c - Index Pipeline → Persistent Graph: writes graph
src/pipeline/pipeline.c - Incremental Indexing → Persistent Graph: merges updates
src/pipeline/pipeline_incremental.c - Coding Agent → Client Integration: installs integrations
- Native Entry → Persistent Graph: opens store
src/main.c - MCP Tools → Graph Queries: exposes queries
- Coding Agent → Lens Workspace: explores repository
- Lens Workspace → Source Reader: reads source
graph-ui/src/App.tsx - Lens Workspace → Architecture Maps: opens maps
graph-ui/src/App.tsx - Lens Workspace → Galaxy Explorer: opens graph
- Lens Workspace → Change Impact: inspects changes
graph-ui/src/App.tsx - Lens Workspace → Architecture Decisions: manages decisions
graph-ui/src/App.tsx - Lens Workspace → Local Code Chat: asks about code
graph-ui/src/App.tsx - Local Code Chat → On-device Model: optionally infers