Skip to content
appsgit

MCP Gopls

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.

github.com/hloiseau/mcp-gopls (opens in a new tab)

Data as of from the GitHub API; description from the project's repository. Report an error

Install MCP Gopls

Generated from the server's published package. Replace your-value with your own values.

Claude Desktop

claude_desktop_config.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

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
{
  "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
{
  "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 Oct 7, 2026: modelcontextprotocol.io (opens in a new tab), code.claude.com (opens in a new tab), cursor.com (opens in a new tab), code.visualstudio.com (opens in a new tab).

Environment variables

Variables the server reads at startup.

NameRequiredDescription
MCP_GOPLS_LOG_LEVELNoShown in the README's example configuration.

Tools (14)

Parsed from the Tools section of the README; check the repository for the current list.

  • 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

About MCP Gopls

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

  • ai-agents
  • ai-tools
  • developer-tools
  • go
  • golang
  • gopls
  • lsp
  • mcp
  • model-context-protocol

FAQ

MCP Gopls FAQ

Still curious? Email info@appsgit.com.

How do I install the MCP Gopls MCP server?

Add the command docker run -i --rm -e MCP_GOPLS_LOG_LEVEL ghcr.io/hloiseau/mcp-gopls to your MCP client: put it in claude_desktop_config.json for Claude Desktop, run claude mcp add for Claude Code, or add it to .cursor/mcp.json (Cursor) or .vscode/mcp.json (VS Code). The snippets on this page are ready to paste.

Is MCP Gopls free?

The server is open source under the Apache-2.0 license, so running it is free. It does not declare any required API key.

Is MCP Gopls actively maintained?

The most recent commit was on Jun 22, 2026. The latest release is v2.1.0, published Jun 22, 2026. appsgit only lists MCP servers with a commit in the last six months.