v0.4.0
This release fixes several bugs, and expands on OAuth support and examples. It also makes a few (hopefully minor) API changes as we approach a release candidate (see #328).
For more details, see the v0.4.0 milestone.
Thank you to all who tested the SDK, filed bugs, and contributed.
API Changes
This release includes the following incompatible changes:
mcp.CallToolRequestnow holds anmcp.CallToolParamsRaw, to avoid confusion about the raw state ofArguments(see proposal #377)mcp.ToolForis unexported, as it was also a footgun: modifying the resulting schema was ineffective (see proposal #401).auth.TokenVerifieris changed fromfunc(context.Context, string) (*TokenInfo, error)tofunc(context.Context, string, *net/http.Request) (*TokenInfo, error), to allow access to the HTTP request (see proposal #403).
Additionally, it includes the following additions:
mcp.StreamableServerTransport.JSONResponseandmcp.StreamableHTTPOptions.JSONResponseare exported, to configure serving responses asapplication/jsonrather thantext/event-stream(#397).auth.ErrOAuthis added.
New Examples
Several new examples are added to demonstrate different ways to use the SDK. We will continue to expand on these examples and other documentation as we approach the release.
- examples/server/auth-middleware provides an example of server-side auth middleware.
- examples/http provides an example of HTTP logging middleware.
- examples/server/distributed provides an example of an MCP server distributed across multiple subprocesses.
- examples/server/toolschemas provides several examples of configuring tool schemas.
Bug fixes
Several notable bugs or misbehaviors are addressed:
- Typed tool handlers now verify against their output schema (#301).
- The streamable hanging GET now sends HTTP headers immediately, to avoid client timeouts (#410).
- Strictness around
notifications/initializedis relaxed, to fix flaky initialization with Claude (#395). Mcp-Session-Idresponse headers are now sent only for theInitializerequest, per the spec (#416).
New Contributors
- @bradhoekstra made their first contribution in #392
- @CCpro10 made their first contribution in #397
- @KasonBraley made their first contribution in #420
Full Changelog: v0.3.1...v0.4.0