Model Context Protocol (MCP) server for Go using gopls – LSP-powered analysis, tests, coverage, and tooling.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mcp-gopls": {
"env": {
"MCP_GOPLS_LOG_LEVEL": "info"
},
"args": [
"--workspace",
"/absolute/path/to/your/go/project"
],
"command": "mcp-gopls"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server that lets AI assistants use Go’s LSP (gopls) for navigation, diagnostics, testing, coverage, and more.
This server supports HTTP transport. Be the first to test it — help the community know if it works.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked @mark3labs/mcp-inspector against OSV.dev.
Click any tool to inspect its schema.
workspace/overviewOverview of the Go workspace
resource://workspace/overview
workspace/go.modGo module file (go.mod) contents
resource://workspace/go.mod
summarize_diagnosticsSummarize and prioritize diagnostics from the workspace
refactor_planCreate a plan for refactoring code
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Copy/paste detector for programming source code, supports 223 formats. AI-ready with token-efficient reporter, skill and MCP server.
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
MCP Security Weekly
Get CVE alerts and security updates for Mcp Gopls and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server that lets AI assistants use Go’s LSP (gopls) for navigation, diagnostics, testing, coverage, and more.
TL;DR: If you use Claude / Cursor / Copilot with Go,
mcp-goplsgives the AI full LSP powers: go-to-definition, references, hover, completion,go test, coverage,go mod tidy,govulncheck, etc.

This MCP server helps AI assistants to:
go mod tidy, govulncheck, and module graph commands with structured resultsStatus: Actively developed – used in real projects.
Tested with Go 1.25.x andgopls@latest.
This project uses the mark3labs/mcp-go library to implement the Model Context Protocol. The MCP integration enables seamless communication between AI assistants and Go tools.
The server communicates with gopls, the official language server for Go, via the Language Server Protocol (LSP).
--workspace, --gopls-path, --log-level, --rpc-timeout, and --shutdown-timeout flags + env vars (MCP_GOPLS_*)go test, go mod tidy, govulncheck, go mod graphresource://workspace/overview, resource://workspace/go.mod) and prompts (summarize_diagnostics, refactor_plan)notifications/progress events so clients can surface status updatesmcp-gopls vs built-in gopls MCPAs of gopls v0.20.0, the built-in MCP server exposes these tools:
go_context, go_diagnostics, go_file_context, go_file_diagnostics,
go_file_metadata, go_package_api, go_references, go_rename_symbol,
go_search, go_symbol_references, go_workspace, go_vulncheck.
| Feature / capability | mcp-gopls (this project) | Built-in gopls MCP |
|---|---|---|
| Go-to-definition | Yes (go_to_definition tool) | No dedicated MCP tool (not in tool list) |
| Find references | Yes (find_references) | Yes (go_references, go_symbol_references) |
| Diagnostics (file / workspace) | Yes (check_diagnostics) | Yes (go_diagnostics, go_file_diagnostics) |
| Hover information | Yes (get_hover_info) | No dedicated MCP tool (not in tool list) |
| Completion | Yes (get_completion) | No dedicated MCP tool (not in tool list) |
| Formatting | Yes (format_document) | No dedicated MCP tool (not in tool list) |
| Rename symbol | Yes (rename_symbol) | Yes (go_rename_symbol) |
| Code actions | Yes (list_code_actions) | No dedicated MCP tool (not in tool list) |
| Workspace symbol search | Yes (search_workspace_symbols) | Yes (go_search) |
| Package / workspace API/context tools | No dedicated MCP tool | Yes (go_package_api, go_file_context, go_file_metadata, go_workspace, go_context) |