The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Fs MCP Rs listing page.
A fast, configurable filesystem server for the Model Context Protocol (MCP), written in Rust.
fs-mcp-rs gives an MCP client a small set of filesystem tools while keeping access inside directories selected by the operator. It has no implicit filesystem root, no built-in personal path, and no writable default. The server starts only when you provide a configuration file.
The public distribution is one crate and one executable, both named fs-mcp-rs. The protocol, policy, filesystem, search, and settings components remain separate Rust modules inside that crate. This keeps installation simple:
Users do not need to install or understand a graph of internal crates. The benchmark runner remains a development-only workspace member and is not included in the crates.io package.
npx fs-mcp-rs..gitignore support and configurable hidden-file handling.[OK] / [WARN]).npx execution, or Rust 1.85+ when building from source.The easiest way to run fs-mcp-rs with any MCP client (such as Claude Desktop or Cursor) is using npx:
The npm package automatically downloads the appropriate precompiled binary for your operating system and architecture (Windows x64, Linux x64, macOS x64/arm64).
The executable will be at target/release/fs-mcp-rs on Unix-like systems or target\release\fs-mcp-rs.exe on Windows.
Copy configs/example.toml somewhere appropriate and edit it. The server intentionally has no default config path:
Windows PowerShell:
Minimal read-only configuration:
Windows roots use escaped backslashes or forward slashes:
Relative roots are resolved relative to the directory containing the configuration file, not relative to an arbitrary process working directory.
[server]host: IP address to bind. Keep 127.0.0.1 unless remote clients genuinely need access.port: TCP port for /health and /mcp.max_concurrency: maximum number of MCP requests processed at once.max_io_concurrency: maximum number of simultaneous non-search filesystem jobs.log_tools: whether concise tool execution logging ([OK] / [WARN]) is printed (default: true).[filesystem]roots: non-empty list of allowed directories. Every requested path must resolve inside one of them.read_only: when true, all mutating tools are rejected.max_write_bytes: largest permitted write_file or resulting edit_text content.follow_links: whether paths containing symbolic links may be followed. Leave this false unless you have reviewed the consequences.[search]max_results: maximum matches returned by one search.max_concurrency: maximum simultaneous search jobs.worker_threads: filesystem traversal threads used by each search.regex_cache_capacity: number of compiled search patterns cached in memory; 0 disables the cache.include_hidden: include hidden files and directories.respect_gitignore: apply Git ignore files while walking directories.[terminal]enabled: expose command execution. When disabled, run_command returns a tool error.max_concurrency: maximum terminal commands running simultaneously.default_timeout_ms: timeout used when a call does not provide one.max_timeout_ms: largest timeout a call may request.max_output_bytes: maximum combined stdout/stderr bytes retained per terminal session. Old output is evicted and reported as dropped/truncated.max_read_bytes: maximum output bytes returned by one terminal_read call.max_wait_ms: maximum long-poll duration for one terminal_read call.session_retention_ms: how long completed sessions and their output remain readable before automatic cleanup.run_command executes arbitrary commands through cmd.exe on Windows and /bin/sh on GNU/Linux and macOS. It is advertised with destructive and open-world MCP annotations so compatible providers can show a warning. Enabling it gives commands all permissions of the operating-system account running the server; filesystem roots and read-only mode do not sandbox terminal commands.
Unknown fields and zero-valued safety limits are rejected. This catches misspelled settings instead of silently ignoring them.
Start directly by specifying allowed filesystem directories on the command line:
If no configuration file or positional roots are passed, fs-mcp-rs uses default settings scoped to the current working directory.
Pass the configuration explicitly:
Or use the environment variable:
PowerShell:
--stdio. Structured logs are written to stderr to keep stdout clean for line-delimited JSON-RPC messages./health and /mcp endpoints.Check HTTP health:
Expected response:
The MCP endpoint is:
The run subcommand always starts the MCP server in HTTP mode and can manage an ngrok, Cloudflare Quick Tunnel, or zrok public share in the same process lifecycle:
The providers are mutually exclusive. On Windows, the tunnel opens in a new console by default. Use --tunnel-window hidden to avoid a separate visible console while keeping the generated URL in the current terminal, or --tunnel-window inherit to attach normally. On Linux and macOS, new inherits the current terminal because creating a terminal window is desktop-specific. Each provider accepts repeatable extra arguments and an explicit executable path:
Stopping the MCP server also stops the tunnel process. Existing invocations such as fs-mcp-rs [PATHS], fs-mcp-rs --config FILE, and fs-mcp-rs serve are unchanged. The earlier --ngrok-window spelling remains an alias for --tunnel-window.
For testing with a remote MCP client, keep fs-mcp-rs bound to loopback and expose it through a tunnel. Start the server first:
Verify the local endpoint before creating a tunnel:
[!CAUTION] A public tunnel URL gives remote clients a path to the tools and filesystem roots allowed by your configuration. Start with
read_only = true, grant only narrowly scoped roots, never expose secrets, and stop the tunnel when it is no longer needed. Quick tunnels are intended for development—not permanent production hosting.
Install cloudflared, then create a temporary Quick Tunnel:
cloudflared prints a temporary URL similar to https://random-name.trycloudflare.com. Use the MCP endpoint with /mcp appended:
For a stable hostname, create a named Cloudflare Tunnel, map a DNS hostname to it, and route that hostname to http://127.0.0.1:8000. Protect long-lived deployments with Cloudflare Access or another authentication layer.
Install ngrok, authenticate its CLI if required by your account, and start an HTTP tunnel:
Use the HTTPS forwarding URL shown by ngrok and append /mcp:
The local inspection UI is normally available at http://127.0.0.1:4040. It can expose request details, so keep it local and do not share it publicly.
Use the public HTTPS URL as an HTTP/Streamable HTTP MCP server:
Test both endpoints after the tunnel starts:
A non-200 response from a plain GET /mcp can be expected because MCP communication uses protocol requests; the important checks are that /health is reachable and that the MCP client can initialize a session.
For a persistent deployment, prefer a private network/VPN or a named authenticated tunnel. Run fs-mcp-rs under a dedicated low-privilege account and a service manager, keep it bound to loopback, terminate TLS at the tunnel or reverse proxy, restrict client access, pin the configuration path, and monitor logs. Do not rely on an unprotected public URL as the only security boundary.
fs-mcp-rs can be configured as a local STDIO subprocess or a remote/local HTTP service in MCP clients like Claude Desktop, Cursor, VS Code, or Windsurf.
No pre-installation required:
Or using an installed binary with explicit --stdio:
Start fs-mcp-rs as a long-running service, then point your client to the /mcp HTTP endpoint:
Do not expose HTTP endpoints to untrusted networks without authentication or TLS.
list_directory: list direct children of a directory.read_file: read a UTF-8 byte range with explicit offset and length.write_file: atomically create or replace a UTF-8 file. Set createParents: true for a new nested path; the server safely creates missing parent directories after validating the allowed root. The default is false.search_files: find paths whose file name contains a string.search_content: case-insensitive literal or regex search in text files.get_capabilities: report sanitized effective limits, roots, protocol versions, and advertised tools.list_tree: return a bounded, deterministic, paginated flat directory tree.apply_patch: atomically apply a validated single-file unified text diff; dryRun never mutates.file_info: return rich metadata and an optional bounded-streaming BLAKE3 digest.create_directory: create one directory; parents must already exist.remove: remove one file or an empty directory.hash_file: calculate a BLAKE3 file hash.move: move without overwriting an existing destination.edit_text: replace an exact expected number of text matches atomically.terminal_start: start a persistent command and immediately return a session ID.terminal_read: incrementally read stdout/stderr events using a byte cursor; optionally long-poll for new output.terminal_write: write UTF-8 data to a running session's stdin.terminal_close_stdin: send EOF to a running session.terminal_kill: terminate the session's complete process tree.terminal_close: explicitly remove a completed session and retained output.run_command: execute an arbitrary shell command with optional working directory and timeout, waiting for completion for backward compatibility.Mutating tools remain visible in read-only mode but return a clear tool error. This lets one client configuration work with both read-only and writable deployments.
edit_text requires an expected replacement count, preventing accidental broad edits.Recommended production posture:
read_only = true.Filesystem checks can still be affected by operating-system races if another process can replace path components during an operation. Do not share writable roots with untrusted local users.
Discover effective constraints without probing paths:
List a deterministic tree page and continue with the returned cursor:
Validate a one-file patch without mutating the target:
Request rich metadata and a bounded streaming hash:
apply_patch rejects binary, multi-file, create/delete, and rename patches. All hunks apply atomically or none do. It preserves the target's existing LF or CRLF convention and final-newline state. dryRun performs complete validation but never writes, including in read-only mode.
The following optional [filesystem] fields have validated defaults, so existing configuration files continue to load:
| Field | Default | Constraint |
|---|---|---|
tree_max_depth | 8 | Positive maximum recursive depth |
tree_max_entries | 1000 | Positive maximum entries returned per page |
tree_max_warnings | 32 | Positive maximum skipped-entry warnings |
patch_max_bytes | 1048576 | Positive maximum unified-diff input bytes |
patch_preview_bytes | 16384 | Positive and no greater than patch_max_bytes |
list_tree uses the search hidden-file and Git-ignore settings. Cursors are opaque and bound to the canonical root, depth, and filters. Every requested path still passes through Policy; these tools do not weaken root isolation, read-only enforcement, or symlink restrictions.
file_info replaces the former public stat tool. stat is no longer advertised or dispatched. Clients should migrate to file_info; set includeHash only when a BLAKE3 digest is needed.
All structured tracing logs are printed to stderr to ensure stdout remains clean for JSON-RPC 2.0 frames when running in STDIO mode. Set RUST_LOG to control verbosity:
Use debug only while troubleshooting because paths may appear in diagnostic output.
When log_tools = true (the default), fs-mcp-rs logs a single line summarizing each tool invocation:
[OK] read_file src/main.rs (3 ms)[WARN] read_file outside/allowed/path - OUTSIDE_ALLOWED_ROOT: path outside allowed roots (0 ms)Tool logging can be disabled in your TOML config under [server]: log_tools = false.
Run the complete local gate before opening a release:
On Windows, scripts\build.cmd runs the same checks. Continuous integration (.github/workflows/ci.yml) runs formatting, linting, and tests on Ubuntu, macOS, and Windows runners. GitHub Actions release workflow (.github/workflows/release.yml) builds precompiled binary archives for all major platforms and releases them alongside the npm package.
Benchmark methodology is documented in BENCHMARKS.md. Performance claims should be accompanied by raw results, machine details, configuration, and commit hashes.
Copyright (C) 2026 nihmadev (lolz@nihmadev.fun).
Licensed under GNU GPL version 3 or any later version (GPL-3.0-or-later). See LICENSE and the canonical license text at https://www.gnu.org/licenses/gpl-3.0.html.