filesystem
Officialby modelcontextprotocol·★ 85,748·Score 77
A feature-rich MCP server for filesystem operations with dynamic directory access control.
Overview
The Filesystem MCP Server provides comprehensive tools for reading, writing, and manipulating files and directories. It offers both read-only and write capabilities with detailed metadata information. What sets this server apart is its sophisticated directory access control system that supports both command-line configuration and dynamic updates via the MCP Roots protocol. This allows for flexible runtime adjustments without server restarts. The server follows security best practices by restricting all operations to explicitly allowed directories.
Try asking AI
After installing, here are 6 things you can ask your AI assistant:
When to choose this
Choose this when you need comprehensive file system operations with dynamic directory access control, especially when working with AI agents that need secure, scoped access to multiple directories.
When NOT to choose this
Avoid if you need fine-grained file permissions beyond directory-level access control, or if you're working with extremely sensitive systems where you need additional security layers beyond MCP's basic access model.
Tools this server exposes
12 tools extracted from the READMEread_text_fileRead complete contents of a file as text
read_media_fileRead an image or audio file and return base64 data
write_fileCreate new file or overwrite existing file
edit_fileMake selective edits to a file using pattern matching
create_directoryCreate new directory or ensure it exists
list_directoryList directory contents with [FILE] or [DIR] prefixes
search_filesRecursively search for files/directories that match patterns
get_file_infoGet detailed file/directory metadata
move_fileMove or rename files and directories
directory_treeGet recursive JSON tree structure of directory contents
list_allowed_directoriesList all directories the server is allowed to access
list_directory_with_sizesList directory contents with file sizes
Comparable tools
Installation
Installation
Using NPX
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/allowed/directory"
]
}
}
}Using Docker
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/path/to/allowed/dir,dst=/projects/allowed/dir",
"mcp/filesystem",
"/projects"
]
}
}
}VS Code Extension
Click the installation buttons in the README to install directly in VS Code.
FAQ
- How do I restrict access to only specific directories?
- You can specify allowed directories via command-line arguments when starting the server or use the MCP Roots protocol for dynamic directory access control. The server will only allow operations within these specified directories.
- Can the filesystem server be used with Claude Desktop?
- Yes, the server provides specific configuration examples for Claude Desktop in the README, including both NPX and Docker deployment options.
- What happens if no directories are specified?
- If the server starts without command-line arguments and the client doesn't support the roots protocol (or provides empty roots), the server will throw an error during initialization as it requires at least one allowed directory to operate.
On Hacker News
Recent discussion from the developer community.
- Story by vinnyglennon · 2025-03-20
Compare filesystem with
Last updated · Auto-generated from public README + GitHub signals.