How to Deploy DeusData codebase-memory-mcp in Production: Complete Setup Guide
Deploy DeusData codebase-memory-mcp by downloading the zero-dependency binary via the official install script, which auto-configures MCP integration for AI coding agents and handles all platform-specific setup.
The DeusData codebase-memory-mcp repository provides a self-contained, zero-dependency binary that builds structural knowledge graphs of source code and exposes them through a Model-Context-Protocol (MCP) server. This guide covers production deployment across macOS, Linux, and Windows, including manual offline installation for air-gapped environments.
Understanding the Production Architecture
Before deploying, understand the three logical layers that make up the system. According to the DeusData source code, the architecture is split between the entry point, indexing pipeline, and MCP tool layer.
Entry Point and CLI Layer (src/main.c)
The src/main.c file serves as the universal entry point. It launches either the MCP JSON-RPC server for integration with coding agents or a command-line interface for ad-hoc queries. This binary requires no runtime libraries, making it ideal for containerized or restricted production environments.
Indexing Pipeline (pipeline/)
The pipeline/ directory contains the multi-stage indexing logic. It walks the filesystem, parses files using vendored tree-sitter grammars (located in internal/cbm/), and enriches the AST with a Hybrid LSP type-resolution pass supporting Python, TypeScript, Go, Rust, and 150+ other languages. The pipeline writes nodes and edges into an in-memory SQLite database, then compresses the result into a *.zst file stored under $CBM_CACHE_DIR (defaulting to ~/.cache/codebase-memory-mcp).
MCP Tool Layer (mcp/)
The mcp/ directory implements 14 JSON-RPC methods including index_repository, search_graph, trace_path, and query_graph. These tools allow AI agents to retrieve structural information, execute Cypher-like queries, and perform impact analysis without parsing raw source code themselves.
Automated Installation Methods
The DeusData repository provides platform-specific install scripts that download the correct binary, verify SHA-256 checksums, strip macOS quarantine attributes, and auto-register the server with supported agents (Claude Code, Codex CLI, Gemini CLI, Zed, and OpenCode).
One-Line Install on macOS and Linux
Run the official installer to deploy the latest stable release:
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
This command detects your OS and architecture (arm64 or amd64), downloads the matching archive from GitHub releases, extracts the binary to ~/.local/bin, and runs the installation routine. To include the graph visualization UI (served on port 9749), append the --ui flag:
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui
Windows PowerShell Deployment
For Windows Server or desktop environments, use the PowerShell equivalent:
Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1
.\install.ps1
This mirrors the Unix flow, placing the executable in %USERPROFILE%\AppData\Local\Programs\codebase-memory-mcp and handling Windows-specific path registration.
Manual and Offline Installation
For air-gapped networks or custom installation directories, perform a manual deployment using the release artifacts.
- Download the platform-specific archive from the GitHub Releases page
- Extract the archive (
tar xzfon Unix orExpand-Archiveon Windows) - Run the bundled
install.shorinstall.ps1with the--dir=<path>flag to specify a custom location
The install script supports offline mode by skipping the download phase if the archive is already present in the working directory. This method is required for production environments behind strict firewalls.
Configuring for Production Use
Registering with AI Coding Agents
The install.sh and install.ps1 scripts automatically write the appropriate *.mcp.json configuration files. However, for agents that do not support automatic detection, manually edit ~/.claude/.mcp.json (or create a per-project .mcp.json):
{
"mcpServers": {
"codebase-memory-mcp": {
"command": "/usr/local/bin/codebase-memory-mcp",
"args": []
}
}
}
Replace the command path with the actual location of your binary if you used a custom installation directory.
Environment Variables and Caching
Set $CBM_CACHE_DIR to control where compressed graph databases are stored. In production, point this to a persistent volume to avoid re-indexing on container restarts. The binary also creates a .codebase-memory/ directory next to each indexed repository to store pre-computed graph.db.zst snapshots, enabling teammates to skip the full indexing pipeline.
Verifying the Deployment
Starting the MCP Server
If the install script did not auto-start the server, run it manually with UI enabled:
codebase-memory-mcp --ui=true --port=9749
The server starts the JSON-RPC interface and the optional HTTP server (defined in ui/) hosting the Three.js-based 3D graph visualizer. Agents can now invoke the 14 MCP tools to query the codebase structure.
Indexing Your First Repository
Validate the installation by indexing a test repository via the CLI:
codebase-memory-mcp cli index_repository '{"repo_path":"/path/to/project"}'
This executes the full pipeline: tree-sitter parsing, Hybrid LSP resolution, and SQLite compression. Subsequent queries against this index execute in milliseconds using the query_graph or search_graph methods.
Summary
- Deploy DeusData codebase-memory-mcp by running the platform-specific install script from the repository, which handles binary placement, checksum verification, and agent registration.
- The architecture consists of
src/main.cfor the entry point,pipeline/for AST generation and Hybrid LSP resolution, andmcp/for the JSON-RPC tool implementation. - Use
$CBM_CACHE_DIRto manage the location of compressed graph files and enable persistent caching in production environments. - For offline deployment, manually download the release archive and run the bundled
install.shorinstall.ps1with custom directory flags.
Frequently Asked Questions
What are the system requirements for running codebase-memory-mcp?
The binary is statically compiled for macOS (arm64/amd64), Linux (amd64/arm64), and Windows (amd64) with zero external dependencies. It requires no runtime libraries, Docker, or package managers, making it suitable for minimal container images and restricted production hosts.
How do I configure the server for AI agents that don't support automatic detection?
Manually create or edit the MCP configuration file (e.g., ~/.claude/.mcp.json) and specify the absolute path to the binary in the command field. Ensure the binary has execute permissions and that the args array is empty or contains specific flags like --ui=false for headless production servers.
Can I run codebase-memory-mcp without the UI component in production?
Yes. The UI is optional and controlled by the --ui flag. For headless production servers, omit the --ui flag or explicitly set --ui=false. The core MCP functionality and all 14 JSON-RPC methods work without the HTTP server or Three.js visualizer components located in ui/.
Where are the indexed graph files stored?
By default, compressed graph databases are stored in ~/.cache/codebase-memory-mcp (controlled via $CBM_CACHE_DIR). Additionally, each indexed repository contains a .codebase-memory/ directory with a graph.db.zst snapshot, allowing teams to share pre-computed indices without re-running the parsing pipeline.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →