GoMCP

v1.0.0โ€ขDeveloper Toolsโ€ขstable

๐ŸŽ๏ธ - A Gin-like framework for building MCP servers in Go. Struct-tag auto schema, middleware chain, auth,

gomcpmcpai-integration
Share:
52
Stars
0
Downloads
0
Weekly
0/5

What is GoMCP?

GoMCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐ŸŽ๏ธ - a gin-like framework for building mcp servers in go. struct-tag auto schema, middleware chain, auth,

๐ŸŽ๏ธ - A Gin-like framework for building MCP servers in Go. Struct-tag auto schema, middleware chain, auth,

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

Features

  • MCP protocol support

Use Cases

Build MCP servers in Go with struct-tag auto schema, middleware chains, and auth support.
zhangpanda

Maintainer

LicenseApache 2.0
Languagego
Versionv1.0.0
UpdatedApr 10, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx gomcp

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 GoMCP

GoMCP is a Gin-inspired framework for building MCP (Model Context Protocol) servers in Go, letting developers define tools, resources, and prompts with minimal boilerplate using struct-tag-driven schema generation. It supports middleware chains, authentication, tool grouping, and multiple transport modes (stdio for desktop clients, HTTP with SSE for remote deployments). Developers coming from Gin or gRPC backgrounds can adapt existing routes and services to MCP with one-line adapters, making it a productive choice for exposing Go services to AI assistants.

Prerequisites

  • Go 1.21 or later (framework targets 1.25 with GOTOOLCHAIN=auto for automatic downloads)
  • A Go module initialized in your project (go mod init)
  • An MCP-compatible client such as Claude Desktop or Cursor for testing
  • Familiarity with Go struct tags and HTTP middleware concepts
1

Add GoMCP to your Go module

Use go get to download the GoMCP framework and add it to your go.mod file.

go get github.com/zhangpanda/gomcp
2

Define your tool input struct with mcp tags

GoMCP generates JSON schemas automatically from struct fields annotated with mcp tags. Tag fields as required, set descriptions, defaults, min/max, or enum values.

type SearchInput struct {
    Query string `json:"query" mcp:"required,desc=Search keyword"`
    Limit int    `json:"limit" mcp:"default=10,min=1,max=100"`
}
3

Create the server and register tools

Instantiate a GoMCP server with a name and version, then register tool handler functions. The framework validates inputs against your struct schema before calling your handler.

package main

import "github.com/zhangpanda/gomcp"

func main() {
    s := gomcp.New("my-server", "1.0.0")

    s.ToolFunc("search", "Search documents",
        func(ctx *gomcp.Context, in SearchInput) (map[string]any, error) {
            // your logic here
            return map[string]any{"items": []string{}, "total": 0}, nil
        })

    s.Stdio() // Use stdio for Claude Desktop / Cursor
}
4

Choose a transport mode

For local desktop clients use stdio. For remote or web-embedded deployments use HTTP with SSE. You can also embed the handler in an existing HTTP server.

// Stdio (Claude Desktop, Cursor, Kiro)
s.Stdio()

// HTTP with SSE on port 8080
s.HTTP(":8080")

// Embed in existing HTTP server
http.Handle("/mcp", s.Handler())
5

Build and register with your MCP client

Compile your server binary and point your MCP client config at it. For Claude Desktop, add a mcpServers entry with the binary path.

go build -o my-mcp-server .
# Then add to claude_desktop_config.json

GoMCP Examples

Client configuration

Claude Desktop config for a compiled GoMCP server binary running via stdio.

{
  "mcpServers": {
    "my-gomcp-server": {
      "command": "/path/to/my-mcp-server"
    }
  }
}

Prompts to try

Example prompts once your GoMCP-based server tools are registered and the client is connected.

- "Search for documents about Go concurrency patterns"
- "List all available tools on the connected MCP server"
- "Run the search tool with query='middleware' and limit=5"
- "What resources does this server expose?"

Troubleshooting GoMCP

Go toolchain version mismatch โ€” build fails with 'requires go1.25'

GoMCP uses GOTOOLCHAIN=auto which downloads the required Go version automatically. Ensure your environment allows outbound downloads, or explicitly install Go 1.25+ from go.dev/dl.

Struct tags are not producing the expected JSON schema

Verify both json and mcp tags are present on each field. The json tag provides the field name while mcp provides constraints. Check that required fields are listed before optional ones to avoid schema validation surprises.

Claude Desktop does not show the server's tools after adding the config

Restart Claude Desktop after editing claude_desktop_config.json. Ensure the binary path in 'command' is absolute and the binary has execute permissions (chmod +x my-mcp-server).

Frequently Asked Questions about GoMCP

What is GoMCP?

GoMCP is a Model Context Protocol (MCP) server that ๐ŸŽ๏ธ - a gin-like framework for building mcp servers in go. struct-tag auto schema, middleware chain, auth, It connects AI assistants to external tools and data sources through a standardized interface.

How do I install GoMCP?

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

Which AI clients work with GoMCP?

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

Is GoMCP free to use?

Yes, GoMCP 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": { "gomcp": { "command": "npx", "args": ["-y", "gomcp"] } } }

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

Read the full setup guide โ†’

Ready to use GoMCP?

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