home / mcp / mcp-filesystem mcp server
Not just another MCP filesystem. Optimized file operations with smart context management and token-efficient partial reading/editing. Process massive files without overwhelming context limits.
Configuration
View docs{
"mcpServers": {
"safurrier-mcp-filesystem": {
"command": "uv",
"args": [
"run",
"run_server.py",
"/absolute/path/to/mcp-filesystem",
"/absolute/path/to/dir1",
"/absolute/path/to/dir2"
]
}
}
}You operate MCP-Filesystem to securely access and manipulate large files and directories with precise, token-efficient interactions. This server provides a rich set of filesystem operations, intelligent context management, and fast search capabilities so you can read, edit, and analyze big data without loading everything into memory.
You interact with the server through an MCP client. Start the local MCP-Filesystem server, then connect your client to it to perform operations such as reading specific lines, editing content with verification, listing directories, and performing advanced searches with contextual results.
Prerequisites you need before starting are a Python environment and the ability to run UV (a lightweight asynchronous tooling runner). Ensure you have these installed on your system.
# Install UV if you haven't already
curl -fsSL https://raw.githubusercontent.com/astral-sh/uv/main/install.sh | bash
# Or with pipx
pipx install uvThe server enforces strict path validation to ensure access is limited to explicitly allowed directories. It protects against path traversal and validates symlinks to prevent exposure beyond authorized paths. Always run the server with directories you intend to access and keep permissions appropriate for the user running the server.
You can configure MCP-Filesystem to run as a local process using UV. Here are example startup commands you can use directly in your environment. Adapt absolute paths to your system.
uv run run_server.py /absolute/path/to/mcp-filesystem /absolute/path/to/dir1 /absolute/path/to/dir2
```
```
uv run run_server.py /path/to/mcp-filesystem/repo /Users/yourusername/Projects /Users/yourusername/DocumentsWatch server logs to debug requests and verify what Claude or your MCP client is requesting. Use the following commands to tail logs on macOS or Windows.
# macOS
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-mcp-filesystem.log
# Windows PowerShell
Get-Content -Path "$env:APPDATA\Claude\Logs\mcp-server-mcp-filesystem.log" -Tail 20 -WaitRead the full contents of a file.
Read multiple files in parallel to reduce round-trips.
Create a new file or overwrite an existing one.
Create a new directory or ensure it exists.
Provide a detailed listing of files and subdirectories.
Move or rename files and directories.
Retrieve detailed metadata for a file or directory.
List directories the server is allowed to access.
Read specific line ranges with offset/limit parameters.
Make precise edits with content verification and relative line numbers.
Read the first N lines of a text file.
Read the last N lines of a text file.
Search patterns with ripgrep integration, context options, and paginated results.
Search for files by name or pattern with content search.
Get a recursive tree view of files and directories.
Compute the total size of a directory.
Identify duplicate files by comparing content.
Show differences between two text files.
Find files exceeding a specified size.
Find directories that contain no files.