MCP Catalogs
Homemcp-gopls screenshot

mcp-gopls

by hloiseau·84·Score 47

MCP server for Go using gopls – LSP-powered analysis, tests, coverage, and tooling.

developer-toolsai-llm
11
Forks
3
Open issues
4 mo ago
Last commit
2d ago
Indexed

Overview

mcp-gopls is an MCP server that bridges AI assistants with Go's powerful language server (gopls). It provides a comprehensive set of LSP features including code navigation, diagnostics, formatting, test execution, coverage analysis, and Go module management. The server offers more functionality than gopls' built-in MCP implementation, particularly for development operations like running tests, tidying modules, and analyzing coverage.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:AI assistants analyzing Go codebases with full LSP capabilities
you:Automating Go test execution and coverage reporting
you:Refactoring Go code with AI assistance using LSP tools
you:How does mcp-gopls compare to gopls built-in MCP?
you:What Go versions are supported?

When to choose this

Choose mcp-gopls when you need comprehensive Go language tooling through MCP, including LSP features not available in gopls's built-in MCP server, and you're already working with Go projects.

When NOT to choose this

Avoid if you only need basic introspection tools like diagnostics and symbol search, in which case gopls's built-in MCP server would be sufficient without requiring additional binaries.

Tools this server exposes

12 tools extracted from the README
  • 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_govulncheck

    Execute govulncheck on the codebase

Comparable tools

gopls built-in mcpshell-mcp

Installation

# Install the server
go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest

# Configure Claude Desktop
{
  "mcpServers": {
    "mcp-gopls": {
      "command": "mcp-gopls",
      "args": ["--workspace", "/absolute/path/to/your/go/project"],
      "env": {
        "MCP_GOPLS_LOG_LEVEL": "info"
      }
    }
  }
}

FAQ

How does mcp-gopls compare to gopls built-in MCP?
mcp-gopls provides more development-focused tools like go test, coverage analysis, and go mod tidy, while gopls built-in MCP focuses more on introspective tools like diagnostics and symbol search.
What Go versions are supported?
Tested with Go 1.25.x and gopls@latest. The project actively maintains compatibility with recent Go versions.

Compare mcp-gopls with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.