# MCP Gopls (MCP server)

> MCP Gopls is an MCP server that lets AI assistants use Go’s LSP (gopls) for navigation, diagnostics, testing, coverage, and more. It has 104 GitHub stars, is released under the Apache-2.0 license and runs locally with docker run -i --rm -e MCP_GOPLS_LOG_LEVEL ghcr.io/hloiseau/mcp-gopls.

A Model Context Protocol (MCP) server that lets AI assistants use Go’s LSP (gopls) for navigation, diagnostics, testing, coverage, and more.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/hloiseau/mcp-gopls |
| GitHub stars | 104 |
| License | Apache-2.0 |
| Language | Go |
| Transport | stdio |
| Packages | docker: ghcr.io/hloiseau/mcp-gopls |
| Remote URL | none |
| Needs API key | no |
| Official | no |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Developer tools |
| Latest release | v2.1.0 (Jun 22, 2026) |
| Last commit | Jun 22, 2026 |

## Install

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-gopls": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GOPLS_LOG_LEVEL",
        "ghcr.io/hloiseau/mcp-gopls"
      ],
      "env": {
        "MCP_GOPLS_LOG_LEVEL": "your-value"
      }
    }
  }
}
```

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

### Claude Code

```sh
claude mcp add --env MCP_GOPLS_LOG_LEVEL=your-value --transport stdio mcp-gopls -- docker run -i --rm -e MCP_GOPLS_LOG_LEVEL ghcr.io/hloiseau/mcp-gopls
```

### Cursor (.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-gopls": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GOPLS_LOG_LEVEL",
        "ghcr.io/hloiseau/mcp-gopls"
      ],
      "env": {
        "MCP_GOPLS_LOG_LEVEL": "your-value"
      }
    }
  }
}
```

Project file; use ~/.cursor/mcp.json to enable it in every project.

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-gopls": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GOPLS_LOG_LEVEL",
        "ghcr.io/hloiseau/mcp-gopls"
      ],
      "env": {
        "MCP_GOPLS_LOG_LEVEL": "your-value"
      }
    }
  }
}
```

Config formats checked against the official docs on 2026-10-07.

## Environment variables

- `MCP_GOPLS_LOG_LEVEL`: Shown in the README's example configuration.

## 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 an entire document
- `rename_symbol`: Return workspace edits for a rename
- `list_code_actions`: List available code actions for a range
- `search_workspace_symbols`: Search workspace-wide symbols
- `analyze_coverage`: Run go test with coverage + optional per-function report
- `run_go_test`: Execute go test for a package/pattern
- `run_go_mod_tidy`: Execute go mod tidy
- `run_govulncheck`: Execute govulncheck ./...
- `module_graph`: Return go mod graph output

## Similar MCP servers

- [Atlassian Dc MCP Bitbucket](https://appsgit.com/mcp-servers/atlassian-dc-mcp-bitbucket): MCP server for Atlassian Bitbucket Data Center - interact with repositories and code. (105 stars, MIT, needs API key)
- [stalemap](https://appsgit.com/mcp-servers/stalemap): Tells coding agents which npm dependencies changed after their training cutoff, and what changed. (103 stars, MIT)
- [reevesagents](https://appsgit.com/mcp-servers/reevesagents): Spawn, read and steer AI coding CLIs (Claude Code, Codex, Kimi and more) in local tmux windows. (107 stars, Apache-2.0)
- [Cynicalsally](https://appsgit.com/mcp-servers/cynicalsally): Brutally honest code reviews: scores, real issues, and usable fixes. (101 stars, MIT)
- [PlaceCall](https://appsgit.com/mcp-servers/placecall): Real phone calls to US businesses: book, ask, get quotes. (107 stars, MIT, needs API key)
- [WTFM](https://appsgit.com/mcp-servers/wtfm): Your coding agent writes the user docs from your codebase, screenshots included. (95 stars, Apache-2.0, official)

---

Canonical page: https://appsgit.com/mcp-servers/mcp-gopls
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed daily.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
