Skip to content

Stream local MCP responses so native elicitation reaches the client - #1556

Merged
RhysSullivan merged 2 commits into
mainfrom
repro-1555-local-native-elicitation
Aug 7, 2026
Merged

Stream local MCP responses so native elicitation reaches the client#1556
RhysSullivan merged 2 commits into
mainfrom
repro-1555-local-native-elicitation

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Fixes #1555.

Native elicitation over the local daemon's HTTP MCP endpoint never reached the client: execute on a policy-gated tool failed with -32001: Request timed out while the session had correctly negotiated elicitation_mode=native and the client's elicitation.form capability.

Cause

apps/local/src/mcp.ts built the Streamable HTTP transport with enableJsonResponse: true. In the MCP SDK that mode stores only a resolveJson callback for the POST — no stream controller or encoder. send() gates every server-to-client write on !enableJsonResponse && stream?.controller, so an elicitation/create raised during a tools/call was dropped on the floor. The buffered response then never resolved, because the tool was blocked waiting on the elicitation that never went out, and the call sat until the client's timeout.

PR #1522 fixed the equivalent routing for Cloudflare; the local host still had the flag.

Fix

Drop enableJsonResponse and use the spec-default SSE streaming, so the reverse request rides the originating tool call's stream. Clients must already accept text/event-stream — the transport rejects a POST that does not — so no client compatibility is lost.

Tests

Adds e2e/local/mcp-native-elicitation.test.ts, a local-target mirror of the existing cloudflare/mcp-native-elicitation.test.ts, covering accept, decline, and cancel. It fails on the parent commit with the reported -32001 timeout and passes with the fix.

  • apps/local unit: 71 passed; packages/hosts/mcp: 187 passed
  • typecheck, lint, format:check clean
  • local/mcp-browser-approve and local/stdio-mcp still pass (same transport, so they were the regression risk)

Notes

  • local/toolkits-mcp.test.ts fails with a 500 on this branch, but fails identically on an unmodified tree — pre-existing, unrelated, not addressed here.
  • packages/hosts/mcp/src/in-memory-session-store.ts:261 still sets enableJsonResponse: true for the self-host path, which likely has the same bug. Left alone as out of scope; there is no native-elicitation e2e coverage on self-host to prove it either way.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 95ec9d8 Aug 07 2026, 08:18 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 95ec9d8 Commit Preview URL

Branch Preview URL
Aug 07 2026, 08:18 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1556

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1556

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1556

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1556

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1556

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1556

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1556

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1556

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1556

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1556

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1556

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1556

executor

npm i https://pkg.pr.new/executor@1556

commit: 95ec9d8

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 7, 2026 21:43
@RhysSullivan
RhysSullivan merged commit f674fb8 into main Aug 7, 2026
21 checks passed
@RhysSullivan
RhysSullivan deleted the repro-1555-local-native-elicitation branch August 7, 2026 21:43
@RhysSullivan RhysSullivan mentioned this pull request Aug 7, 2026
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.

Local HTTP MCP native elicitation times out before reaching client

1 participant