MCP LSP Go is an MCP server that connects AI assistants to the official Go Language Server Protocol implementation, gopls, for advanced code intelligence and analysis. Developed for Go software engineers using tools like Cursor, Claude Desktop, and GitHub Copilot, it bridges large language models directly to workspace tools and language analysis features. By serving as an intermediary between Model Context Protocol clients and gopls, the server enables assistants to run definitions navigation, symbol references, document hover queries, code completions, formatting, and workspace-wide symbol lookups without manual copy-pasting. Beyond standard language server protocol functions, it also incorporates native Go CLI tooling directly into the model context. Assistants can execute Go unit tests, generate structured code coverage breakdowns, organize imports with module tidy operations, check dependencies via module graph inspection, and perform security vulnerability scans through govulncheck. It also exposes standard MCP workspace resources and structured analysis prompts, letting developers orchestrate code refactoring and diagnostics evaluation natively within AI chat sessions.
Category: Developer Tools & Code Intelligence
Tags: code analysis, go, golang, language-server, lsp
bash go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest 2. Verify that the binary is available on your system PATH by running mcp-gopls --help. 3. To configure Claude Desktop, open claude_desktop_config.json and add the server definition under mcpServers: json { "mcpServers": { "mcp-gopls": { "command": "mcp-gopls", "args": ["--workspace", "/absolute/path/to/your/go/project"] } } } 4. For Cursor IDE, navigate to Settings -> MCP Servers -> Edit JSON and insert the identical mcp-gopls configuration block, then run the command Developer: Reload Window to enable the server.Part of MCP Servers
You can install MCP LSP Go using the standard Go CLI by running go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest. Alternatively, you can run the official Docker container image ghcr.io/hloiseau/mcp-gopls:latest mounted to your local project directory.
MCP LSP Go provides code navigation including go-to-definition, reference finding, hover details, and symbol search. It also executes formatting, symbol renaming, code actions, Go test execution, coverage analysis, dependency audits with go mod tidy, and vulnerability scanning with govulncheck.
MCP LSP Go works with any standard Model Context Protocol client over standard input and output. It has documented configuration support for Cursor, Claude Desktop, and GitHub Copilot Agent Mode in Visual Studio Code.
Yes, MCP LSP Go is open source software published under the Apache 2.0 license. The source code, issue tracking, and container configuration files are publicly available on GitHub.
While the built-in gopls MCP focuses on read-only diagnostics and workspace metadata, MCP LSP Go adds tools for definition navigation, document formatting, code completion, running go test suites, calculating test coverage, and managing Go module graphs.