能力标签
gograph MCP工具
🔌
MCP工具

gograph MCP工具

基于 Go · 让 AI 助手直接操作你的系统与工具
英文名:gograph
⭐ 118 Stars 🍴 7 Forks 💻 Go 📄 MIT 🏷 AI 8.0分
8.0AI 综合评分
代码结构MCP工具AI编码Go开发本地工具
✦ AI Skill Hub 推荐

gograph MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

gograph MCP工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 gograph MCP工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。gograph MCP工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 gograph MCP工具 评为 AI 评分 8.0 分,属于同类工具中的优质选择。

📋 工具概览

gograph MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 118
开发语言
Go
支持平台
Windows / macOS / Linux(跨平台)
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
8.0 分
工具类型
MCP工具
Forks
7

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

gograph MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 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
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 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 生效
📑 README 深度解析 真实文档 完整度 82/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

gograph

Go Report Card License: MIT Go Version Homebrew Docs

Give Go coding agents a compiler-aware map for safer refactors.

gograph builds a local structural graph of your Go repository, with optional type-checked CHA/SSA enrichment. Its CLI and MCP workflows help coding agents trace callers and interface implementations, plan change impact, and enforce architecture without embeddings or a hosted code index.

Explore the interactive no-install demo · Review the reproducible benchmark

See CLI/MCP query contracts for bounded result pages, snapshot-bound cursors, exact/possible impact, and change-evaluation status.

Companion projects: Scrinium provides repository-owned, evidence-backed knowledge for coding agents, while Rulefloor protects repository-local invariants by binding them to concrete tests and detecting drift. They are independent, optional tools: Scrinium can keep Gograph structural observations and Rulefloor validation results as separate evidence without treating either as proof of unrelated behavior or global project correctness.

Gograph Demo

Static analysis; no target-code execution. Default indexing parses Go source locally and does not call application services. Linked directories and linked/special files for extensions recognized by go/build are excluded; unrelated regular-file or dangling links with non-Go extensions are not Go tool inputs and do not block precise analysis. Graph-directed source reads remain confined to regular files beneath the analyzed repository, and linked/non-regular Go tool metadata (go.mod, go.sum, go.work, go.work.sum, and vendor/modules.txt) is rejected before toolchain invocation; an explicitly symlinked repository root remains supported. Applicable go.work use members may be sibling modules beneath the nearest real Git checkout; without that boundary they remain confined beneath the workspace directory. Each member directory, go.mod, and optional go.sum is validated before cmd/go starts. Gograph also reads project metadata such as .gitignore, graph/config JSON, and Git state. Indexing asks the installed Go toolchain for the effective build/module context; precise mode additionally performs package type loading, and doc runs go doc. Those operations follow your configured module/cache/network policy. Before repository package loading or go doc, applicable local module/workspace source trees are preflighted for links that cmd/go may inspect; .git and .gograph subtrees are excluded. Session telemetry is local under .gograph/sessions/; nothing is sent to gograph services.

generated orientation starts at: llm-wiki/overview.md

Key Features

Machine and Agent Workflowsexplore provides bounded first-call discovery with ranked lexical matches, explicit symbol selection, source, callers, callees, tests, and exact identity-resolved impact; focused callers, callees, broader impact, reverse test coverage, stable identity, plan, review, flow, validation, and policy commands remain available. The MCP server registers 68 endpoints including four session lifecycle tools. Full command reference →

Federated Workspaces — model multiple checked-out repositories through independently fingerprinted repository graphs plus a small deterministic cross-repository overlay. Resolution scopes support alternative fleets such as OSS/CE without merging repository ownership. P0 resolves Go modules, ordinary cross-repository Go calls, and first-class HTTP contracts for workspace-wide status, query, path, and impact analysis. The four read-only workspace MCP tools return the same native result values as CLI --json; member refresh and overlay publication remain explicit CLI mutations. Workspace guide →

Native MCP Server — all 64 repository query, analysis, and workflow capabilities have project-MCP equivalents for Claude, Cursor, Copilot, and other MCP clients; four additional endpoints cover session lifecycle (68 project tools total). A separate workspace server provides status, query, path, and impact with the same native results as the corresponding CLI operations. The normal mapping is CLI <command> to MCP gograph_<command>; contract, boundaries --create, and session actions use the documented special mappings. CLI-only process/host/artifact operations are build, validate, doctor, gate, snapshot, plugin/hook installation, project/workspace MCP startup, workspace build/member refresh, and help. The standalone version command has no MCP tool, but gograph_capabilities reports the running server version. Transport presentation differs where appropriate, but paired operations share functional semantics. Complete CLI/MCP matrix →

