AI Skill Hub 强烈推荐:代码图谱 是一款优质的MCP工具。已获得 2.3k 颗 GitHub Star,AI 综合评分 8.2 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
代码图谱 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
代码图谱 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/vitali87/code-graph-rag
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"----": {
"command": "npx",
"args": ["-y", "code-graph-rag"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 代码图谱 执行以下任务... Claude: [自动调用 代码图谱 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"____": {
"command": "npx",
"args": ["-y", "code-graph-rag"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p> <a href="https://trendshift.io/repositories/99619" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/99619" alt="vitali87/code-graph-rag | Trendshift" width="250" height="55"/></a> </p>
<p> <a href="https://github.com/vitali87/code-graph-rag/actions/workflows/ci.yml"> <img src="https://img.shields.io/github/actions/workflow/status/vitali87/code-graph-rag/ci.yml?branch=main" alt="CI" /> </a> <a href="https://codecov.io/gh/vitali87/code-graph-rag"> <img src="https://codecov.io/gh/vitali87/code-graph-rag/graph/badge.svg" alt="Codecov" /> </a> <a href="https://sonarcloud.io/summary/overall?id=vitali87_code-graph-rag"> <img src="https://sonarcloud.io/api/project_badges/measure?project=vitali87_code-graph-rag&metric=alert_status" alt="Quality Gate Status" /> </a> <a href="https://code-graph-rag.com"> <img src="https://img.shields.io/badge/Enterprise-Support%20%26%20Services-6366f1" alt="Enterprise Support" /> </a> <a href="https://pypi.org/project/code-graph-rag/"> <img src="https://img.shields.io/pypi/v/code-graph-rag" alt="PyPI Version" /> </a> <a href="https://pepy.tech/projects/code-graph-rag"> <img src="https://static.pepy.tech/personalized-badge/code-graph-rag?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads" alt="PyPI Downloads" /> </a> <a href="https://skillsllm.com/security-check/DHsMGRb1Ysys"> <img src="https://skillsllm.com/security-check/badge.svg?owner=vitali87&repo=code-graph-rag" alt="SkillsLLM Security Check" /> </a> <a href="https://scorecard.dev/viewer/?uri=github.com/vitali87/code-graph-rag"> <img src="https://api.scorecard.dev/projects/github.com/vitali87/code-graph-rag/badge" alt="OpenSSF Scorecard" /> </a> <a href="https://www.bestpractices.dev/projects/13757"> <img src="https://www.bestpractices.dev/projects/13757/badge" alt="OpenSSF Best Practices" /> </a> </p> </div>
cgr is published to PyPI. Install it system-wide with the treesitter-full (all languages) and semantic (vector search) extras:
```bash
```bash
cgr daemon up
Code-Graph-RAG 是一个强大的代码知识图谱构建与检索增强生成(RAG)系统。它通过解析代码库的结构,将其转化为知识图谱,从而为开发者提供深度的代码理解能力,支持企业级的代码分析与智能交互需求。
本项目具备强大的多语言解析能力,能够深度支持 C、C++ 等语言的函数、类、结构体及模块检测。通过结合代码结构与语义信息,系统可以实现精准���代码索引、关系查询及基于上下文的智能代码分析。
运行本项目需要 Python 3.12+ 环境,并需安装 Docker & Docker Compose 以运行 Memgraph 数据库。此外,系统依赖 cmake 进行编译,使用 ripgrep 进行文本搜索。若使用云端模型需准备 Google Gemini API key,若使用本地模型则需安装 Ollama 并拉取相关模型(如 llama3.2)。
在安装依赖工具时,macOS 用户可以通过 brew 安装 cmake 和 ripgrep;Linux 用户(Ubuntu/Debian)建议使用 apt-get,CentOS/RHEL 用户则使用 yum 或 dnf。请确保在安装过程中正确配置环境,以便顺利构建 pymgclient 等核心依赖。
系统提供五种核心工作模式:1. Parse & Ingest(构建代码知识图谱);2. Interactive Query(通过自然语言询问代码逻辑);3. Export & Analyze(导出图数据进行程序化分析);4. AI Optimization(获取 AI 驱动的代码优化建议);5. Editing(执行精准的代码替换)。您可以直接通过命令行进行索引或针对特定逻辑进行提问。
用户可以通过编辑 .env 文件进行灵活配置。系统支持 provider-explicit 配置模式,允许开发者混合使用不同的模型提供商。例如,您可以配置 ORCHESTRATOR 使用 Ollama 本地模型进行任务编排,而 CYPHER 使用 OpenAI 模型来生成 Cypher 查询语句,实现性能与成本的最佳平衡。
Code-Graph-RAG 可作为 MCP (Model Context Protocol) Server 运行,实现与 Claude Code 及其他 MCP 客户端的无缝集成。系统内置了 Agentic Workflow(智能体工作流),确保 Agent 在执行文件系统修改等操作时具备高度的上下文感知能力与执行精度。
高质量的MCP工具,支持多语言代码分析
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,代码图谱 是一款质量优秀的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | code-graph-rag |
| 原始描述 | 开源MCP工具:The ultimate RAG for your monorepo. Query, understand, and edit multi-language c。⭐2.3k · Python |
| Topics | code-analysiscode-understandingpython |
| GitHub | https://github.com/vitali87/code-graph-rag |
| License | MIT |
| 语言 | Python |
收录时间:2026-07-02 · 更新时间:2026-07-03 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端