MCP GOPLS Server

Provides Go language server features by wrapping gopls, delivering code navigation, diagnostics, formatting, and imports management.
  • go

41

GitHub Stars

go

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "yantrio-mcp-gopls": {
      "command": "mcp-gopls",
      "args": [
        "-gopls",
        "/path/to/gopls",
        "-workspace",
        "/path/to/project"
      ],
      "env": {
        "GOPLS_PATH": "/path/to/gopls",
        "MCP_GOPLS_WORKSPACE": "/path/to/project"
      }
    }
  }
}

You can think of MCP GOPLS as a bridge that lets your editor or IDE access Go language features powered by gopls through a consistent MCP interface. It wraps gopls so you get reliable navigation, diagnostics, formatting, and other productive capabilities directly in your workflow.

How to use

To use this MCP server with an MCP client, start the server and point your client to the local process. You can run with a default setup or specify where gopls lives and which Go workspace to target. The server exposes the same Go language features you expect from gopls, but accessible through the MCP channel.

How to install

Prerequisites: you need Go installed on your machine. Ensure you have a Go toolchain that matches your system requirements.

Install the MCP GOPLS server toolchain using Go’s module installer.

Install the MCP GOPLS binary:

go install github.com/yantrio/mcp-gopls/cmd/mcp-gopls@latest

Additional configuration and usage notes

Run the MCP GOPLS server with explicit go tooling and workspace settings when you want to customize the environment.

Environment variables you may use to customize runtime behavior include the following: GOPLS_PATH to specify the gopls binary path and MCP_GOPLS_WORKSPACE to set the workspace directory for your Go project. You can export them in your shell before starting the server.

Available tools

GoToDefinition

Navigate to the symbol definition across the workspace or file.

FindReferences

Locate all references to a symbol across the project.

GetDiagnostics

Retrieve compile errors and static analysis findings for files in the workspace.

Hover

Show information about symbols under the cursor.

SearchSymbol

Search for symbols across the workspace with partial matching.

RenameSymbol

Rename symbols across the workspace and apply changes to files.

FindImplementers

Find all types that implement a given interface.

ListDocumentSymbols

Provide an outline of symbols defined in a document.

FormatCode

Format Go source code according to gofmt standards and apply changes to files.

OrganizeImports

Organize and sort import statements in Go files.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational