Filesystem MCP Server
Reference MCP server for reading, writing, searching and moving files inside directories you explicitly allow.
- Author
- Model Context Protocol
- Works with
- Any MCP client
- License
- MIT
- Documented
- Oct 2, 2026
What Filesystem MCP Server is
Node.js server implementing MCP for filesystem operations, published on npm as @modelcontextprotocol/server-filesystem. Access is limited to allowed directories given as command-line arguments or via MCP Roots.
What it does
- Read text files (with head/tail options) and media files
- Read multiple files at once
- Write and overwrite files
- Create, list and delete directories and move files or directories
- Search files and get file metadata
- Update allowed directories at runtime through MCP Roots
When to use it
Good fit
- Letting an agent work on a few specific project folders
- Clients that support Roots and need runtime directory changes
Not for
- Anything needing access outside the allowed directories
- Production use without your own review: The root README says these are reference implementations meant as educational examples, not production-ready solutions.
How to install Filesystem MCP Server
You need: Node.js (npx); At least one allowed directory via arguments or Roots, otherwise it errors on start
- Make sure Node.js and npx are available
- Add the server to your MCP client config with the npx command
- Pass at least one allowed directory as an argument, or use a client that supports Roots
- Restart the client and call list_allowed_directories to confirm
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/dir1",
"/path/to/dir2"
]
}
}
}Permissions and security
What it can access
- Read and write files and directories inside allowed directories only
Security notes from the maintainers
- write_file overwrites existing files; README says to exercise caution
- The root README says these are reference implementations meant as educational examples, not production-ready solutions.
Review the source before granting an agent access to credentials or production systems. We document what the maintainers state; we do not audit code.
Limitations
- Server errors on startup if no args are given and the client does not support Roots
- Roots from the client completely replace command-line directories
Frequently asked questions
What does the Filesystem MCP server need to start?
At least one allowed directory, passed as an argument or supplied by the client through Roots. source
Can the Filesystem MCP server access files outside the allowed directories?
No. The README says all operations are restricted to allowed directories. source
What is the npm package for the Filesystem MCP server?
@modelcontextprotocol/server-filesystem. source
Related guides
Sources and gaps
- https://raw.githubusercontent.com/modelcontextprotocol/servers/main/src/filesystem/README.md readme, checked Oct 2, 2026
- https://raw.githubusercontent.com/modelcontextprotocol/servers/main/README.md readme, checked Oct 2, 2026
Not stated by the maintainers: Hosts other than generic MCP clients are not individually named as supported for Claude Code/Cursor/Windsurf/Codex in this README; last_release date not visible in the checked README.