| Filename | Latest commit message | Latest commit date |
|---|---|---|
CallToolResult currently decodes structuredContent through an any field, which converts JSON numbers to float64 and silently rounds integers outside the IEEE-754 safe range. This change decodes structuredContent separately with UseNumber, preserving wire numbers as json.Number while retaining the existing decoded object, array, and primitive shapes. The field documentation now describes that representation. Users who depend on the previous float64 behavior can temporarily restore it with MCPGODEBUG=structuredcontentfloat64=1. An end-to-end in-memory client/server regression covers 9007199254740993 from a low-level Server.AddTool result. Additional coverage verifies the compatibility option restores the legacy rounded float64 value. Verification: - gofmt -l . - go test ./... - go vet ./... Fixes #1236 --------- Co-authored-by: Guglielmo Colombo <guglielmoc@google.com> |
||
| .. | ||
| client.src.md | ||
| doc.go | ||
| mcpgodebug.src.md | ||
| protocol.src.md | ||
| quick_start.src.md | ||
| README.src.md | ||
| rough_edges.src.md | ||
| server.src.md | ||
| toc_test.go | ||
| troubleshooting.src.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.