2026-01-31
Claude Code supports the
Model Context Protocol (MCP), which allows
it to connect to external tools and services. The Go language server
gopls now has an MCP mode,
giving Claude Code access to Go-specific functionality like finding references,
looking up documentation, and navigating to definitions.
Setting this up requires two steps.
Install the latest gopls. The MCP support in gopls is relatively new, so
you’ll need a recent version. Install or update it with:
go install golang.org/x/tools/gopls@latest
Configure Claude Code. Tell Claude Code about the MCP server by running:
claude mcp add --transport stdio --scope user gopls -- gopls mcp
This registers gopls as an MCP server that communicates over stdio. The
--scope user flag makes it available across all your projects rather than
just the current one.
That’s it. Claude Code will now have access to Go language server features when working on Go code.
Further links: