Direct answer
The Filesystem MCP server is the official Model Context Protocol server for local files. It lets an AI app or AI agent read, write, move and search files, but only inside folders you name. It is free and runs on your computer through npx or Docker. It helps most in chat apps such as Claude Desktop, which cannot reach your files on their own.
Published 27 November 2026 by the Better Design team. Checked that day against the server's README, npm, the Claude Code docs and the Claude Help Center.
Summary
- Package: @modelcontextprotocol/server-filesystem, version 2.4.0 on npm (18 November 2026), MIT licensed. It needs Node.js 24 or later when it runs through npx.
- Tools: 15, counted from the README. Nine only read, six can change files, and none deletes a file.
- Access: the server touches only the allowed directories you pass on the command line. Add --read-only to hide every write tool.
- Who needs it: Claude Desktop and other chat apps. Claude Code, Cursor and Codex already read and edit files in your project without it.
- Claude Desktop ships a built-in Filesystem extension, so you may not need to edit any JSON at all.
- Need terminal commands too? Desktop Commander is built on the official server and adds a shell, which also means more risk.
What is the Filesystem MCP server?
It is a small Node.js program that speaks the Model Context Protocol and offers file tools to an AI client. The client, such as Claude Desktop or VS Code, starts the server and lists its tools to the model. When the model asks to read a file, the server checks the path against your allowed directories, then reads it.
The server lives in the modelcontextprotocol/servers repository on GitHub, next to the Memory, Fetch and Git reference servers. It is a reference implementation: written to show how a good MCP server behaves, and widely used as is.
Do Claude Code, Cursor and Codex need a filesystem MCP?
Usually not. Coding agents have their own file tools. Claude Code reads files in its working directory without asking, and asks before it edits them. A filesystem server would give the agent a second, slower way to do the same thing.
- To let Claude Code reach another folder, add it instead: claude --add-dir ../shared at launch, /add-dir during a session, or additionalDirectories in settings.json.
- Cursor and Codex work on the folder you open. Open a parent folder, or a multi-root workspace, when the agent needs two projects.
- Add the server to a coding agent for a narrow job. One example is read-only access to a reference folder the agent should not edit.
- Chat apps are different from AI agents. Claude Desktop, and other clients without file tools, see nothing on your disk until you connect a server like this one.
Read Claude Code's docs on working directories and permissions.
What tools does the Filesystem MCP server give the model?
Fifteen tools, counted from the README on 27 November 2026. A sixteenth, read_file, is a deprecated alias of read_text_file.
- Read files: read_text_file, read_media_file and read_multiple_files.
- List and find: list_directory, list_directory_with_sizes, directory_tree, search_files, get_file_info and list_allowed_directories.
- read_text_file takes head or tail to return only the first or last lines of a long file.
- Can change files: write_file, append_file, edit_file, create_directory, move_file and copy_file.
- No tool deletes a file or a folder. move_file removes the source only after the move, and fails if the destination exists.
- edit_file replaces exact text and returns a git-style diff. Pass dryRun: true to preview the diff before anything changes.
- search_files matches file names with a glob such as **/*.md. It does not search inside files, so the model cannot grep with it.
- Files are also readable as resources at file:// URIs, for clients that attach files directly instead of through a tool call.
Some setup guides still list 13 tools or call Roots the recommended way to set folders. Both are out of date: append_file and copy_file arrived later, and Roots is deprecated as of protocol version 2026-07-28.
How do you set up the filesystem MCP in Claude Desktop?
The quickest way to enable the Claude filesystem MCP is the built-in extension. Claude Desktop lists a Filesystem extension from Anthropic, and you pick folders in a form instead of editing JSON.
- Open Settings, then Desktop app, and select Manage next to Extensions. In the older layout this is Settings, then Extensions.
- Click Browse extensions, find Filesystem and click Install.
- Add the folders Claude may use under Allowed Directories, and turn the extension on.
- Start a new chat and ask: list the files in my Documents folder. Approve the tool call when Claude asks.
To run the npm package yourself, open Settings, then Developer, then Edit Config. Add a server under mcpServers in the JSON file claude_desktop_config.json. Set command to npx and args to -y, @modelcontextprotocol/server-filesystem and one absolute path per folder. Quit and reopen Claude Desktop after you save.
- On Windows, set command to cmd and start args with /c, npx. Write paths as C:\\Users\\you\\Documents, with doubled backslashes inside JSON.
- Give your own entry a name such as local-fs. A February 2026 bug report said Claude Desktop ignored an entry named filesystem. It ran the built-in extension instead.
- Check the connection with the + button in the chat box, then Connectors. It lists each server and its tools.
Read the Claude Help Center guide to local MCP servers on Claude Desktop.
How do you add it to VS Code, Cursor, Codex and Claude Code?
Every client takes the same command: npx -y @modelcontextprotocol/server-filesystem followed by the folders to allow.
- VS Code: use the Install with NPX button in the README, or run MCP: Open User Configuration. VS Code nests the entry under servers, not mcpServers, and accepts ${workspaceFolder} as the folder.
- Cursor: add the entry under mcpServers in ~/.cursor/mcp.json, or .cursor/mcp.json in one project, then check Settings, then MCP.
- Codex: run codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/folder, or add [mcp_servers.filesystem] to ~/.codex/config.toml.
- Claude Code: run claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/folder, then type /mcp to see it connected. See the section above first: Claude Code rarely needs it.
- claude.ai on the web and ChatGPT need a remote URL. A server running on your computer over stdio cannot connect to them.
How do you limit which folders the filesystem MCP can touch?
List only the folders the job needs. The command-line list is the whole allow-list, and every path the model sends is resolved and checked against it, symlinks included.
- Read-only everywhere: add --read-only. The README says the server then registers only the nine read tools. The model does not see write_file or edit_file at all.
- Read-only for some folders: add --read-only-dir /path/to/reference. Writes into that folder fail with an Access denied error, while other folders stay writable.
- We advise against allowing your home folder or the root of a drive. Give the project folder, not its parent, and keep .env files and SSH keys out of it.
- Roots: older 2025-era clients can replace your folders at runtime with their workspace roots. With --confine-roots, the README says they can narrow your list but not widen it.
- Docker: mount each folder under /projects and add ,ro to a mount to make it read-only at the operating-system level as well.
Can the filesystem MCP run over HTTP?
Yes. Start it with --transport streamable-http and the folders to allow. It listens on 127.0.0.1:3001 at /mcp, and clients connect with a URL instead of a command.
- Over HTTP the folders must be on the command line. The server cannot ask a client for Roots, and it refuses to start without a folder.
- Do not set HOST=0.0.0.0 unless you mean to. The reference server has no sign-in, so anyone who reaches the port reaches the files.
- Requests from a browser page on any origin but localhost get a 403.
Why does the filesystem MCP not work?
Most failures come from Node.js, paths or the client, not the server. Check them in this order.
- spawn npx ENOENT
- The client cannot find npx. Install Node.js 24 or later, or set command to the full path of npx. On Windows, launch it through cmd /c.
- Access denied, path outside allowed directories
- The model asked for a folder you did not list. Ask it to run list_allowed_directories, then add the folder and restart.
- Server connected but every tool call fails in Claude Desktop
- This hit many users after a July 2026 update. On r/ClaudeAI and GitHub, they fixed it by turning off Use Built-in Node.js for MCP under Extensions, then Advanced settings. That needs Node.js installed on the computer.
- Filesystem call timed out after 15000 ms
- A cloud-synced folder such as iCloud Drive stalled. Narrow the path or name the slow folder in excludePatterns.
- stopped after visiting 100000 entries
- search_files or directory_tree walked too far. Exclude node_modules or pass a depth.
- Parent directory does not exist
- The README says write_file does not create folders. Ask the model to call create_directory first.
Filesystem MCP or Desktop Commander?
Use the official server when the model only needs files. Use Desktop Commander when it also needs to run commands, such as tests or a dev server.
- Desktop Commander
- @wonderwhy-er/desktop-commander, version 0.3.4 on npm (18 November 2026), MIT licensed. Its README says it is built on the official server and adds terminal commands, process control and Excel, PDF and Word files.
- The trade
- Its own README warns that terminal commands can still reach files outside its allowedDirectories setting. A shell is a much wider door than 15 file tools.
- Other options
- mark3labs/mcp-filesystem-server is a Go version for people who want one binary and no Node.js. Docker's mcp/filesystem image runs the official server in a container.
Is the filesystem MCP safe?
- Within its folders, yes, to the extent you trust the model. write_file overwrites without a backup, so keep the folder under git or another backup.
- Prompt injection is the real risk. A file the model reads can contain instructions, and a model with write tools may follow them. Use --read-only for folders full of downloads or other people's files.
- On Windows, the README warns that another local program writing inside an allowed folder could redirect a read or write during a race. Do not allow folders that untrusted programs can write to.
- Approve tool calls one by one at first. In Claude Desktop you can later set a trusted tool to Always allow, as users in the threads above did.
How we checked
On 27 November 2026 we read the server's README and npm entry, and the same for Desktop Commander. We also read the Claude Code permissions and MCP docs and the Claude Help Center article on local MCP servers. We read GitHub issues and r/ClaudeAI threads about Claude Desktop's Filesystem extension. We counted the tools from the README's tool list. We did not benchmark the servers.
Want your agent to build with your design system too?
A filesystem server lets a model read your files. It does not tell it which colors, type and components to use. Better Design is an MCP server we make that gives Claude Code, Cursor or Codex your design system before they build a page. A free account gets 300 tool calls in 30 days.
Frequently asked questions
Yes. It is MIT licensed and runs on your computer. You pay only for the AI app you connect it to.
No. The current tool list has no delete tool. It can overwrite a file with write_file and move a file with move_file, so it can still lose data.
Claude Code does, inside its working directories. Claude Desktop chats do not, unless you add the Filesystem extension or another server. You can still attach files to a chat by hand.
It is the command that downloads and runs the server. The -y flag skips npx's prompt, and every argument after the package name is a folder the server may use.
It returns images and audio through read_media_file, and other files such as PDFs as an embedded resource. Whether the model can read the PDF's text depends on the client.
Looking for more servers? Read the MCP servers list.
Read the Memory MCP guide, another official reference server.