Explicit Freshness Model — CLI graph-backed analysis reads the last trusted persisted graph. Its JSON envelope includes gograph.graph-state.v1, separating source (persisted/in_memory), freshness (current/stale), completeness (complete/partial), precision (ast/precise/fallback), refresh outcome, and persistence outcome; bounded diagnostics remain on the operation that produced them. Text stats and stale report the same persisted state. gograph stale compares selected source content digests plus the effective build/module fingerprint; mtimes are diagnostic only for current indexes. It is a tri-state predicate: exit 0 means current, 2 means stale, and 1 means an operational or JSON serialization error; a missing or unsupported source-policy marker is an explicit status-1 rebuild requirement. MCP source-analysis tools check the same freshness per call, adopt a newer persisted precise graph, and incrementally rebuild changed package ASTs in memory using the latest requested analysis mode. Refresh-backed tools preserve their compatibility text and add gograph.mcp-result.v1 structured content plus _meta.gograph_graph_state. Failed precise enrichment can serve a clearly marked current in-memory fallback, while an ordinary refresh failure can serve the last trusted stale graph; neither degraded result is silently published, and a mismatched effective Go environment still fails closed. MCP stale, default changes, and stats inspect the trusted persisted snapshot, or the startup auto-build fallback when no usable artifact exists. With --persist-refresh, that snapshot advances after a successful refresh; publication failures leave the fresh in-memory graph usable and explicitly report persistence.outcome=failed with a persistence diagnostic for retry.

Compact Composite Workflowsexplore, context, plan, and explain combine source and graph evidence that would otherwise require several separate queries. explore is additive: specialized commands remain the complete, stable interfaces for focused analysis. Actual tool-call and token savings depend on the repository and task.

Narrow by Design — never runs target repository binaries or tests and does not intentionally scan .env, key, certificate, or credential files. Linked directories and linked/special recognized Go build inputs are excluded; unrelated non-Go regular-file links are outside Go-tool preflight. On-demand source and snippet reads use a repository-rooted filesystem handle and accept only regular .go files without symlink components. Linked/non-regular Go module/workspace metadata, sums, and vendor/modules.txt are rejected before toolchain use. Applicable go.work members may be siblings inside the nearest real Git checkout and otherwise stay beneath the workspace directory; their directories plus module metadata are preflighted before cmd/go. Default/relative policy configs are project-confined; documented absolute config/output arguments are explicit operator-selected local locations. AI worktree directories (.claude/, .cursor/, .agents/) are excluded. The installed Go toolchain resolves effective build context during indexing; precise repository package loading and external go doc run only after a preflight that rejects source-tree links cmd/go may inspect across the selected root plus its effective module root, or the workspace root and member trees, excluding .git and .gograph. Dependency and toolchain resolution remain open-world under the user's Go environment.

Architecture Enforcement — boundary rules, API drift detection, complexity gates, dead code sweeps, god-object detection, coupling analysis. Run in CI with gograph gate.

Security Flow Analysisflow follows potential HTTP request, decoded JSON, and environment data across assignments and function calls to SQL query text, process execution, filesystem paths, and outbound HTTP targets. Findings include severity, confidence, and source-to-sink path steps; MCP exposes the same analysis as gograph_flow.

Integrity-Aware Indexing — publication refuses a linked or non-directory .gograph; graph.json is staged and replaced last only after a successful parse (the same-directory rename is atomic on Unix-like systems), records complete/partial build health and ast/precise/precise_fallback analysis status, and exposes both through gograph stats. gate refuses to evaluate a stale graph.

Agent Compliance Auditing — session telemetry tracks whether agents run plan before edits and review after. Grades agent behavior A–F with actionable recommendations.

Start with repository-wide results that require no guessed symbol

gograph summary gograph hotspot --top 5 gograph flow --no-tests


Homebrew and `go install` install the normal `gograph` CLI. MCP clients that
support MCP Bundles can instead discover the local stdio server in the
[official MCP Registry](https://registry.modelcontextprotocol.io) as
`io.github.ozgurcd/gograph`. Registry/MCPB installation is a separate
distribution path; it does not install the Homebrew cask or configure the
Claude Code marketplace plugin. The Registry is currently in preview. See
[Official MCP Registry and MCPB installation](docs/mcp-registry.md) for client
support, target selection, and current limitations.

Choose a real function or method shown by `summary`, `hotspot`, or
`gograph complexity`, then substitute its name below:
bash gograph explore "YourSymbol" --compact # low-token discovery, identity/role, and complete evidence counts gograph explore "YourSymbol" # standard source + callers/callees + tests + exact identity impact gograph explore "YourSymbol" --deep # standard response + depth-3 exact evidence, package context, explanation gograph context "YourSymbol" # source + callers + callees + tests

Install

brew install --cask ozgurcd/tap/gograph

or: go install github.com/ozgurcd/gograph/cmd/gograph@latest

Confirm which installation will run and detect PATH shadowing

gograph doctor --json

Build a type-enriched precise graph, then verify it

gograph build . --precise gograph stats

Quick Start

```bash

Example Output

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>

---

Optional CI contract: fail when precise enrichment falls back

gograph build . --precise --strict

Optional: prioritize lower heap use on constrained hosts

gograph build . --precise --memory-mode=low --max-memory=1GiB

Optional: include integration-tagged files and tests in this graph

gograph build . --precise --tags=integration

Optional low-memory policy for startup analysis and later refreshes:

gograph mcp . --memory-mode=low --max-memory=1GiB ```

This opt-in mode writes or overwrites .gograph/graph.json and the nine Markdown reports after a confirmed-fresh refresh. It does not modify .gitignore, so ignore .gograph/ yourself before enabling it when needed. The directory holds only the latest published state; it is not a per-branch cache. If no usable graph exists (including an unsafe or unsupported artifact), the startup auto-build is published before serving; a failure there prevents startup. A later tool-triggered publication failure makes that tool return an error, and the server retries the pending publication on another refresh-capable call without rebuilding the already-fresh in-memory graph. Writers coordinate through a local .gograph/.artifacts.lock file; an existing lock entry must be regular rather than a link or special file. Reports are replaced first and graph.json is replaced last as the publication commit marker; the complete ten-file bundle is not a single atomic filesystem transaction. Same-directory replacement is atomic on Unix-like systems; Go does not guarantee atomic rename semantics on non-Unix platforms. The lock file remains as operational coordination state in addition to the ten outputs.

Persisted graphs are bound to their effective Go environment and build selection. Start MCP with the same GOWORK, GOFLAGS, and --tags context used to build the graph; a mismatch is stale and must refresh successfully or return a diagnostic rather than silently serving incompatible facts. gograph doctor --json reports that repository diagnostic.

Command Reference

Query and composed-analysis commands support --json; version --json and validate ... --json use their dedicated machine schemas. The exact --files-only surface is listed in the command reference. Operational commands such as build, wiki, gate, snapshot, installation, and help use text output; doctor and workspace build/status/query/path/impact also accept --json, and session audit additionally supports raw JSON. CLI --mermaid renders callers, callees, impact, endpoint, dependents, deps, path, and coupling as fenced Mermaid. Their MCP equivalents accept mermaid=true and return the same Markdown-fenced Mermaid text; without it, each tool retains its normal response format.

CategoryCommandsWhat it does
**Indexing**build . [--precise] [--strict] [--memory-mode=low] [--max-memory=1GiB], stale, statsParse AST, optionally require precise success or prioritize lower heap use, write graph, check freshness and health.
**Machine Validation**version --json, validate --repo PATH --binding-json JSON --jsonVersioned exact structural predicates with tri-state outcomes.
**Navigation**query, callers [--depth N], callees [--depth N], path, source, nodeFind symbols, trace call chains, extract source.
**Context**context, explain, focus, endpointBundled structural data in one call. Token savers.
**Change Analysis**plan, review, risk, impact [--uncommitted\|--since], changes [--git], api --sincePre-edit planning, post-edit review, risk analysis, blast radius, drift.
**Architecture**boundaries, coupling, complexity, godobj, orphans, arityQuality gates, dead code, coupling, god objects.
**Types & Structs**fields, implementers [--test-only], interfaces, embeds, constructors, literals, usages, mutate, schemaStruct fields, interface satisfaction, type usage.
**Infrastructure**routes [term] [--module MODULE] [--include-tests] [--limit N] [--cursor CURSOR], sql [term] [--table T] [--verb V] [--access read\|write\|ddl] [--function F] [--module M] [--no-tests] [--limit N] [--cursor C], envs, errors, concurrency, globals, httpcalls, deps [--transitive], dependents, importsBounded CLI/MCP route and PostgreSQL static SQL pages with cursor continuation, module selectors, explicit test controls, and structured filtering; plus env vars, concurrency, outbound HTTP calls, and imports.
**Security**flow [term] [--source kind] [--sink kind] [--config path] [--no-tests]Potential untrusted-data paths to SQL, process, filesystem, and outbound HTTP sinks.
**Testing**tests [symbol] [--transitive] [--exact-only] [--package name], coverage <TestFunc> [--exact-only] [--package name], untested [--pkg name] [--top N] [--exclude glob] [--wide], fixtures, mocksDirect and transitive reverse exact/possible static test attribution, one-sweep gap census, full stable-ID output, helpers, mock implementations.
**Error Tracing**errorflow [--no-tests], traceReverse-BFS from error strings to HTTP entry points.
**Diagnostics**doctor [--json], hotspot, returnusage, skeleton, diagram, changes, publicInstall/PATH plus current graph freshness/capability diagnostics, hotspots, return usage, API signatures, Mermaid diagrams.
**CI/CD**check [--since\|--uncommitted], gate, snapshot save\|diff\|list\|dropPolicy checks, threshold enforcement, metric snapshots.
**Telemetry**session create\|end\|audit\|cleanupAgent compliance tracking and grading (A–F).
**LLM-Wiki**wiki [--output dir]Generate llm-wiki/ and prune obsolete generator-owned package pages while preserving custom pages and packages/README.md.
**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.
**Stable IDs**identity <symbol-or-stable-id> [--package name] [--json]Print and re-resolve module/package/receiver/name identity that survives line shifts and file moves inside a package; package disambiguates external-test collisions.
**Reverse Attribution**coverage <TestFunc> [--exact-only] [--package name] [--json]Transitive product-symbol set for one unambiguous test, with stable-ID paths and exact/possible propagation. Static evidence only—not runtime or branch coverage.
**Tests reaching a symbol**tests <symbol> --transitive [--exact-only] [--package name] [--json]Versioned reverse attribution listing every test with a representative stable-ID path to one product symbol. Default tests remains direct for compatibility.
**Untested**untested [--pkg name] [--top N] [--exclude glob] [--wide] [--json]Called production symbols without an exact transitive test path. Precise builds devirtualize only proven concrete receivers; open interface paths remain test_resolution=possible. JSON includes stable_id; --wide prints it without truncation.
**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.

Precise implementers results merge type-checked production types with AST-discovered test-file fakes; --test-only/MCP test_only=true returns only the latter. Direct tests lookup accepts Receiver.Method (including pointer receivers) or a stable ID. usages covers signature/field/interface references and Foo{...} construction; literals remains the focused construction-only view.

SQL extraction includes direct literals and statically resolvable local or same-file package const/var declarations, straight-line assignments, and bounded string concatenations. Runtime-generated SQL remains excluded. Route and SQL JSON are paged row censuses; --files-only follows all pages but emits a complete deduplicated file census, not every row.

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 stale (and rebuild when stale) before gograph boundaries; the CLI evaluates the persisted graph and exits with code 1 on violation. The default policy is .gograph/boundaries.json; use --config PATH for another regular, repository-confined policy. MCP uses the same evaluation after its normal source refresh. Works in CI/CD. </details>

<details> <summary><strong>Security flow sanitizer policy</strong></summary>

gograph flow includes test files by default; add --no-tests for production-only results. It automatically reads .gograph/flow.json when present, or accepts --config <path> for another JSON file inside the graph root. Sanitizers apply to a function's return value and can be scoped to selected sink kinds:

{
  "sanitizers": [
    { "function": "security.CleanPath", "for": ["filesystem"] },
    { "function": "security.ValidateURL", "for": ["outbound_http"] }
  ]
}

Omit for to trust the return value for every sink kind. function accepts the call spelling or a fully-qualified symbol ID; use the fully-qualified form when names collide. A validator that returns only bool or error does not sanitize the original input; wrap validation in a function that returns the trusted value if that is the intended policy. </details>

Keep MCP startup and every later refresh on the integration-tagged selection:

gograph mcp . --tags=integration

AI Agent Integration

Official MCP Registry (preview): MCPB-capable clients can discover io.github.ozgurcd/gograph. The bundle asks for the root directory of the Go project and launches the bundled executable with separate arguments equivalent to gograph mcp <project-directory>. Releases provide macOS, Linux, and Windows bundles for both amd64 and arm64. The current Registry package schema cannot select by CPU architecture, so choose the asset whose filename matches the host; do not assume a client will select it automatically. All analysis still runs locally over stdio, with no hosted gograph service or remote telemetry.

The Registry bundle and installer-generated MCP registrations intentionally omit --persist-refresh, keeping disk publication off by default. Use a custom local MCP command if you explicitly want that behavior.

Desktop config, shared rules, and Claude Code hook setup:

gograph add-claude-plugin
This registers the Claude Desktop MCP server, injects shared CLAUDE.md steering rules, and installs a Claude Code PreToolUse hook. The hook redirects Go-symbol searches only when an effective search target belongs to a repository with a .gograph index, so unindexed folders in multi-root workspaces remain unaffected. For Claude Code MCP registration, also run the command printed by the installer: claude mcp add gograph -- gograph mcp .. The installer exits non-zero when any installation step fails.

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 workflow (doctor --jsoncapabilitiesstatsplancontext → edit → review), when a durable precise CLI build is useful, when to use structural queries, and when to verify with gopls or targeted text/source search.

You still need the gograph binary installed (brew install --cask ozgurcd/tap/gograph or go install github.com/ozgurcd/gograph/cmd/gograph@latest). Use gograph add-claude-plugin for Claude Desktop MCP wiring plus shared rules and the Claude Code hook; register the Claude Code MCP server with the printed claude mcp add command. Use the plugin marketplace when you prefer discovery from Claude Code's plugin UI.

Other agents (Cursor, Copilot, Antigravity, etc.):

gograph mcp .                     # stdio server; refreshes stay in memory
gograph mcp . --persist-refresh   # opt in to publishing refreshed artifacts
gograph mcp . --tags=integration  # retain the same tagged context on every refresh
gograph mcp . --memory-mode=low --max-memory=1GiB  # same low-memory refresh policy as CLI builds
Add to your .cursorrules or AI system prompt: > Before answering architecture or repository questions, inspect the available > gograph_* MCP tools and run gograph capabilities. Prefer gograph for > supported structural queries; use gopls or targeted source/text search when > results are ambiguous, precision fell back, or a known source call is missing.

Query and composed-analysis commands support --json for machine-readable output: ```bash gograph callers "YourSymbol" --json

🇨🇳 中文文档镜像 AI 翻译 2026-07-02
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

gograph 是一个专为 Go 语言开发者设计的代码图谱分析工具。它能够深度解析代码结构,为 AI Agent 提供精准的代码上下文,帮助开发者更高效地理解复杂的代码逻辑与依赖关系。

⚡ 功能介绍

gograph 提供超过 50 种强大的查询工具,涵盖 callers、callees、impact、context、plan 等多种维度,支持对代码进行深度影响分析。此外,它内置了原生的 MCP Server,可无缝接入 Claude、Cursor、Copilot 等支持 MCP 协议的 AI 助手。通过 Token-Saving Composites 技术,gograph 能够以极高的压缩率提供关键上下文,显著降低 AI 使用过程中的 Token 消耗。

🛠 安装步骤(Docker/pip/源码)

您可以通过 Homebrew 进行快速安装:执行 `brew install ozgurcd/tap/gograph`。安装完成后,在项目根目录下运行 `gograph build . --precise` 即可构建精确的代码图谱。

🚀 使用教程

使用 gograph 构建图谱后,它会生成一个 `GRAPH_REPORT.md` 文件。该文件为 AI 提供了一个精简的上下文映射,包括外部依赖(Tech Stack)清单以及关键符号(Important Symbols)的调用关系。通过这种方式,AI 可以清晰地识别代码中的调用流向,从而提供更准确的辅助建议。

⚙️ 配置说明(含 MCP / env)

gograph 支持高度灵活的交互模式。在进行代码编辑或重构前,您可以使用 `gograph plan` 命令(例如 `gograph plan "ValidateToken"`)来预演变更计划,涵盖测试、路由、SQL 及环境变量等维度的影响评估。

🔌 API 说明

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 驱动的智能开发体验。

🎯 aiskill88 AI 点评 A 级 2026-05-20

质量较高的MCP工具,Go实现保证性能。功能聚焦明确,适合IDE集成场景。维护活跃度良好,生态价值明显。

📚 实用指南(长尾问题)
适合谁
  • 使用 Cursor 编辑器、希望提升 AI 编程效率的开发者
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
  • Cursor rules 控制在 80 行内,否则模型上下文成本会显著上升
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
部署方案
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
gograph 中文教程gograph 安装报错怎么办gograph MCP 配置gograph Agent 工作流gograph 与同类工具对比gograph 最佳实践gograph 适合谁用

⚡ 核心功能

👥 适合谁
  • 使用 Cursor 编辑器、希望提升 AI 编程效率的开发者
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
  • 构建多智能体协作系统的 Agent 开发者
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
  • Agent 任务先做 dry-run 验证工具调用链,再开启自主执行
  • Cursor rules 控制在 80 行内,否则模型上下文成本会显著上升
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

通过AST解析支持多种语言,主要针对Go、Python等常见语言优化
💡 AI Skill Hub 点评

经综合评估,gograph MCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 gograph 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
🔗 原始来源
🐙 GitHub 仓库  https://github.com/ozgurcd/gograph 🌐 官方网站  https://github.com/ozgurcd/gograph

收录时间:2026-05-16 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →