Prerequisites for Installing codebase-memory-mcp: Build Requirements and Setup Guide
Installing codebase-memory-mcp requires no runtime dependencies when using pre-built binaries, but building from source requires a C/C++ compiler toolchain, zlib development headers, and Git.
The codebase-memory-mcp tool from DeusData is a pure-C application that powers in-memory code indexing. While you can download pre-built binaries that run standalone, compiling the project from source—located in the internal/cbm/ directory—requires specific development dependencies to generate the static binary at build/c/codebase-memory-mcp.
Pre-Built Binary vs. Source Compilation
You have two installation paths with vastly different requirements:
- Pre-built binaries: Zero runtime dependencies. Download, extract, and run immediately.
- Build from source: Requires a development toolchain to compile the C engine and optional UI components as defined in
scripts/build.shandMakefile.cbm.
Choose source compilation only if you need custom builds or are contributing to the repository.
Prerequisites for Building from Source
When compiling locally, your system must provide these four core components:
- C compiler (
gccorclang): Compiles the core engine source files ininternal/cbm/that handle AST extraction and graph construction. - C++ compiler (
g++orclang++): Required for helper components and the optional UI build process. - zlib development headers: Powers the LZ4 and SQLite pipeline used for the in-memory index. On Linux, this is typically
zlib1g-dev. - Git: Required for cloning the repository and used by the
scripts/build.shwrapper for version detection.
Optional but recommended: make and bash, which are used by the provided build wrapper at scripts/build.sh (line references indicate this script orchestrates the entire compilation).
Platform-Specific Installation Commands
macOS Prerequisites
macOS users need only the Xcode command-line tools, which bundle clang, clang++, and make. zlib is provided by the system.
# Install Xcode command-line tools
xcode-select --install
# Verify installation
gcc --version
clang --version
git --version
Ubuntu and Debian Prerequisites
Install the complete build toolchain including the zlib development package:
sudo apt update
sudo apt install -y build-essential zlib1g-dev git
# Verify versions
gcc --version
g++ --version
git --version
Windows Prerequisites via MSYS2
For Windows builds, use MSYS2 to provide a POSIX-compatible environment:
# From an MSYS2 terminal after initial setup
pacman -Syuu
pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-zlib git
# Verify tools
gcc --version
g++ --version
git --version
Understanding the Build Process
Once prerequisites are installed, the repository's scripts/build.sh handles the entire compilation. This script:
- Invokes the C compiler to build sources from
internal/cbm/ - Links against SQLite and LZ4 using flags defined in
Makefile.cbm - Outputs the final static binary to
build/c/codebase-memory-mcp
For a standard build:
git clone https://github.com/DeusData/codebase-memory-mcp.git
cd codebase-memory-mcp
scripts/build.sh
To include the optional UI components (which require the C++ compiler):
scripts/build.sh --with-ui
If any prerequisite is missing, scripts/build.sh fails with a descriptive error message indicating which tool or library was not found.
Summary
- Pre-built route: No prerequisites; the binary runs standalone with zero dependencies.
- Source build route: Requires
gcc/clang,g++/clang++,zlibdev headers, andgit. - Key build files:
scripts/build.shorchestrates the process usingMakefile.cbm, targetingbuild/c/codebase-memory-mcpfor output. - Platform differences: macOS includes zlib by default; Linux requires explicit
zlib1g-devinstallation; Windows needs MSYS2.
Frequently Asked Questions
Do I need a C++ compiler if I am not building the UI?
Yes. While the core codebase-memory-mcp engine is pure C, the build system defined in scripts/build.sh and Makefile.cbm still invokes the C++ compiler for certain helper components even in standard builds. The --with-ui flag specifically adds UI-related C++ components, but the base toolchain requirement remains.
Can I install codebase-memory-mcp without administrative privileges?
Yes, if you use the pre-built binaries or install the development tools to a user-writable location (such as via Homebrew on macOS or custom prefix builds on Linux). The scripts/build.sh wrapper produces a static binary at build/c/codebase-memory-mcp that requires no system-wide installation.
What specific compiler versions are supported?
The project compiles with standard C11 and C++17 support. Any recent version of GCC (7+) or Clang (6+) is sufficient. The build.sh script checks for compiler presence but generally accepts any modern toolchain that ships with build-essential on Ubuntu or Xcode Command Line Tools on macOS.
Where does the installation script place the final binary?
When building from source, scripts/build.sh places the executable at build/c/codebase-memory-mcp relative to the repository root. The user-friendly install.sh (Unix) and install.ps1 (Windows) scripts automate downloading pre-built versions and placing them in system PATH directories, but manual builds remain in the build directory until you move them.
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 →