Skip to main content
Community resource — not affiliated with Anthropic. Learn more


Filesystem MCP

Filesystem · Official by Anthropic

Read and write files on your local machine. Claude can create, edit, move, search, and manage files — all with per-operation permission prompts keeping you in full control.

4.9 rating 12,400+ connects Free · Open source Protocol v1.0
Files Read/Write Search Official Cross-platform

Connect command

claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir
View on GitHub →

Free · Open source · MIT license

12.4k Connects
4.9 Rating

What it does

The Filesystem MCP server gives Claude direct, controlled access to your local file system. You specify which directories are in scope when you connect — Claude can only touch those paths. Every destructive operation (write, delete, move) requires your explicit approval before it executes.

It is the most-installed MCP server in the Claude ecosystem, maintained directly by Anthropic as part of the official MCP reference implementation. It works on Windows, macOS, and Linux without any additional dependencies beyond Node.js.

  • Read files of any type — source code, markdown, JSON, logs, CSVs
  • Write and overwrite files with new content generated by Claude
  • Edit files with precise diff-style patches
  • Move and copy files between directories
  • Search files by name, extension, or content pattern
  • Inspect file metadata: size, modified date, permissions
  • Create nested directory trees

How to connect

Run the command below in your terminal. Replace /path/to/dir with the directory you want Claude to access. You can pass multiple paths separated by spaces.

terminal
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir

To grant access to multiple directories:

terminal — multiple paths
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/projects ~/documents

Available tools

  • read_file — read the full contents of a file
  • write_file — create or overwrite a file with new content
  • edit_file — apply targeted edits using old/new string replacement
  • move_file — move or rename a file or directory
  • list_directory — list files and subdirectories in a path
  • search_files — search by filename pattern or content regex
  • get_file_info — return metadata: size, modified, permissions
  • create_directory — create a directory and any missing parents

Example usage

Ask Claude to refactor a file, generate a report, or reorganize a folder. Here is a typical prompt and the kind of operation it triggers:

example prompt
# User prompt
Read all .ts files in src/utils, find any function that
takes more than 3 arguments, and refactor them to use
an options object instead. Write the changes back.
tool call sequence
list_directory("src/utils")
read_file("src/utils/api.ts")
read_file("src/utils/format.ts")
→ identifies 2 functions to refactor
edit_file("src/utils/api.ts", old="...", new="...")
edit_file("src/utils/format.ts", old="...", new="...")

Security tip: Always scope to the minimum directory needed. Avoid passing your entire home directory — use project-specific paths so Claude cannot accidentally touch unrelated files.