Rust MCP Filesystem
Operate safely inside explicitly allowed filesystem roots exposed by rust-mcp-filesystem (v0.4.5). The server exposes 24 tools (17 read/search/analysis tools + 7 write/archive tools) and runs read-only by default unless launched with -w / --allow-write.
Core Workflow
- Discover allowed scope: Call
list_allowed_directoriesbefore accessing paths so all targets stay inside permitted directories. - Orient cheaply: Use
list_directory,list_directory_with_sizes,directory_tree(passmax_depthon deep trees), orget_file_infobefore reading large files. - Search & locate:
- Use
search_files(globpattern, optionalexcludePatterns,min_bytes,max_bytes) to find paths. - Use
search_files_content(globpattern,query,is_regex,excludePatterns) for literal or regex content matches with line/column numbers.
- Use
- Read selectively:
- Prefer
head_file,tail_file, orread_file_lines(0-basedoffset+ optionallimit) on large logs or files. - Use
read_text_file(with_line_numbers: truewhen preparing edits) orread_multiple_text_filesfor batch reads; useread_media_file/read_multiple_media_files(withmax_bytes) for images/audio.
- Prefer
- Modify safely (requires
-w/--allow-write):- Prefer
edit_file(edits: [{oldText, newText}],dryRun: truefirst when risky,replaceAllonly when intended) overwrite_file(which overwrites existing files without warning). - Use
create_directory,move_file,zip_files,zip_directory, andunzip_fileonly when write mode is active.
- Prefer
Guardrails
- Never assume write access is enabled; if a write/archive tool fails with a read-only error, report that
-w/--allow-write(orALLOW_WRITE=true) is required on the server. - Watch parameter casing across tools:
search_filesandsearch_files_contenttakeexcludePatterns, whereasfind_duplicate_filesandfind_empty_directoriestakeexclude_patterns. - Note there is no built-in file deletion tool; use
move_fileor inspect allowed operations rather than guessing adelete_filetool. - Honor
--disable-tools: disabled tools are omitted fromtools/listand rejected if called.
References
- references/tools-reference.md: All 24 tools with exact parameter names, types, defaults, and read-only vs write-mode classification.
- references/setup-and-config.md: CLI flags (
-w,-t,-d), env vars, Docker permissions, MCP Roots behavior, and HTTP-to-stdio bridge notes.


