mcp-sdk-go
A professional, high-performance implementation of the Model Context Protocol (MCP) specification (2025-03-26) in Go.
claude mcp add --transport stdio ajitpratap0-mcp-sdk-go docker run -i ajitpratap0/mcp-sdk-go:latest \ --env LOG_LEVEL="info" \ --env MCP_ENDPOINT="https://api.example.com/mcp"
How to use
The mcp-sdk-go repository provides a production-ready Go implementation of the Model Context Protocol (MCP). It emphasizes enterprise authentication, observability, and a highly configurable transport and server stack. This SDK supports a full JSON-RPC 2.0 protocol stack with batch processing, pluggable authentication providers, RBAC, rate limiting, and comprehensive observability via OpenTelemetry and Prometheus. It also offers developer tooling such as hot-reload development capabilities, code generation templates, protocol validation, and debugging utilities. As a user, you can run the enterprise server in Docker/Kubernetes and connect clients through a transport layer that supports streamable HTTP or stdio-based MCP channels, depending on your deployment needs. The client and server examples illustrate how to initialize transport, enable features like authentication and observability, and perform operations such as listing tools and managing MCP capabilities.
To use the server, start the Docker image or deploy via your Kubernetes setup, configure the transport with the endpoint, and enable the features you need (authentication, observability, reliability). The server exposes integration points for authentication (bearer tokens, API keys, and RBAC), and provides observability hooks (metrics, tracing, and logging). Clients can be created with the provided Go SDK packages (pkg/client, pkg/transport, pkg/protocol) to interact with the MCP server, negotiate capabilities, and retrieve MCP resources. The examples show practical flows, including a production-oriented enterprise server configuration and a simple client illustrating how to initialize and paginate results.
How to install
Prerequisites:
- Go installed (1.18+ recommended)
- Docker or Kubernetes cluster for deployment
- Git to clone the repository
-
Install Go (example for macOS/Linux): curl https://go.dev/dl/go1.20.4.darwin-amd64.tar.gz -L -o go1.20.4.darwin-amd64.tar.gz sudo tar -C /usr/local -xzf go1.20.4.darwin-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin
-
Clone the repository: git clone https://github.com/ajitpratap0/mcp-sdk-go.git cd mcp-sdk-go
-
Build the Go modules (optional if you want to run locally without Docker): go mod download go build ./...
-
Run with Docker (preferred for production):
- Ensure Docker is running
- Start the MCP server image (example):
docker run -it --rm
-p 8080:8080
-e MCP_ENDPOINT=https://api.example.com/mcp
ajitpratap0/mcp-sdk-go:latest
-
Kubernetes deployment (optional):
- Use Helm charts or manifests provided in the repository to deploy the enterprise MCP server with proper RBAC and observability configurations.
-
Verify installation:
- Check logs for health and readiness indicators
- Use the client example to connect to the endpoint and perform a basic ListAllTools operation.
Additional notes
Tips and common considerations:
- Enable authentication and observability flags in your transport configuration to get full enterprise features (RBAC, rate limiting, tracing, metrics).
- If you are deploying in Kubernetes, consider using Helm charts and setting proper resource requests/limits and autoscaling configuration.
- Use OpenTelemetry exporters compatible with your stack (OTLP, gRPC, HTTP) to integrate traces with your tracing backend.
- Ensure your MCP endpoint is reachable from clients and that TLS termination is handled at the ingress or API gateway.
- For local development, the hot-reload server and code-generation templates can accelerate iteration; watch for changes to protocol definitions to keep your client-server interactions in sync.
Related MCP Servers
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
go-utcp
Official Go implementation of the UTCP
boilerplate
TypeScript Model Context Protocol (MCP) server boilerplate providing IP lookup tools/resources. Includes CLI support and extensible structure for connecting AI systems (LLMs) to external data sources like ip-api.com. Ideal template for creating new MCP integrations via Node.js.
mcp-shell
Give hands to AI. MCP server to run shell commands securely, auditably, and on demand.
mcp-protocol-sdk
[DEPRECATED] Moved to prism-mcp-rs - Enterprise-grade Rust MCP SDK
mcp-kit
MCP (Model Context Protocol) Kit for Go - A Complete MCP solutions for ready to use