经 AI Skill Hub 精选评估,MCP工具:AST知识图谱 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
基于Rust开发的MCP服务器,支持语义搜索和调用图分析,提高代码导航效率。
MCP工具:AST知识图谱 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于Rust开发的MCP服务器,支持语义搜索和调用图分析,提高代码导航效率。
MCP工具:AST知识图谱 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/sdsrss/code-graph-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp---ast----": {
"command": "npx",
"args": ["-y", "code-graph-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 MCP工具:AST知识图谱 执行以下任务... Claude: [自动调用 MCP工具:AST知识图谱 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp___ast____": {
"command": "npx",
"args": ["-y", "code-graph-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
A high-performance code knowledge graph server implementing the Model Context Protocol (MCP). Indexes codebases into a structured AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing — designed to give AI coding assistants deep, structured understanding of your code.
#include imports + gtest test markers; Class::method scope qualification deferred): C, C++source/. imports), Markdown (headings)net/http)embed-model). Context reordered to prioritize structural relations over code for better embedding quality/understand, /trace, /impact), agents, skills, auto-indexing hooks, StatusLine integration, and self-updatingSingle binary, embedded SQLite, bundled sqlite-vec extension, optional local embedding model via Candle — no database server, no cloud API, no Docker required. Runs entirely on your machine.
/plugin install code-graph-mcp
What you get:
- **MCP Server** — All code-graph tools available to Claude
- **Slash Commands** — `/understand <module>`, `/trace <route>`, `/impact <symbol>`
- **Code Explorer Agent** — Deep code understanding expert via `code-explorer`
- **Auto-indexing Hook** — Incremental index on every file edit (PostToolUse)
- **StatusLine** — Real-time health display (nodes, files, watch status) — compatible with other plugins' StatusLine via composite multiplexer
- **Auto-update** — Checks for new versions every 6h, updates silently
#### Manual Update
bash npm update -g @sdsrs/code-graph
Then reconnect the MCP server in Claude Code with `/mcp`.
> **Note:** Auto-update is disabled in the source repo directory (dev mode). Use manual update when developing the plugin itself.
#### Invited-memory mode (quieter prompts)
By default, every user prompt the plugin deems code-related gets a small context injection from `code-graph` CLI output. If you'd rather rely on MEMORY.md + explicit tool calls, opt into invited-memory mode:
1. Adopt the plugin contract into your project's memory index (idempotent, self-heals):
bash code-graph-mcp adopt This writes `plugin_code_graph_mcp.md` (decision rules) into `~/.claude/projects/<slug>/memory/` and links it from `MEMORY.md` inside a sentinel block. Run `code-graph-mcp unadopt` to remove.
2. Set the activation env var in `~/.claude/settings.json`:
json { "env": { "CODE_GRAPH_QUIET_HOOKS": "1" } } ``` 3. Restart Claude Code. Session startup skips the project-map injection, UserPromptSubmit stops auto-injecting context, and the MCP instructions become a short pointer to the MEMORY.md file.
Run directly without installing:
npx -y @sdsrs/code-graph
Install globally, then run anywhere:
npm install -g @sdsrs/code-graph
code-graph-mcp
/plugin uninstall code-graph-mcp
```bash
cargo build --release
Install as a Claude Code plugin for the best experience — includes slash commands, agents, skills, auto-indexing hooks, StatusLine health display, and automatic updates:
```bash
Register as an MCP server without the plugin features:
claude mcp add code-graph-mcp -- npx -y @sdsrs/code-graph
Add to your MCP settings file (e.g. ~/.cursor/mcp.json):
{
"mcpServers": {
"code-graph": {
"command": "npx",
"args": ["-y", "@sdsrs/code-graph"]
}
}
}
/plugin marketplace remove code-graph-mcp
node ~/.claude/plugins/cache/code-graph-mcp/code-graph-mcp/*/scripts/lifecycle.js uninstall ```
Add the compiled binary to your MCP settings:
{
"mcpServers": {
"code-graph": {
"command": "/path/to/target/release/code-graph-mcp"
}
}
}
All tools are also available as CLI subcommands for shell scripts, hooks, and terminal workflows:
| Command | MCP Equivalent | Description |
|---|---|---|
search <query> | semantic_code_search | FTS5 search by concept |
ast-search [query] | ast_search | Structural search with --type/--returns/--params filters |
callgraph <symbol> | get_call_graph | Show call graph (callers/callees) |
impact <symbol> | impact_analysis | Impact analysis (callers, routes, risk level) |
show <symbol> | get_ast_node | Show symbol details (code, type, signature) |
map | project_map | Project architecture map |
overview <path> | module_overview | Module symbols grouped by file and type |
deps <file> | dependency_graph | File-level dependency graph |
trace <route> | trace_http_chain | Trace HTTP route → handler → downstream calls |
similar <symbol> | find_similar_code | Find semantically similar code (requires embeddings) |
refs <symbol> | find_references | Find all references to a symbol |
dead-code [path] | find_dead_code | Find unused code (orphans and exported-unused) |
grep <pattern> | — | AST-context grep (ripgrep + containing function/class) |
incremental-index | — | Run incremental index update (auto-creates DB if needed) |
health-check | get_index_status | Query index status and freshness |
benchmark | — | Benchmark index speed, query latency, token savings |
Common options: --json (JSON output), --compact (compact output), --limit N, --depth N, --file <path>.
```bash
Available when installed as a Claude Code plugin:
| Command | Description |
|---|---|
/understand <module> | Deep dive into a module or file's architecture and relationships |
/trace <route> | Trace a full HTTP request flow from route to data layer |
/impact <symbol> | Analyze the impact scope of changing a symbol before modifying it |
/status | Show code-graph index status and embedding progress |
/rebuild | Force a full code-graph index rebuild |
Real-world benchmarks comparing code-graph-mcp tools against traditional approaches (Grep + Read + Glob) on a 33-file Rust project (~537 AST nodes).
该项目基于Rust开发的MCP服务器,支持语义搜索和调用图分析,提高代码导航效率,值得关注。
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
AI Skill Hub 点评:MCP工具:AST知识图谱 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | code-graph-mcp |
| Topics | mcpastcall-graphclaude-codeclaude-code-plugincode-navigationrust |
| GitHub | https://github.com/sdsrss/code-graph-mcp |
| 语言 | Rust |
收录时间:2026-05-23 · 更新时间:2026-05-23 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端