Model Context Protocol SDK for Go
February 3, 2025 ยท View on GitHub
Model Context Protocol SDK for Go
A Go implementation of the Model Context Protocol (MCP).
Overview
This SDK provides a comprehensive implementation of MCP in Go, allowing developers to:
- Create MCP clients to connect to MCP servers
- Build MCP servers that provide context and capabilities
- Handle all core MCP features: resources, prompts, tools, and more
- Support for both stdio and SSE transport
Examples
The SDK includes several example implementations:
Standard stdio Examples
See the example client that runs the example servers:
SSE Transport Examples
See the SSE (Server-Sent Events) transport examples:
Running the Examples
Run the stdio-based examples with different servers:
make run-client-promptsmake run-client-toolsmake run-client-resources
Run the SSE examples (in separate terminals):
- Start the SSE server:
make run-sse-server - Start the SSE client:
make run-sse-client
The SSE examples accept command-line flags:
- Server:
--addrto specify listen address (default ":8080") - Client:
--serverto specify server address (default "localhost:8080")
Development Status
This SDK is currently in development. While core functionality is implemented, some features are still in progress:
-
notifications/cancelledfor request cancellation -
notifications/progressfor long-running operations -
logging/setLevelandnotifications/messagefor logs - SSE transport
- Advanced examples