MCP Catalogs
首页gograph screenshot

gograph

by ozgurcd·118·综合分 47

一个本地AST/类型感知的Go代码库上下文索引器,为AI编码代理创建优化的图谱。

developer-toolsai-llmknowledge-graph
7
Forks
1
活跃 Issue
本月
最近提交
2 天前
收录于

概述

gograph是一个快速的、仅限本地的CLI工具,专门用于生成Go代码库的仓库结构并提高IDE上下文感知能力。它构建了一个包含包、符号、调用、路由、配置读取、测试和代码质量信号的紧凑图谱,使AI代理能够通过更少的原始文件读取来导航Go代码库。与为人类IDE优化的语言服务器(如gopls)不同,gograph专门为基于终端的LLM设计,通过以原生Markdown格式提取精确的结构切片来节省上下文标记。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:通过提供结构化上下文增强AI对Go项目的代码理解
:通过展示变更的影响分析提供代码重构辅助
:通过圈复杂度和耦合度指标进行代码质量分析
:gograph与gopls等语言服务器有何不同?
:gograph是否支持Go以外的语言?

什么时候选它

当处理需要为 AI 编码助手提供高效的 AST 分析和上下文生成的 Go 代码库时,选择 gograph。

什么时候不要选它

如果你不使用 Go 代码库,或者你特别需要一个 MCP 服务器实现,不要选择 gograph。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • boundaries

    Verify package architecture constraints using boundaries.json

  • callers

    See what functions call a specific symbol

  • callees

    See what a specific function calls

  • complexity

    Calculate cyclomatic complexity for functions

  • focus

    Generate highly targeted context for a specific package

  • hotspot

    Rank functions by incoming call count

  • impact

    View the full blast radius of a symbol

  • interfaces

    See which interfaces a struct satisfies

  • path

    Find the shortest call chain between two symbols

  • context

    Get node, source, callers, callees, and tests in one response

  • trace

    Trace an error string backwards to entry points

  • deps

    Show direct or transitive import dependencies for a package

可对比工具

goplsgo-outlinegomodifytags

安装

# MacOS / Linux (通过Homebrew)
brew install ozgurcd/tap/gograph

# 或使用Go安装:
go install github.com/ozgurcd/gograph/cmd/gograph@latest

要作为MCP服务器使用,您需要将其与MCP客户端配置集成。该工具支持JSON输出,便于机器解析,非常适合MCP集成。

FAQ

gograph与gopls等语言服务器有何不同?
虽然gopls拥有类似的AST和类型数据,但将AI代理连接到它很困难且效率低下。gograph提取原生Markdown格式的精确结构切片,而不是简单的文件坐标,从而节省标记并为AI代理提供更好的上下文。
gograph是否支持Go以外的语言?
目前gograph仅解析和映射Go代码库。但是其架构可扩展,欢迎为其他语言贡献代码。

gograph 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。