Opinionated, zero-configuration bridge that automatically exposes any Go Gin API as an MCP (Model Context Protocol) server/tools.
https://github.com/ckanthony/gin-mcpYour Gin API is already built. Your routes are defined. Your handlers work perfectly. But getting AI assistants like Cursor to actually use your API? That's where the tedious documentation and tool configuration usually begins.
gin-mcp changes that completely.
Instead of writing tool definitions, OpenAPI specs, or custom integrations, you add three lines of code and your entire Gin API becomes instantly available to any MCP-compatible AI assistant.
You've got a perfectly functional REST API, but AI assistants can't discover or use it without extensive manual setup. The traditional approach means:
Meanwhile, your API already contains all the information needed - route paths, parameter types, response structures. The data is there, but locked away from AI tools.
gin-mcp reads your existing Gin application and automatically:
Here's what "zero configuration" actually looks like:
// Your existing Gin API
r := gin.Default()
r.GET("/users/:id", getUserHandler)
r.POST("/users", createUserHandler)
r.GET("/orders", listOrdersHandler)
// Make it available to AI assistants
mcp := server.New(r, &server.Config{
Name: "Customer API",
Description: "Handles users and orders",
BaseURL: "http://localhost:8080",
})
mcp.Mount("/mcp")
r.Run(":8080")
That's it. Your /users/:id, /users, and /orders endpoints are now available as tools in Cursor, Claude Desktop, or any MCP-compatible client.
E-commerce API: Your product catalog, inventory, and order management endpoints become tools that AI assistants can use to help customers check availability, track orders, or find products.
Internal Admin API: User management, configuration, and monitoring endpoints get exposed as tools for AI-powered administrative assistance.
Data Processing API: Analytics, reporting, and data transformation endpoints become available for AI-driven insights and automated reporting.
Microservice Mesh: Each service automatically exposes its capabilities to AI assistants, creating a self-documenting, AI-accessible service architecture.
While automatic discovery handles 90% of use cases, gin-mcp gives you control when you need it:
// Fine-grained schema control
type ListProductsParams struct {
Page int `form:"page" jsonschema:"minimum=1"`
Limit int `form:"limit" jsonschema:"maximum=100"`
Tag string `form:"tag" jsonschema:"description=Filter by tag"`
}
mcp.RegisterSchema("GET", "/products", ListProductsParams{}, nil)
Selective exposure lets you control which endpoints become AI tools:
// Only expose user-related endpoints
mcp := server.New(r, &server.Config{
// ... other config
IncludeTags: []string{"users", "public"},
})
/mcp)When a user asks "Show me user 123's details", the AI assistant:
/users/:id endpointgin-mcp runs alongside your existing Gin server - it doesn't intercept or modify your API traffic. The MCP endpoint handles tool discovery and execution coordination, while your original API endpoints continue serving regular HTTP traffic exactly as before.
Route discovery happens once at startup, not on every request. Schema inference uses Go's reflection capabilities efficiently, with results cached for subsequent tool calls.
For production deployments, you can mount the MCP server on the same instance as your API or deploy it separately, pointing to your API's base URL.
Get started: go get github.com/ckanthony/gin-mcp
Your existing Gin API can be AI-accessible in the next five minutes. No rewrites, no extensive configuration, no ongoing maintenance burden - just instant integration with the growing ecosystem of AI-powered development tools.