Title: 2026-07-28 transport rejects client notifications with -32600; real clients send notifications/cancelled (TODO(L57)) · Issue #3324 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: 2026-07-28 transport rejects client notifications with -32600; real clients send notifications/cancelled (TODO(L57)) · Issue #3324 · modelcontextprotocol/python-sdk
X Title: 2026-07-28 transport rejects client notifications with -32600; real clients send notifications/cancelled (TODO(L57)) · Issue #3324 · modelcontextprotocol/python-sdk
Description: Summary On the 2026-07-28 per-request-envelope path, the streamable-HTTP transport rejects any client notification with HTTP 400 and -32600 "Body must be a single JSON-RPC request object". The same notification is accepted with 202 on th...
Open Graph Description: Summary On the 2026-07-28 per-request-envelope path, the streamable-HTTP transport rejects any client notification with HTTP 400 and -32600 "Body must be a single JSON-RPC request object". The same...
X Description: Summary On the 2026-07-28 per-request-envelope path, the streamable-HTTP transport rejects any client notification with HTTP 400 and -32600 "Body must be a single JSON-RPC request object"...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3324
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"2026-07-28 transport rejects client notifications with -32600; real clients send notifications/cancelled (TODO(L57))","articleBody":"### Summary\n\nOn the `2026-07-28` per-request-envelope path, the streamable-HTTP transport rejects **any** client notification with HTTP 400 and `-32600 \"Body must be a single JSON-RPC request object\"`. The same notification is accepted with `202` on the handshake era.\n\n`mcp/server/_streamable_http_modern.py:349-362` documents this as a deliberate choice, and notes the decision is still open:\n\n```python\nexcept ValidationError:\n # Well-formed JSON that isn't a single request object. The transport\n # spec permits notification POSTs and gives the server two responses\n # (202 accept / 4xx cannot-accept; streamable-http §Sending Messages\n # item 5). The core protocol defines no client→server notifications\n # over HTTP at 2026-07-28 (cancellation is SSE-stream close), so this\n # entry takes the cannot-accept branch. TODO(L57): S4 owns the\n # strict-vs-lenient choice.\n```\n\n**I'm not reporting a spec violation** — the transport spec permits either branch, and the reasoning above is sound. I'm supplying the empirical input that `TODO(L57)` is missing: **real clients do send notifications on `2026-07-28`**, so the strict branch produces a steady stream of 400s in production.\n\n### Observed in production\n\nA server running `mcp==2.0.0` behind an OAuth-protected streamable-HTTP endpoint, serving live `Claude-User` connector traffic. Within one client session, on `2026-07-28`:\n\n| Method | Result |\n|---|---|\n| `server/discover` | 200 |\n| `notifications/cancelled` | **400** `-32600` |\n| `tools/list` (234 ms later) | 200 |\n\nThe client was unaffected — notifications are fire-and-forget, so it carried on and the next request succeeded. The practical cost is observability rather than function: a monitoring rule of the obvious shape (\"no 400s on the new revision\") fires permanently, and the 400s are indistinguishable by status code from genuine protocol failures.\n\n### Reproduction\n\nDepends only on `mcp` and `httpx`; no network.\n\n```python\nimport anyio, httpx\nfrom mcp.server import MCPServer\nfrom mcp.server.transport_security import TransportSecuritySettings\n\nPV = \"io.modelcontextprotocol/protocolVersion\"\nCC = \"io.modelcontextprotocol/clientCapabilities\"\n\nsrv = MCPServer(name=\"repro\", version=\"0.0.1\")\n\n@srv.tool(name=\"ping\", description=\"noop\")\ndef ping() -> str:\n return \"pong\"\n\ndef app():\n return srv.streamable_http_app(\n stateless_http=True, json_response=True,\n transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False),\n )\n\nasync def post(label, body, version):\n a = app()\n async with a.router.lifespan_context(a):\n async with httpx.AsyncClient(transport=httpx.ASGITransport(app=a), base_url=\"http://localhost\") as c:\n r = await c.post(\"/mcp\", json=body, headers={\n \"Accept\": \"application/json, text/event-stream\",\n \"MCP-Protocol-Version\": version,\n \"Mcp-Method\": body[\"method\"],\n })\n print(f\"{label:\u003c48} HTTP {r.status_code} {r.text[:100]}\")\n\nasync def main():\n meta = {PV: \"2026-07-28\", CC: {}}\n await post(\"notification, WITH _meta envelope\",\n {\"jsonrpc\": \"2.0\", \"method\": \"notifications/cancelled\",\n \"params\": {\"requestId\": 1, \"_meta\": meta}}, \"2026-07-28\")\n await post(\"notification, without _meta envelope\",\n {\"jsonrpc\": \"2.0\", \"method\": \"notifications/cancelled\",\n \"params\": {\"requestId\": 1}}, \"2026-07-28\")\n await post(\"control: request (has id), WITH envelope\",\n {\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"tools/list\",\n \"params\": {\"_meta\": meta}}, \"2026-07-28\")\n await post(\"same notification on 2025-11-25\",\n {\"jsonrpc\": \"2.0\", \"method\": \"notifications/cancelled\",\n \"params\": {\"requestId\": 1}}, \"2025-11-25\")\n\nanyio.run(main)\n```\n\nOutput:\n\n```\nnotification, WITH _meta envelope HTTP 400 {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32600,\"message\":\"Body must be a single JSON-RPC request object\"},\"id\":null}\nnotification, without _meta envelope HTTP 400 {\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32600,\"message\":\"Body must be a single JSON-RPC request object\"},\"id\":null}\ncontrol: request (has id), WITH envelope HTTP 200 {\"jsonrpc\":\"2.0\",\"id\":1,\"result\":{...}}\nsame notification on 2025-11-25 HTTP 202\n```\n\nNote the discriminator is the **absent `id`**, not the envelope: adding a well-formed `params._meta` changes nothing, because `JSONRPCRequest.model_validate` fails before the envelope is ever examined.\n\n### Questions\n\n1. Is the cannot-accept branch intended to stay, now that clients are observably sending these? The lenient branch (`202` and drop) would match handshake-era behaviour for the same message and keep 4xx meaningful as a failure signal.\n2. If it stays, would you consider a distinguishable response — a dedicated error message or code for \"notifications are not accepted on this revision\" — so operators can separate it from genuine protocol errors without parsing bodies?\n3. Is it worth a note in the migration guide? A dual-era server inherits this the moment a client starts using `2026-07-28`, with no change on the server's part.\n\n### Environment\n\n```\npython 3.13.7\nmcp 2.0.0\nmcp-types 2.0.0\nstarlette 1.0.0\npydantic 2.13.4\n```\n","author":{"url":"https://github.com/EsntlSolutions","@type":"Person","name":"EsntlSolutions"},"datePublished":"2026-08-17T13:03:13Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3324"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e39013d6-eaaf-c44f-079c-8e505ac3ef70 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A44E:33067A:AF8D2:E8658:6B00B9AC |
| html-safe-nonce | c0cc65dee83866df8cfea549507f8a58cfd66826042d1298ad5eeae3450b9382 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDRFOjMzMDY3QTpBRjhEMjpFODY1ODo2QjAwQjlBQyIsInZpc2l0b3JfaWQiOiIzOTE0Mjk3MzQ5ODQ5MDA0NDYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c247a981b5b014fc917af8c8df31f8f0576f2c666badd36f571483c6502cc78e |
| hovercard-subject-tag | issue:5172171323 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3324/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5d4ba366b12aa50bc56adf6e43626e343f11ea6411f32978eed2d39598b94dd2/modelcontextprotocol/python-sdk/issues/3324 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5d4ba366b12aa50bc56adf6e43626e343f11ea6411f32978eed2d39598b94dd2/modelcontextprotocol/python-sdk/issues/3324 |
| og:image:alt | Summary On the 2026-07-28 per-request-envelope path, the streamable-HTTP transport rejects any client notification with HTTP 400 and -32600 "Body must be a single JSON-RPC request object". The same... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EsntlSolutions |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5429cbfc6aca8c7b9a086a3c8f47400346f38cc9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width