Skip to content

Expose actual inbound-processing completion for reusable transport admission - #3024

Draft
servrox wants to merge 2 commits into
modelcontextprotocol:mainfrom
servrox:codex/inbound-request-lifecycle
Draft

servrox wants to merge 2 commits into
modelcontextprotocol:mainfrom
servrox:codex/inbound-request-lifecycle

Conversation

@servrox

@servrox servrox commented Oct 14, 2026 •

Copy link
Copy Markdown

Transport adapters cannot safely return reusable admission credits from responses or cancellation alone: handlers, response writes and SDK cleanup may still be running. This adds local MessageExtraInfo.onMessageProcessed metadata, preserved through the official stdio entry, and a public stdio capability marker. Completion joins ordinary handlers/writes/controller cleanup, asynchronous inbound-response validation, opening/error paths, and subscription ACK/teardown/started notification deliveries.

Draft proposal for #3020; maintainer acceptance is still pending. The metadata is never serialized and does not attest remote effects or application work outside returned promises. No alternate MCP transport or protocol implementation is introduced.

Validation:

  • Core: 1,533 tests passed. Server: 585 passed; the explicit duration test is skipped in the normal suite.
  • Client: 995 passed; three unchanged stdio fixture cases fail because NixOS has no /usr/bin/tee. No system workaround was installed.
  • A separate 601.56-second run processed successful asynchronous tools in both protocol generations through the official StdioServerTransport framing and Node Writable callbacks, reusing eight IDs only after completion. Controlled in-memory streams do not attest OS pipes or remote delivery. The callback-only correction preserves this ordinary write boundary; four focused actual-source regressions separately cover close, early error, destroyed output and end without drain.
  • Affected core/server/client typechecks and changed-source lint/format passed. Independent read-only lifecycle review findings were corrected and rechecked with no remaining findings in that scope.

Official stdio send now waits for the actual chunk callback even when write() accepts the chunk immediately. Failure and close cannot return an unfinished write credit. Independent review reproduced and closed both missing-event hangs.

The new changeset and documentation describe the local completion boundary. This is a source proposal, not released SDK support or downstream production qualification.

@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fdd1ffb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/server Minor
@modelcontextprotocol/client Minor
@modelcontextprotocol/codemod Minor
@modelcontextprotocol/core Minor
@modelcontextprotocol/server-legacy Minor
@modelcontextprotocol/core-internal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@3024

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@3024

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@3024

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@3024

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@3024

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@3024

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@3024

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@3024

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@3024

commit: fdd1ffb

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant