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
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
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-qualityA secure MCP server enabling read-only access and file search capabilities within a specified directory, while respecting .gitignore patterns.Last updated -PythonMIT License
- -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 -4Python
- AsecurityAlicenseAqualityA server implementing the Model Context Protocol that provides filesystem operations (read/write, directory management, file movement) through a standardized interface with security controls for allowed directories.Last updated -93TypeScriptMIT License