You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: full MCP transport/spec parity for @jimhoyd/urlcode-mcp (streaming, batching, pagination, resources/prompts) #626
enhancementNew feature or requestextensionInvolves an extension or companion package (store, ui, auth, admin)needs-decisionWaiting on a maintainer decision before work can proceed
#573 added @jimhoyd/urlcode-mcp (PR #625), a declarative extension that serves a bounded set of project-declared tools as an MCP JSON-RPC-over-HTTP server. It was deliberately scoped to a minimal, correct core: JSON-RPC 2.0 framing, exact request-id handling, protocol version negotiation, and initialize/ping/tools/list/tools/call.
Several parts of the MCP specification are explicitly not implemented in v1 (documented in packages/mcp/README.md under "What this does not implement"), so a client that needs them cannot be served today:
The Streamable HTTP transport's optional GET/SSE stream for server-initiated messages, and Mcp-Session-Id session resumption. A GET to the mount currently answers 405.
tools/list pagination (cursor) — the whole declared tool set is returned in one page, which is fine for the current bounded (≤64) tool cap but not spec-complete.
Tool outputSchema / structuredContent — a tool result is always a single text content block today.
The resources and prompts MCP primitives.
JSON-RPC batching (arrays of requests) is refused outright; note the 2025-06-18 MCP revision itself removed batching, so this one may not need fixing, just re-confirming against whatever revision is current when this is picked up.
Proposed behavior and alternatives
Prioritize based on real client needs rather than implementing the full spec speculatively — the extension's whole design goal is staying a minimal, bounded declarative surface ("MCP over HTTP becomes declarative", not a full-featured MCP server). SSE/session resumption is likely the highest-value gap for long-lived agent clients; pagination and outputSchema are lower effort. Each should get its own focused interoperability test the way packages/mcp/test/mcp.test.ts already covers the implemented subset.
See PR #625 and issue #573 for the current implementation and design record.
Investigation: SSE/streaming transport + Mcp-Session-Id resumption
Following up on the scope PR #654 left open. I read packages/mcp/src/mcp.ts, the
generic extension contract (packages/core/src/extensions.ts), HandlerResult
(packages/core/src/http-response.ts), and all three hosts that currently accept
extensions — packages/core/server.ts, vercel.ts, aws.ts — plus docs/RUNTIME-IMPLEMENTATION.md and packages/core/src/capabilities.ts's
per-target native/delegated/refused reporting. I'm not opening a PR for this;
per the issue's own guidance I'd rather report what I found than land a
core-seam change I'm not confident is correct on every target.
The core gap is real, and it splits into two independent problems
HandlerResult is a single buffered value, not a stream.ExtensionInstance.handle()
returns one HandlerResult ({status, headers, body?}) that every host awaits in
full before writing a response. There's no seam anywhere in prepareResponse/ writeResponse for "send bytes now, more bytes later, close whenever."
There is no session/connection registry anywhere in core. Every host activates
one Runtime and calls handle() per request with no persistent per-connection
state. Mcp-Session-Id resumption needs a live registry mapping a session id to
pending/replayable server-initiated messages (and Last-Event-ID replay on
reconnect) that outlives a single request — this doesn't exist today at any layer.
Per-target feasibility is not uniform — this is the risk
server.ts (Node): real http.ServerResponse. Chunked, long-lived writes are
architecturally straightforward — res.write() before res.end() already works at
the transport level. But prepareResponse computes Content-Length up front and
the server has requestTimeoutMs/headersTimeoutMs socket-destroy timers and an inFlight admission counter (maxInFlightRequests) tuned for short buffered
requests, not long-lived SSE connections. A streaming HandlerResult variant would
need its own admission/timeout treatment, or a long-lived SSE stream will either get
killed by requestTimeoutMs or exhaust the in-flight budget.
vercel.ts: same node:http transport as server.ts (this is the Vercel Node
function runtime, not Edge/Response-streaming), so the same approach applies in
principle — but Vercel's Node function runtime has its own platform-imposed max
execution duration, which makes a long SSE connection more of an operational caveat
than a hard blocker. That caveat needs to be surfaced the same way policies.throttle's partition: route is reported delegated rather than native in capabilities.ts, not silently promised.
aws.ts: this is the real blocker. createLambdaHandler is payload-format-2.0
classic Lambda: one JSON event in, one Promise<LambdaResponse> (a single JSON
object, base64 body) out. That invocation model cannot stream at all — true Lambda
response streaming needs awslambda.streamifyResponse(), only reachable via
Function URLs with InvokeMode: RESPONSE_STREAM, which is a different handler
export shape ((event, responseStream, context), writing to a Node Writable),
not an incremental change to the existing handler. Supporting SSE on aws isn't a
"add a stream field" change; it's effectively a second Lambda entry point with its
own event shape, own docs, own tests. Per docs/RUNTIME-IMPLEMENTATION.md's own directive ("a runtime must either reproduce a
declared capability and pass its fixtures, or refuse that capability before
serving"), the correct near-term behavior is for aws to keep refusing the GET/SSE
stream (as it already implicitly does — no GET support at all) while tools/call
keeps working over POST, same as today.
cloudflare.ts: not actually in scope here. packages/core/src/extensions.ts's prepareExtensions hard-asserts registration.targets can only contain 'node' | 'aws' | 'vercel' — Cloudflare Workers don't run RuntimeExtensions at
all today (the Cloudflare artifact path is a separately compiled route table with
no extension concept). So @jimhoyd/urlcode-mcp was never reachable on Cloudflare
in the first place; no work needed there for this issue, but it means "3 runtime
targets" for this feature is actually node + vercel (real streaming candidates) and
aws (structural refusal), not 4.
Why I'm not implementing this now
Getting all of the above right in one PR — a new streaming capability on HandlerResult/ExtensionInstance, admission/timeout treatment for long-lived
connections on server.ts, the Vercel caveat reported correctly through capabilities.ts, explicit aws refusal wired through the same native/ delegated/refused machinery policies.throttle already uses, and a
session-id registry with bounded memory, TTL/eviction and Last-Event-ID replay in packages/mcp on top of it — is a lot of new surface to land correctly and prove
with real HTTP round-trip tests (including a reconnect-after-restart resumption
test) in a single change. Getting the admission/timeout interaction wrong on server.ts risks breaking ordinary buffered requests, which matters far more than
closing this issue today.
Recommended scoped next step
Split this into two pieces so the risky part is reviewable on its own:
A core-only PR: add an explicitly additive streaming capability to HandlerResult/ExtensionInstance (e.g. an optional async-iterable/stream body
variant), consumed only by server.ts and vercel.ts, with its own
admission/timeout handling, refused by aws.ts, and reported through capabilities.ts's existing native/delegated/refused vocabulary (vercel
likely delegated with the max-duration caveat named, awsrefused). This gets
its own RIM-* card in docs/RUNTIME-IMPLEMENTATION.md and a focused fixture,
per the semantic-seam rule in AGENTS.md, independent of MCP.
A follow-up packages/mcp-only PR that consumes that capability for the
GET/SSE stream and adds the Mcp-Session-Id registry (bounded, in-memory,
extension-owned — this part doesn't need a further core change beyond the
streaming primitive itself).
I'd suggest keeping #626 scoped to (2) and filing a new issue for (1), since (1) is
a generic core capability with no MCP-specific content and deserves its own
review/fixtures independent of this package. Happy to file that core-capability
issue if that's the preferred split — flagging here first since it's a call about
how to slice the remaining work rather than a pure implementation detail.
Decision (owner, 2026-09-24): streaming is out of scope for now. Everything else here shipped: pagination, outputSchema/structuredContent, resources and prompts (#654); Origin and MCP-Protocol-Version checks (#685); title/annotations (#687); handler request context (#691). Batching stays refused (dropped from the 2025-06-18 spec). Streaming, sessions and the GET stream remain parked under #659. Closing as completed.
enhancementNew feature or requestextensionInvolves an extension or companion package (store, ui, auth, admin)needs-decisionWaiting on a maintainer decision before work can proceed
Activity
feat(mcp): resources/prompts, outputSchema, and list pagination (#626) (
jimhoyd commentedon Sep 24, 2026
Investigation: SSE/streaming transport +
Mcp-Session-IdresumptionFollowing up on the scope PR #654 left open. I read
packages/mcp/src/mcp.ts, thegeneric extension contract (
packages/core/src/extensions.ts),HandlerResult(
packages/core/src/http-response.ts), and all three hosts that currently acceptextensions —
packages/core/server.ts,vercel.ts,aws.ts— plusdocs/RUNTIME-IMPLEMENTATION.mdandpackages/core/src/capabilities.ts'sper-target
native/delegated/refusedreporting. I'm not opening a PR for this;per the issue's own guidance I'd rather report what I found than land a
core-seam change I'm not confident is correct on every target.
The core gap is real, and it splits into two independent problems
HandlerResultis a single buffered value, not a stream.ExtensionInstance.handle()returns one
HandlerResult({status, headers, body?}) that every host awaits infull before writing a response. There's no seam anywhere in
prepareResponse/writeResponsefor "send bytes now, more bytes later, close whenever."one
Runtimeand callshandle()per request with no persistent per-connectionstate.
Mcp-Session-Idresumption needs a live registry mapping a session id topending/replayable server-initiated messages (and
Last-Event-IDreplay onreconnect) that outlives a single request — this doesn't exist today at any layer.
Per-target feasibility is not uniform — this is the risk
server.ts(Node): realhttp.ServerResponse. Chunked, long-lived writes arearchitecturally straightforward —
res.write()beforeres.end()already works atthe transport level. But
prepareResponsecomputesContent-Lengthup front andthe server has
requestTimeoutMs/headersTimeoutMssocket-destroy timers and aninFlightadmission counter (maxInFlightRequests) tuned for short bufferedrequests, not long-lived SSE connections. A streaming
HandlerResultvariant wouldneed its own admission/timeout treatment, or a long-lived SSE stream will either get
killed by
requestTimeoutMsor exhaust the in-flight budget.vercel.ts: samenode:httptransport asserver.ts(this is the Vercel Nodefunction runtime, not Edge/
Response-streaming), so the same approach applies inprinciple — but Vercel's Node function runtime has its own platform-imposed max
execution duration, which makes a long SSE connection more of an operational caveat
than a hard blocker. That caveat needs to be surfaced the same way
policies.throttle'spartition: routeis reporteddelegatedrather thannativeincapabilities.ts, not silently promised.aws.ts: this is the real blocker.createLambdaHandleris payload-format-2.0classic Lambda: one JSON event in, one
Promise<LambdaResponse>(a single JSONobject, base64 body) out. That invocation model cannot stream at all — true Lambda
response streaming needs
awslambda.streamifyResponse(), only reachable viaFunction URLs with
InvokeMode: RESPONSE_STREAM, which is a different handlerexport shape (
(event, responseStream, context), writing to a NodeWritable),not an incremental change to the existing handler. Supporting SSE on
awsisn't a"add a stream field" change; it's effectively a second Lambda entry point with its
own event shape, own docs, own tests. Per
docs/RUNTIME-IMPLEMENTATION.md's own directive ("a runtime must either reproduce adeclared capability and pass its fixtures, or refuse that capability before
serving"), the correct near-term behavior is for
awsto keep refusing the GET/SSEstream (as it already implicitly does — no GET support at all) while
tools/callkeeps working over POST, same as today.
cloudflare.ts: not actually in scope here.packages/core/src/extensions.ts'sprepareExtensionshard-assertsregistration.targetscan only contain'node' | 'aws' | 'vercel'— Cloudflare Workers don't runRuntimeExtensions atall today (the Cloudflare artifact path is a separately compiled route table with
no extension concept). So
@jimhoyd/urlcode-mcpwas never reachable on Cloudflarein the first place; no work needed there for this issue, but it means "3 runtime
targets" for this feature is actually node + vercel (real streaming candidates) and
aws (structural refusal), not 4.
Why I'm not implementing this now
Getting all of the above right in one PR — a new streaming capability on
HandlerResult/ExtensionInstance, admission/timeout treatment for long-livedconnections on
server.ts, the Vercel caveat reported correctly throughcapabilities.ts, explicitawsrefusal wired through the samenative/delegated/refusedmachinerypolicies.throttlealready uses, and asession-id registry with bounded memory, TTL/eviction and
Last-Event-IDreplay inpackages/mcpon top of it — is a lot of new surface to land correctly and provewith real HTTP round-trip tests (including a reconnect-after-restart resumption
test) in a single change. Getting the admission/timeout interaction wrong on
server.tsrisks breaking ordinary buffered requests, which matters far more thanclosing this issue today.
Recommended scoped next step
Split this into two pieces so the risky part is reviewable on its own:
HandlerResult/ExtensionInstance(e.g. an optional async-iterable/stream bodyvariant), consumed only by
server.tsandvercel.ts, with its ownadmission/timeout handling, refused by
aws.ts, and reported throughcapabilities.ts's existingnative/delegated/refusedvocabulary (vercellikely
delegatedwith the max-duration caveat named,awsrefused). This getsits own
RIM-*card indocs/RUNTIME-IMPLEMENTATION.mdand a focused fixture,per the semantic-seam rule in AGENTS.md, independent of MCP.
packages/mcp-only PR that consumes that capability for theGET/SSE stream and adds the
Mcp-Session-Idregistry (bounded, in-memory,extension-owned — this part doesn't need a further core change beyond the
streaming primitive itself).
I'd suggest keeping #626 scoped to (2) and filing a new issue for (1), since (1) is
a generic core capability with no MCP-specific content and deserves its own
review/fixtures independent of this package. Happy to file that core-capability
issue if that's the preferred split — flagging here first since it's a call about
how to slice the remaining work rather than a pure implementation detail.
jimhoyd commentedon Sep 24, 2026
Decision (owner, 2026-09-24): streaming is out of scope for now. Everything else here shipped: pagination, outputSchema/structuredContent, resources and prompts (#654); Origin and MCP-Protocol-Version checks (#685); title/annotations (#687); handler request context (#691). Batching stays refused (dropped from the 2025-06-18 spec). Streaming, sessions and the GET stream remain parked under #659. Closing as completed.
Streaming responses for extensions and trusted functions, and the opt…