Filesystem MCP Server

by Anthropic (MCP reference servers)

Reference Developer Tools

Anthropic's reference server for reading, writing, and searching files inside sandboxed local directories — the most commonly connected MCP server for giving an agent safe filesystem access.

Add to Claude Code

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

Source: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem

About

The Filesystem MCP server gives an agent direct, sandboxed access to a set of local directories you explicitly allow — reading file contents, writing new files, creating and listing directories, moving files, and searching by name or content. Every operation is scoped to the paths you pass at startup, so the agent can never wander outside the folders you granted.

It's the reference implementation from the official Model Context Protocol servers repository, and the pattern most other filesystem-style MCP servers (cloud storage, remote drives) follow: explicit path allow-listing plus a small, predictable tool surface.

Key features

  • Sandboxed access limited to explicitly allowed directories
  • Read, write, create, move, and delete files and folders
  • Recursive directory listing and file search by name or content
  • Works identically across macOS, Linux, and Windows

Use cases

  • Let an agent read and edit source files in a project directory during a coding session
  • Search a folder of notes or logs for a specific string without opening each file
  • Batch-rename or reorganize files based on their content

Available tools

read_file

Reads the full contents of a file at a given path.

write_file

Creates a new file or overwrites an existing one with the given content.

list_directory

Lists files and subdirectories inside an allowed folder.

search_files

Recursively searches allowed directories for files matching a name pattern.

move_file

Moves or renames a file or directory.

Frequently asked questions

Can the agent access files outside the folder I specify?

No — every path argument passed at startup defines the full boundary of what the server can touch. Requests for anything outside those directories are rejected.

Do I need an API key?

No. It runs entirely locally with no external service or credentials — just Node.js to run the npx command.