Stream local MCP responses so native elicitation reaches the client - #1556
Merged
Conversation
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 95ec9d8 | Aug 07 2026, 08:18 PM |
Deploying with
|
| 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 |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
@executor-js/codemode-core
@executor-js/runtime-quickjs
executor
commit: |
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.
Fixes #1555.
Native elicitation over the local daemon's HTTP MCP endpoint never reached the client:
executeon a policy-gated tool failed with-32001: Request timed outwhile the session had correctly negotiatedelicitation_mode=nativeand the client'selicitation.formcapability.Cause
apps/local/src/mcp.tsbuilt the Streamable HTTP transport withenableJsonResponse: true. In the MCP SDK that mode stores only aresolveJsoncallback for the POST — no stream controller or encoder.send()gates every server-to-client write on!enableJsonResponse && stream?.controller, so anelicitation/createraised during atools/callwas 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
enableJsonResponseand use the spec-default SSE streaming, so the reverse request rides the originating tool call's stream. Clients must already accepttext/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 existingcloudflare/mcp-native-elicitation.test.ts, covering accept, decline, and cancel. It fails on the parent commit with the reported-32001timeout and passes with the fix.apps/localunit: 71 passed;packages/hosts/mcp: 187 passedtypecheck,lint,format:checkcleanlocal/mcp-browser-approveandlocal/stdio-mcpstill pass (same transport, so they were the regression risk)Notes
local/toolkits-mcp.test.tsfails 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:261still setsenableJsonResponse: truefor 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.