About Fastmcp Filesystem Server
Fastmcp Filesystem Server is an MCP server published by newbieking in the Search category: a production-ready filesystem MCP server built with FastMCP. Secure file operations with path sandboxing, supporting read/write/search/move/copy and directory management. Designed for AI assistants to safely interact with local filesystems.
Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/newbieking/fastmcp-filesystem-serverThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (9)
copy_fileCopy file or directory
Parameters not published.
create_directoryCreate directory (mkdir -p)
Parameters not published.
delete_pathDelete file or directory
Parameters not published.
get_file_infoGet metadata + MD5 hash
Parameters not published.
list_directoryList directory contents
Parameters not published.
move_fileMove/rename file or directory
Parameters not published.
read_fileRead file with offset/limit
Parameters not published.
search_filesSearch by name/content
Parameters not published.
write_fileWrite or append to file
Parameters not published.
Ask AI
Ask AI about Fastmcp Filesystem Server
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
FastMCP Filesystem Server
A secure, feature-rich filesystem MCP (Model Context Protocol) server built with FastMCP. Enables AI assistants like Claude to safely read, write, search, and manage files on your local machine with configurable path restrictions.
Features
- 🔒 Security First: Path sandboxing prevents unauthorized directory access
- 📁 Complete Operations: List, read, write, create, delete, move, copy files and directories
- 🔍 Smart Search: Glob pattern matching with optional content regex search
- 📊 Metadata: File hashes (MD5), MIME types, permissions, timestamps
- 🚀 FastMCP Powered: Clean decorator-based API, async support, multiple transports
- 🛠️ Production Ready: Error handling, logging, size limits, encoding detection
Quick Start
Installation
# Clone repository
git clone https://github.com/newbieking/fastmcp-filesystem-server.git
cd fastmcp-filesystem-server
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install fastmcp
Usage
Standalone Mode
# Allow access to specific directories only (recommended)
python filesystem_server.py /home/user/Documents /home/user/Projects
# Development mode (no restrictions - use with caution)
python filesystem_server.py
With Claude Desktop
Add to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "python",
"args": [
"/absolute/path/to/filesystem_server.py",
"/Users/yourname/Documents",
"/Users/yourname/Projects"
]
}
}
}
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "python",
"args": [
"C:\\path\\to\\filesystem_server.py",
"C:\\Users\\yourname\\Documents"
]
}
}
}
Available Tools
| Tool | Description | Parameters |
|---|---|---|
list_directory |
List directory contents | path |
read_file |
Read file with offset/limit | path, offset, limit |
write_file |
Write or append to file | path, content, append |
create_directory |
Create directory (mkdir -p) | path, parents |
delete_path |
Delete file or directory | path, recursive |
search_files |
Search by name/content | path, pattern, content_pattern, max_depth |
get_file_info |
Get metadata + MD5 hash | path |
move_file |
Move/rename file or directory | source, destination, overwrite |
copy_file |
Copy file or directory | source, destination, overwrite |
Examples
List Directory
{
"path": "/home/user/Projects"
}
Read Large File (Chunked)
{
"path": "/var/log/syslog",
"offset": 0,
"limit": 10240
}
Search Python Files Containing "TODO"
{
"path": "/home/user/Projects",
"pattern": "*.py",
"content_pattern": "TODO|FIXME",
"max_depth": 3
}
Write Configuration File
{
"path": "/home/user/.config/app/settings.json",
"content": "{\"theme\": \"dark\", \"version\": \"1.0\"}"
}
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude/AI │◄───►│ MCP Protocol │◄───►│ FastMCP Server │
│ Assistant │ │ (stdio/SSE) │ │ │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
┌───────────────────────────┼───────────┐
▼ ▼ ▼
┌──────────┐ ┌────────────┐ ┌────────┐
│ Path │ │ File Ops │ │ Search │
│ Validator│ │ (read/write)│ │ Engine │
└──────────┘ └────────────┘ └────────┘
Security Considerations
⚠️ Important: This server grants AI assistants direct filesystem access.
-
Always use path restrictions in production:
python filesystem_server.py /safe/path/only -
Never run with sudo/root permissions
-
Audit sensitive directories: Avoid exposing
.ssh/,.env files, or financial data -
Review AI actions: Claude will ask permission before destructive operations (delete/overwrite)
Development
Testing
# Run tests
pytest tests/
# Test with MCP Inspector
npx @modelcontextprotocol/inspector --config mcp-config.json --server fs-server
Project Structure
.
├── mcp-config.json # mcp config file for mcp client
├── README.md # This file
└── fast_mcp_server/
└── filesystem_server.py # Main MCP server implementation
Requirements
- Python 3.10+
fastmcp>=1.0.0mcp>=1.0.0
License
MIT License - see LICENSE file.
Related
Built with FastMCP | Secure by Design | AI-Ready
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.