# codegraph-rust [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/sunerpy/codegraph-rust  
**GitHub Stars:** 24  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codegraph-rust

## Description
Deterministic tree-sitter + SQLite/FTS5 code knowledge graph for coding agents and developers: symbols, calls and dependencies over a CLI, an MCP server and a local browser viewer. No AI/LLM inside; byte-stable output.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/sunerpy/codegraph-rust), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.sh | sh
```

2. Install:

```sh
irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.ps1 | iex
```

3. Install:

```sh
curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/vX.Y.Z/scripts/install.sh \
  | CODEGRAPH_VERSION=vX.Y.Z sh
```

4. Install:

```sh
irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/vX.Y.Z/scripts/install.ps1 | iex
```

5. Install:

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

## Documentation

## 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:

```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.

_Full upstream README: https://allmcps.com/mcp/codegraph-rust/readme_

