Fixing MCP Filesystem: Server Disconnected (Node via mise)
Introduction
If you’re using Claude Desktop and trying to enable filesystem access, you might run into this annoying error:
MCP filesystem: Server disconnected
In my case, I was using mise to manage my Node.js setup — and that ended up being the root of the problem. Claude couldn’t find the right node
or npx
binary because GUI apps don’t inherit the shell’s $PATH
.
Here’s exactly how I got it working.
What Was Going Wrong
Claude tries to run the filesystem plugin via npx
. But since my Node was installed through mise
, the npx
command wasn’t available to Claude, even though it worked fine in the terminal.
I also made the mistake of adding --yes
to the plugin args — which made things worse, because the plugin tried to treat that as a folder.
Step-by-Step Fix
1. Make sure Node.js is installed via mise
This is what I ran to install and set Node globally:
mise install node@lts
mise use -g node@lts
To double-check that Node is working and see where it’s coming from:
which node
Mine showed something like:
/Users/oz/.local/share/mise/installs/node/22.11.0/bin/node
If that’s what you see, you’re good.
2. Create a wrapper script for npx
Claude Desktop can’t see your shell environment, so we need to help it out a bit.
Create a script like this:
mkdir -p ~/bin/scripts
nano ~/bin/scripts/npx-for-claude
And paste this in:
#!/usr/bin/env bash
export PATH="/Users/oz/.local/share/mise/installs/node/22.11.0/bin:$PATH"
exec npx "$@"
Give it permission to run:
chmod +x ~/bin/scripts/npx-for-claude
This script makes sure the right version of npx
runs, even if Claude can’t see your terminal’s setup.
3. Tell Claude to use your script
Open your Claude config file:
~/Library/Application Support/Claude/claude_desktop_config.json
Update the filesystem
section to look like this:
{
"mcpServers": {
"filesystem": {
"command": "/Users/oz/bin/scripts/npx-for-claude",
"args": [
"@modelcontextprotocol/server-filesystem",
"/Users/oz/Desktop",
"/Users/oz/Downloads"
]
}
}
}
Make sure to replace /Users/oz/
with your actual username if it’s different.
Also important: don’t include --yes
here — I tried that at first and it broke everything. The plugin interpreted it as a folder name and crashed.
4. Run it once manually (optional)
To avoid Claude prompting you to install the plugin the first time, I just ran this myself once:
~/bin/scripts/npx-for-claude @modelcontextprotocol/server-filesystem /Users/oz/Desktop
That installed the plugin and made it easier to debug since I could see any errors directly.
5. Restart Claude Desktop
Once the config is set and the plugin is installed, quit Claude and open it again.
Then go to:
Settings → Developer → Filesystem
You should see:
filesystem: ✅ connected
It finally worked 🎉
Troubleshooting Tips
If you still get errors, here’s what helped me debug:
-
Make sure the script path is correct and executable
-
Add a simple debug log to the script:
echo "[Claude MCP] Running..." >> /tmp/claude.log exec npx "$@" >> /tmp/claude.log 2>&1
-
Check the Claude logs (Settings → Open Logs Folder)
-
Remove any bad flags like
--yes
from the config
References
Final Thoughts
This took longer than I expected to figure out, but once I realized Claude didn’t inherit my terminal’s environment, everything clicked. If you're using a Node version manager like mise
, that little wrapper script is all you need to get filesystem access working again.
Hope this saves someone a few hours of debugging.