
gopls-mcp
โ 57from xieyuschen
The essential MCP server for Go language: Exposing compiler-grade semantics to AI Agents and LLM for deterministic code analysis and minimal token usage.
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.
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.
Install
Claude Code (plugin โ recommended)
/plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git
/plugin install gopls-mcpThe plugin automatically installs the binary and injects the routing skill โ no manual setup required.
Codex (plugin โ recommended)
codex plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git
codex plugin add gopls-mcpManual install (all clients)
Linux / macOS:
curl -sSL https://gopls-mcp.org/install.sh | bashWindows (PowerShell):
irm https://gopls-mcp.org/install.ps1 | iexThen follow the per-client setup at https://gopls-mcp.org/quick-start.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
Licensed under BSD-3-Clauseโ you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub โ