
mcp-gopls
by hloiseau
Full LSP-powered Go analysis for AI assistants, featuring navigation, diagnostics, testing and coverage.
What it does
mcp-gopls bridges the Model Context Protocol with Go's official language server (gopls), giving AI assistants deep programmatic insight into Go workspaces. It allows the AI to navigate code, find references, and run development tools as if it were a seasoned Go developer.
Tools
go_to_definition: Navigate to the definition of a symbol.find_references: List all references for a symbol.check_diagnostics: Fetch cached diagnostics for a file.get_hover_info: Return hover markdown for a symbol.get_completion: Return completion labels at a position.format_document: Return formatting edits for a document.rename_symbol: Perform workspace-wide symbol renaming.list_code_actions: List available code actions for a range.search_workspace_symbols: Search for symbols across the workspace.analyze_coverage: Run tests with coverage and per-function reports.run_go_test: Execute Go tests for a package or pattern.run_go_mod_tidy: Rungo mod tidyto sync dependencies.run_govulncheck: Execute vulnerability checks.module_graph: Inspect dependency graphs viago mod graph.
Installation
{
"mcpServers": {
"mcp-gopls": {
"command": "mcp-gopls",
"args": ["--workspace", "/absolute/path/to/your/go/project"]
}
}
}
Supported hosts
- Claude Desktop
- Cursor
- GitHub Copilot
- MCP Inspector
Quick install
go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latestInformation
- Pricing
- free
- Published






