{"full_name":"modelcontextprotocol/go-sdk","owner":"modelcontextprotocol","name":"go-sdk","shard":"1","url":"https://github.com/modelcontextprotocol/go-sdk","description":"The official Go SDK for Model Context Protocol servers and clients. Maintained in collaboration with Google.","homepage":"https://modelcontextprotocol.io","topics":["go","mcp"],"tag_pages":["go","mcp"],"language":"Go","license":"NOASSERTION","avatar":"https://avatars.githubusercontent.com/u/182288589?v=4","created_at":"2025-04-23T10:07:33Z","pushed_at":"2026-11-13T14:49:31Z","metrics":{"stars":5348,"forks":621,"watchers":55,"issues":561,"prs":936,"releases":32,"issues_open":45,"issues_closed":516,"prs_open":38,"prs_closed":181,"prs_merged":717,"discussions":31},"growth":{"day":{"stars":2,"forks":1,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-14","2026-11-15","2026-11-16"],"stars":[5343,5346,5348],"forks":[617,620,621],"watchers":[55,55,55],"issues_open":[42,44,45],"prs_open":[38,38,38]},"boards":{},"same_owner":[{"full_name":"modelcontextprotocol/servers","name":"servers","shard":"1","boards":{"total":176}},{"full_name":"modelcontextprotocol/modelcontextprotocol","name":"modelcontextprotocol","shard":"1","boards":{}},{"full_name":"modelcontextprotocol/php-sdk","name":"php-sdk","shard":"1","boards":{}}],"issues":[{"number":720,"title":"Add examples to modelcontextprotocol.io","comments":14,"created_at":"2025-12-12T05:24:40Z"},{"number":1189,"title":"streamable client: Connect blocks far past its context deadline against an unresponsive server (detached-context cleanup)","comments":13,"created_at":"2026-08-20T17:01:58Z"},{"number":745,"title":"Expose generic `SendNotification` on `ServerSession` for custom protocol extensions","comments":13,"created_at":"2026-01-06T07:05:50Z"},{"number":626,"title":"SEP-1686 (experimental): Implement Tasks","comments":12,"created_at":"2025-11-07T23:38:18Z"},{"number":479,"title":"Proposal: Export callback to StreamableHTTPHandler for closed transports","comments":12,"created_at":"2025-09-17T09:30:00Z"},{"number":579,"title":"Proposal: Provide better error handling for HTTP errors when using a Streamable Client","comments":10,"created_at":"2025-10-14T15:14:13Z"},{"number":1265,"title":"mcp: a resource update cannot be delivered to one session, and the caller's context never reaches the sending middleware","comments":8,"created_at":"2026-09-13T18:18:00Z"},{"number":657,"title":"Proposal: allow `mcp.streamableClientConn` to listen to SSE stream without using `mcp.Client`","comments":8,"created_at":"2025-11-25T19:52:52Z"}],"discussions":[{"number":1161,"title":"Supporting the new stateless map spec 2026-07-28","comments":0,"category":"General","created_at":"2026-08-13T10:02:28Z"},{"number":899,"title":"Might need to migrate from Mkdocs","comments":0,"category":"General","created_at":"2026-04-16T12:03:55Z"},{"number":839,"title":"Client side oauth token refresh","comments":3,"category":"Q&A","created_at":"2026-03-11T09:59:17Z"},{"number":831,"title":"DNS rebinding protection","comments":1,"category":"Q&A","created_at":"2026-03-02T18:57:44Z"},{"number":830,"title":"DNS rebinding protection","comments":2,"category":"Q&A","created_at":"2026-03-02T18:54:28Z"},{"number":727,"title":"Please test the v1.2.0-pre.1 prerelease!","comments":0,"category":"Announcements","created_at":"2025-12-16T23:48:02Z"},{"number":670,"title":"Create a MCP Server with Go and OAuth","comments":0,"category":"Show and tell","created_at":"2025-12-01T11:12:33Z"},{"number":669,"title":"when tools/call request is complete, but  notifications/progress is still sent,  will get a  error \"rejected by transport\"","comments":2,"category":"Q&A","created_at":"2025-12-01T07:13:52Z"}],"latest_release":{"name":"v1.8.0","tag":"v1.8.0","published_at":"2026-09-14T08:05:46Z","body":"_**This release is equivalent to v1.8.0-pre.2. Thank you to those who tested the pre-release.**_\r\n\r\nIn this release we introduce several fixes and improvements on top of [v1.7.0](https://github.com/modelcontextprotocol/go-sdk/releases/tag/v1.7.0). It adds no new protocol revision: the supported set is unchanged, and `2026-07-28` remains the newest version the SDK negotiates.\r\n\r\nThe bulk of the work is hardening the transports against resource exhaustion, closing session leaks, deadlocks and teardown hangs found by users running the new protocol at scale, and giving servers explicit control over which protocol versions they advertise.\r\n\r\nTwo behavior changes are guarded by new `MCPGODEBUG` flags; see the section below.\r\n\r\n## Hardening against resource exhaustion\r\n\r\nEvery decoding path that buffers incoming input is now bounded. JSON payloads are rejected past 1000 levels of nesting, before the parser recurses. Both SSE readers cap the bytes buffered for a single event via `MaxEventSize` on `SSEClientTransport` and `StreamableClientTransport`, and the stdio transport caps a single JSON-RPC frame via `StdioTransport.MaxLineLength`.\r\n\r\nOn the OAuth side, dynamic client registration responses are bounded to 1 MB, and the discovery code now validates metadata documents rather than trusting them.\r\n\r\n- internal/json: json nesting depth check by [@yarolegovich](https://github.com/yarolegovich) ([#1200](https://github.com/modelcontextprotocol/go-sdk/pull/1200))\r\n- mcp: add an sse event size cap by [@yarolegovich](https://github.com/yarolegovich) ([#1205](https://github.com/modelcontextprotocol/go-sdk/pull/1205))\r\n- mcp: add a max request body size of the old transport by [@yarolegovich](https://github.com/yarolegovich) ([#1224](https://github.com/modelcontextprotocol/go-sdk/pull/1224))\r\n- oauthex: bound dcr read to 1mb by [@yarolegovich](https://github.com/yarolegovich) ([#1206](https://github.com/modelcontextprotocol/go-sdk/pull/1206))\r\n- oauthex: oauth discovery checks by [@yarolegovich](https://github.com/yarolegovich) ([#1220](https://github.com/modelcontextprotocol/go-sdk/pull/1220))\r\n\r\n## Restricting the protocol versions a server supports\r\n\r\n`ServerOptions.SupportedProtocolVersions` lets a server narrow the set of versions it advertises and negotiates. The list can only narrow, never widen; naming a version the SDK does not implement panics at construction.\r\nRelatedly, a stateful streamable handler receiving a `2026-07-28` request now returns that same JSON-RPC error instead of a plain-text 400, so the client can renegotiate down instead of losing the connection.\r\n\r\n- mcp: allow restricting the protocol versions a server supports by [@guglielmo-san](https://github.com/guglielmo-san) ([#1199](https://github.com/modelcontextprotocol/go-sdk/pull/1199))\r\n- mcp: return json-rpc error on stateful server serving protocolVersion20260728 requests by [@guglielmo-san](https://github.com/guglielmo-san) ([#1143](https://github.com/modelcontextprotocol/go-sdk/pull/1143))\r\n- mcp: limit SSE discover supportedVersions to SSE-defined revisions by [@arimu1](https://github.com/arimu1) ([#1121](https://github.com/modelcontextprotocol/go-sdk/pull/1121))\r\n- mcp: prefer the negotiated protocol version over the request context by [@gwyszynski-sa](https://github.com/gwyszynski-sa) ([#1163](https://github.com/modelcontextprotocol/go-sdk/pull/1163))\r\n- mcp: export ClientSessionOptions.ProtocolVersion by [@arimu1](https://github.com/arimu1) ([#1127](https://github.com/modelcontextprotocol/go-sdk/pull/1127))\r\n\r\n## Per-request cache control\r\n\r\n`ServerOptions.SetCacheable` is a new hook that decides the `ttlMs` and `cacheScope` fields of every result carrying them: `server/discover`, the four list methods, and `resources/read`. It runs once per result, after the handler returns, with the values that handler produced, so it can set a policy globally while still letting an individual handler override it. Anything left unset falls back to the protocol default of `","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}