Filesystem MCP Server
Secure, sandboxed filesystem access enabling agents to list, read, write, create, move, delete, search files and directories within allowed paths.
Secure, sandboxed filesystem access enabling agents to list, read, write, create, move, delete, search files and directories within allowed paths.
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Secure File Operations for AI Agents
Official MCP reference implementation providing safe, sandboxed filesystem access with fine-grained permission controls.
Most agent tasks involve files:
Pure implementation using Node.js built-in modules. No external API dependencies or rate limits.
# Official reference implementation npm install -g @modelcontextprotocol/server-filesystemOr build from source
git clone https://github.com/modelcontextprotocol/servers cd servers/src/filesystem npm install npm run build
Add to your MCP client config:
{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/yourname/Documents", "/Users/yourname/Projects" ] } } }
Arguments = allowed directories (one or more paths)
Read-Only Access:
"args": ["--read-only", "/path/to/docs"]
Full Access (default):
"args": ["/path/to/workspace"]
{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/dev/projects", "/Users/dev/workspace" ] } } }
{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "--read-only", "/Users/docs/knowledge-base" ] } } }
list_directory)Agent: "What files are in my Projects folder?" Agent: "Show contents of /workspace/src"
Returns:
create_directory)Agent: "Create a new folder called 'components'" Agent: "Make directory /workspace/tests"
move_file)Agent: "Rename old-name.txt to new-name.txt" Agent: "Move report.pdf to /Documents/Reports/"
read_file)Agent: "Read the contents of config.json" Agent: "Show me the README.md file"
Supports:
write_file)Agent: "Create a file called notes.txt with meeting notes" Agent: "Write the generated code to src/index.ts"
edit_file)Agent: "Replace 'version: 1.0' with 'version: 2.0' in package.json" Agent: "Add a new function to utils.js"
get_file_info)Agent: "When was report.pdf last modified?" Agent: "What's the size of data.csv?"
Returns:
search_files)Agent: "Find all Python files in the project" Agent: "Search for files containing 'API_KEY'"
Search by:
delete_file)Agent: "Delete the temporary log files" Agent: "Remove old-backup.zip"
Safety:
Human: "Create a React component for a login form"Agent:
- create_directory("/workspace/components")
- write_file("/workspace/components/LoginForm.tsx", generated_code)
- write_file("/workspace/components/LoginForm.test.tsx", test_code)
"Created LoginForm component at components/LoginForm.tsx"
Human: "Analyze error logs and summarize issues"Agent:
- list_directory("/var/log/app")
- read_file("/var/log/app/error.log")
- search_files(pattern="ERROR", path="/var/log/app")
- generate_summary()
write_file("/reports/error-summary.md", summary)
Human: "Organize my documents by type"Agent:
- list_directory("/Documents")
For each file:- get_file_info(file)
- Determine file type
- create_directory("/Documents/[type]")
move_file(file, destination_folder)
Human: "Generate API documentation from code comments"Agent:
- search_files(pattern="*.ts", path="/src")
- For each file:
- read_file(file)
- extract_doc_comments()
- Generate markdown docs
write_file("/docs/API.md", generated_docs)
What Agents CAN Do:
What Agents CANNOT Do:
../)/etc/, /sys/)Allowed: /Users/dev/projects Agent tries: /Users/dev/projects/src/index.ts → ✅ Allowed Agent tries: /Users/dev/projects/../secret → ❌ Blocked Agent tries: /etc/passwd → ❌ Blocked
Principle of Least Privilege
--read-only when write not neededNever Allow Root Access
/ or system directoriesAudit Agent Actions
Separate Sensitive Data
Agents generate blog posts, reports, documentation and save to organized folders.
Read project files, generate code, create tests, update configurations.
Read CSV/JSON data files, analyze, generate reports and visualizations.
Scan directories, categorize files, move to appropriate folders, cleanup duplicates.
Index markdown files, search documentation, extract information, update wikis.
Parse log files, identify errors, generate summaries, create alerts.
node_modules/)--read-only mode| Method | Security | Agent Integration | Setup |
|---|---|---|---|
| Filesystem MCP | ✅ Sandboxed | ✅ Auto-discovered | Simple |
| Direct FS Access | ❌ Full system | ❌ Manual | None |
| File Upload/Download | ✅ Manual control | ⚠️ Limited | Complex |
| Cloud Storage API | ✅ API-level | ⚠️ Requires SDK | Complex |
{ "mcpServers": { "filesystem": { "command": "node", "args": [ "/path/to/filesystem-server/build/index.js", "/workspace", "/documents" ], "env": { "MAX_FILE_SIZE": "10485760", "ENABLE_LOGGING": "true", "LOG_PATH": "/var/log/mcp-filesystem.log" } } } }
Safe, secure filesystem access for agents: From code generation to log analysis, Filesystem MCP is the foundation for agent file operations.
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.