Back to Blog

Claude Desktop Can't Read Your Files? Fix MCP Filesystem Access in 5 Minutes

Notion
8 min read
AIDeveloper-ToolsOpen-SourceTutorial

Claude Desktop ships with filesystem tools that silently do nothing.

The Model Context Protocol (MCP) filesystem server is supposed to give Claude the ability to read, write, search, and navigate files on your machine. It's one of the most useful MCP integrations available. But if you manage Node.js with NVM, Homebrew, asdf, or fnm, there's a good chance it's broken right now — and Claude Desktop won't tell you why.

Instead of an error message, you get a Claude that claims it's running in a "sandboxed Linux container" with no access to your files. The MCP server connects, completes the handshake, reports 13 working tools, and then the process silently exits. No crash log. No warning. Just a broken promise.

This guide covers the exact root causes and the fix that takes under five minutes.

What Is MCP and Why Filesystem Access Matters

MCP (Model Context Protocol) is an open standard by Anthropic that lets AI assistants connect to external tools and data sources through a JSON-RPC interface. Think of it as a USB-C port for AI — a universal connector that any tool provider can implement.

The @modelcontextprotocol/server-filesystem package is the official MCP server for local file access. When working, it gives Claude these 13 tools:

  • read_file / read_text_file — Read file contents
  • read_multiple_files — Batch-read multiple files
  • write_file — Create or overwrite files
  • edit_file — Make targeted edits within a file
  • create_directory — Create directories
  • list_directory — List directory contents
  • directory_tree — Recursive tree view
  • move_file — Move or rename files
  • copy_file_user_to_claude — Copy files to Claude's sandbox
  • search_files — Search by name or content
  • get_file_info — File metadata (size, timestamps, permissions)
  • list_allowed_directories — Show configured access paths Without these tools, Claude Desktop is limited to whatever you paste into the chat window. With them, it becomes a proper coding assistant that can explore your project, read documentation, and write code directly to disk.

The Three Errors That Break MCP Filesystem

Error 1: npx Can't Find Node (ENOENT)

The most common configuration uses npx as the command to launch the filesystem server:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/"]
    }
  }
}

This fails silently because Claude Desktop does not inherit your shell's PATH. When you open a terminal, your .zshrc or .bashrc sets up NVM, which adds the correct Node.js version to your PATH. But Claude Desktop launches MCP servers as child processes with a minimal environment — it doesn't source your shell profile. The npx command either isn't found at all (ENOENT) or resolves to the wrong Node.js version.

Error 2: NVM Path Conflicts (Wrong Node Version)

Even if you use an absolute path to npx, NVM can cause version conflicts. Your terminal might show Node v22, but Claude Desktop's minimal PATH might resolve the NVM shim to Node v14 — which can't run the MCP SDK because it uses modern JavaScript syntax like logical assignment (&&=) that requires Node 15+.

The symptom: the server process starts but immediately crashes with a syntax error that never shows up in Claude Desktop's UI. You just see "Server Disconnected" in the MCP status.

Error 3: The Built-in Extension Crashes

Claude Desktop includes a built-in Filesystem Extension (ant.dir.ant.anthropic.filesystem) that's supposed to handle all of this automatically. It uses Claude Desktop's own "built-in Node.js" to run the server. The problem? It crashes.

Here's what the MCP log shows — a successful handshake followed by an unexplained disconnect:

[Filesystem] Server started and connected successfully
[Filesystem] Message from server: {"result":{"capabilities":{"tools":{}},...}}
[Filesystem] Message from client: {"method":"tools/list",...}
[Filesystem] Message from server: {"result":{"tools":[...13 tools...]}}
 
... 100ms to 9 minutes later ...
 
[Filesystem] Server transport closed unexpectedly
[Filesystem] Server disconnected.

The server reports 13 working tools, then the process exits. The Extension's wrapper script uses a dynamic ESM import (await import()) that appears to be incompatible with Claude Desktop's embedded Node.js runtime. This is a bug in the Extension itself, not your configuration.

The Fix: Bypass npx, Run the Server Directly

The solution is straightforward: install the server globally, find the exact file path to its entry point, and tell Claude Desktop to run it directly with your Node.js binary. No npx. No Extension. No PATH resolution games.

Step 1: Install the Server Globally

npm install -g @modelcontextprotocol/server-filesystem

If you use NVM, make sure you're on the Node version you want Claude Desktop to use (nvm use 22 or whatever version you prefer) before running this.

Step 2: Find Your Paths

Run these commands to get the two paths you need:

# Get your Node.js binary path
which node
# Example output: /Users/you/.nvm/versions/node/v22.12.0/bin/node
 
