GeezerVison is showing github.com — feat(mcp): migrate to the stateless MCP 2026-07-28 protocol by antfubot · Pull Request #297 · devframes/devframe
Conversation
antfubot
commented
Aug 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
What & why
Migrates devframe's MCP surface to the stateless MCP 2026-07-28 protocol, as tracked in #293. It retires devframe's hand-rolled Mcp-Session-Id lifecycle in favor of the SDK's stateless serving entry points, so requests reach any server instance without session affinity and modern MCP clients are first-class.
The endpoints keep serving 2025-era clients through the SDK's default stateless legacy path — the custom session registry is gone, but existing clients keep listing and calling tools/resources.
Compatibility (ships within 0.9)
This is source-compatible — no public API, option-type, or dependency changes (the tsnapi snapshot is unchanged), so consumers need zero code changes and it lands as a 0.9 minor rather than a dedicated major.
The changes are on the wire only:
GET/DELETE on the HTTP endpoint now return 405 (were the 2025 session stream/teardown ops).
- No
Mcp-Session-Id is issued; both a default (2025-era) client and a modern client connect + list + call successfully.
- The one regression: a 2025-era client no longer receives live
list_changed push over HTTP (stateless legacy has no server→client channel); modern clients get it via subscriptions/listen.
Changes
- HTTP (
createMcpFetchHandler) moves to the SDK's createMcpHandler, building a fresh server per request. The loopback origin gate is unchanged.
- stdio (
createMcpServer) moves to serveStdio, pinning one server per connection.
devframe connect negotiates the modern era via server/discover, falling back to the 2025 handshake for a 2025-only instance.
list_changed events bridge onto modern subscriptions/listen streams — over HTTP through the handler's notify bus, on stdio through the pinned server's send*ListChanged calls.
- The pure server factory (
buildMcpServerFromContext) is split from the notification bridge (bridgeListChanged); the old transports.ts stdio wrapper is removed.
Docs
- Rewrites the MCP adapter page's serving model (stateless, per-request).
- Documents the change as a section in the "Migrating to 0.9" guide.
Closes #293
This PR was created with the help of an agent.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Serve the MCP surface through the SDK's stateless 2026-07-28 entry points,
retiring devframe's custom Mcp-Session-Id lifecycle:
- HTTP moves to `createMcpHandler`, building a fresh server per request
(no session registry, no session-local routing, GET/DELETE -> 405).
2025-era clients are still served through the SDK's stateless legacy path.
- stdio moves to `serveStdio`, pinning one server per connection.
- `devframe connect` negotiates the modern era via `server/discover`,
falling back to the 2025 handshake for a 2025-only instance.
- `list_changed` events bridge onto modern `subscriptions/listen` streams
(HTTP via the handler's notify bus; stdio via the pinned server's
send*ListChanged calls).
The devframe API surface (createMcpServer, createMcpFetchHandler,
mountMcpHttp, cli.mcp) and the origin gate are unchanged.
Closes #293
vercel
Bot
commented
Aug 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
antfu
changed the title
feat(mcp): migrate to the stateless MCP 2026-07-28 protocol
feat(mcp)!: migrate to the stateless MCP 2026-07-28 protocol
Aug 26, 2026
The hub aggregate-MCP and Next handler tests still exercised the 2025
initialize/Mcp-Session-Id handshake. Serve them statelessly: the hub test
lists tools with a single per-request POST, and both assert no session id
is issued.
# Conflicts:
# docs/content/2.adapters/7.mcp.md
Retarget the stateless MCP 2026-07-28 migration to ship within 0.9: the
change is source-compatible (no public API or dependency changes), so it
lands as a 0.9 minor rather than a dedicated 0.10 clean break. Remove the
separate 0.10 guide, revert the migration renumbering, and document the
stateless endpoints as a section in the 0.9 guide.
antfu
changed the title
feat(mcp)!: migrate to the stateless MCP 2026-07-28 protocol
feat(mcp): migrate to the stateless MCP 2026-07-28 protocol
Aug 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
antfu
antfu approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|