Back to MCP Catalog

Go Documentation MCP Server

Developer ToolsGo
Access Go documentation efficiently for LLMs
Available Tools

get_doc

Retrieves Go documentation for packages, types, functions, and other symbols

pathtargetcmd_flagsworking_dir

Go Documentation MCP provides efficient access to Go package documentation for LLMs. It helps AI models understand Go projects by providing direct access to package documentation without needing to read entire source files, significantly reducing token usage. This tool enables LLMs to get precisely the information they need about Go packages, from individual symbols to complete package documentation.

Overview

Go Documentation MCP is a Model Context Protocol server that provides efficient access to Go documentation. It helps LLMs understand Go projects by providing direct access to package documentation without needing to read entire source files, substantially reducing the number of tokens needed to understand and make use of Go packages.

Installation

  1. First, install the Go Documentation MCP:
go install github.com/mrjoshuak/godoc-mcp@latest
  1. Add the MCP server to your Claude desktop app configuration:
{
  "mcpServers": {
    "godoc": {
      "command": "/path/to/godoc-mcp",
      "args": [],
      "env": {
        "GOPATH": "/path/to/go",
        "GOMODCACHE": "/path/to/go/pkg/mod"
      }
    }
  }
}

Make sure to replace /path/to/godoc-mcp with the actual path to the installed binary, and set the correct paths for GOPATH and GOMODCACHE environment variables.

Features

  • Efficient Documentation Access: Retrieves official Go documentation with minimal token usage
  • Smart Package Discovery: When pointed at a directory without Go files, lists available Go packages in subdirectories
  • Flexible Path Support: Works with local file paths and import paths
  • Automatic Module Context: Creates temporary Go projects when needed and handles cleanup
  • Module-Aware: Supports documentation for third-party packages through working directory context
  • Performance Optimized: Includes built-in response caching and efficient token usage

Usage Examples

You can use Go Documentation MCP to:

  1. Understand Project Structure: "I'm looking at a Go project at /path/to/some/project. What packages does it contain and what do they do?"

  2. Explore Package Interfaces: "What interfaces does the io package provide? I'm particularly interested in anything related to reading."

  3. Get Implementation Guidance: "I need to implement the io.Reader interface. Show me its documentation and any related types I should know about."

  4. Learn API Usage: "Show me the documentation for the Resource type in the /path/to/some/project. I need to understand how to create and use it."

  5. Discover Methods: "What methods are available on the http.Request type? I'm working with standard library HTTP handlers."

Troubleshooting

  • For local paths, ensure they contain Go source files or point to directories containing Go packages
  • If you see module-related errors, ensure GOPATH and GOMODCACHE environment variables are set correctly in your MCP server configuration
  • The server automatically handles module context for external packages, but you can still provide a specific working_dir if needed for special cases

Related MCPs

Apple Shortcuts
Developer ToolsJavaScript

Control Apple Shortcuts automations from AI assistants

Clojars Dependency Lookup
Developer ToolsJavaScript

Fetch dependency information from Clojars, the Clojure community's artifact repository

Simple Timeserver
Developer ToolsPython

Provides Claude with current time and timezone information

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.