Filesystem MCP Server (v0.1)
A simple MCP server for filesystem operations with directory sandboxing and read-only mode support.
Early version (0.1) - not thoroughly tested/reviewed, use with caution
Quick Start
Install dependencies:
Run the server:
Features
- Directory sandboxing (operations restricted to allowed paths)
--read-only
flag disables write operations- Gitignore support for searches
- Human-readable error messages
Usage Examples
Normal Mode
Read-Only Mode
Multiple Directories
Available Tools
Read Operations (always available):
read_text_file
- Read file contentslist_directory
- List directory contentsdirectory_tree
- JSON directory structuresearch_files
- Find files by patterngrep
- Search text in filesread_multiple_files
- Bulk file reading
Write Operations (disabled in --read-only
):
create_file
- Create new filesdelete_file
- Delete filesmove_file
- Move/rename filesedit_file
- Edit file contentscreate_directory
- Create directories
Dependencies
From pyproject.toml
:
fastmcp>=2.11.2
- MCP frameworkpathspec>=0.12.1
- Gitignore patterns
Security Notes
- All paths resolved with
Path.resolve()
to prevent traversal - Operations restricted to allowed directories only
- Binary files rejected for text operations
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Enables secure filesystem operations with directory sandboxing and optional read-only mode. Supports file reading/writing, directory management, file searching, and text operations while restricting access to specified directories.
Related MCP Servers
- -securityAlicense-qualityThis server offers secure, read-only access to directory files via the MCP, supporting file searching, .gitignore compliance, path traversal protection, and MIME type detection using the 'file://' URI scheme.Last updated -19MIT License
- -securityFlicense-qualityThis server provides an interface for performing basic file system operations such as navigation, reading, writing, and file analysis, allowing users to manage directories and files efficiently.Last updated -4
- AsecurityFlicenseAqualityEnables comprehensive directory analysis and file management operations including project structure exploration, intelligent file search, full CRUD operations on files and directories, batch operations with rollback capabilities, and Git integration.Last updated -133
- -securityFlicense-qualityEnables safe file system operations including reading, writing, updating, and deleting files with built-in security safeguards, automatic backups, and comprehensive error handling. Provides directory listing, file metadata extraction, and protects against operations on system-critical paths.Last updated -