If you use Claude Desktop to edit code, write patches, or build plugin files, you have probably hit the same wall I did: Claude runs in a sandboxed Linux container. It cannot read or write files on your Mac. Every session resets. There is no shared folder. You end up copy pasting sed commands or trying to download patch files that never seem to land in your Downloads folder.
The solution is the Model Context Protocol filesystem server. It runs locally on your Mac and gives Claude direct read and write access to a directory you choose. Once set up, Claude can edit your repo files, generate patches, and build outputs directly on your machine.
Here is how to set it up in under five minutes.
1. Prerequisites
You need Node.js installed. Check with:
node --version
If you do not have it, install it from nodejs.org or via Homebrew:
brew install node
You also need Claude Desktop installed and updated to the latest version.
2. Create the Configuration File
Claude Desktop reads its MCP server configuration from a JSON file. Run this command in your terminal, replacing the directory path with wherever you want Claude to have access:
cat > ~/Library/Application\ Support/Claude/claude_desktop_config.json << 'EOF'
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/YOUR_USERNAME/Desktop/github"
]
}
}
}
EOF
Replace YOUR_USERNAME with your actual macOS username. You can find it by running whoami in the terminal.
You can grant access to multiple directories by adding more paths to the args array:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/YOUR_USERNAME/Desktop/github",
"/Users/YOUR_USERNAME/Projects"
]
}
}
}
If you already have a claude_desktop_config.json with other MCP servers configured, add the filesystem block inside the existing mcpServers object rather than overwriting the file.
3. Restart Claude Desktop
This is important. You must fully quit Claude Desktop with Cmd+Q (not just close the window) and reopen it. The MCP server configuration is only loaded at startup.
4. What to Say to Claude to Verify and Use the MCP Filesystem
Here is the honest truth about what happened when I first tested this. I opened Claude Desktop and typed:
List the files in my github directory
Claude told me it could not access my MacBook’s filesystem. It gave me instructions on how to use ls in Terminal instead. The MCP filesystem server was running and connected, but Claude defaulted to its standard response about being sandboxed.
I had to nudge it. I replied:
What about the MCP?
That was all it took. Claude checked its available tools, found the MCP filesystem server, called list_allowed_directories to discover the paths, and then listed my files directly. From that point on it worked perfectly for the rest of the conversation.
The lesson is that Claude does not always automatically reach for MCP tools on the first ask. If Claude tells you it cannot access your files, remind it that you have MCP configured. Once it discovers the filesystem tools, it will use them naturally for the rest of the session.
After the initial nudge, everything becomes conversational. You can ask Claude to:
Show me the contents of my README.md file
What is in the config directory?
Read my package.json and tell me what dependencies I have
Claude can also write files directly to your Mac. This is where MCP becomes genuinely powerful compared to the normal sandboxed workflow:
Create a new file called notes.txt in my github directory with a summary of what we discussed
Edit my script.sh and add error handling to the backup function
Write a new Python script called cleanup.py that deletes log files older than 30 days
You do not need special syntax or commands. Claude figures out which MCP tool to call based on what you ask for. But be prepared to remind it on the first message of a new conversation that MCP is available. Once it clicks, it just works.
If Claude still cannot find the filesystem tools after you mention MCP, the server is not connected. Go back to the troubleshooting section and verify your configuration file is valid JSON, Node.js is installed, and you fully restarted Claude Desktop with Cmd+Q.
5. Why This Matters: What I Actually Use This For
I maintain several WordPress plugins across multiple GitHub repos. Before setting up MCP, getting Claude’s changes onto my machine was a nightmare. Here is what I went through before finding this solution.
The Pain Before MCP
Patch files that never download. Claude generates patch files and presents them as downloadable attachments in the chat. The problem is clicking the download button often does nothing. The file simply does not appear in ~/Downloads. I spent a solid 20 minutes trying ls ~/Downloads/*.patch and find commands looking for files that were never there.
sed commands that break in zsh. When patch files failed, Claude would give me sed one liners to apply changes. Simple ones worked fine. But anything involving special characters, single quotes inside double quotes, or multiline changes would hit zsh parsing errors. One attempt produced zsh: parse error near '}' because the heredoc content contained curly braces that zsh tried to interpret.
Base64 encoding that is too long to paste. When sed failed, we tried base64 encoding the entire patch and piping it through base64 -d. The encoded string was too long for the terminal. zsh split it across lines and broke the decode. We were solving problems that should not exist.
Copy paste heredocs that corrupt patches. Git patches are whitespace sensitive. A single missing space or an extra newline from copy pasting into the terminal will cause git apply to fail silently or corrupt your files. This is not a theoretical risk. It happened.
No shared filesystem. Claude runs in a sandboxed Linux container that resets between sessions. My files are on macOS. There is no mount, no symlink, no shared folder. We tried finding where Claude Desktop stores its output files on the Mac filesystem by searching ~/Library/Application Support/Claude. We found old session directories with empty outputs folders. Nothing bridged the gap.
What I Do Now With MCP
With the filesystem MCP server running, Claude reads and writes files directly in my local git repo. Here is my actual workflow for plugin development:
Direct code editing. I tell Claude to fix a bug or add a feature. It opens the file in my local repo clone at ~/Desktop/github/cloudscale-page-views/repo, makes the edit, and I can see the diff immediately with git diff. No intermediary files, no transfers.
CSS debugging with browser console scripts. Claude gives me JavaScript snippets to paste into the browser DevTools console to diagnose styling issues. We used getComputedStyle to find that two tabs had different font sizes (12px vs 11px) and that macOS subpixel antialiasing was making white on green text render thicker. Claude then fixed the source files directly on my machine.
Version bumping. Every change to the plugin requires bumping CSPV_VERSION in cloudscale-page-views.php. Claude does this automatically as part of each edit.
Git commit and push. After Claude edits the files, I run one command:
git add -A && git commit -m "description" && git push origin main Zip building and S3 deployment. I have helper scripts that rebuild the plugin zip from the repo and upload it to S3 for WordPress to pull. The whole pipeline from code change to deployed plugin is: Claude edits, I commit, I run two scripts.
The Difference
Before MCP: 45 minutes of fighting file transfers to apply a two line CSS fix.
After MCP: Claude edits the file in 3 seconds, I push in 10 seconds.
If you use Claude Desktop for any kind of development work where the output needs to end up on your local machine, set up the MCP filesystem server. It is not optional. It is the difference between Claude being a helpful coding assistant and Claude being an actual development tool.
6. Security Considerations
The filesystem server only grants access to the directories you explicitly list in the configuration. Claude cannot access anything outside those paths. Each action Claude takes on your filesystem requires your approval through the chat interface before it executes.
That said, only grant access to directories you are comfortable with Claude reading and modifying. Do not point it at your entire home directory.
7. Troubleshooting
The tools icon does not appear after restart: Check that the config file is valid JSON. Run:
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | python3 -m json.tool
If it shows errors, fix the JSON syntax.
npx command not found: Make sure Node.js is installed and the npx binary is in your PATH. Try running npx --version in the terminal.
Server starts but Claude cannot access files: Verify the directory paths in the config are absolute paths (starting with /) and that the directories actually exist.
Permission errors: The MCP server runs with your user account permissions. If you cannot access a file normally, Claude cannot access it either.
8. Practical Workflow Example
Here is the workflow I use for maintaining WordPress plugins with Claude:
- Clone the repo to
~/Desktop/github/my-plugin/repo - Ask Claude to make changes (it edits the files directly via MCP)
- Run
git add -A && git commit -m "description" && git push origin mainin the terminal - Build and deploy
No intermediary steps. No file transfer headaches. Claude works on the same files as me.
Summary
The MCP filesystem server bridges the gap between Claude’s sandboxed environment and your local machine. It takes five minutes to configure and eliminates the most frustrating part of using Claude Desktop for real development work. The package name is @modelcontextprotocol/server-filesystem and the documentation lives at modelcontextprotocol.io.