Codegraph Rust logo

Codegraph Rust

Deterministic local code graph with Tree-sitter indexing, SQLite/FTS5 search, graph traversal, CLI access, and MCP tools.

Install Codegraph Rust

Run the project’s own setup commands, in order.

Setup steps from the project

codegraph-rust installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.sh | sh
    
  2. 2. Install
    irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.ps1 | iex
    
  3. 3. Install
    curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/vX.Y.Z/scripts/install.sh \
      | CODEGRAPH_VERSION=vX.Y.Z sh
    
  4. 4. Install
    irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/vX.Y.Z/scripts/install.ps1 | iex
    
  5. 5. Install
    cargo install --locked --git https://github.com/sunerpy/codegraph-rust codegraph-rs
    

Overview

codegraph-rust turns a source tree into a local, queryable graph of symbols, calls, imports, inheritance, references, ownership, and type relationships. It uses Tree-sitter for extraction and SQLite with FTS5 for persistence and search, exposing the indexed representation through a native CLI and an MCP server. Results are deterministic and do not require an AI model, embeddings, or a vector database. Reach for it when an agent needs structural code exploration, caller and callee analysis, impact checks, or task-focused source context.

Use cases

  • Index a local repository for structural code questions
  • Trace callers and callees around a symbol
  • Assess the likely impact of changing a function
  • Build task-specific source context for a coding agent
  • Explore architecture and call paths in a browser viewer

Key features

  • Tree-sitter source extraction
  • SQLite and FTS5 indexed search
  • Symbol and relationship graph traversal
  • Deterministic, model-free output
  • CLI and MCP access to one project index
  • Incremental synchronization with a local watcher

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

10/10 checks healthy over the last 41d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars24Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Codegraph Rust works

What codegraph-rust does

codegraph-rust indexes a project into a local knowledge graph. Source symbols become graph nodes, while relationships such as calls, imports, inheritance, ownership, references, and type links become edges. The index is stored per project and can be queried by coding agents or developers without repeatedly reconstructing program structure from raw text.

The project combines Tree-sitter extraction with SQLite and FTS5 search in a native executable. It also provides a command-line interface, an MCP server, and a local browser viewer that reads the same project index. The indexer contains no AI or LLM runtime, does not create embeddings, and does not use vector search.

How it works

Start by initializing a project with codegraph init .. Use status to inspect the index, sync to update changed files, or index for a full rebuild. Research commands accept a query or symbol and a project path, while lifecycle commands take the project path positionally.

The MCP entry point runs through the executable:

config.json
{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph",
      "args": ["serve", "--mcp"]
    }
  }
}

A server started without --path can select an existing index through an explicit per-call projectPath, client roots, or workspace adoption. Supplying --path pins the default project. The default setup uses shared local daemon and watcher services; setting CODEGRAPH_NO_DAEMON=1 enables direct mode instead.

Setup and configuration

Verified installers are available for Linux, macOS, and Windows. Release archives cover Linux x86_64 and ARM64, macOS Intel and Apple Silicon, and Windows x86_64 and ARM64. Archives include checksums, and the Linux builds use static musl binaries. The project is also installable from Git with Cargo:

bash
cargo install --locked --git https://github.com/sunerpy/codegraph-rust codegraph-rs

The installed executable is named codegraph, and SQLite is bundled. After installation, initialize the target project and register the MCP server manually or run codegraph install --yes to update supported agent configurations. CODEGRAPH_MCP_TOOLS can enable additional known MCP tools beyond the default surface. Claude Code and Codex profile locations can be overridden with CLAUDE_CONFIG_DIR and CODEX_HOME.

Tools and capabilities

The CLI and MCP server cover the same indexed representation. Core operations include:

  • Searching symbols and indexed content with search or its query alias.
  • Exploring an area or flow with explore.
  • Reading a symbol or identifier with node.
  • Finding callers, callees, and likely impact with callers, callees, and impact.
  • Building task-oriented entry points, symbols, and source with context.
  • Listing project files, including tree formatting.
  • Serving MCP over stdio or serving the local HTTP transport.

Incremental synchronization and the watcher update changed files while preserving the same canonical result as a clean index. A local browser viewer can show callers, source, callees, call paths, architecture relationships, type hierarchies, and code with no incoming reachability.

Limitations and notes

Language coverage and static-analysis boundaries vary by supported grammar and framework integration. Embedded or template files and some framework-derived relationships are handled through the shared schema. Lua projects can configure custom module loaders when their modules are loaded through project-specific functions.

The MCP server exposes a deliberately limited default tool surface focused on exploration, file and symbol reads, search, and callers. Further known tools require CODEGRAPH_MCP_TOOLS. Multiple MCP sessions can share one writer per project, while direct mode permits one direct writer and rejects a second. The browser viewer is described as a preview.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Codegraph Rust

codegraph-rust is an MCP server that connects coding agents to local, Tree-sitter-indexed source projects stored in SQLite with FTS5 search. Its main tools support exploration, symbol and file reads, search, callers, callees, impact analysis, and task-oriented code context without using an AI model or vector database.

Install it with the platform installer, a prebuilt release archive, or Cargo from Git, then register `codegraph serve --mcp` as an MCP server. The Cargo command is `cargo install --locked --git https://github.com/sunerpy/codegraph-rust codegraph-rs`; the resulting executable is `codegraph`.

Run `codegraph init .` from the project directory, then check it with `codegraph status . --json`. Use `codegraph sync .` for changed files or `codegraph index .` to rebuild the selected project completely.

Yes, it can be configured as a standard stdio MCP server in clients that support MCP, including Cursor. Add `codegraph` as the command and pass `serve --mcp`; the installer can also update supported agent configurations.

Set `CODEGRAPH_MCP_TOOLS` to enable additional known tools beyond the default MCP surface. The default emphasizes exploration, file and symbol reads, search, and callers.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCodegraph Rust AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/codegraph-rust?style=directory)](https://allmcps.com/mcp/codegraph-rust)
HTML Embed
<a href="https://allmcps.com/mcp/codegraph-rust"><img src="https://allmcps.com/api/badge/codegraph-rust?style=directory" alt="Codegraph Rust on AllMCPs" /></a>