# gopls-mcp [Health: Active]

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

## Description
Semantic code analysis for Go using gopls - language-aware navigation, definitions, references

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/xieyuschen/gopls-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Add to Codex:

```sh
codex plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git
```

2. Add to Codex:

```sh
codex plugin add gopls-mcp
```

3. Install:

```sh
curl -sSL https://gopls-mcp.org/install.sh | bash
```

4. Install:

```sh
irm https://gopls-mcp.org/install.ps1 | iex
```

## Documentation

## What gopls-mcp does

gopls-mcp exposes Go language analysis to AI agents through the Model Context Protocol. Its analysis is based on gopls and operates at the type-checker level rather than treating source files as unstructured text. This lets an agent distinguish symbols with the same name, follow identities across packages, account for shadowed scopes, and reason about interface relationships.

The server is aimed at questions where semantic context matters. Examples include locating every concrete type that satisfies an interface, finding callers across a call hierarchy, resolving definitions and references, and understanding package dependencies. It is a fork of the upstream gopls project and is maintained as a community project rather than as an official Go or Google product.

## How it works

An MCP-compatible AI client invokes the server for Go navigation and analysis instead of relying only on grep or similar text-search commands. gopls supplies the language-aware resolution needed to connect declarations, uses, implementations, calls, and packages. The project reports a benchmark across 11 tasks in which its semantic approach used two to four times fewer tool calls and completed faster than grep-based navigation; that comparison applies to the tested semantic tasks, not every lookup.

For a lookup confined to one file, ordinary shell search can be just as effective and introduces less overhead. gopls-mcp is most appropriate when the answer depends on Go's type system or relationships between packages.

## Setup and configuration

Claude Code can install gopls-mcp as a plugin by adding the Git repository as a marketplace and then installing the `gopls-mcp` plugin. Codex has a corresponding marketplace and plugin flow. These plugin routes install the binary and add the routing skill automatically.

For other MCP clients, install manually with the project-provided script. On Linux and macOS, run the shell installer from `gopls-mcp.org`; on Windows, execute the PowerShell installer. After installation, use the client-specific instructions in the project's quick-start guide to register the server.

The documented installation paths do not require manual binary setup for the Claude Code and Codex plugins. The server is licensed under the same BSD license as its upstream source.

## Tools and capabilities

Supported analysis capabilities include:

- Language-aware Go navigation
- Definition lookup
- Reference lookup
- Discovery of concrete types implementing an interface
- Call-hierarchy tracing
- Package-dependency mapping
- Resolution of cross-package type identity and shadowed scopes

These capabilities are intended for agents working on Go repositories, particularly when a result must follow symbols and relationships rather than match names in files.

## Limitations and notes

gopls-mcp adds value primarily for semantic navigation. Same-file searches and other simple text lookups may not benefit from the additional analysis and can be handled effectively with bash or grep. The project is a community-driven fork of gopls, is not affiliated with or endorsed by Google, and should not be treated as an official Go team product.

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