# Find the installed server entry point
npm ls -g @modelcontextprotocol/server-filesystem
# Then construct the path:
# {npm global prefix}/lib/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js
 
# Verify the file exists
ls $(dirname $(which node))/../lib/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js

Step 3: Edit claude_desktop_config.json

Open the config file:

# macOS
open ~/Library/Application\ Support/Claude/claude_desktop_config.json
 
# Windows
# %APPDATA%\Claude\claude_desktop_config.json
 
# Linux
# ~/.config/claude/claude_desktop_config.json

Add (or replace) the filesystem entry in mcpServers. Replace the paths with your actual paths from Step 2:

{
  "mcpServers": {
    "filesystem": {
      "command": "/Users/you/.nvm/versions/node/v22.12.0/bin/node",
      "args": [
        "/Users/you/.nvm/versions/node/v22.12.0/lib/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js",
        "/Users/you/Projects",
        "/Users/you/Documents"
      ],
      "env": {
        "PATH": "/Users/you/.nvm/versions/node/v22.12.0/bin:/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}

⚠️ **Security note: **The paths after dist/index.js in the args array are the directories Claude can access. Use / for full filesystem access, or list specific directories to restrict access. Only grant access to directories you trust Claude to read and write.

Three things make this config work:

  • command points directly to the Node.js binary — no PATH resolution needed
  • The first arg is the server's dist/index.js — bypasses npx entirely, starts instantly
  • env.PATH pins the correct Node version first, so any child processes also use the right version

Step 4: Disable the Built-in Extension

If the Filesystem Extension is enabled, it will conflict with your manual configuration (two servers fighting for the same tools). Disable it in Claude Desktop:

  • Open Claude Desktop Settings
  • Go to Extensions
  • Find "Filesystem" and toggle it off Or edit the Extension settings file directly at:
# macOS
~/Library/Application Support/Claude/Claude Extensions Settings/ant.dir.ant.anthropic.filesystem.json
 
# Set isEnabled to false:
{
  "isEnabled": false,
  "userConfig": {
    "allowed_directories": ["/"]
  }
}

Step 5: Restart Claude Desktop

Fully quit Claude Desktop (Cmd+Q on macOS, not just close the window) and reopen it. MCP servers only reconnect on a full restart.

How to Verify It Works

After restarting, check three things:

  • **MCP status indicator: **Click the plug icon (or MCP indicator) in Claude Desktop. The filesystem server should show a green dot with 13 tools listed.
  • **Test with a prompt: **Ask Claude "List the files in my home directory" or "Read the contents of ~/.zshrc". If it responds with actual file listings instead of claiming it's in a sandbox, the server is working.
  • **Check logs: **Open the MCP log at ~/Library/Logs/Claude/mcp*.log and look for "Secure MCP Filesystem Server running on stdio" — this confirms the server started successfully.

Bonus: What About mcp-registry and Chrome Errors?

You might see two other MCP errors in Claude Desktop that have nothing to do with your configuration:

  • "Could not connect to MCP server mcp-registry" — This is a hardcoded server built into the Claude Desktop Electron app. It's Anthropic's cloud directory for discovering MCP servers. It requires internet access and valid authentication. You cannot fix this in claude_desktop_config.json because it's not defined there. If it fails, ignore it — it doesn't affect your manually configured servers.
  • "Could not connect to MCP server Claude in Chrome" — Also hardcoded. This connects to the Claude browser extension via Chrome's native messaging protocol. If you don't have the Chrome extension installed (or Chrome isn't running), you'll see this error. Again, safe to ignore — it has no impact on filesystem access. Both of these are built-in Claude Desktop features, not user-configurable MCP servers. They appear in the error list alongside your actual servers, which is confusing, but they're separate systems entirely.

Full Working Config Reference

Here's a complete, working configuration for NVM users. Replace all paths with your actual paths:

{
  "mcpServers": {
    "filesystem": {
      "command": "/Users/you/.nvm/versions/node/v22.12.0/bin/node",
      "args": [
        "/Users/you/.nvm/versions/node/v22.12.0/lib/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js",
        "/Users/you/Projects",
        "/Users/you/Documents",
        "/Users/you/Desktop"
      ],
      "env": {
        "PATH": "/Users/you/.nvm/versions/node/v22.12.0/bin:/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}

The core insight: npx adds a layer of PATH resolution and package management that breaks in non-interactive environments like Claude Desktop. Bypassing it with a direct node path/to/dist/index.js invocation is instant, reliable, and immune to NVM version conflicts. The fix takes five minutes and survives Claude Desktop updates.