
Filesystem
Secure file operations with configurable access controls
Send to Your Agent
Copy this prompt and paste it into Claude, Cursor, or any MCP client to install instantly.
Install the Filesystem MCP server for me.
Server: Filesystem
Description: Secure file operations with configurable access controls
Install command: npx -y @modelcontextprotocol/server-filesystem /allowed/path
Environment variables needed:
- ALLOWED_PATHS: Directory paths the server can access (space-separated) (required)
GitHub: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem
Please install this MCP server and confirm when ready. Paste into any AI agent with MCP support — works with Claude Desktop, Cursor, Cline, and more.
Quick Install
Config file: ~/Library/Application Support/Claude/claude_desktop_config.json
- Open Claude Desktop app
- Go to Settings → Developer → Edit Config
- Paste the config below into the file
- Restart Claude Desktop
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/allowed/path"
],
"env": {
"ALLOWED_PATHS": "/home/user/documents /home/user/projects"
}
}
}
} Add this to your ~/Library/Application Support/Claude/claude_desktop_config.json
Installation Methods
npx -y @modelcontextprotocol/server-filesystem /allowed/pathdocker run -i --rm mcp/filesystem /allowed/pathTools (7)
read_file Read the complete contents of a file from the file system
write_file Create a new file or overwrite an existing file with new content
list_directory Get a detailed listing of all files and directories in a specified path
move_file Move or rename files and directories from one location to another
search_files Recursively search for files and directories matching a pattern
get_file_info Retrieve detailed metadata about a specific file or directory
list_allowed_directories Show all directories the server is currently allowed to access
Environment Variables
ALLOWED_PATHS RequiredDirectory paths the server can access (space-separated)
/home/user/documents /home/user/projects| Name | Description | Required | Example |
|---|---|---|---|
| ALLOWED_PATHS | Directory paths the server can access (space-separated) | Required | /home/user/documents /home/user/projects |
Compatibility
About
A Node.js server implementing Model Context Protocol (MCP) for filesystem operations. This server provides tools to read, write, create, list, delete, move, and search files and directories with strict access controls.
Key Features
- Read/write files — Access file contents for analysis and modification
- Create/list/delete directories — Manage directory structures
- Move files/directories — Rename and reorganize files
- Search files — Find files matching patterns across directories
- Get file metadata — Retrieve size, permissions, timestamps
- Dynamic directory access control via Roots
Directory Access Control
The server uses a flexible directory access control system. Directories can be specified via command-line arguments or dynamically via MCP Roots.
Method 1: Command-line Arguments
Specify allowed directories when starting the server:
npx -y @modelcontextprotocol/server-filesystem /path/to/dir1 /path/to/dir2
Method 2: MCP Roots (Recommended)
MCP clients that support Roots can dynamically update allowed directories at runtime without restarting the server.
Use Cases
- Code analysis and refactoring across multiple files
- Documentation generation from source code
- Project structure exploration
- File organization and cleanup
- Content migration between directories
Related Resources
GitHub
MCP ServerRepository management, file operations, and GitHub API integration
Prompt Injection Defender
PromptDesign robust defense mechanisms against prompt injection attacks, jailbreaks, and adversarial inputs. Implement multi-layered security for AI systems handling untrusted user input.
Prompt Security Auditor
SkillAudit AI systems for prompt injection vulnerabilities, jailbreak risks, and output safety issues.
Artificial Intelligence
GlossaryThe broad field of creating machines that can perform tasks requiring human-like intelligence, such as reasoning, learning, and perception.
Git
MCP ServerTools to read, search, and manipulate Git repositories
Compare LLM Pricing
This server works with Claude, GPT-4o, and other models. Compare API costs side-by-side to find the cheapest option for your workflow.