CodeGraph-Rust MCP server
2026년 11월 11일 커밋tree-sitter와 SQLite를 사용하여 심볼, 호출, 의존성을 AI agent에게 제공하는 결정론적 코드 지식 그래프를 생성합니다.
다른 이름 sunerpy/codegraph-rust
- 스타
- 22
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 11월 11일
- 라이선스
- MIT
CodeGraph-Rust MCP란?
CodeGraph-Rust은(는) MCP server입니다. tree-sitter와 SQLite를 사용하여 심볼, 호출, 의존성을 AI agent에게 제공하는 결정론적 코드 지식 그래프를 생성합니다.
프로젝트 README에서 생성된 요약
CodeGraph-Rust MCP server 정보
CodeGraph-Rust는 개발자와 AI agent를 지원하기 위해 소스 코드로부터 결정론적 지식 그래프를 구축합니다. 추출에는 tree-sitter를, 저장에는 SQLite를 사용하여 심볼이 노드가 되고 호출, 임포트, 상속과 같은 관계가 엣지가 되는 로컬 인덱스를 생성합니다. 이 방식은 LLM 기반의 재탐색이나 벡터 검색의 필요성을 없애고 프로젝트의 안정적인 구조적 표현을 제공합니다.
사용자는 codegraph serve --mcp 명령어를 사용하여 이를 로컬 MCP server로 실행할 수 있습니다. Claude, Codex, Zed을 포함한 다양한 코딩 agent 및 IDE와 통합됩니다. 이 시스템은 로컬 우선(local-first) 방식으로 설계되어 인덱스가 프로젝트 디렉토리 내에 존재하며 전송을 위해 로컬 프로세스를 사용합니다. 또한 sync 명령어를 통한 증분 업데이트를 지원하여 전체 재빌드 없이도 그래프를 최신 상태로 유지할 수 있습니다.
활용 사례
- 1코드 아키텍처 분석AI agent가 explore 도구를 사용하여 코드베이스 내의 상위 수준 흐름이나 아키텍처 패턴을 이해할 수 있습니다.
- 2함수 의존성 추적개발자가 특정 심볼을 호출하는 모든 함수를 식별하여 사용처를 파악할 수 있습니다.
- 3변경 영향도 평가공유 심볼을 수정하기 전에 agent가 시스템의 어느 부분이 영향을 받을지 결정할 수 있습니다.
- 4특정 심볼 위치 찾기사용자가 인덱싱된 소스 트리 내에서 특정 이름이나 식별자를 찾기 위해 타겟 검색을 수행할 수 있습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
구성
CODEGRAPH_UI
| 이름 | 설명 | 유형 |
|---|---|---|
| CODEGRAPH_UI | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식
- 소스 저장소 연결 및 접근 가능sunerpy/codegraph-rust is public and reachablegithub.com/sunerpy/codegraph-rust ↗통과
- 패키지가 이 저장소를 소스로 지정검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-11-11github.com/sunerpy/codegraph-rust ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지와 의존성에 심각한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 endpoint가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기CodeGraph-Rust
Deterministic code intelligence for agents and developers.
Tree-sitter extraction, SQLite/FTS5 search, graph traversal, CLI, and MCP in one native binary. No AI or vector runtime inside the indexer.
English · 简体中文 · Website · Documentation · Browser viewer · Community · Contributing
Why CodeGraph
CodeGraph turns a source tree into a local knowledge graph: symbols become nodes; calls, imports, inheritance, ownership, references, and type relationships become edges. The graph is persisted per project and can be queried without asking an LLM to rediscover structure through repeated text searches.
- Deterministic: no model calls, embeddings, or vector search; canonical graph output is guarded by byte-stable golden fixtures.
- Source-aware: search, callers/callees, impact, file source, and multi-file exploration use one indexed representation.
- Agent-ready: an MCP server exposes the same graph and verbatim source used by the CLI.
- Visual (preview): a local browser viewer reads the same index: a symbol's callers, source and callees side by side, call paths, an architecture map, type hierarchies and the code nothing reaches.
- Local-first: the index lives under the project; the shared daemon and HTTP transport are local processes.
- Broad language coverage: grammar-backed languages, embedded/template files, and framework-aware Godot/Tauri/JS ecosystem relationships share one schema.
- Incremental:
syncand the watcher update changed files while preserving the same final canonical result as a clean index.
Exact language and static-analysis boundaries are documented in
docs/languages.md.
Install
Verified release installer
The installers select the platform archive, require its entry in SHA256SUMS,
verify the checksum, and then install the binary.
# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.sh | sh
# Windows PowerShell 5.1+
irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.ps1 | iex
Pin an exact release when reproducibility matters:
curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/vX.Y.Z/scripts/install.sh \
| CODEGRAPH_VERSION=vX.Y.Z sh
$env:CODEGRAPH_VERSION = "vX.Y.Z"
irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/vX.Y.Z/scripts/install.ps1 | iex
Prebuilt archives
GitHub Releases publish these archive families:
| Platform | Target | Archive |
|---|---|---|
| Linux x86_64 | x86_64-unknown-linux-musl |
.tar.gz |
| Linux ARM64 | aarch64-unknown-linux-musl |
.tar.gz |
| macOS Intel | x86_64-apple-darwin |
.tar.gz |
| macOS Apple Silicon | aarch64-apple-darwin |
.tar.gz |
| Windows x86_64 | x86_64-pc-windows-msvc |
.zip |
| Windows ARM64 | aarch64-pc-windows-msvc |
.zip |
The Linux archives are static musl builds that allocate through mimalloc; the macOS and Windows archives use the platform allocator.
Each release also includes SHA256SUMS. GitHub CLI users can additionally verify
an archive's build provenance:
gh attestation verify codegraph-X.Y.Z-x86_64-unknown-linux-musl.tar.gz \
--repo sunerpy/codegraph-rust \
--signer-workflow sunerpy/codegraph-rust/.github/workflows/release.yml \
--deny-self-hosted-runners
Build from Git
The project is not published to crates.io:
cargo install --locked --git https://github.com/sunerpy/codegraph-rust codegraph-rs
The installed executable is codegraph; SQLite is bundled.
Quickstart
Create an index, check its state, then ask a structural question:
cd /path/to/project
codegraph init .
codegraph status . --json
codegraph search "main" -p .
codegraph explore "startup and configuration flow" -p .
Lifecycle commands take a positional project path. Research commands take one
query or target plus -p/--path. For example:
codegraph sync .
codegraph node "ReferenceResolver" -p .
codegraph callers "ReferenceResolver" -p .
codegraph impact "ReferenceResolver" -p .
If a command rejects an argument, run codegraph <command> --help; do not abandon
an available index because a lifecycle and research command use different path
syntax.
CLI
Common workflows:
# Index lifecycle
codegraph status . --json
codegraph sync .
codegraph index . # full rebuild of the selected project
# Research
codegraph search "symbol" -p .
codegraph explore "area or flow" -p .
codegraph node "symbol-or-id" -p .
codegraph files -p . --format tree
# Relationships
codegraph callers "symbol" -p .
codegraph callees "symbol" -p .
codegraph impact "symbol" -p .
# Operations
codegraph serve --mcp --path .
codegraph serve --http --path .
codegraph mcp list
codegraph http list
query remains an alias for search. For every command and flag, see
docs/cli.md.
MCP
Register the stdio server manually:
{
"mcpServers": {
"codegraph": {
"command": "codegraph",
"args": ["serve", "--mcp"],
},
},
}
Or let the installer update supported agent configurations:
codegraph install --yes
codegraph install --yes --init
codegraph install --target=codex,claude,kiro --yes
Global profile overrides are honored: Claude Code follows
CLAUDE_CONFIG_DIR, Codex follows CODEX_HOME, and OpenCode 2 receives its
native mcp.servers.codegraph entry with codemode: false. Claude entries set
alwaysLoad: true; Copilot CLI entries set deferTools: "never" so Explore is
available from the first prompt.
A server launched without --path can serve an existing index selected by an
explicit per-call projectPath, client roots, or deterministic workspace
adoption. First explicit access to an existing index waits for catch-up and
retains that project's shared daemon/watcher; multiple child projects remain
separate and multiple MCP sessions share one writer per project. Pin --path
when a project should be the default rather than supplied per call. Explicit
direct mode (CODEGRAPH_NO_DAEMON=1) opts out of lazy cross-project daemon
services, permits one direct writer, and rejects a second.
The default visible MCP surface emphasizes exploration, file/symbol reads,
search, and callers. Additional known tools can be enabled with
CODEGRAPH_MCP_TOOLS. Tool schemas, project resolution, stdio/HTTP behavior,
and protocol compatibility are in docs/mcp.md.
Agents and IDEs
codegraph install supports common coding agents and IDE integrations. Some
clients can expand a workspace variable in global configuration; others require a
project-local absolute path for live watching. The installer prints the relevant
caveat rather than guessing.
codegraph install --target=auto --global --yes
codegraph install --target=auto --local --yes
codegraph init --target=kiro .
codegraph init --target=zed .
The optional embedded skill teaches an agent to use CodeGraph before grep/read:
codegraph skill install --yes
codegraph skill status
codegraph skill update --dry-run --diff
- Run
codegraph status <project> --jsonbefore research. - Use
codegraph_explorefirst for architecture, a bug, or a flow. - Use
codegraph_searchto locate one name andcodegraph_nodeto read one symbol or indexed file with its caller/callee trail. - Use
codegraph_impactbefore changing a shared symbol. - Trust the structural index; re-read only files explicitly reported stale.
- Use
codegraph sync <project>for ordinary catch-up. Rebuild only when status or a requested operation requires it.
Full target and configuration matrices:
docs/cli.md, docs/mcp.md, and
editors/zed/README.md.
Browser viewer
codegraph ui opens a local, read-only reader of the index in your browser. It is a
preview, refused unless CODEGRAPH_UI=1 is set:
CODEGRAPH_UI=1 codegraph ui # the indexed project you are in
CODEGRAPH_UI=1 codegraph ui --read-only # also refuse saving trails
It binds 127.0.0.1 only, never builds or changes the index, and writes nothing but
the trails you choose to save under .codegraph/ui/trails/. It has a dark and a light
theme and follows the system's until you pick one.
A tour of every view is on the website:
the browser viewer. The reference is
docs/ui.md.
Determinism and safety
The compatibility contract includes stable node IDs, canonical golden artifacts, SQLite schema parity, deterministic resolution and ordering, project-contained filesystem access, and fail-closed ambiguity. Incremental output is tested against a clean full index.
CodeGraph reports static evidence, not runtime certainty. Reflection, registries, event buses, framework conventions, generated code, and dynamic dispatch can continue beyond a known edge. Absence of a static reference is not proof that code is dead.
For schema and oracle details, read docs/data-model.md and
docs/equivalence.md. Security reports should follow
SECURITY.md.
Performance
Performance is measured by the committed benchmark harness on pinned corpora. A valid result records the implementation commits, environment, cache policy, run count, median, dispersion, and query percentiles. This README intentionally makes no floating latency claim.
Methodology and the current result status are in
docs/benchmark.md and
docs/benchmark-results.md.
Development
The pinned Rust toolchain and locked dependency graph are repository contracts. Start with:
git clone https://github.com/sunerpy/codegraph-rust.git
cd codegraph-rust
make hooks
make check
make check and make ci run the same complete local quality path; make pre-ci adds a local package/unpack/execute smoke. Focused targets are available through make help. Contributors should read
CONTRIBUTING.md and the canonical agent contract in
AGENTS.md.
Documentation
- firlab.app/codegraph — the website: guide, quick start and a tour of the viewer (简体中文)
docs/README.md— documentation mapdocs/architecture.md— workspace and runtime designdocs/cli.md— complete command referencedocs/mcp.md— MCP transports, tools, and clientsdocs/ui.md— local browser viewer (preview,CODEGRAPH_UI=1)docs/languages.md— language coverage and boundariesdocs/equivalence.md— deterministic golden contractdocs/upstream-sync/UPSTREAM.md— upstream ledgerdocs/troubleshooting.md— diagnostic workflow
Community
- Questions, bug reports and feature requests: GitHub Issues.
- WeChat: the Official Account 六月水蓝.
License
MIT — see LICENSE-MIT.
CodeGraph-Rust MCP 질문
CodeGraph는 인덱싱을 위해 AI나 LLM을 사용합니까?
아니요, 인덱서 내부에 AI나 벡터 런타임을 사용하지 않으며 tree-sitter 추출과 SQLite/FTS5를 사용하는 결정론적 도구입니다.
인덱서가 증분식으로 작동합니까?
네, sync 및 watcher 명령어를 통해 변경된 파일만 업데이트하며, 전체를 새로 인덱싱했을 때와 동일한 최종 정규화 결과를 유지합니다.
코드 그래프를 시각적으로 볼 수 있습니까?
네, codegraph ui 명령어를 사용하여 로컬 읽기 전용 브라우저 뷰어를 열 수 있습니다.