fix(mcp): preflight filesystem sandbox dir + offer mkdir in wizard (#362)#379
Merged
Conversation
) The official @modelcontextprotocol/server-filesystem refuses to start when its sandbox directory is missing and prints a raw Node stack trace, leaving the user without an actionable next step. - preflightStdioSpec validates every positional path arg before spawn and throws a one-line error: "create it with: mkdir -p '<path>'" - The first-run / reconfigure wizard now stat()s the directory the user typed for filesystem MCP and offers Y/Enter to mkdir -p, N/Esc to enter a different path.
esengine
added a commit
that referenced
this pull request
May 7, 2026
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
…sengine#362) (esengine#379) The official @modelcontextprotocol/server-filesystem refuses to start when its sandbox directory is missing and prints a raw Node stack trace, leaving the user without an actionable next step. - preflightStdioSpec validates every positional path arg before spawn and throws a one-line error: "create it with: mkdir -p '<path>'" - The first-run / reconfigure wizard now stat()s the directory the user typed for filesystem MCP and offers Y/Enter to mkdir -p, N/Esc to enter a different path.
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
Ink 7 + React 19 chat scroll rewrite (esengine#380), configurable web_search backend with SearXNG (esengine#338), MCP filesystem sandbox preflight + wizard mkdir confirm (esengine#362, PR esengine#379), README URL fix (esengine#375), bug template update (esengine#378).
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.
Closes #362.
Why
The official
@modelcontextprotocol/server-filesystemrefuses to start when its sandbox directory doesn't exist and prints a raw Node stack trace from insidenpx's child:The user has no idea what to do, and we're partly responsible: our wizard suggests
/tmp/reasonix-sandboxas a placeholder, then saves whatever the user types into~/.reasonix/config.jsonwithout checking it.What changes
Two-layer fix.
1. Wizard input-time validation (
src/cli/ui/Wizard.tsx)When the filesystem MCP server's directory arg is submitted:
[Y/Enter] create it (mkdir -p)/[N/Esc] enter a different path2. Spawn-time fallback (
src/mcp/preflight.ts+ 3 call sites)preflightStdioSpec(spec)runs right beforenew StdioTransport(...)inchat.tsx,run.ts, andmcp-inspect.ts. If a stdio spec contains@modelcontextprotocol/server-filesystem, every positional path arg isstated; missing → throwsThe existing per-call-site catch already surfaces this as a
failedMCP lifecycle event, so users see the actionable message in the same place they currently see the raw stack.The spawn-time path deliberately does not auto-mkdir: at that point the user might be running with a stale config they don't remember writing, and silently creating directories on their behalf is too magic. The wizard is the right place to ask before creating.
Tests
tests/mcp-preflight.test.ts— 6 cases:Test plan
npx vitest run tests/mcp-preflight.test.ts— 6/6 passnpx vitest run— full suite 2430 pass / 5 skippedtsc --noEmitcleanbiome checkclean on touched filesbunx reasonix codewith a stale config pointing at a missing dir → actionable error instead of raw Node stackreasonix init→ pick filesystem → enter a missing path → Y creates it, N returns to input