gopls-mcp — Claude Code MCP server: what it does, how to install
Go semantic code analysis MCP server powered by gopls. It gives LLMs compiler-level insights to track interface implementations, call trees, and package references.
Open on GitHubWhat gopls-mcp does
The project is a community fork of gopls that supplies compiler information directly to the assistant. It operates like the compiler. Instead of scanning lines for regex matches, the agent inspects Go semantics. This setup reveals concrete types behind an interface, tracks cross-package identifiers, and resolves variables hidden by nested scopes.
Across 11 benchmark tasks, gopls-mcp needed 2–4× fewer tool calls than grep. For looking up a symbol inside one file, running this server is unnecessary: standard terminal search carries less overhead. The Claude Code plugin setup fetches the binary and configures routing without manual steps.
What it helps with
- find concrete types that implement an interface
- trace function call hierarchies across Go packages
- resolve variable names inside shadowed scopes
- map package dependencies across a Go project
Example prompts for the agent
- Find all concrete types that satisfy the
Readerinterface in this repository. - Trace the call hierarchy for the
ProcessJobfunction. - Show where the
Configstruct is declared and list all packages that use it.
How to install gopls-mcp
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about gopls-mcp
How to install gopls-mcp in Claude Code?
Add the marketplace source by running /plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git in Claude Code, then execute /plugin install gopls-mcp. The plugin installs the binary and configures skill routing automatically.
What does gopls-mcp do?
The server exposes gopls semantic analysis to the LLM. It lets your AI agent trace Go type structures, resolve interface implementations, and inspect cross-package references.
How does gopls-mcp compare to grep-based navigation?
Grep matches text patterns without understanding scopes or types. Across 11 benchmark tasks, gopls-mcp used 2–4× fewer tool calls to complete the work, though standard grep has lower overhead for single-file lookups.