fix(mcp): execute tool dies on Deno >= 2.9 (unix sockets moved behind net permission)#101
Merged
Merged
Conversation
|
Firetiger has created a monitoring plan for this PR. |
Confidence Score: 5/5 - Safe to MergeSafe to merge — this PR correctly addresses a compatibility break introduced in Deno >= 2.9 where Unix socket access was moved behind a Key Findings:
|
… net permission) Deno 2.9.0 moved unix sockets behind the net permission as part of the 2.8.2-2.9.1 socket-hardening series (denoland/deno#34395, #35835). deno-http-worker (0.0.21 and 2.0.3 alike) still grants its Node<->sandbox socket via --allow-read/--allow-write, so on Deno >= 2.9 every execute call dies at startup: 'Deno exited before being ready' (NotCapable). Health checks and tools/list still pass, so the breakage is silent. The socket path is generated inside newDenoHTTPWorker and Deno accepts only exact socket paths (no globs) with no repeated --allow-net flags, so no flag can be scoped up front. Use the library's spawnFunc hook to pluck the socket path from the injected --allow-write flag and comma-merge unix:<sock> onto the existing --allow-net scope. Gated on Deno >= 2.9 exactly: 2.0-2.8 reject the unix: token at startup ('invalid port') and 1.x panics on it, while their legacy read/write grant keeps working. Verified end-to-end over MCP stdio: published 0.40.0 fails on 2.9.3; this build returns results on both 2.8.3 and 2.9.3; a >=2 gate (the naive fix) provably breaks 2.8.3; non-allowlisted fetch stays denied. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dithilli
force-pushed
the
david/mcp-execute-deno29-unix-net-gate
branch
from
July 17, 2026 00:56
e20f878 to
9ecd689
Compare
Merged
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.
Supersedes #100, which fixed Deno 2.9 but would have broken 2.0–2.8.
Problem
Every
executecall on@hyperspell/hyperspell-mcp@0.40.0fails with "Deno exited before being ready" on Deno ≥ 2.9 (found in the 2026-07-16 MCP/CLI test battery). Silent: health checks andtools/liststill pass.Root cause — pinned down empirically and against Deno's changelog: Deno 2.9.0 moved unix sockets behind the net permission (
--allow-net=unix:<path>), part of the 2.8.2–2.9.1 socket-hardening series (denoland/deno#34395, #35835).@valtown/deno-http-worker— 0.0.21 and latest 2.0.3, so a dependency bump is not a fix — still grants its Node↔sandbox socket via--allow-read/--allow-write.Fix
The socket path is generated inside
newDenoHTTPWorker; Deno accepts only exact socket paths (no globs/prefixes) and rejects repeated--allow-netflags — so nothing can be scoped up front. Instead use the library'sspawnFunchook: extract the socket path from the--allow-writeflag it injects and comma-mergeunix:<sock>onto the existing--allow-netscope at spawn time.Gated on Deno ≥ 2.9 exactly. This is the critical difference from #100: Deno 2.0–2.8 reject the
unix:token at startup (invalid port) and 1.x panics on it — while their legacy read/write grant still works.Verification (real MCP stdio JSON-RPC, real
executecalls)Deno exited before being ready>= 2gate)invalid port in 'unix:…'>= 2.9gate)4242Version bracket (worker-level): 2.0.1 / 2.4.4 / 2.6.8 / 2.8.3 all work with legacy grants and all reject the
unix:token; enforcement starts at 2.9.0. Sandbox unchanged:fetch('https://example.com')from executed code still denied (NotCapable).pnpm lint+pnpm testpass; prettier-clean.Follow-ups (separate): upstream this into the stlc-mcp codegen source (
packages/sdk-codegen-typescript/src/mcp/code-tool.ts) so regen doesn't clobber it, and offer the fix to val-town/deno-http-worker.🤖 Generated with Claude Code