GoMCP
๐๏ธ - A Gin-like framework for building MCP servers in Go. Struct-tag auto schema, middleware chain, auth,
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
Maintainer
Works with
Installation
Manual Installation
npx gomcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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/gomcpDefine 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"`
}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
}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())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.jsonGoMCP 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.
GoMCP Alternatives โ Similar Developer Tools Servers
Looking for alternatives to GoMCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
โ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
โ 155.8kJava ้ข่ฏ & ๅ็ซฏ้็จ้ข่ฏๆๅ๏ผ่ฆ็่ฎก็ฎๆบๅบ็กใๆฐๆฎๅบใๅๅธๅผใ้ซๅนถๅใ็ณป็ป่ฎพ่ฎกไธ AI ๅบ็จๅผๅ
Gemini CLI
โ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
โ 87.3kโญ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
โ 86.0kModel Context Protocol Servers
CC Switch
โ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up GoMCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.