Skip to main content

bridgemcp-server-filesystem

Official BridgeMCP reference server — safe filesystem access for AI clients.

CI PyPI Python License: MIT

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 /workspace to restrict all operations to that directory. Path traversal attacks (../../etc/passwd) and symlink escapes are blocked at the Path.resolve() level before any filesystem operation occurs.
  • Read-only mode — set --read-only to expose a directory for inspection without permitting any writes.
  • File size limit — set --max-file-size-mb 10 to prevent accidentally reading large files.
  • Binary detection — read_file detects binary files before decoding and returns a structured is_binary=True response instead of a UnicodeDecodeError.
  • Explicit delete confirmation — delete_path requires confirm=True in 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

Metadata

Release files for bridgemcp-server-filesystem 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bridgemcp-server-filesystem 0.1.1
File Size Uploaded Provenance
bridgemcp_server_filesystem-0.1.1.tar.gz 26.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bridgemcp-server-filesystem 0.1.1
File Interpreter ABI Platform
bridgemcp_server_filesystem-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / bridgemcp_server_filesystem-0.1.1.tar.gz

Download URL bridgemcp_server_filesystem-0.1.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c947263332dba526e7f27c1335c27007b360cb4d7fb33999eeddbd53a9caf5d7
BLAKE2b-256 checksum
How to use checksums
03c74330f14d2046899ecc723226dc863d3caa06051eaaf3f360f6196b09fd6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / bridgemcp_server_filesystem-0.1.1-py3-none-any.whl

Download URL bridgemcp_server_filesystem-0.1.1-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ac6ebcaac3b3cbc9279aec10490f0f2bdbb73ee1f3090ddf467215554a5f116
BLAKE2b-256 checksum
How to use checksums
a3acdba371f6bd3263d1626755ec329e43f4da90ac25b9327d44ab28639f9f31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for bridgemcp-server-filesystem 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page