Go Language Server

v1.0.0Developer Toolsstable

A Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with Go's Language Server Protocol (LSP) and benefit from advanced Go code analysis features.

ai-agentsai-toolsdeveloper-toolsgogolang
Share:
85
Stars
0
Downloads
0
Weekly
0/5

What is Go Language Server?

Go Language Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server that allows ai assistants like claude to interact with go's language server protocol (lsp) and benefit from advanced go code analysis features.

A Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with Go's Language Server Protocol (LSP) and benefit from advanced Go code analysis features.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) server that allows AI assista

Use Cases

Leverage Go's Language Server Protocol for advanced code analysis.
Enable Claude to understand and navigate Go codebases.
Provide intelligent Go code completion and refactoring.
hloiseau

Maintainer

LicenseApache 2.0
Languagego
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-gopls

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Go Language Server

mcp-gopls is an MCP server that bridges AI assistants like Claude to Go's official language server, gopls, enabling advanced Go code analysis directly from a chat interface. It exposes 14 tools covering navigation (go-to-definition, find-references, hover), diagnostics, formatting, symbol search, test execution with coverage, module tidying, vulnerability checking, and dependency graphing. Developers use it to let Claude understand large Go codebases, find usages of a symbol across packages, and run `govulncheck` without leaving their MCP client.

Prerequisites

  • Go 1.25 or later installed and on your PATH
  • gopls installed (`go install golang.org/x/tools/gopls@latest`)
  • Optional: govulncheck installed for vulnerability scanning (`go install golang.org/x/vuln/cmd/govulncheck@latest`)
  • An MCP client such as Claude Desktop, Cursor, or GitHub Copilot Agent Mode
  • A Go workspace/project directory to analyze
1

Install gopls

Install Go's official language server if it is not already present. This is a required dependency for mcp-gopls.

go install golang.org/x/tools/gopls@latest
2

Install mcp-gopls

Install the mcp-gopls binary using Go's package manager. The binary will be placed in your GOPATH/bin.

go install github.com/hloiseau/mcp-gopls/v2/cmd/mcp-gopls@latest
3

Verify installation

Confirm the binary is accessible and review available flags before configuring your MCP client.

mcp-gopls --help
4

Configure your MCP client

Add the server to your `claude_desktop_config.json`, setting `--workspace` to the root of the Go project you want to analyze. Use the `MCP_GOPLS_WORKSPACE` environment variable as an alternative.

5

Restart your MCP client and start analyzing Go code

After restarting, Claude can use tools like `go-to-definition`, `find-references`, and `get-diagnostics` against your Go workspace.

Go Language Server Examples

Client configuration

Add this to `claude_desktop_config.json` to connect Claude Desktop to your Go project. Adjust `--workspace` to the absolute path of your project.

{
  "mcpServers": {
    "mcp-gopls": {
      "command": "mcp-gopls",
      "args": ["--workspace", "/path/to/your/go/project"],
      "env": {
        "MCP_GOPLS_LOG_LEVEL": "info",
        "MCP_GOPLS_RPC_TIMEOUT": "30s"
      }
    }
  }
}

Prompts to try

Use these prompts to navigate and analyze your Go codebase through Claude.

- "Find all references to the function `ProcessOrder` in this Go project."
- "Show me the definition of the `UserRepository` interface."
- "Run diagnostics on the entire workspace and list any errors or warnings."
- "Check this module for known vulnerabilities using govulncheck."
- "Rename the `OldHandler` function to `NewHandler` across the codebase."

Troubleshooting Go Language Server

mcp-gopls fails to start with 'gopls not found'

Ensure gopls is installed and on your PATH: `go install golang.org/x/tools/gopls@latest`. Use `--gopls-path /absolute/path/to/gopls` in the args if it is installed in a non-standard location.

Tools time out for large codebases

Increase the RPC timeout by setting `MCP_GOPLS_RPC_TIMEOUT=60s` in the env block of your MCP config, or passing `--rpc-timeout 60s` in args.

No results from find-references or go-to-definition

Verify the `--workspace` path is the module root (contains `go.mod`). Run `gopls version` and `go build ./...` in that directory to confirm the project compiles and gopls can index it.

Frequently Asked Questions about Go Language Server

What is Go Language Server?

Go Language Server is a Model Context Protocol (MCP) server that model context protocol (mcp) server that allows ai assistants like claude to interact with go's language server protocol (lsp) and benefit from advanced go code analysis features. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Go Language Server?

Follow the installation instructions on the Go Language Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Go Language Server?

Go Language Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Go Language Server free to use?

Yes, Go Language Server is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-gopls": { "command": "npx", "args": ["-y", "mcp-gopls"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Go Language Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides