Filesystem

Filesystem

Official
anthropic

Provides secure filesystem operations for AI agents with batch processing to read, write, and search files while staying confined to your project directory.

80,5271,618 views9,820Local (stdio)

What it does

  • Read and write files in batch operations
  • Search file contents with pattern matching
  • List directory contents recursively
  • Create and delete files safely
  • Validate file paths within project boundaries
  • Process multiple files in single requests

Best for

AI agents needing safe file accessDevelopers building MCP-enabled toolsAutomating file operations in projectsCode analysis and modification workflows
Token-optimized batch operationsProject root security boundaries10+ files per request

Tools (14)

read_file

Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.

read_text_file

Read the complete contents of a file from the file system as text. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Use the 'head' parameter to read only the first N lines of a file, or the 'tail' parameter to read only the last N lines of a file. Operates on the file as text regardless of extension. Only works within allowed directories.

read_media_file

Read an image or audio file. Returns the base64 encoded data and MIME type. Only works within allowed directories.

read_multiple_files

Read the contents of multiple files simultaneously. This is more efficient than reading files one by one when you need to analyze or compare multiple files. Each file's content is returned with its path as a reference. Failed reads for individual files won't stop the entire operation. Only works within allowed directories.

write_file

Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.