gograph MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
gograph MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
gograph MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/ozgurcd/gograph
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"gograph-mcp--": {
"command": "npx",
"args": ["-y", "gograph"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 gograph MCP工具 执行以下任务... Claude: [自动调用 gograph MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"gograph_mcp__": {
"command": "npx",
"args": ["-y", "gograph"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Stop burning tokens on grep. Give your AI agent a graph.
gograph builds a local, AST-aware call graph of your Go repository and exposes 50+ query tools via CLI and MCP so coding agents can navigate packages, symbols, call chains, routes, SQL, env vars, and tests — without reading raw files.

Zero network. Zero execution. Zero secrets read.gographis purely static analysis — it never runs your code, makes API calls, or opens non-.gofiles.
``` Add llm-wiki/ to .gitignore — these files are regenerated each session.
50+ Query Tools — callers, callees, impact, context, plan, review, errorflow, orphans, hotspot, coupling, and more. Full command reference →
Native MCP Server — all tools available as MCP endpoints for Claude, Cursor, Copilot, and any MCP-compatible agent. One command setup: gograph add-claude-plugin
Token-Saving Composites — context replaces 5 calls. plan replaces 8. explain synthesizes architectural narratives. Built to minimize agent round-trips.
Safe by Design — no network, no code execution, no secrets, no .env files read. AI worktree directories (.claude/, .cursor/, .agents/) auto-excluded.
Architecture Enforcement — boundary rules, API drift detection, complexity gates, dead code sweeps, god-object detection, coupling analysis. Run in CI with gograph gate.
Agent Compliance Auditing — session telemetry tracks whether agents run plan before edits and review after. Grades agent behavior A–F with actionable recommendations.
brew install ozgurcd/tap/gograph
gograph build . --precise
```bash
When you run gograph build ., the generated GRAPH_REPORT.md gives your AI a condensed context map:
External Dependencies (Tech Stack) <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Module</th><th>Version</th></tr></thead><tbody><tr><td>github.com/gin-gonic/gin</td><td>v1.9.1</td></tr><tr><td>github.com/jackc/pgx/v5</td><td>v5.5.5</td></tr></tbody></table></div>
Important Symbols (Top by outgoing calls) <div class="rdm-tbl-wrap"><table class="rdm-tbl"><thead><tr><th>Symbol</th><th>Kind</th><th>File</th><th>Line</th><th>Calls out</th></tr></thead><tbody><tr><td>(Server).Start</td><td>method</td><td>server.go</td><td>42</td><td>18</td></tr><tr><td>ValidateAuth</td><td>function</td><td>auth.go</td><td>12</td><td>14</td></tr></tbody></table></div>
---
gograph plan "ValidateToken" ```
All commands support --json for machine-readable output and --files-only for flat file lists.
| Category | Commands | What it does |
|---|---|---|
| **Indexing** | build . [--precise], stale, stats | Parse AST, write graph. Check freshness. Index health. |
| **Navigation** | query, callers [--depth N], callees [--depth N], path, source, node | Find symbols, trace call chains, extract source. |
| **Context** | context, explain, focus, endpoint | Bundled structural data in one call. Token savers. |
| **Change Analysis** | plan, review, risk, impact [--uncommitted\|--since], changes [--git], api --since | Pre-edit planning, post-edit review, risk analysis, blast radius, drift. |
| **Architecture** | boundaries, coupling, complexity, godobj, orphans, arity | Quality gates, dead code, coupling, god objects. |
| **Types & Structs** | fields, implementers [--test-only], interfaces, embeds, constructors, literals, usages, mutate, schema | Struct fields, interface satisfaction, type usage. |
| **Infrastructure** | routes, sql, envs, errors, concurrency, globals, httpcalls, deps [--transitive], dependents, imports | HTTP routes, SQL, env vars, concurrency, outbound HTTP calls, imports. |
| **Testing** | tests, fixtures, mocks | Test coverage map, helpers, mock implementations. |
| **Error Tracing** | errorflow [--no-tests], trace | Reverse-BFS from error strings to HTTP entry points. |
| **Diagnostics** | hotspot, returnusage, skeleton, diagram, changes, public | Hotspots, return usage, API signatures, Mermaid diagrams. |
| **CI/CD** | check [--since\|--uncommitted], gate, snapshot save\|diff\|list\|drop | Policy checks, threshold enforcement, metric snapshots. |
| **Telemetry** | session create\|end\|audit\|cleanup | Agent compliance tracking and grading (A–F). |
| **LLM-Wiki** | wiki [--output dir] | Generate llm-wiki/ — machine-first markdown pages for zero-cost agent orientation (overview, architecture, hotspots, routes, env, errors, concurrency, per-package, API surface). |
| **Summary** | summary [--json] | Single-call codebase briefing: top 3 hotspots, worst instability package, highest complexity function, orphan count, god-object count. Replaces 5 separate calls. |
| **Untested** | untested [--pkg name] [--top N] [--json] | Functions with callers but zero test edges — coverage gaps invisible to orphans or per-symbol test queries. One sweep replaces N tests <sym> calls. |
| **Doc** | doc <pkg[.Symbol]> [--json] | go doc wrapper — signature + doc comment for any stdlib or third-party symbol. No graph required. Closes the gap when call chains leave the project. |
Full command reference with examples: gograph.identuum.ai/docs/command-reference
<details> <summary><strong>Architecture Boundary Enforcement</strong></summary>
Define boundaries in .gograph/boundaries.json:
{
"layers": [
{ "name": "domain", "packages": ["internal/domain/**"], "may_import": [] },
{ "name": "handler", "packages": ["internal/handler/**"], "may_import": ["internal/service/**", "internal/domain/**"] }
]
} Run gograph boundaries — exits with code 1 on violation. Works in CI/CD. </details>
One-command setup (Claude Desktop + Claude Code):
gograph add-claude-plugin This registers the MCP server, injects CLAUDE.md steering rules, and installs a PreToolUse hook that redirects grep on Go symbols to gograph tools.
Alternative — install via Claude Code plugin marketplace:
/plugin marketplace add ozgurcd/gograph
/plugin install gograph@gograph Discovers gograph through Claude Code's plugin marketplace and ships a SKILL.md that auto-activates on Go work, teaching the agent the mandatory workflow (capabilities → build → plan → context → review) and that grep/rg/find must not be used for Go symbol search.
You still need the gograph binary installed (brew install ozgurcd/tap/gograph or go install github.com/ozgurcd/gograph@latest). Use gograph add-claude-plugin above for the full one-command bootstrap (MCP wiring + CLAUDE.md rules + PreToolUse hook). Use the plugin marketplace when you'd rather discover and install gograph from inside Claude Code's plugin UI.
Other agents (Cursor, Copilot, Antigravity, etc.):
gograph mcp . # Run as MCP server over stdio Add to your .cursorrules or AI system prompt: > Before answering architecture or repository questions, inspect the available gograph_* MCP tools and use them instead of grep/find. Run gograph capabilities first.
All commands support --json for machine-readable output: ```bash gograph callers "ValidateToken" --json
gograph 是一个专为 Go 语言开发者设计的代码图谱分析工具。它能够深度解析代码结构,为 AI Agent 提供精准的代码上下文,帮助开发者更高效地理解复杂的代码逻辑与依赖关系。
gograph 提供超过 50 种强大的查询工具,涵盖 callers、callees、impact、context、plan 等多种维度,支持对代码进行深度影响分析。此外,它内置了原生的 MCP Server,可无缝接入 Claude、Cursor、Copilot 等支持 MCP 协议的 AI 助手。通过 Token-Saving Composites 技术,gograph 能够以极高的压缩率提供关键上下文,显著降低 AI 使用过程中的 Token 消耗。
您可以通过 Homebrew 进行快速安装:执行 `brew install ozgurcd/tap/gograph`。安装完成后,在项目根目录下运行 `gograph build . --precise` 即可构建精确的代码图谱。
使用 gograph 构建图谱后,它会生成一个 `GRAPH_REPORT.md` 文件。该文件为 AI 提供了一个精简的上下文映射,包括外部依赖(Tech Stack)清单以及关键符号(Important Symbols)的调用关系。通过这种方式,AI 可以清晰地识别代码中的调用流向,从而提供更准确的辅助建议。
gograph 支持高度灵活的交互模式。在进行代码编辑或重构前,您可以使用 `gograph plan` 命令(例如 `gograph plan "ValidateToken"`)来预演变更计划,涵盖测试、路由、SQL 及环境变量等维度的影响评估。
gograph 的所有命令均支持 `--json` 参数以输出机器可读的数据,或使用 `--files-only` 获取扁平化的文件列表。命令集分为 Indexing(索引管理,如 `build`、`stale`、`stats`)、Navigation(导航查询,如 `query`、`call`)等多个类别,方便开发者进行自动化集成。
gograph 实现了深度 AI Agent 集成工作流。通过简单的 `gograph add-claude-plugin` 命令,即可完成 Claude Desktop 与 Claude Code 的一键配置。该过程会自动注册 MCP server,注入 `CLAUDE.md` 引导规则,并安装 `PreToolUse` 钩子,将针对 Go 符号的 `grep` 操作自动重定向至 gograph 的专业工具集,实现 AI 驱动的智能开发体验。
质量较高的MCP工具,Go实现保证性能。功能聚焦明确,适合IDE集成场景。维护活跃度良好,生态价值明显。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,gograph MCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | gograph |
| 原始描述 | 开源MCP工具:A fast, local-only CLI tool to generate repository structures and improve IDE co。⭐118 · Go |
| Topics | 代码结构MCP工具AI编码Go开发本地工具 |
| GitHub | https://github.com/ozgurcd/gograph |
| License | MIT |
| 语言 | Go |
收录时间:2026-05-16 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端