Filesystem logo

Filesystem

Restricts agent-driven file operations to configured directories over MCP, with reading, editing, search, and directory management.

Install Filesystem

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

The install command installed and started the server, which then stopped for configuration (such as an API key) that our sandbox does not have — expected for servers that connect to your account.

npx -y @modelcontextprotocol/server-filesystem

Process exited after initialize, before tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Filesystem MCP server provides an MCP interface for reading, writing, editing, and managing files and directories through Node.js. It runs over stdio and restricts every operation to directories supplied at startup, with deprecated Roots-based updates available for compatible 2025-era clients. Use it when an agent needs controlled access to local project files, including text, media, metadata, and directory contents.

Use cases

  • Read project files within explicitly allowed directories
  • Edit source files with previewable diffs
  • Inspect directory contents and file sizes
  • Search local files from an MCP client
  • Create, move, or rename project files

Key features

  • Command-line directory allow-listing
  • Text and binary file reading
  • Selective multi-edit operations
  • Dry-run diff previews
  • Directory and file management
  • File metadata and hard-link reporting

Tools23

What Filesystem lets your agent do. Expand a tool for its parameters.

Self-reported~46 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

60/60 checks healthy over the last 97d

Supply-chain signal

2 high-severity advisories on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage — this is a directional signal, not a security audit.

Critical 0High 2Medium 0Low 0

Scanned 12d ago via OSV.dev · @modelcontextprotocol/server-filesystem (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars91kStargazers on the source repository.
npm downloads4.6MPackage downloads in the last 30 days.
Last commit3d agoMost recent push to the default branch.
Install checkRunsOur sandbox started it; it then asked for an API key or config.
Tools exposed23Callable tools this server registers over MCP.
Directory activity1 installsConfig copies, upvotes, and views on AllMCPs.

How Filesystem works

What Filesystem MCP server does

Filesystem MCP server exposes local filesystem operations to MCP clients. It can read text files, return media or other binary files as MCP content, read several files in one request, write or selectively edit files, create and list directories, move or rename filesystem entries, search for files, and inspect file metadata.

Access is limited to an allow-list of directories. Every requested path is resolved and checked against that allow-list, which prevents operations outside the configured locations. The server requires at least one allowed directory before tools can operate.

How it works

The server communicates over stdio and supports both the 2026-07-28 protocol style and the 2025-era initialization flow. For the newer protocol, command-line directories remain the complete allow-list. For a 2025-era client that advertises Roots support, the server can request Roots and replace its configured directories with the client’s valid Roots. Runtime Root changes replace the previous set and can revoke access when no valid Root remains.

The recommended configuration method is to pass directories as command-line arguments because it works across protocol versions. A typical launch uses:

bash
mcp-server-filesystem /path/to/project /path/to/another-directory

Paths reached through symlinks are checked against resolved allowed directories. A symlink inside an allowed directory that points outside the allow-list is refused.

Setup and configuration

The package is published as @modelcontextprotocol/server-filesystem. Start it with one or more directories that the agent may access. For example:

bash
mcp-server-filesystem /workspace/project

Use list_allowed_directories to inspect the directories currently available to the connection. A 2026-07-28 connection does not obtain directories through Roots, so command-line arguments are required for useful access. A 2025-era client without Roots support also relies on command-line arguments; if none are supplied, initialization fails. Clients that support Roots can provide or update the allow-list during that protocol flow.

Tools and capabilities

  • Read complete text files or request only their first or last lines.
  • Read multiple files in one operation without aborting all reads when one path fails.
  • Return images, audio, and other binary files with appropriate MCP content handling.
  • Create, overwrite, move, and rename files or directories.
  • Apply multiple targeted text edits with whitespace handling, indentation preservation, line-ending preservation, and diff output.
  • Preview edits with dry-run mode before changing a file.
  • Create directories recursively and list entries with optional size-based sorting and totals.
  • Search files and retrieve file metadata, including hard-link counts.

Limitations and notes

Text reads always interpret files as UTF-8 regardless of extension. read_text_file cannot use head and tail together. Moving an item fails when the destination already exists.

Writes and edits modify an existing file in place. The operation preserves the file’s inode, creation time, hard links, and permissions, but a crash during writing can leave partial content. A read-only file is refused rather than replaced. Because access checks are based on the requested path, editing or overwriting a file with hard links can change the content visible through other names outside the allowed directories. Check the reported hard-link count when that distinction matters. Use edit dry-run mode to inspect the proposed diff before applying changes.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Filesystem

Filesystem is an MCP server that connects AI clients to selected local directories for controlled file operations. Its main tools read text and media, write or edit files, list and create directories, move entries, search files, inspect metadata, and report the active allowed directories over a stdio connection.

Install the `@modelcontextprotocol/server-filesystem` npm package, then start `mcp-server-filesystem` with one or more allowed directory paths. Pass directories as command-line arguments because this configuration works across supported protocol versions.

Pass the allowed directories as arguments when starting the server, such as `mcp-server-filesystem /workspace/project`. Every filesystem request is resolved and checked against those directories. Compatible 2025-era clients can replace them with MCP Roots, but command-line arguments are the cross-version option.

Yes. Set `dryRun` when using `edit_file` to receive match information and a detailed diff without changing the file. The server supports multiple edits, indentation preservation, whitespace normalization, and preservation of LF or CRLF line endings.

Yes. Filesystem uses the standard MCP stdio transport, so it can be configured in Cursor as an MCP server. Start it with the directories Cursor should be allowed to access.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewFilesystem AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/filesystem?style=directory)](https://allmcps.com/mcp/filesystem)
HTML Embed
<a href="https://allmcps.com/mcp/filesystem"><img src="https://allmcps.com/api/badge/filesystem?style=directory" alt="Filesystem on AllMCPs" /></a>