A Go implementation of the Model Context Protocol (MCP).
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
The SDK includes several example implementations:
See the example client that runs the example servers:
See the SSE (Server-Sent Events) transport 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")
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