MCP Server Go Template is a production-hardened starter kit for building secure Model Context Protocol servers with Go and the official MCP Go SDK (modelcontextprotocol/go-sdk). It solves the core production challenges of serverless cold starts, unauthenticated tool ingress, and authorization bottlenecks.

Key Features

  • Dual-Transport Multiplexing: Handles legacy Server-Sent Events (SSE) streams and stateless Streamable HTTP requests through a single endpoint.
  • Serverless Resilience: Configured with Stateless: true to survive autoscaling and container recycling on Google Cloud Run or AWS ECS.
  • Zero-Trust OAuth 2.1: Dynamic Client Registration (RFC 7591) and Client ID Metadata Documents (CIMD) paired with an SSRF-safe connection dialer.
  • Generic Tool Scopes: Type-safe generic middleware (RequireScope) enforces granular permissions per tool before executing business logic.
  • Agent Plugin Ready: Pre-packaged with plugin.json, mcp.json, and an interactive mcp-go-scaffolder agent skill.

Explore the source code on GitHub: github.com/ghchinoy/mcp-server-go-template.