DeusData/codebase-memory-mcp Source Code Location: C Core and Python Wrapper Guide

The DeusData/codebase-memory-mcp project stores its implementation in two main directories: the C/C++ core engine lives in src/ while the Python wrapper and CLI entry point reside in pkg/pypi/src/codebase_memory_mcp/.

The DeusData/codebase-memory-mcp repository is organized as a hybrid codebase that combines a high-performance C engine with a convenient Python interface. Understanding exactly where the source code is located helps developers navigate the architecture, whether they need to modify the core memory indexing logic or adjust the Python CLI wrapper.

C/C++ Core Implementation in src/

The bulk of the functionality lives under the src/ directory, organized into functional sub-modules that handle everything from memory management to the embedded web server.

Foundation Utilities

The src/foundation/ directory contains low-level utilities for memory handling, logging, and cryptographic hashing. Key files include:

Discovery and Analysis

The src/discover/ module handles code-base analysis, including language detection and gitignore parsing:

MCP Core Engine

The src/mcp/ directory contains the "memory code-path" core responsible for indexing and compact output generation:

Web Interface and File Watching

The project includes an embedded web UI served by a custom HTTP server:

Program Entry Point

The main entry point for the compiled binary is located at:

  • src/main.c – Contains the main() function that parses high-level flags and starts the UI server

Python Wrapper Location

The Python wrapper provides a pip-installable entry point that invokes the native binary. This code resides in pkg/pypi/src/codebase_memory_mcp/:

React UI Source Code

The front-end visualization layer is built with React and TypeScript. These assets are located in:

  • graph-ui/src/* – React/TypeScript source files that visualize the memory map produced by the C core

The UI assets are compiled into the binary and served by the embedded HTTP server defined in src/ui/http_server.c.

Building and Running from Source

To build and run the project from the source code locations described above:

Building the C core:


# Navigate to the C source directory

cd src

# Build with make (requires a C compiler)

make

# Run the binary directly

./codebase_memory_mcp /path/to/your/project

Installing and running the Python wrapper:


# Install the package in editable mode

pip install -e ./pkg/pypi

# Invoke via CLI

python -m codebase_memory_mcp /path/to/your/project

Programmatic Python usage:

from codebase_memory_mcp import _cli

_cli.main(["/path/to/your/project"])

Launching the web interface:


# Start the server (default port 8000)

./codebase_memory_mcp /my/project

# Access in browser at http://localhost:8000/

Summary

  • The C/C++ core resides in src/ and is organized into functional modules: foundation/, discover/, mcp/, ui/, and watcher/.
  • The Python wrapper is located in pkg/pypi/src/codebase_memory_mcp/ and provides CLI access to the native binary.
  • The React UI source files are found in graph-ui/src/ and are compiled into the binary for the embedded server.
  • The entry point for the C application is src/main.c, which initializes the UI server and core indexing logic.

Frequently Asked Questions

Where is the main entry point in the DeusData/codebase-memory-mcp source code?

The main entry point is located at src/main.c in the C source directory. This file contains the main() function responsible for parsing command-line flags, initializing the core engine, and starting the embedded HTTP server on the default port 8000.

What programming languages are used in the codebase-memory-mcp project?

The project uses three primary languages: C for the core engine (located in src/), Python for the wrapper and CLI (located in pkg/pypi/src/codebase_memory_mcp/), and TypeScript/React for the web interface (located in graph-ui/src/). The C layer handles performance-critical tasks like file system indexing, while Python provides a convenient entry point for pip installation.

How does the Python wrapper interact with the C core?

The Python wrapper acts as a thin layer that invokes the native binary. According to the source code in pkg/pypi/src/codebase_memory_mcp/_cli.py, the Python CLI handles argument parsing and then forwards commands to the compiled C binary. The __init__.py file exposes a minimal public API that allows programmatic invocation of the core functionality.

Where are the web UI components located in the codebase-memory-mcp repository?

The React-based web UI source code is located in the graph-ui/src/ directory. These TypeScript and React components are compiled and embedded into the binary, where they are served by the HTTP server defined in src/ui/http_server.c. The 3-D layout logic is specifically handled in src/ui/layout3d.c.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →