
Gopls Mcp
io.github.xieyuschen由 GitHub 账号 xieyuschen 发布v1.0.7更新于 Oct 24, 2026
Semantic code analysis for Go using gopls - language-aware navigation, definitions, references
概览
借助 gopls 为助手提供 Go 代码的编译器级语义分析:定义、引用、接口实现与调用层级。
- 可以做什么
- gopls-mcp 通过 Go 语言服务器 gopls 提供 Go 语义分析,让助手按语义而非文本匹配来导航代码。它能解析类型系统,包括接口满足关系、跨包标识以及被遮蔽的作用域,适用于查找实现某接口的所有具体类型、追踪调用层级、梳理包依赖等任务。README 提到一项覆盖 11 个任务的基准测试,在语义任务上它比基于 grep 的导航少用 2 至 4 倍的工具调用并更快完成。
- 适用场景
- 当助手需要处理 Go 代码库并回答语义问题时值得加入,例如哪些类型实现了某个接口、调用如何串联、包之间如何依赖。对于单文件内的简单查找,README 指出普通 grep 同样有效且开销更小。
- 运行要求
- 以本地进程方式在用户机器上通过 stdio 运行,仅限桌面端。清单中未声明任何软件包、环境变量、请求头或身份验证。安装方式包括 Claude Code 或 Codex 插件,以及面向 Linux、macOS 和 Windows 的手动安装脚本,之后按客户端进行配置。
安装
在 SourceWeft 中
- 打开 控制台中的 Gopls Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
gopls-mcp
Give your AI Agent the compiler's brain, not a text searcher.
Documentation: https://gopls-mcp.org
gopls-mcp delivers type-checker-level semantic analysis directly to your LLM. Unlike text search, it resolves Go's type system — interface satisfaction, cross-package identity, and shadowed scopes — with the same precision as the compiler.
Where it pays off most is on semantic tasks: finding all concrete types that implement an interface, tracing call hierarchies, and mapping package dependencies. A benchmark over 11 tasks shows gopls-mcp uses 2–4× fewer tool calls and finishes faster than grep-based navigation on those tasks. For simple same-file lookups, plain bash/grep remains equally effective and carries less overhead.
Install
Claude Code (plugin — recommended)
The plugin automatically installs the binary and injects the routing skill — no manual setup required.
Codex (plugin — recommended)
Manual install (all clients)
Linux / macOS:
Windows (PowerShell):
Then follow the per-client setup at https://gopls-mcp.org/quick-start.
Contribute
The project is actively developing, and feel free to raise PRs or issues if you find anything to improve. AI generated code will also be accepted but do remember to narrow the change to a specific feature for reviewer to quickly review them.
Disclaimer: gopls-mcp is a fork of gopls and is a community-driven project. It is not an official Go team product and is not affiliated with or endorsed by Google LLC. This project is licensed under the same BSD license as its upstream source.
来源:README.md,提交 2a45722
工具
0版本历史
1- v1.0.7最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分