Commit Graph

46 Commits

Author SHA1 Message Date
Max Isbey 5b1275beae Merge branch 'main' into shttp-native-dispatch
Brings in "Stop answering cancelled requests" and reapplies its policy
onto the rebuilt seam instead of the code it targeted:

- The cancelled-request answer policy now lives at the correlator's
  single site: a peer-cancelled request is never answered by the dispatch
  layer, its late result or error is dropped, and it settles through a
  transport-supplied hook. The dispatcher forwards the hook it receives in
  message metadata; the streamable HTTP transport supplies its own, which
  ends the request's stream with the REQUEST_CANCELLED terminal error
  written through the request's ordered channel (so a resuming client's
  replay terminates too).
- Hook containment happens once, in the correlator.
2026-07-28 00:59:18 +00:00
Max Isbey 47e156d560 Rework channel liveness, stream ids, and init ordering after review
The second review round found several defects that traced back to a few
structural gaps rather than isolated bugs; this addresses the gaps.

- Channel delivery is now a value: write() returns whether the message
  reached the event store or an attached response, an EventStore failure is
  contained inside the write (resumability degrades, the stream survives,
  no store text on the wire), and attach() returns None on a dead channel
  so nothing can stream from one. A server-to-client request that cannot
  reach any client fails the caller with CONNECTION_CLOSED instead of
  parking it, and the JSON-response body derives from the channel's
  recorded outcome (result, terminated-404, or 500) rather than a
  "cannot happen" branch.
- Stream ids handed to the EventStore are minted by the transport in a
  session-scoped namespace, so a client-chosen request id can no longer
  name the standalone GET stream and two sessions on one store can no
  longer replay each other's frames.
- One SSE-response runner owns the pump, error containment, and cleanup
  for the POST, GET, and replay responses (the POST path had lost the
  guard its siblings kept).
- A session-level gate holds requests that arrive while an initialize is
  still being served until the handshake commits, restoring the ordering
  the stream-pair driver's parked read loop used to guarantee.
- The POSTed client message is delivered even when the 202 could not be
  written back, and the correlator marks the single site where the
  cancelled-request answer policy lives for every transport.

