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-prompts
make run-client-tools
make 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:
--addr
to specify listen address (default ":8080") - Client:
--server
to specify server address (default "localhost:8080")
This SDK is currently in development. While core functionality is implemented, some features are still in progress:
-
notifications/cancelled
for request cancellation -
notifications/progress
for long-running operations -
logging/setLevel
andnotifications/message
for logs - SSE transport
- Advanced examples