Expand description
A bounded, root-isolated filesystem server for the Model Context Protocol (MCP).
The crate separates path-policy enforcement, filesystem operations, search,
protocol types, configuration, and child-process management into independent
modules. Applications can embed these modules directly or run the bundled
fs-mcp-rs binary using either HTTP POST or STDIO JSON-RPC transports.
§Transports & Execution Modes
- STDIO Mode: Standard input/output line-delimited JSON-RPC 2.0 streaming,
ideal for local MCP client subprocess integration (e.g. via
npx fs-mcp-rs). - HTTP Mode: Streamable HTTP server exposing
/mcpand/healthendpoints with optional OAuth 2.0 / OIDC authentication metadata. - CLI Quickstart: Roots can be passed directly as positional arguments or configured via TOML files and environment variables.
§Security model
All filesystem entry points accept a security::Policy. The policy
canonicalizes paths, confines them to configured roots, optionally rejects
symbolic links, and can disable every write operation.
§Resource bounds
Reads, writes, search results, terminal output, terminal reads, execution time, and concurrency are bounded by configuration. File replacement is performed through a temporary file in the destination directory.
§Modules
filesystemprovides bounded and atomic filesystem operations.searchimplements parallel filename and text search.securityvalidates paths against the configured access policy.protocolcontains the JSON-RPC and MCP wire types.settingsloads and validates TOML configuration.terminalmanages bounded persistent command sessions.treegenerates bounded and paginated directory trees.patchvalidates and applies unified diff text patches.cli_formatgenerates client configuration snippets and help views.wizardinteractive setup wizard for initial configuration.
Modules§
- cli_
format - Formatting utilities for CLI guidance, tools catalog, client snippets, and config validation summaries.
- filesystem
- Bounded filesystem operations guarded by an access policy.
- patch
- Safe, bounded application of a unified diff to one existing UTF-8 file.
- protocol
- JSON-RPC 2.0 and Model Context Protocol wire types.
- search
- Parallel, bounded filename and file-content search.
- security
- Filesystem access-policy enforcement.
- settings
- Command-line and TOML configuration.
- terminal
- Bounded command execution and persistent terminal sessions.
- tree
- Bounded, deterministic, flat directory-tree traversal.
- wizard
- Interactive CLI setup wizard for creating fs-mcp-rs configuration files.