# DeusData codebase-memory-mcp Examples: Complete CLI and Installation Guide

> Explore DeusData codebase-memory-mcp CLI examples for installation, indexing with Tree-Sitter, and querying knowledge graphs. Get started with our comprehensive guide.

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

---

**DeusData/codebase-memory-mcp provides extensive command-line examples for installing the static binary, indexing repositories using Tree-Sitter grammars, and executing Cypher-like queries against the generated knowledge graph.**

DeusData/codebase-memory-mcp is a static, zero-dependency binary that builds a knowledge graph of your entire codebase using bundled Tree-Sitter grammars and a lightweight Hybrid LSP type-resolution layer. These DeusData codebase-memory-mcp examples demonstrate how to install the tool, index repositories manually or automatically, and query the resulting SQLite-backed graph using 15 built-in MCP tools. All processing occurs locally without API keys, supporting 158 programming languages through vendored parsers.

## Installing the Binary

The repository provides one-line installation scripts for macOS and Linux referenced in the README quick-start section (lines 45-53). The installer auto-detects supported agents including Claude Code, Codex, and VS Code, writing the necessary MCP configuration entries (lines 37-39).

Install the standard binary:

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

```

Install with UI support enabled:

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

```

## Indexing Repository Examples

You can populate the knowledge graph either automatically on first use or manually via CLI commands. The `auto_index` flag triggers indexing automatically during the first MCP session, while the CLI provides explicit control via `index_repository` (README line 218).

### Manual Indexing

To explicitly index a specific repository path:

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

```

### Automatic Indexing Configuration

Enable automatic indexing for future sessions to eliminate manual steps:

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

```

This configuration persists and triggers graph construction whenever the MCP server initializes with a new project.

## Querying the Knowledge Graph

Once indexed, the tool exposes 15 built-in tools for graph traversal and analysis (README lines 172-182). The CLI supports pattern matching, call-chain tracing, and Cypher-like queries executed against the local graph.

### Searching by Name Pattern

Find all functions matching a regex pattern across the indexed project:

```bash
codebase-memory-mcp cli search_graph \
  --project my-project \
  --name-pattern '.*Handler.*' \
  --label Function

```

### Tracing Call Paths

Trace callers and callees for impact analysis or dependency tracking:

```bash
codebase-memory-mcp cli trace_path \
  --project my-project \
  --function-name Search \
  --direction both

```

### Executing Cypher-like Queries

Run arbitrary graph queries using Cypher-like syntax to extract structural information:

```bash
codebase-memory-mcp cli query_graph \
  --project my-project \
  --query 'MATCH (f:Function) RETURN f.name LIMIT 5'

```

These CLI examples are documented in the README under "CLI mode" (lines 546-559).

## Key Source Files

The following files in the repository contain the implementation details supporting these examples:

| Purpose | File Path | Implementation Details |
|---------|-----------|----------------------|
| Core documentation | **[[`README.md`](https://github.com/DeusData/codebase-memory-mcp/blob/main/README.md)](https://github.com/DeusData/codebase-memory-mcp/blob/main/README.md)** | Contains installation commands (lines 45-53), the 15-tool feature list (lines 172-182), and CLI usage examples (lines 546-559). |
| Configuration reference | **[[`docs/CONFIGURATION.md`](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/CONFIGURATION.md)](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/CONFIGURATION.md)** | Documents indexing workers, cache location, and UI configuration options. |
| Graph engine | **`internal/cbm/`** | Houses the Go implementation for graph building, Hybrid LSP resolution, and tool dispatch. |
| Language parsers | **`internal/cbm/vendored/grammars/`** | Contains 158 Tree-Sitter grammars enabling language-agnostic indexing. |
| CLI entry point | **[`cmd/cli/main.go`](https://github.com/DeusData/codebase-memory-mcp/blob/main/cmd/cli/main.go)** | Handles argument parsing and forwards commands to the internal MCP tools. |

## Summary

- **DeusData/codebase-memory-mcp** operates as a static, zero-dependency binary requiring no API keys, constructing a local knowledge graph using Tree-Sitter and Hybrid LSP resolution.
- **Installation** uses a single curl command that auto-configures MCP entries for Claude Code, Codex, and VS Code (README lines 37-39).
- **Indexing** supports both automatic (`auto_index` flag) and manual (`index_repository`) modes, processing 158 languages via grammars stored in `internal/cbm/vendored/grammars/`.
- **Querying** leverages 15 built-in tools accessible through CLI commands like `search_graph`, `trace_path`, and `query_graph` with Cypher-like syntax.
- **Implementation** resides primarily in `internal/cbm/`, with configuration options documented in [`docs/CONFIGURATION.md`](https://github.com/DeusData/codebase-memory-mcp/blob/main/docs/CONFIGURATION.md).

## Frequently Asked Questions

### How do I install DeusData codebase-memory-mcp on Windows?

For Windows systems, use the PowerShell installation script referenced in the README quick-start section (lines 45-53) or download the release binary directly from the GitHub releases page. The installer automatically configures MCP entries for supported agents including VS Code and Claude Code.

### What is the difference between manual and automatic indexing?

Manual indexing requires explicitly running `codebase-memory-mcp cli index_repository --repo-path /path/to/repo`, while automatic indexing occurs when you set `auto_index` to true via `codebase-memory-mcp config set auto_index true`. The automatic mode triggers graph construction on the first MCP session without manual intervention.

### Where does the knowledge graph store its data?

The knowledge graph persists in a local SQLite database managed by the `internal/cbm/` package. This implementation ensures all code analysis remains local-only with no external API calls, storing structural data derived from Tree-Sitter parsing and Hybrid LSP type resolution.

### Can I query the graph using natural language?

While `codebase-memory-mcp` itself accepts structured Cypher-like queries via the `query_graph` CLI command, natural language translation occurs within your MCP client such as Claude Code. The client converts natural language questions into precise graph queries before forwarding them to the tool's 15 built-in analysis functions.