go-sdk: An implementation of the official Go software development kit (SDK) for the Model Context Protocol (MCP).
What problem it solves
Go developers need packages for constructing MCP clients and servers while connecting them to transports and supporting protocol features such as OAuth. The SDK organizes these capabilities into importable packages and documents how supported MCP specification versions map to them.
Key features
Client and server APIs — The primary package provides APIs for constructing and using MCP clients and servers, including tools and session-based communication.
Source: README, mcp
Transport integration — Built-in transports support server communication over stdin/stdout, while a separate JSON-RPC package is available for implementations that need their own transports.
Source: README, jsonrpc
OAuth primitives and extensions — Dedicated packages provide OAuth support primitives and protocol extensions such as ProtectedResourceMetadata.
Source: README, oauthex
Specification documentation — Feature documentation maps MCP specification requirements to the SDK packages, and the repository includes additional examples for clients and servers.
Source: README, examples
Defined specification compatibility — The README publishes a compatibility table for SDK and MCP specification versions, including notes about experimental and partial support.
Source: README
Quick start
Copied verbatim from the project's README.
package main
import (
"context"
"log"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
type Input struct {
Name string `json:"name" jsonschema:"the name of the person to greet"`
}
type Output struct {
Greeting string `json:"greeting" jsonschema:"the greeting to tell to the user"`
}
func SayHi(ctx context.Context, req *mcp.CallToolRequest, input Input) (
*mcp.CallToolResult,
Output,
error,
) {
return nil, Output{Greeting: "Hi " + input.Name}, nil
}
func main() {
// Create a server with a single tool.
server := mcp.NewServer(&mcp.Implementation{Name: "greeter", Version: "v1.0.0"}, nil)
mcp.AddTool(server, &mcp.Tool{Name: "greet", Description: "say hi"}, SayHi)
// Run the server over stdin/stdout, until the client disconnects.
if err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil {
log.Fatal(err)
}
}Who it may suit
This SDK may suit Go developers building MCP clients, servers, custom transports, or OAuth-enabled integrations.
Topics to discuss
Which MCP specification version should new applications target?
How can transport implementations be designed for custom deployment environments?
What examples or migration guidance would be most useful for developers adopting deprecated protocol features?
Written by ReadmeX AI from the project's README, source and public GitHub data; it may contain mistakes.
Read the original README https://github.com/modelcontextprotocol/go-sdk#readme
ReadmeX opened this community for a trending project; it is not run by the project. Maintainers can claim it from the community page.
Comments
…