# hloiseaufcms/mcp-gopls [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/hloiseaufcms/mcp-gopls  
**GitHub Stars:** 101  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/hloiseaufcms-mcp-gopls

## Description
A MCP server for interacting with Go's Language Server Protocol (gopls) and benefit from advanced Go code analysis features.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-gopls": {
    "command": "npx",
    "args": ["-y","@mark3labs/mcp-inspector"]
  }
}
```

## Documentation

## What hloiseaufcms/mcp-gopls does

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.

## How it works

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.

## Setup and configuration

Install the command with Go:

```bash
go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest
```

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.

## Tools and capabilities

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.

## Limitations and notes

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.

## Getting started with this hloiseaufcms/mcp-gopls MCP server
Always refer to the official documentation for the most accurate and up-to-date information.

_Full upstream README: https://allmcps.com/mcp/hloiseaufcms-mcp-gopls/readme_