Adds regression tests for each of the above.
2026-07-27 23:19:39 +00:00
Max 923341c98a Stop answering cancelled requests (#3188) 2026-07-27 23:26:00 +01:00
Max d3ffe87960 Split the registration request model from the registered-client record (#3181) 2026-07-27 23:11:01 +01:00
Max Isbey 1e3be94d4a Fix defects found in review of the streamable HTTP rewrite
- Serialize store-then-forward per channel: concurrent writers on one
  channel (the standalone GET stream) could put frames on the wire out of
  event-store order, breaking Last-Event-ID resumption. A per-channel lock
  restores the store-order == wire-order invariant the serial router used to
  provide.
- Refuse a request that arrives across session termination instead of
  running it: dispatch now branches on the transport's identity (stateful
  vs stateless) rather than on session-task presence, re-checks liveness
  after the request's awaits, and answers 404 for an ended session; queued
  work for an ended session is dropped.
- Contain event-store failures at the channel: a raising store_event was
  reaching the correlator as a handler error and leaking its text onto the
  wire; write() now never raises (a broken store ends that stream), which
  also protects the courtesy-cancel write.
- Close the replay reader when priming fails; drop dead exception arms in
  the SSE pump.
- Correct the migration note's JSON-mode claim to request-scoped requests,
  drop a claim handlers cannot observe, fix a vacuous test assertion, and
  add regression tests for each fix.
2026-07-27 20:48:49 +00:00
Max Isbey d9f77bcf8e Document the streamable HTTP transport change in the migration guide
Records the removal of StreamableHTTPServerTransport.connect() (the
transport is now driven per request by the session manager) and the
behaviours clarified alongside it, and refreshes the docstrings that still
described the old serve_loop wiring.
2026-07-27 20:04:55 +00:00
Max 814072c94d Narrow message_handler's parameter to notifications and exceptions (#3168) 2026-07-26 00:24:48 +01:00
Max e90a66b554 Rename scopes= to scope= on the client-credentials OAuth providers (#3166) 2026-07-25 20:23:36 +01:00
Max 629ca297d2 Isolate the stdio server's stdin and stdout from handler subprocesses (#3117) 2026-07-25 13:05:51 +01:00
Max 837ef904f8 Align with spec #3002: optional clientInfo, serverInfo in result _meta (#3143)
Deploy Docs / deploy-docs (push) Has been cancelled
CI / checks (push) Failing after 24m23s
CI / all-green (push) Has been cancelled
Conformance Tests / server-conformance (push) Has been cancelled
Conformance Tests / client-conformance (push) Has been cancelled
GitHub Actions Security Analysis / zizmor (push) Has been cancelled
2026-07-23 12:00:36 +01:00
Marcelo Trylesinski 2713b53b12 Replace httpx and httpx-sse with httpx2 (#2972)
CI / checks (push) Failing after 1s
CI / all-green (push) Has been cancelled
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
2026-07-14 17:05:08 +01:00
Max 9bdc03d54e Add the client-side subscriptions/listen driver (#3047) 2026-07-07 14:26:09 +01:00
Max 867bba6263 Share one event loop per test module to stop Windows socketpair churn (#3070) 2026-07-07 13:19:04 +01:00
Max 53117cb3a9 Make client-side cancellation work over the 2026 transports (#3046) 2026-07-02 19:21:04 +01:00
Max 48ef569f7e Validate Mcp-Param-* headers server-side on the 2026-07-28 HTTP path (SEP-2243) (#3033) 2026-06-30 21:39:32 +01:00
Max 4df609119f Add a client extension API (#3034) 2026-06-30 21:31:02 +01:00
Max b15b1d5f07 Add a client-side response cache honoring SEP-2549 caching hints (#3023) 2026-06-30 11:31:06 +01:00
Max 067f90578c Add SSE response mode to the 2026 streamable-HTTP server entry (#3001) 2026-06-26 19:09:08 +02:00
Marcelo Trylesinski c0ecb70e24 Support RFC 8693 token exchange for enterprise IdP flows (SEP-990) (#2988)
Co-authored-by: Max Isbey <224885523+maxisbey@users.noreply.github.com>
2026-06-26 17:57:10 +02:00
Marcelo Trylesinski ecdf09d44f Deprecate Server.__init__ handlers for removed capabilities (#3002) 2026-06-26 17:51:13 +02:00
Marcelo Trylesinski 5b2713d40c Mirror x-mcp-header tool arguments into Mcp-Param-* request headers (SEP-2243) (#2990) 2026-06-26 14:36:56 +02:00
Max 587340279e Conformance burn-down: server-side InputRequiredResult, Mcp-Method/Name validation, x-mcp-header filter (14 scenarios → green) (#2974)
CI / checks (push) Failing after 0s
CI / all-green (push) Has been cancelled
2026-06-26 09:51:59 +02:00
Marcelo Trylesinski 0ee7f1b293 Split protocol types into a standalone mcp-types package (#2973) 2026-06-25 19:18:38 +02:00
Max f226d00d0a Client-side 2026-07-28 support: .discover()/.adopt() + Client(mode=); request-metadata green (#2950) 2026-06-25 16:09:23 +02:00
Max a527142312 Buffer per-request StreamableHTTP streams to avoid serial-router head-of-line block (#2934) 2026-06-22 16:20:45 +01:00
Max 2397319a68 Server-side 2026-07-28 stateless support: classifier, driver split, server/discover (#2928) 2026-06-21 19:34:17 +01:00
Marcelo Trylesinski 44724284b3 Bind client credentials to their authorization server (SEP-2352) (#2933) 2026-06-20 18:47:22 +01:00
Marcelo Trylesinski 1331131650 Union previously requested scopes on step-up re-authorization (SEP-2350) (#2931) 2026-06-20 18:45:04 +02:00
Marcelo Trylesinski 4573e4ac33 Deprecate roots, sampling, and logging methods per SEP-2577 (#2926) 2026-06-20 18:25:41 +02:00
Marcelo Trylesinski cf41441e44 Send application_type during Dynamic Client Registration (SEP-837) (#2930) 2026-06-20 18:19:12 +02:00
Marcelo Trylesinski 48cf4950dc Validate the iss authorization-response parameter (RFC 9207 / SEP-2468) (#2921) 2026-06-20 17:54:18 +02:00
Marcelo Trylesinski f253682393 Return -32602 for resource not found (SEP-2164) (#2920) 2026-06-20 16:55:23 +02:00
Max 84bf9bde05 First end-to-end 2026-07-28 stateless tools/call (experimental entry + ClientSession pin) (#2917) 2026-06-20 14:55:59 +01:00
Max 1cec2d60f4 Relax monolith ElicitRequestURLParams.elicitation_id for 2026-07-28 (#2913) 2026-06-19 16:06:08 +01:00
Max 364b762ef6 tests/interaction: era-axis machinery for the requirements manifest (#2909) 2026-06-19 12:59:39 +01:00
Max 65be5a7147 Protocol types for 2026-07-28: superset monolith, committed per-version packages, and wire-method maps (#2849) 2026-06-16 17:40:14 +01:00
Max ac36a395aa Widen the stdio round-trip test's termination grace and overall timeout (#2880) 2026-06-15 18:23:49 +01:00
Max 1012d60004 [v2] ClientSession runs on JSONRPCDispatcher; BaseSession removed (#2838) 2026-06-15 14:46:34 +01:00
Max 535fc1d0fb Flush the stdio subprocess's coverage data before the clean-exit line (#2840) 2026-06-12 10:23:37 +01:00
Max 7267818e44 Fix unknown-method error code and add a protocol version registry (#2836) 2026-06-11 16:47:22 +01:00
Max 5d826490b6 [v2] Dispatcher/ServerRunner receive-path swap — replaces BaseSession (#2710) 2026-06-09 12:58:47 +01:00
Max ac96f88abd Deflake the session-level timeout test with trio's virtual clock (#2788) 2026-06-05 21:33:48 +01:00
Max bdc48e98b1 Fix stdio client shutdown bugs and rebuild the stdio test suite (#2773) 2026-06-05 16:15:43 +01:00
Max b3025f93b4 Run transport security tests in process instead of over sockets (#2764) 2026-06-02 20:30:17 +01:00
Max 8cc187fac0 Remove Tasks (SEP-1686) from the SDK (#2714) 2026-06-02 18:27:05 +02:00
Max 24725633f1 test: interaction-model end-to-end suite with a requirements manifest (#2691) 2026-05-28 18:48:30 +00:00