GoMCP — Gin-like Framework for MCP Servers in Go
@zhangpanda
关于 GoMCP — Gin-like Framework for MCP Servers in Go
The fast, idiomatic way to build MCP servers in Go. Struct-tag auto schema, middleware chain, tool groups, auth, adapters for Gin/OpenAPI/gRPC, async tasks, Inspector UI, and more.
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"gomcp": {
"command": "go",
"args": [
"run",
"github.com/zhangpanda/gomcp/examples/basic@latest"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is GoMCP?
GoMCP is a framework for building Model Context Protocol (MCP) servers in Go, designed as "Gin for MCP." It lets developers create servers that AI applications like Claude Desktop, Cursor, Kiro, and VS Code Copilot can use to call external tools, read data sources, and use prompt templates.
How to use GoMCP?
Install via go get github.com/zhangpanda/gomcp, then create a server with gomcp.New("name", "version"), register tools using s.ToolFunc(), and start a transport such as s.Stdio(). Use struct tags (e.g., mcp:"required,desc=...") to define parameter schemas with automatic validation.
Core features of GoMCP
- Struct-tag auto schema generation and validation
- Typed handlers with automatic parameter parsing and validation
- Middleware chain: Logger, Recovery, Auth, RateLimit, OTel
- Tool groups with prefix naming and group-level middleware
- Adapters for Gin, OpenAPI/Swagger, and gRPC services
- Built-in Bearer, API Key, Basic auth with RBAC
Use cases of GoMCP
- Building MCP servers for AI-powered tool calling
- Importing existing Gin web routes as MCP tools in one line
- Generating MCP tools from OpenAPI/Swagger documentation
- Exposing gRPC service methods as MCP tools
- Developing async task tools with polling and cancellation support
FAQ from GoMCP
What Go version does GoMCP require?
Go ≥ 1.25 is required.
What MCP protocol version is supported?
2024-11-05, with backward compatibility for 2025-11-25.
Does GoMCP have built-in authentication?
Yes: BearerAuth (JWT), APIKeyAuth, BasicAuth, plus RBAC via RequireRole and RequirePermission on tool groups.
What transports does GoMCP support?
stdio (for Claude Desktop, Cursor, Kiro) and Streamable HTTP with SSE.
Is there a testing utility included?
Yes, the mcptest package provides an in-memory client for unit testing with snapshot support.
开发工具 分类下的更多 MCP 服务器
mcp-excalidraw
yctimlinMCP server and Claude Code skill for Excalidraw — programmatic canvas toolkit to create, edit, and export diagrams via AI agents with real-time canvas sync.
Hello World MCP Server (Reference Extension)
anthropicsDesktop Extensions: One-click local MCP server installation in desktop apps
Test
x1xhlolFULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Qoder, Replit, Same.dev, Trae, Traycer AI, VSCode Agent, Warp.dev, Windsurf, Xcode, Z.ai Code, Dia & v0. (And other Open Sou
Deepwiki MCP Server
regenrek📖 MCP server for fetch deepwiki.com and get latest knowledge in Cursor and other Code Editors
TalkToFigma
sonnylazuardiTalkToFigma: MCP integration between AI Agent (Cursor, Claude Code, Codex) and Figma, allowing Agentic AI to communicate with Figma for reading designs and modifying them programmatically.
评论