| Filename | Latest commit message | Latest commit date |
|---|---|---|
Change the error code returned by ResourceNotFoundError from -32002 to -32602 (jsonrpc.CodeInvalidParams), aligning with [SEP-2164](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2164). * Not gated with a protocol version check, because the previous error code was never formally specified and the behaviour varied across SDKs. * In case clients which rely on the old error code exist, the previous behaviour can be restored with `MCPGODEBUG=customresnotfounderrcode=1`. * `CodeResourceNotFound` deprecated since its only purpose going forward is backward compatibility. The new code should use `jsonrpc.CodeInvalidParams` directly. * `CodeResourceNotFound` changed to `var` so it can stay in sync with `ResourceNotFoundError` and existing code doing `code == mcp.CodeResourceNotFound` keeps working in both the default and compat modes. |
||
| .. | ||
| images | ||
| client.md | ||
| CNAME | ||
| contributing.md | ||
| mcpgodebug.md | ||
| protocol.md | ||
| quick_start.md | ||
| README.md | ||
| rough_edges.md | ||
| server.md | ||
| troubleshooting.md | ||
Overview
The SDK consists of several importable packages:
- The
github.com/modelcontextprotocol/go-sdk/mcppackage defines the primary APIs for constructing and using MCP clients and servers. - The
github.com/modelcontextprotocol/go-sdk/jsonrpcpackage is for users implementing their own transports. - The
github.com/modelcontextprotocol/go-sdk/authpackage provides some primitives for supporting OAuth. - The
github.com/modelcontextprotocol/go-sdk/oauthexpackage provides extensions to the OAuth protocol, such as ProtectedResourceMetadata.
These docs mirror the official MCP spec. Use the index below to learn how the SDK implements a particular aspect of the protocol.
Base Protocol
Client Features
Server Features
TroubleShooting
See troubleshooting.md for a troubleshooting guide.
Backwards compatibility
See mcpgodebug.md for a list of backwards incompatible behavior changes and description how they can be temporarily undone.
Rough edges
See rough_edges.md for a list of rough edges or API oversights that can't be addressed due to our compatibility promise. We'll revisit these if/when we move to a v2 of the SDK.