Skip to content

Menu

Filesystem MCP Server logo

Filesystem MCP Server

Published · Updated

At a glance

Category
Code & Git
Watch out for
In coding agents that already have file tools, this server is mostly redundant and adds about 15 overlapping tools.

The Filesystem server is one of the reference servers maintained in the official modelcontextprotocol/servers repository, published on npm as @modelcontextprotocol/server-filesystem. It gives a model the ability to read, write, move and search files, but only inside directories you name when you start it.

It matters most in clients that have no file access of their own, such as Claude Desktop or a chat app. Coding agents like Claude Code, Cursor or Codex already read and edit files natively, so adding this server to them mostly duplicates tools they have and makes tool selection noisier. If you are writing up notes, sorting a folder of exports, or letting a desktop assistant work on a project directory, this is the server to reach for.

The design is deliberately simple. Access control is a list of allowed directories passed on the command line, and every path the model asks for is checked against that list. The README is now explicit that this command-line list is the method to rely on: MCP Roots, which let a client change the allowed directories at runtime, are deprecated as of the 2026-07-28 protocol version and do not work on connections that use it.

How it connects

Your AI app

An assistant or agent that supports MCP

Filesystem MCP Server

Runs as

  • npx (Node.js)
  • Docker

Gives the agent

  • Reading files
  • Line-based editing with a dry run
  • Writing and moving
  • Exploring a tree
  • Read-only mode

Files on your machine

The data or system the tools act on

Your AI app talks to Filesystem MCP Server over the Model Context Protocol, and the server carries out the work. Built from the setup and capability sections on this page.

What it can do

Reading files
read_text_file supports head and tail so the model can look at the start or end of a large log without loading all of it. read_multiple_files reads several at once, and read_media_file returns images and audio as base64.
Line-based editing with a dry run
edit_file applies a list of find-and-replace edits and can return a diff instead of writing when dryRun is true. The README recommends a dry run first, which is good advice for anything you care about.
Writing and moving
write_file creates or overwrites a file, append_file adds to one, create_directory is safe to repeat, and move_file renames or moves within the allowed directories.
Exploring a tree
list_directory, list_directory_with_sizes, directory_tree and search_files (glob matching) let the model get its bearings. get_file_info returns size, timestamps and permissions.
Read-only mode
Start the server with --read-only and it registers only the tools marked readOnlyHint, so there is no way for the model to change anything on disk.

Setting it up

Run it with npx: npx -y @modelcontextprotocol/server-filesystem /path/to/dir1 /path/to/dir2. Each path after the package name becomes an allowed directory. In Claude Desktop, put that command and its arguments in claude_desktop_config.json under mcpServers. The README also shows a Docker setup, where you bind-mount the folders you want under /projects and pass those container paths as the allowed directories. Add --read-only before the paths when you only want the model to look. Keep the list as narrow as you can: point it at a project folder, not your home directory.

Run in a terminal
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem

Runs the @modelcontextprotocol/server-filesystem package from npm. Add any API keys, environment variables or extra arguments the setup notes above list. Combine several servers in the MCP config generator

Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)

Where it helps

  • Letting Claude Desktop read and tidy a folder of meeting notes or exported documents
  • Searching a large directory of logs and reading only the last few hundred lines of each
  • Bulk-renaming or reorganising files with a model that explains each move first
  • Giving a chat-only client read access to a project so it can answer questions about the code

Limitations and things to watch

  • In coding agents that already have file tools, this server is mostly redundant and adds about 15 overlapping tools.
  • write_file overwrites without asking, and the README notes the write is not crash-atomic, so a crash mid-write can leave a partial file.
  • Roots-based directory changes are deprecated and do not work on 2026-07-28 connections; plan on fixed command-line paths.
  • directory_tree and search_files stop with an error after 100,000 entries, and any file call on a slow cloud or network folder times out after 15 seconds. Point it at a subfolder rather than a whole drive.
  • It reads and writes as your user, so any secrets inside an allowed directory, such as .env files, are visible to the model.

Sources

Written from the project's own documentation, checked November 2026.

How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…