bridgemcp-server-filesystem
Provides safe filesystem access for AI clients with root confinement, read-only mode, and file operations like read, write, search, copy, move, delete.
README
bridgemcp-server-filesystem
Official BridgeMCP reference server — safe filesystem access for AI clients.
Overview
bridgemcp-server-filesystem exposes ten filesystem tools to any MCP-compatible AI client (Claude Desktop, Cursor, etc.). It is the second official server in the BridgeMCP ecosystem and serves as the canonical reference implementation for filesystem access.
Key safety features:
- Root confinement — set
--root /workspaceto restrict all operations to that directory. Path traversal attacks (../../etc/passwd) and symlink escapes are blocked at thePath.resolve()level before any filesystem operation occurs. - Read-only mode — set
--read-onlyto expose a directory for inspection without permitting any writes. - File size limit — set
--max-file-size-mb 10to prevent accidentally reading large files. - Binary detection —
read_filedetects binary files before decoding and returns a structuredis_binary=Trueresponse instead of aUnicodeDecodeError. - Explicit delete confirmation —
delete_pathrequiresconfirm=Truein every call. The configured root can never be deleted.
Installation
pip install bridgemcp-server-filesystem
pip install 'bridgemcp-server-filesystem[mcp]' # for running as an MCP server
Quick start
Programmatic use:
from bridgemcp_filesystem import create_app
app = create_app(root="/workspace", read_only=False, max_file_size_mb=10.0)
app.run()
CLI use:
# Stdio transport (default) — for Claude Desktop / Cursor
bridgemcp-filesystem --root /workspace
# Read-only with a size limit
bridgemcp-filesystem --root /data --read-only --max-file-size-mb 5
# HTTP/SSE transport
bridgemcp-filesystem --root /app --http --port 8080
Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"filesystem": {
"command": "bridgemcp-filesystem",
"args": ["--root", "/workspace"]
}
}
}
Tools
| Tool | Description |
|---|---|
read_file |
Read file content. Returns is_binary=true, content=null for binary files. |
write_file |
Write text to a file. Optionally creates missing parent directories. |
list_directory |
List directory contents with type, size, and timestamps. |
search_files |
Glob search within a directory, optionally recursive. |
get_info |
Metadata for a file or directory: type, size, timestamps, permissions. |
create_directory |
Create a directory, optionally including parents. |
copy_path |
Copy a file or directory tree. |
move_path |
Move a file or directory. Supports cross-filesystem moves. |
rename_path |
Atomic rename within the same filesystem. |
delete_path |
Delete a file or directory. Requires confirm=True. |
Safety model
Root confinement
Set root to restrict all operations to a single directory tree:
app = create_app(root="/workspace")
Any path that resolves outside /workspace — including ../../etc/passwd and symlinks pointing out — raises an error before any IO occurs. The check uses Path.resolve() which follows all symlinks, so there is no way to escape the root through link indirection.
When root is not set, the server operates in unrestricted mode: any path on the filesystem is accessible. This is appropriate for trusted local tools but should not be used in multi-user or production environments.
Read-only mode
app = create_app(root="/data", read_only=True)
All mutating tools (write_file, create_directory, copy_path, move_path, rename_path, delete_path) raise an error immediately without touching the filesystem.
Delete safeguard
delete_path always requires confirm=True:
# This always raises an error:
app.call("delete_path", path="/workspace/file.txt")
# This proceeds with deletion:
app.call("delete_path", path="/workspace/file.txt", confirm=True)
The configured root directory can never be deleted, even with confirm=True.
Development
git clone https://github.com/Arsie-codes/bridgemcp-server-filesystem
cd bridgemcp-server-filesystem
pip install -e '.[dev]'
ruff check bridgemcp_filesystem tests
black --check bridgemcp_filesystem tests
pyright bridgemcp_filesystem
pytest tests/ -v
License
MIT — see LICENSE.
Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。