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.
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir
To grant access to multiple directories:
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/projects ~/documents
Available tools
read_file— read the full contents of a filewrite_file— create or overwrite a file with new contentedit_file— apply targeted edits using old/new string replacementmove_file— move or rename a file or directorylist_directory— list files and subdirectories in a pathsearch_files— search by filename pattern or content regexget_file_info— return metadata: size, modified, permissionscreate_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:
# 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.
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.