feat(server): adopt MCP 2026-07-28 stateless spec over HTTP - #432
Merged
Conversation
This was referenced Aug 9, 2026
Closed
Migrate the MCP server from @modelcontextprotocol/sdk v1 to the v2 SDK (@modelcontextprotocol/server + /node, zod 4 declared explicitly): - http-server.mjs: replace the hand-rolled session map with createMcpHandler + toNodeHandler. The modern leg serves 2026-07-28 stateless requests (_meta envelope, Mcp-Method/Mcp-Name headers, resultType, cache hints); the built-in legacy: 'stateless' fallback answers 2025-era traffic — including the initialize handshake the shipped Anglesite-app MCPClient (pinned 2024-11-05) sends — from the same buildServer factory, per-request, with no session minted. - index-tools.mjs: server.tool() -> registerTool() with explicit z.object() input schemas; v2 import paths for McpServer and stdio. - tests: keep the v1-SDK client test as drain-window regression coverage, add raw 2024-11-05 wire, raw 2026-07-28 stateless, and v2-SDK client tests. Verified against the app's real Swift client: AppliesEditEndToEndTests and MCPClientHTTPEndToEndTests pass with ANGLESITE_PLUGIN_PATH at this checkout (stdio + HTTP). Part of Anglesite/Anglesite#1277 (sidecar half of the paired PRs). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidwkeith
force-pushed
the
feat/mcp-2026-stateless
branch
from
August 10, 2026 16:03
bdc8e69 to
5c6e484
Compare
7 tasks
The update skill bundles the root package.json as a reference file, so the @modelcontextprotocol/sdk -> server/node + zod dependency change must be re-exported (agent-skills-export CI gate). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@modelcontextprotocol/server+@modelcontextprotocol/node, explicitzod@^4.2) and adopts the MCP 2026-07-28 stateless spec on the HTTP path:createMcpHandlerserves the modern protocol (_metaenvelope,Mcp-Method/Mcp-Nameheaders,resultType, cache hints) and its built-inlegacy: 'stateless'fallback keeps answering 2025-era Streamable HTTP traffic — including theinitializehandshake the shipped Anglesite-appMCPClient(pinned2024-11-05) sends — from the samebuildServerfactory, per-request, with no session minted. The hand-rolledMcp-Session-Idsession map is gone.server.tool()to v2registerTool()with explicitz.object()input schemas; stdio stays on the same server via the v2 stdio transport (verified to still negotiate2024-11-05with the app's raw JSON-RPC handshake).@modelcontextprotocol/clientv2 covers the modern era.Paired PR check
Anglesite/Anglesite-app(MCP message schema, template fields the app reads, hook surface, anything the native app embeds or shells out to). Link it here: Adopt MCP 2026-07-28 stateless spec (sidecar first, then app client) Anglesite#1277 (app PR to follow — bumpprotocolVersion, drop theinitialize/session plumbing fromMCPClient/HTTPTransport, re-vendor the container image)Backward compatible by design: the legacy fallback means the current app keeps working against this server before the app PR lands, so this can ship first in a tagged release per the two-repo flow.
Test plan
npx vitest run test/mcp-http-transport.test.js— 4 tests: v1-SDK client (drain-window regression), raw2024-11-05wire mirroring the app'sHTTPTransport(asserts noMcp-Session-Idis minted), raw 2026-07-28 stateless request with the_metaenvelope (assertsresultType: "complete"), v2-SDK clientnpx vitest run tests/mcp-server.test.ts— 11 stdio tests pass unchanged (raw JSON-RPCinitializepinned to2024-11-05)npm test— 149/150 files pass; the one failing file (tests/build-agent-skills.test.ts, 56 SKILL.md drift assertions) also fails on cleanmainand is unrelatedANGLESITE_PLUGIN_PATH=<this worktree> swift test --filter "AppliesEditEndToEnd|MCPClientHTTPEndToEnd"— real SwiftMCPClient/HTTPTransportpass over stdio and HTTPNotes
/mcpnow answer405(previously400). The app only sends DELETE when it holds a session id, which a stateless server never mints, so no consumer is affected.🤖 Generated with Claude Code