fix(mcp): execute tool dies on Deno >= 2 (unix socket needs net permission)#100
Conversation
…ssion) Deno 2.x moved unix sockets under the net permission: listening on the socket that deno-http-worker uses to talk to the sandbox now requires --allow-net=unix:<path>. The library (0.0.21, and still 2.0.3) only grants the socket via --allow-read/--allow-write — the Deno 1.x model — so on any modern Deno every execute call fails with 'Deno exited before being ready' (NotCapable: Requires net access to unix:...). Health checks and tools/list still pass, so the breakage is silent. The socket path is generated inside newDenoHTTPWorker, so we can't scope a flag up front (Deno only accepts exact socket paths, no globs/prefixes, and rejects repeated --allow-net flags). Instead, use the library's spawnFunc hook to pluck the socket path out of the --allow-write flag it injects and graft unix:<sock> onto the existing --allow-net scope at spawn time. Gated on Deno major >= 2 because Deno 1.46 panics outright on a unix: token in --allow-net. Verified end-to-end over MCP stdio against Deno 2.9.3: published 0.40.0 fails, this build returns results; fetch to a non-allowlisted host is still denied (sandbox scoping unchanged). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Firetiger has created a monitoring plan for this PR. |
Confidence Score: 5/5 - Safe to MergeSafe to merge — this PR correctly addresses a runtime permission failure on Deno >= 2 where unix socket connections require an explicit Key Findings:
|
|
Superseded by #101. This fix works on Deno ≥ 2.9 but the |
|
Firetiger is already monitoring this PR at change monitor. I'll watch for deployments and start monitoring when this PR merges. |
|
Review — Cubert (interactive path, node-sdk) Verdict: LGTM. Root cause and fix both check out. Verified independently:
Checks: Entelligence 5/5 (Safe to Merge), One durability note (not a blocker): Not stamping a formal approval here — node-sdk is outside the |
Problem
Every
executecall on@hyperspell/hyperspell-mcp@0.40.0fails with "Deno exited before being ready" on any modern Deno (found during the 2026-07-16 MCP/CLI test battery). The failure is silent — health checks andtools/liststill report the server as connected.Root cause: Deno 2.x moved unix sockets under the net permission. Listening on the socket
@valtown/deno-http-workeruses to talk to the sandbox now requires--allow-net=unix:<path>, but the library (0.0.21 — and still 2.0.3, so a version bump does not fix this; verified empirically) only grants the socket via--allow-read/--allow-write, the Deno 1.x model:Fix
The socket path is generated inside
newDenoHTTPWorker, so no flag can be scoped up front — Deno accepts only exact socket paths (no globs or directory prefixes) and rejects repeated--allow-netflags. Instead, use the library'sspawnFunchook: at spawn time, pluck the socket path out of the--allow-writeflag the library injects and graftunix:<sock>onto the existing--allow-netscope (comma-merged into the one flag).Gated on Deno major ≥ 2: Deno 1.46 panics on a
unix:token in--allow-net(tested), and on 1.x the old read/write grant still works.Verification (all against Deno 2.9.3, driven over real MCP stdio JSON-RPC)
0.40.0,tools/call execute(return 6 * 7)Deno exited before being ready42fetch('https://example.com')from executed codeNotCapable: Requires net access to "example.com:443") — sandbox scoping unchanged@valtown/deno-http-worker@2.0.3(the "just bump it" theory)unix:token in--allow-netpnpm lintandpnpm testpass; file is prettier-clean.🤖 Generated with Claude Code