
mcp-gopls
by hloiseau·★ 84·Score 47
MCP server for Go using gopls – LSP-powered analysis, tests, coverage, and tooling.
Overview
mcp-gopls is an MCP server that bridges AI assistants with Go's powerful language server (gopls). It provides a comprehensive set of LSP features including code navigation, diagnostics, formatting, test execution, coverage analysis, and Go module management. The server offers more functionality than gopls' built-in MCP implementation, particularly for development operations like running tests, tidying modules, and analyzing coverage.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose mcp-gopls when you need comprehensive Go language tooling through MCP, including LSP features not available in gopls's built-in MCP server, and you're already working with Go projects.
When NOT to choose this
Avoid if you only need basic introspection tools like diagnostics and symbol search, in which case gopls's built-in MCP server would be sufficient without requiring additional binaries.
Tools this server exposes
12 tools extracted from the READMEgo_to_definitionNavigate to the definition of a symbol
find_referencesList all references for a symbol
check_diagnosticsFetch cached diagnostics for a file
get_hover_infoReturn hover markdown for a symbol
get_completionReturn completion labels at a position
format_documentReturn formatting edits for an entire document
rename_symbolReturn workspace edits for a rename
list_code_actionsList available code actions for a range
search_workspace_symbolsSearch workspace-wide symbols
analyze_coverageRun go test with coverage + optional per-function report
run_go_testExecute go test for a package/pattern
run_govulncheckExecute govulncheck on the codebase
Comparable tools
Installation
# Install the server
go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest
# Configure Claude Desktop
{
"mcpServers": {
"mcp-gopls": {
"command": "mcp-gopls",
"args": ["--workspace", "/absolute/path/to/your/go/project"],
"env": {
"MCP_GOPLS_LOG_LEVEL": "info"
}
}
}
}FAQ
- How does mcp-gopls compare to gopls built-in MCP?
- mcp-gopls provides more development-focused tools like go test, coverage analysis, and go mod tidy, while gopls built-in MCP focuses more on introspective tools like diagnostics and symbol search.
- What Go versions are supported?
- Tested with Go 1.25.x and gopls@latest. The project actively maintains compatibility with recent Go versions.
Compare mcp-gopls with
Last updated · Auto-generated from public README + GitHub signals.