codegraph-summary
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codegraph-summary 搜索'交易查询'相关代码"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codegraph-summary
CodeGraph 中文语义摘要工具 — 为代码符号生成中文业务摘要,支持语义搜索和 PRD 关联分析。
将代码知识图谱与 LLM 结合,让你用中文业务术语搜索代码、理解系统架构、追踪需求覆盖。
特性
一键初始化 —
codegraph-summary init自动构建索引 + 生成摘要中文语义搜索 — 用 "交易查询"、"清退流程" 等业务术语搜索代码
FTS5 trigram — 高质量中文子串匹配,无需分词器
图谱扩展 — 搜索结果展示调用链(谁调用了它、它调用了谁)
PRD 关联 — 导入需求文档,自动关联到代码实现
多协议 LLM — 支持 Anthropic / OpenAI 兼容 API
启发式降级 — 无 LLM API Key 时仍可生成基础摘要
三种接口 — CLI / HTTP API / MCP Server
Related MCP server: MCP Indexer
快速开始
安装
npm install -g codegraph-summary需要先安装 CodeGraph:
npm install -g @colbymchenry/codegraph一键初始化
cd your-project
codegraph-summary init这会自动完成:
构建 CodeGraph 代码索引(如果不存在)
用 LLM 为所有导出符号生成中文摘要
配置 LLM(可选)
在项目根目录创建 .env 文件:
SUMMARY_LLM_API_KEY=your-api-key
SUMMARY_LLM_BASE_URL=https://api.anthropic.com
SUMMARY_LLM_MODEL=claude-sonnet-4-20250514
SUMMARY_LLM_API_TYPE=anthropic不配置 API Key 也能用(启发式模式,用函数签名作为摘要)。
使用
搜索代码
codegraph-summary search "交易查询" -p /path/to/project查看状态
codegraph-summary status -p /path/to/project强制重新生成
codegraph-summary init -f
codegraph-summary generate -f -p /path/to/projectPRD 关联
# 导入 PRD 文档(支持 .md / .docx / .pdf / .txt)
codegraph-summary prd-import ./docs/prd.md -p /path/to/project
# 用需求描述搜索代码
codegraph-summary prd-search "用户清退流程" -p /path/to/project
# 查看需求覆盖率
codegraph-summary prd-coverage -p /path/to/projectMCP Server(AI 助手集成)
codegraph-summary mcp在 Claude Code 的 MCP 配置中添加即可让 AI 助手直接搜索代码摘要。
HTTP API
codegraph-summary serve --port 3000环境变量
变量 | 说明 | 默认值 |
| LLM API Key | (空,启发式模式) |
| LLM API 地址 | (空) |
| 模型名称 | (空) |
|
|
|
| 每批符号数量 |
|
| 并发请求数 |
|
| 向量服务地址(可选) | (空) |
| 自定义 codegraph 路径 | (自动查找) |
系统要求
Node.js >= 22.5.0
CodeGraph (用于代码索引)
PDF 支持需要
poppler-utils(macOS:brew install poppler)DOCX 支持需要
unzip命令
License
MIT
Available Tools
6 toolsprd_coverageC
分析 PRD 需求的代码覆盖率,找出没有对应实现的需求片段(离散节点)。
Inputs: projectPath.
prd_importC
导入 PRD/需求文档,按章节切分后与代码符号建立关联。支持 markdown 格式。需要向量库配置。
Inputs: prdPath (required), minScore, projectPath.
prd_searchA
【需求定位代码】当问题涉及"需求实现"、"功能在哪"、"这个需求怎么做的"时,必须调用此工具。输入需求描述文字,直接返回实现该需求的函数/组件及文件路径,基于 PRD 文档与代码的预关联索引。
Inputs: query (required), limit, projectPath.
summary_generateA
为当前项目的导出符号生成或更新中文摘要。首次运行全量生成,后续运行增量更新。需要 LLM API 配置(SUMMARY_LLM_API_KEY 等环境变量)。
Inputs: force, projectPath.
summary_searchA
【首选工具】搜索代码时必须首先调用此工具。输入中文业务术语或需求描述(如"清退转正常"、"交易溯源"、"订单状态机"),直接返回对应的函数/组件名称、文件路径和中文功能说明。比 grep 和 codegraph_explore 更快更准,因为它基于预生成的中文语义索引,一次调用即可定位目标代码,无需逐文件搜索。
Inputs: query (required), limit, projectPath.
summary_statusA
查看当前项目的摘要生成状态:覆盖率、PRD 关联情况。
Inputs: projectPath.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct purpose: generating summaries, importing PRDs, searching via PRD or summaries, analyzing coverage, and checking status. No overlap.
Tool names follow a clear domain_action pattern: 'summary_generate', 'prd_import', 'prd_search', etc. Consistent prefixing and verb usage.
6 tools is well-scoped for the server's purpose of code summary and PRD management. Not excessive or insufficient.
Covers core workflows: generation, import, search, coverage, status. Minor gap: no explicit tool for deleting or updating individual summaries, but incremental generation works around.
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables semantic code search across projects using AI embeddings to find code by meaning rather than just text matching. Provides fast intelligent search, symbol analysis, and code similarity detection with multi-language support.MIT
- AlicenseNot gradedqualityDmaintenanceEnables semantic code search across multiple repositories using natural language queries. Provides intelligent code discovery, symbol lookups, and cross-repo dependency analysis for AI coding agents.MIT
- AlicenseAqualityDmaintenanceEnables semantic code search across codebases with automatic incremental indexing. Searches return relevant code snippets with file paths and line numbers based on natural language queries.1803Apache 2.0
- AlicenseAqualityDmaintenanceProvides code repository indexing and semantic search capabilities, allowing natural language queries to find relevant code snippets with automatic incremental indexing and multi-language support.1360ISC