← Back to directory
C

Codebase Memory

Community
A codebase knowledge graph for AI coding agents.
GitHub source repository ↗
★ 219 Stars Category · Dev Tools Very popular Source revision 3ff76d29a639
52FMRS · D
Reliability
8/20
Security and permissions
12/20
Maintenance
10/20
Documentation
13/20
Setup experience
9/20

This is an MIT community fork maintained by win4r, not an official DeusData server. It is suited to local codebase knowledge graphs and AI-assisted code exploration. Key considerations are building from source, writes to agent configuration files, and avoiding the update subcommand because it can overwrite the fork build.

Read the FMRS scoring method →

Codebase Memory is a community fork of DeusData/codebase-memory-mcp maintained by win4r. Built in pure C, it creates a code knowledge graph for 158 languages and provides structural queries, call tracing, change-impact analysis, code search, and architecture analysis. The fork adds the incremental-reindex CALLS-edge fix, Cypher fixes, Swift graph improvements, and the explore tool.

Tools

index_repository
Indexes a repository into the knowledge graph and enables subsequent automatic synchronization.
list_projects
Lists indexed projects with node and edge counts.
delete_project
Removes a project and all of its graph data.
index_status
Checks the indexing status of a project.
search_graph
Searches graph nodes using label, name-pattern, file-pattern, and degree filters.
trace_path
Uses BFS to find callers and callees of a function, with depth from 1 to 5.
detect_changes
Maps Git changes to impacted symbols and provides risk classification and caller blast radius.
query_graph
Executes read-only Cypher-like graph queries.
get_graph_schema
Returns node and edge counts, relationship patterns, and property definitions.
get_code_snippet
Reads source code for a function by qualified name.
get_architecture
Returns architecture information including languages, packages, routes, hotspots, boundaries, layers, clusters, and ADRs.
search_code
Performs grep-like text search within indexed project files.
manage_adr
Creates, reads, updates, and deletes Architecture Decision Records.
ingest_traces
Ingests runtime traces to validate HTTP_CALLS edges.
explore
Returns a matched symbol's caller blast radius, nearby neighbors, and line-numbered source grouped by file in one call, with a query_graph/Cypher escape hatch.

Setup

This fork ships no prebuilt binaries and must be built from source. Run git clone https://github.com/win4r/codebase-memory-mcp-pro.git, enter the directory, and execute ./scripts/build.sh. Copy build/c/codebase-memory-mcp to PATH, then configure Claude Code with claude mcp add codebase-memory -s user -- ~/.local/bin/codebase-memory-mcp. A stdio MCP configuration may also be used with command set to the binary's absolute path. The first build compiles 158 tree-sitter grammars and may take several minutes.

claude_desktop_config.json
{"mcpServers":{"codebase-memory-mcp":{"command":"/path/to/codebase-memory-mcp","args":[]}}}

Fit and risk

Best for

  • AI coding agents that need local code intelligence.
  • Teams requiring cross-file call resolution, architecture analysis, or incremental indexing.
  • Users who prefer a pure-C stdio server with local persistent storage.

Not for

  • Users requiring a built-in large language model or cloud-hosted code analysis.
  • Users unable to build from source or provide a C/C++ build environment.
  • Clients requiring SSE or streamable-http transport.

Required permissions

  • Read access to the repositories and Git changes being indexed.
  • Local write access for the SQLite graph database and configuration in the cache directory.
  • When installing or configuring supported agents, write access to agent configuration, instruction files, skills, and hooks.
  • Write access to Architecture Decision Records when managing ADRs.

Risks and side effects

  • The tool reads the codebase and may write to agent configuration files.
  • The fork has no prebuilt binaries; building compiles many vendored grammars.
  • Do not run the binary's update subcommand because it pulls the official upstream release and overwrites the integrated build.
  • Deleting a project or local cache removes the corresponding graph data, but not the source code.

Troubleshooting

  1. If the server does not appear in the MCP list, verify that command uses the binary's absolute path and restart the client.
  2. If index_repository fails, provide an absolute repo_path.
  3. If trace_path returns no results, use search_graph first to find the exact qualified name.
  4. If queries mix projects, specify the project parameter or run list_projects first.
  5. If the binary is not found, add its directory to PATH.
  6. If the build fails, check the C/C++ compiler, zlib, Git, and macOS libgit2 environment.

Use cases

Build a knowledge graph of repository structure and call relationships.
Trace function calls, analyze change impact, and identify possible dead code.
Explore large codebases with Cypher-like queries, structural search, or code search.
Retrieve architecture overviews, source snippets, and cross-service HTTP relationships.

Supported clients

Claude CodeFull support
Codex CLIFull support
Gemini CLIFull support
ZedFull support
OpenCodeFull support
AntigravityFull support
AiderPartial support
KiloCodeFull support
VS CodeFull support
OpenClawFull support
KiroFull support