Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>gopls MCP ServerNew to Visual Studio Code? Get it now.
gopls MCP Server

gopls MCP Server

arczhi

|
441 installs
| (0) | Free
Let your LLM read Go Code more effectively !
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

gopls MCP Server

Supercharge AI's ability to understand and navigate Go code through the Model Context Protocol (MCP).

This extension automatically starts an MCP server that bridges AI assistants with Go's official language server (gopls), enabling them to analyze Go codebases with precision and context-awareness.

Why gopls-mcp?

Large language models often struggle with Go code comprehension—missing type information, unable to trace references, or hallucinating about code structure. gopls-mcp solves this by giving AI assistants the same powerful tools developers use:

  • 🎯 Precise symbol lookup - Navigate to exact definitions, no guessing
  • 🔍 Complete reference tracking - Find every usage of functions, types, and variables
  • 📚 Rich type information - Access full type signatures, documentation, and interfaces
  • 🗺️ Workspace-wide analysis - Understand relationships across your entire codebase

project repository

https://github.com/arczhi/gopls-mcp

Quick Start

1. Install Dependencies

# Install gopls (Go language server)
go install golang.org/x/tools/gopls@latest

2. Install Extension

Install this extension in VS Code. It will automatically start the MCP server on port 3000.

3. Configure Your AI Assistant

Add this to your AI assistant's MCP configuration (e.g., Claude Desktop at ~/.claude/mcp.json):

{
  "servers": {
    "gopls-mcp": {
      "url": "http://127.0.0.1:3000/sse"
    }
  }
}

That's it! The extension handles server startup automatically.

What Your AI Can Do

Once configured, AI assistants gain four powerful tools:

go_definition

Find where any symbol is defined—functions, types, variables, constants.

"Where is the UserRepository interface defined?"

go_references

Discover all locations where a symbol is used across your codebase.

"Show me everywhere the AuthenticateUser function is called"

go_hover

Get complete type information, function signatures, and documentation.

"What's the signature of the handler at line 45?"

go_symbols

List all symbols in a file or search across your entire workspace.

"List all exported functions in the api package"

Extension Settings

  • goplsMcp.enabled - Enable/disable the MCP server (default: true)
  • goplsMcp.serverPort - HTTP server port (default: 3000)
  • goplsMcp.workspacePath - Go workspace path (defaults to current workspace)

Commands

  • gopls MCP: Start Server - Manually start the server
  • gopls MCP: Stop Server - Stop the running server

How It Works

  1. Extension starts main_http.py when VS Code opens
  2. MCP server launches on http://127.0.0.1:3000
  3. Server communicates with gopls to analyze your Go code
  4. AI assistants connect via HTTP/SSE and invoke tools
  5. Results return with precise, type-checked information

Troubleshooting

Server won't start?

  • Check Output panel (View → Output → gopls MCP Server) for errors
  • Verify gopls: gopls version
  • Verify Python deps: pip list | grep mcp

Port 3000 in use?

  • Change port in settings: goplsMcp.serverPort
  • Update AI configuration to match the new port

gopls not found?

  • Ensure ~/go/bin is in your PATH
  • Restart VS Code after installing gopls

Requirements

  • Go 1.18+ with gopls installed
  • Python 3.8+ with MCP dependencies
  • VS Code 1.75+

More Information

  • MCP Protocol
  • gopls Documentation
  • Report Issues

Transform how AI understands your Go code. Install gopls-mcp today.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft