Overview
What is Gopls Go Language Server?
Gopls Go Language Server is an MCP (Model Context Protocol) server that wraps the official Go language server, gopls, to expose its features through MCP. It is intended for developers who want to interact with Go code using MCP clients such as Claude Code or Claude Desktop.
How to use Gopls Go Language Server?
Install it with go install github.com/yantrio/mcp-gopls/cmd/mcp-gopls@latest, then add it to an MCP client. For Claude Code, run claude mcp add mcp-gopls "$(which mcp-gopls)". For Claude Desktop, add the executable to claude_desktop_config.json under mcpServers. Launch the server with mcp-gopls; you can optionally specify a gopls binary path and workspace directory via flags or environment variables.
Key features of Gopls Go Language Server
- Navigate to symbol definitions
- Find all references to a symbol
- Get compile errors and static analysis diagnostics
- Rename symbols with direct file changes
- Search symbols across the workspace
- Format code according to gofmt standards
Use cases of Gopls Go Language Server
- Explore and navigate large Go codebases through an MCP client
- Refactor code by renaming symbols across the workspace
- Identify compilation errors and lint warnings without leaving the chat interface
- Quickly locate definitions and references of a function or type
- Automatically format and organize imports in Go source files
FAQ from Gopls Go Language Server
What are the runtime requirements?
Go 1.24.3 or later and the official gopls language server are required. Install gopls with go install golang.org/x/tools/gopls@latest.
How do I specify a custom workspace or gopls path?
Use the -workspace and -gopls flags, or set the environment variables MCP_GOPLS_WORKSPACE and GOPLS_PATH respectively.
What transport protocol does this server use?
The README only describes command-line invocation; this is consistent with an MCP server using stdio transport. No other transports are mentioned.
Is the code safe for production use?
The README includes a strong warning that the entire project was generated by AI without human code review. It advises extreme caution in production environments and notes that security, performance, and edge cases have not been audited.