feat: official SDK transport for /api/mcp — one server definition, every transport - #97
Open
adamstankiewicz wants to merge 4 commits into
Open
feat: official SDK transport for /api/mcp — one server definition, every transport#97adamstankiewicz wants to merge 4 commits into
adamstankiewicz wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
2 times, most recently
from
August 30, 2026 20:11
06828a2 to
7d30304
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 20:16
7d30304 to
822be3d
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 20:24
822be3d to
720893f
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 20:54
720893f to
d078455
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 20:59
d078455 to
fff01f2
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 21:08
fff01f2 to
b52041f
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 21:13
b52041f to
585659f
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 21:19
585659f to
916d5c8
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 21:25
916d5c8 to
37232d8
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 21:44
1508c6b to
7e4eac2
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 23:31
71a804d to
a939ff7
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 23:41
a939ff7 to
802025b
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 30, 2026 23:52
802025b to
b5e42c4
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 31, 2026 00:04
b5e42c4 to
6af5662
Compare
Owner
Author
|
Addendum to the description: this branch also picked up a spec-correctness fix authored in a parallel session — a GET with |
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 31, 2026 00:17
6af5662 to
4952f3b
Compare
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 31, 2026 00:18
4952f3b to
a432a39
Compare
The tool surface moves to src/lib/mcp/server.ts — one definition consumed by every transport. The route shrinks from 640 hand-rolled JSON-RPC lines to an 80-line Web-standard Streamable HTTP envelope (WebStandardStreamableHTTPServerTransport, stateless per request — the serverless shape). Both historical reasons for hand-rolling are gone: the SDK ships a fetch-native transport, and _meta.ui passes through registerTool/registerResource (per-call view URIs ride a ResourceTemplate). The CLI transports unify on the same definition via an esbuild bundle (mcp/dist/server-core.mjs, emitted by mcp:build): server.mjs and server-http.mjs consume core.mjs; app.mjs — whose tool list had already drifted stale — deletes. pnpm mcp:inspect wires the official inspector. The protocol tests became protocol-correct clients in the process (the SDK enforces the Accept header and answers over SSE where our hand-rolled version was lenient), and adopted the audience-not-grade surface where it crossed this rewrite. Verified: 61 tests green; live inspector v2 run against the SDK route — initialize, tools/list with _meta.ui, and a real find_activity call (semantic ranking, ESS2.C verified, 11 listings) end-to-end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The tool surface iterated in a parallel session: the free-text field is audienceHint on all three tools, keeping the bare word reserved for the scheme-scoped, graph-verified audience on emitted manifests. The contract test now pins both halves — the hint exists under its suffixed name, and no tool exposes a bare audience input to collide with the verified one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Streamable HTTP lets clients open a server-to-client stream with GET; this transport is stateless and never initiates messages, so there is no stream to offer, and the spec's answer is 405 with Allow. A client told no definitively stops asking, where a 200 of unparseable JSON invites a reconnect loop. The Accept header separates that client from a human checking the URL, who still gets the useful info response. Authored in a parallel session; committed with its tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same rewrite as the hand-rolled route below: the live loop keeps the activate → model → practice → check arc as its spine, with evidence setting pacing inside it. One tool surface, one pedagogy, both transports say it identically. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
adamstankiewicz
force-pushed
the
feat/mcp-sdk-transport
branch
from
August 31, 2026 00:39
a432a39 to
9518e82
Compare
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.
What & why
Closes #92, in-stack. The tool surface moves to
src/lib/mcp/server.ts— one definition consumed by the deployed route, stdio, and the local HTTP server. The route becomes an 80-line Web-standard Streamable HTTP envelope overWebStandardStreamableHTTPServerTransport(stateless per request); 640 lines of hand-rolled JSON-RPC delete, andmcp/app.mjs— whose tool list had already drifted (14 kinds, no find_activity/build_pathway) — deletes with it. Both historical hand-rolling reasons are dead: the SDK ships a fetch-native transport, and_meta.uipasses through (per-call view URIs viaResourceTemplate).Also wires
pnpm mcp:inspect(official inspector) and preserves the audience-not-grade tool surface where this rewrite crossed it.Type of change
Breaking or contract changes
Wire-visible but protocol-legal: responses may arrive as SSE and the Accept header is enforced per spec (the SDK is stricter than our hand-rolled leniency — real hosts and the inspector already comply); unknown tools return a tool-result error rather than a protocol error. Tool names, schemas, and MCP Apps metadata are unchanged (inspector-verified).
How it was verified
pnpm test— 61 green, including the protocol-envelope suite rewritten as a spec-correct clientrm -rf .next && npx tsc --noEmit,pnpm build,pnpm mcp:build(emits the shared server-core bundle), lint_meta.uipresent, audience surface intact), and a realfind_activitycall — semantic ranking, ESS2.C verified, 11 listingsmcp/core.mjssmoke)Authorship
audiencecommit rather than clobbering itpackage.jsonchange is one devex script (mcp:inspect), no dependencies🤖 Generated with Claude Code