Pool stdio MCP connections between tool calls - #1861
Merged
Conversation
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 5632b28 | Commit Preview URL Branch Preview URL |
Aug 30 2026, 12:11 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 5632b28 | Aug 30 2026, 12:12 AM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@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
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.
Every tool call on a stdio MCP integration spawned a fresh child process, ran the full MCP handshake, called one tool, and tore the child down. Measured with
@modelcontextprotocol/server-everythingon the local daemon: 875–897ms on every call of a no-opecho, flat. This is the desktop/local host only — cloud disables stdio — and it is the dominant per-call overhead for anyone runningnpx-launched servers.Plain stdio now joins the existing connection pool that remote and app-server connections already use: same five-minute idle window, same hashed identity key, same drop-on-transport-failure semantics. Identity separates on command, args, cwd, secret env, credential values, template, owner, and connection, and plain stdio never shares a session with the app-server bridge. Per-call elicitation handlers were already rebound on each pooled use, so reuse changes no elicitation behavior.
Opt-out:
spawnPerCall: truein the stdio config (also accepted by the add-server API) restores fresh-process-per-call for servers that depend on it. The app-server bridge ignores the flag — its approvals are session state.Measured on this branch, same server and tool:
echo, first callecho, subsequent callsNew tests pin the poolability predicate (default on, opt-out honored, bridge always pooled) and the stdio key separation properties (secret env, command/args/cwd, bridge-vs-plain, owner).
Codex plugin compatibility (checked against #1837/#1858/#1859): curated plugins ride the app-server bridge and were pooled before this change — no behavior change. Scanned cache plugins spawn their own MCP server binary and now pool like any stdio server; their tests pass and none rely on fresh-process semantics. One noted shift: after a plugin update moves the versioned cache dir, a parked child keeps serving until the idle window or a transport failure drops it, so the "command missing" health signal appears on the next fresh dial rather than on the very next call.