Codebase Memory MCP is configured entirely through environment variables — there is no configuration file for runtime behavior. Variables are read at startup and control where indexes are stored, how much parallelism the indexer uses, what gets written to logs, and whether the diagnostics trajectory is captured. All variables are optional; safe defaults are chosen for typical developer workstations.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DeusData/codebase-memory-mcp/llms.txt
Use this file to discover all available pages before exploring further.
Variables
Default:
~/.cache/codebase-memory-mcpOverride the database storage directory. All project index databases and the server configuration file are stored here. Useful for storing indexes on a separate volume, sharing indexes across users, or isolating test environments.Default:
falseSet to 1 or true to enable periodic diagnostics output. When enabled, the server writes two files to the system temp directory ($TMPDIR or /tmp on macOS/Linux, %TEMP% on Windows). See the Diagnostics section below for details on the output format.Default: GitHub releases URLOverride the download URL used by
codebase-memory-mcp update. Useful for self-hosted binary mirrors, air-gapped environments, or testing a release candidate before it is published.Default:
infoSet the minimum log level. Accepted values (case-insensitive): debug, info, warn, error, none — or their numeric equivalents 0 through 4 matching the internal enum. All logs go to stderr; stdout is reserved for MCP JSON-RPC traffic and must not be polluted.Default: Auto-detected from CPU countOverride the parallel-indexing worker count. Range: 1–256. Invalid values are ignored with a warning and the auto-detected count is used instead. Particularly useful inside containers where
sysconf(_SC_NPROCESSORS_ONLN) may report the host’s full CPU count rather than the cgroup’s effective quota, leading to over-subscription.Default:
0.5After indexing, the server compares the number of persisted SQLite nodes to the in-memory committed count. When the ratio of persisted ÷ committed falls below this threshold (and committed count exceeds 50), index_repository returns status: "degraded" instead of silently reporting success. Range: 0–1. Set to 0 to disable the check. Invalid values are ignored with a warning.Usage Examples
Setting Variables in the MCP Server Config
The most reliable way to set environment variables for the MCP server is directly in the agent’s MCP server configuration. This ensures the variables are set regardless of how the agent launches the binary..claude/.mcp.json), VS Code (Code/User/mcp.json), Zed (settings.json), and most other MCP-compatible agents. See the agent’s documentation for the exact config file location.
Diagnostics
WhenCBM_DIAGNOSTICS=1 is set, the server writes two files to the system temp directory on startup and prints their paths to stderr:
cbm-diagnostics-<pid>.ndjson — Memory trajectory
One JSON line every 5 seconds with the following fields:
| Field | Description |
|---|---|
rss | Resident set size in bytes |
committed | Windows commit charge (or equivalent on Linux/macOS) |
peak_rss | Peak RSS since process start |
peak_committed | Peak committed since process start |
page_faults | Cumulative page faults |
fd | Open file descriptor count |
queries | Cumulative query count |
.ndjson.1 when it exceeds approximately 8 MB. This is the primary file for diagnosing memory leaks — the trend over time in rss and committed is what reveals a slow leak.
cbm-diagnostics-<pid>.json — Live snapshot
The latest single data point only, refreshed every 5 seconds. Useful for a quick live check of current memory usage. This file is removed on clean exit.
The diagnostics files contain only resource counters (memory, file descriptors, query counts). They contain no source code, no query text, and no file paths. They are safe to share when reporting memory or performance issues.
env block, restart the agent, reproduce the issue, and then retrieve the .ndjson trajectory file from your system temp directory.