Connects AI clients to gopls for Go code navigation, diagnostics, editing, testing, coverage, and module tooling.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent ā or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag ā we're steadily working through the catalog.
š” Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Gopls.
hloiseaufcms/mcp-gopls MCP server connects an MCP-compatible AI client to Go's official gopls language server. It exposes language features for a configured Go workspace, including definition lookup, reference search, hover information, completion, diagnostics, formatting, symbol renaming, code actions, and workspace symbol search.
Beyond LSP operations, the server exposes tools for running go test, analyzing coverage, applying go mod tidy, checking dependencies with govulncheck, and inspecting the module graph. It also publishes two workspace resources: an overview and the workspace's go.mod file. Curated prompts named summarize_diagnostics and refactor_plan support common diagnostic and refactoring workflows.
The server is implemented with the mark3labs/mcp-go library. It receives MCP requests from an AI client and uses the Language Server Protocol to communicate with gopls. The workspace is selected through configuration, allowing language-server operations to be scoped to a Go project.
Long-running commands can emit notifications/progress events, allowing clients to display status while tests, vulnerability checks, coverage analysis, or other operations are running. Results from the Go tooling helpers are structured for MCP clients rather than being limited to unstructured terminal output.
Install the command with Go:
After installation, verify that mcp-gopls is available on PATH, then configure the client to invoke that binary with a workspace argument such as --workspace /absolute/path/to/project. Cursor and Claude Desktop setup examples are provided in the project documentation. A Docker image is also published at ghcr.io/hloiseau/mcp-gopls; container usage mounts a Go project at /workspace and passes --workspace /workspace.
Runtime options include --workspace, --gopls-path, --log-level, --rpc-timeout, and --shutdown-timeout. The README states that these options also have MCP_GOPLS_* environment-variable forms, but does not enumerate the exact variable names in the supplied material. Logging supports text or JSON output and optional file output.
The documented MCP tools include:
go_to_definition, find_references, and search_workspace_symbols for code navigation.check_diagnostics for file or workspace diagnostics.get_hover_info and get_completion for editor-style assistance.format_document, rename_symbol, and list_code_actions for code changes and refactoring support.run_go_test, analyze_coverage, run_go_mod_tidy, run_govulncheck, and module_graph for Go project tooling.The server is documented as tested with Go 1.25.x and gopls@latest. The repository carries an Apache 2.0 license.
hloiseaufcms/mcp-gopls MCP server is actively developed, so behavior and coverage may change. The supplied documentation does not define exact schemas for every tool or list every supported gopls version. It also does not provide a complete mapping of the MCP_GOPLS_* environment variables. The Docker examples require replacing the documented path placeholder with a real project path before use.
The README compares this project with the experimental MCP server built into gopls. That built-in option covers several read-oriented operations, but the supplied comparison identifies this project as the option with dedicated tools for editing-oriented LSP features, test execution, coverage, go mod tidy, and module-graph inspection.
Always refer to the official documentation for the most accurate and up-to-date information.
Factual signals from GitHub, npm, and our automated checks ā not a rating.
No reviews yet ā be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/hloiseaufcms-mcp-gopls)<a href="https://allmcps.com/mcp/hloiseaufcms-mcp-gopls"><img src="https://allmcps.com/api/badge/hloiseaufcms-mcp-gopls?style=directory" alt="MCP Gopls on AllMCPs" /></a>