Skip to content

Filesystem MCP

Server: user-filesystem / filesystem

Default file I/O channel. Prefer MCP across environments; fall back to host-native tools (Cursor Read/Write/StrReplace) when unavailable.

Tools

ToolPurpose
read_text_fileRead text (preferred)
read_fileRead file (supports head/tail)
read_multiple_filesBatch read
read_media_fileRead media
write_fileWrite (must read first to check existence)
edit_filePrecise edit on existing file
move_fileMove/rename
list_directoryList directory
list_directory_with_sizesList with sizes
list_allowed_directoriesView whitelist roots
directory_treeDirectory tree
search_filesSearch by filename/path pattern
get_file_infoFile metadata
create_directoryCreate directory

Read/Write Policy

Read

  1. read_text_file (preferred) or read_file
  2. If path uncertain → list_allowed_directories first
  3. One MCP failure → fall back to host Read with one-line reason

Write

  1. Must read_text_file to check existence first
  2. Not exists → write_file to create
  3. Exists and not full overwrite → edit_file
  4. Forbidden: write_file overwrite without existence check
NeedPrefer
Symbols / call chains / impactCodegraph
Exact string / i18n keyHost Grep
Filename / path patternsearch_files
Directory structuredirectory_tree

Whitelist

list_allowed_directories roots must cover the workspace root.

ScenarioRecommended root
Frontend repo only…/AOPS/ui
Monorepo…/AOPS

Not recommended: only …/ui/src — breaks reads of .cursor/rules, package.json, etc.

See Host Setup.

Examples

text
Read package.json at project root
text
Change "Hello, World!" to "Hello, MCP!" in hello.py