# How to Deploy Codebase Memory MCP: Complete Installation Guide

> Easily deploy Codebase Memory MCP with our simple one-line installer. Get the complete installation guide and configure coding agents and UI effortlessly.

- Repository: [Martin Vogel/codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp)
- Tags: getting-started
- Published: 2026-07-26

---

**Deploy Codebase Memory MCP by running the one-line installer that downloads the pre-built static binary, executes the bundled [`install.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/install.sh) script to configure supported coding agents, and optionally enables the graph visualization UI with the `--ui` flag.**

Codebase Memory MCP is a self-contained indexing and query engine that creates persistent SQLite knowledge graphs of your codebases. According to the DeusData/codebase-memory-mcp source code, deploying this MCP server involves obtaining the binary, running the automated installer, and optionally building from source when customization is required. Once deployed, the system enables 15 MCP tools that integrate with Claude Code, Codex, VS Code, and other supported agents.

## One-Line Installer Deployment (Recommended)

The fastest way to deploy Codebase Memory MCP uses the one-line installer hosted in the repository root. This script automatically detects your operating system, downloads the appropriate pre-built static binary, and executes post-install configuration to set up agent integration.

### macOS and Linux Installation

Run the installer directly from the repository:

```bash
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

```

The [`install.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/install.sh) script performs several critical operations: it copies the binary to a location on your `$PATH`, strips macOS quarantine attributes when necessary, and auto-detects supported coding agents to inject the required MCP configuration.

### Windows Installation

For Windows environments, use the PowerShell installer located at `install.ps1`:

```powershell

# Download the installer

Invoke-WebRequest -Uri https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.ps1 -OutFile install.ps1

# Review the script (optional)

notepad install.ps1

# Unblock and execute

Unblock-File .\install.ps1
.\install.ps1

```

## Building from Source

When you need a custom build or want to inspect the implementation, clone the repository and invoke the build helper. The core implementation resides in [`internal/cbm/cbm.c`](https://github.com/DeusData/codebase-memory-mcp/blob/main/internal/cbm/cbm.c), which handles parsing with vendored Tree-Sitter grammars and RPC handling.

```bash
git clone https://github.com/DeusData/codebase-memory-mcp.git
cd codebase-memory-mcp
scripts/build.sh

```

The build process compiles the C source using `Makefile.cbm` and produces a static binary at `build/c/codebase-memory-mcp`. To include the optional graph visualization UI, pass the `--with-ui` flag:

```bash
scripts/build.sh --with-ui

```

## Enabling the Graph Visualization UI

The optional UI provides a 3D web interface for exploring your knowledge graph at `http://localhost:9749`. When using the one-line installer, append the `--ui` flag:

```bash
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui

```

If you built from source with UI support, start the server manually:

```bash
codebase-memory-mcp --ui=true --port=9749

```

## Post-Deployment Configuration

After installation, the binary automatically configures supported agents to communicate with the MCP server. The system creates a persistent SQLite knowledge graph under `~/.cache/codebase-memory-mcp/` and enables all 15 MCP tools.

### Runtime Environment Variables

Configure behavior through environment variables documented in [`docs/CONFIGURATION.md`](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/CONFIGURATION.md):

- **CBM_CACHE_DIR**: Overrides the default cache location
- **CBM_AUTO_INDEX**: Enables automatic indexing for new sessions

Set persistent configuration values using the CLI:

```bash
codebase-memory-mcp config set auto_index true

```

### Manual Repository Indexing

To index a project immediately after deployment:

```bash
codebase-memory-mcp cli index_repository --repo-path /absolute/path/to/your/project

```

Query the graph using the search command:

```bash
codebase-memory-mcp cli search_graph --project my-project \
  --name-pattern '.*Handler.*' --label Function | jq '.results[].name'

```

## Architecture Overview

Understanding the deployment architecture helps troubleshoot issues. The system consists of four main components as implemented in the DeusData/codebase-memory-mcp repository:

- **Binary (`codebase-memory-mcp`)**: The core engine located at `build/c/codebase-memory-mcp` after compilation, responsible for parsing source files and building the SQLite graph.
- **Coordination Daemon**: A per-account background process that serializes indexing jobs and watches for file changes.
- **Agent Integration Layer**: Auto-detects supported agents and injects MCP configuration, skills, and hooks.
- **Graph UI**: Optional 3D visualization component served on port 9749.

## Summary

- **Deploy instantly** using the one-line installer from [`install.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/install.sh) or `install.ps1` for your operating system.
- **Build manually** by running [`scripts/build.sh`](https://github.com/DeusData/codebase-memory-mcp/blob/main/scripts/build.sh) to produce the static binary at `build/c/codebase-memory-mcp`.
- **Enable visualization** by adding the `--ui` flag during installation or building with `--with-ui`.
- **Configure agents** automatically through the installer, which detects Claude Code, Codex, VS Code, and other supported clients.
- **Manage settings** via the `config` sub-command and environment variables like `CBM_CACHE_DIR`.

## Frequently Asked Questions

### What is the fastest way to deploy Codebase Memory MCP?

The fastest method is the one-line installer: `curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash`. This downloads the pre-built static binary, places it on your `$PATH`, and automatically configures supported coding agents without manual intervention.

### Where does Codebase Memory MCP store its knowledge graph data?

The system creates a persistent SQLite knowledge graph under `~/.cache/codebase-memory-mcp/` by default. You can override this location by setting the `CBM_CACHE_DIR` environment variable or using the `config` sub-command to modify runtime settings documented in [`docs/CONFIGURATION.md`](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/CONFIGURATION.md).

### How do I deploy the graph visualization UI alongside the MCP server?

Append the `--ui` flag when running the installer: `curl -fsSL .../install.sh | bash -s -- --ui`. Alternatively, when building from source, execute `scripts/build.sh --with-ui` and then start the server with `codebase-memory-mcp --ui=true --port=9749` to access the 3D visualization interface.

### Can I deploy Codebase Memory MCP on Windows without WSL?

Yes, the repository includes `install.ps1`, a native PowerShell installer for Windows. Download the script using `Invoke-WebRequest`, unblock it with `Unblock-File`, and execute it to deploy the binary and configure Windows-based coding agents automatically.