Gopls MCP logo

Gopls MCP

Semantic Go code analysis over MCP, using gopls to resolve definitions, references, interfaces, call hierarchies, and dependencies.

Install Gopls MCP

Run the project’s own setup commands, in order.

Setup steps from the project

gopls-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Add to Codex
    codex plugin marketplace add https://github.com/xieyuschen/gopls-mcp.git
    
  2. 2. Add to Codex
    codex plugin add gopls-mcp
    
  3. 3. Install
    curl -sSL https://gopls-mcp.org/install.sh | bash
    
  4. 4. Install
    irm https://gopls-mcp.org/install.ps1 | iex
    

Overview

gopls-mcp gives AI agents access to compiler-level semantic analysis for Go code through gopls. It resolves types, interfaces, scopes, and cross-package identities for navigation tasks such as finding implementations, tracing calls, and mapping dependencies. Reach for it when text search cannot reliably answer a code question; simple same-file lookups may be faster with grep. Claude Code and Codex have dedicated plugin installation paths, while other clients can use the manual installation.

Use cases

  • Find every concrete Go type that implements an interface
  • Trace callers and callees across a Go project
  • Resolve definitions and references across packages
  • Map dependencies between Go packages

Key features

  • Type-checker-level Go analysis
  • Language-aware definitions and references
  • Interface implementation discovery
  • Call-hierarchy tracing
  • Package-dependency mapping
  • Cross-package and shadowed-scope resolution

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

25/25 checks healthy over the last 83d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars60Stargazers on the source repository.
Last commit21d agoMost recent push to the default branch.

How Gopls MCP works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gopls MCP

gopls-mcp is an MCP server that connects AI agents to Go's gopls-based semantic analysis, exposing language-aware navigation, definition and reference lookup, interface implementation discovery, call-hierarchy tracing, and package-dependency mapping. It is intended for compiler-level questions where text search cannot reliably resolve types, scopes, or cross-package identities.

Install it through the Claude Code or Codex plugin flow, or run the project’s Linux/macOS shell installer or Windows PowerShell installer for manual setup. After a manual install, follow the client-specific quick-start instructions to register gopls-mcp.

Yes, gopls-mcp provides a Claude Code plugin installation path. Add its Git repository as a marketplace, install the `gopls-mcp` plugin, and let the plugin install the binary and routing skill.

Yes, Codex has a dedicated plugin installation path. Add the repository as a Codex plugin marketplace and install `gopls-mcp`.

Use gopls-mcp for type-aware questions involving interfaces, cross-package symbols, scopes, call hierarchies, or dependencies. For simple lookups within one file, grep may be equally effective with less overhead.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGopls MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/gopls-mcp?style=directory)](https://allmcps.com/mcp/gopls-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/gopls-mcp"><img src="https://allmcps.com/api/badge/gopls-mcp?style=directory" alt="Gopls MCP on AllMCPs" /></a>