Get the FREE Ultimate OpenClaw Setup Guide →

gemini-cli-gopls

This extension integrates the official MCP of the Go language server (gopls) with Gemini CLI.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio menghuan1918-gemini-cli-gopls npx -y gemini-cli-gopls

How to use

This MCP server extension provides Go language support inside Gemini CLI by leveraging the official gopls MCP. Once installed, it exposes a set of Go-aware tools that integrate with Gemini to improve code understanding, navigation, and diagnostics within a workspace. The available tools include go_diagnostics for workspace-wide syntax and semantic checks, go_file_context to summarize cross-file dependencies for a given file, go_package_api to fetch information about external and internal Go package APIs, go_search for symbol lookup across the workspace, go_symbol_references to locate references to a symbol, and go_workspace to provide high-level workspace information. The extension also exposes the built-in prompts from the official gopls MCP, adapted for Gemini CLI, which you can view in GEMINI.md. When used in a Go project (one that contains a go.mod), these tools initialize automatically; if there is no Go project, an empty MCP service is loaded to avoid errors.

How to install

Prerequisites:

  • Node.js and npm (required to run MCP extensions via npx).
  • A Go toolchain with gopls (Go language server) v0.20.0 or later. The extension will attempt to download gopls to ~/go/bin if a compatible version is not found in PATH.

Installation steps:

  1. Ensure you have Node.js and npm installed. You can verify with: node -v npm -v

  2. Install the Gemini CLI extension directly via npx (as this MCP server ships as an extension): npx -y gemini-cli-gopls

  3. If gopls is not present or is older than v0.20.0, the extension will attempt to download and place gopls in ~/go/bin. Ensure this directory is in your PATH, or install a compatible gopls version manually:

    • Visit https://golang.org/dl/ and install a Go toolchain that includes gopls, or
    • Run your preferred method to install gopls 0.20.0 or newer and ensure it is on PATH.
  4. After installation, verify Gemini CLI can load the extension in a Go project (with a go.mod) to enable the features.

Notes:

  • If the extension fails to start, try manually installing gopls v0.20.0+ into your PATH and retry.

Additional notes

Tips and common issues:

  • The extension automatically checks gopls version at runtime and attempts to download it if missing. If automatic download fails, install gopls v0.20.0+ manually and ensure it is in PATH.
  • The Go-related MCP tools activate automatically in a workspace containing a go.mod file; without a Go module, the MCP loads as an empty service to avoid errors.
  • If you encounter symbol or reference resolution issues, ensure your workspace has a valid Go module and that gopls is functioning correctly outside Gemini CLI by running gopls diagnostics in the terminal.
  • Environment variables are typically not required; the extension manages gopls within its installation flow. If you need to customize paths, you can modify PATH to include ~/go/bin or the location of gopls.
  • The npm_package field below identifies the source package for the extension (useful for automation or inventory).

Related MCP Servers

Sponsor this space

Reach thousands of developers