CoreOfficialβ˜… 18.2k

Filesystem Operations β€” Read, Write, Search & Manage Files

Give your AI agent direct access to your local file system. Read, write, create, move, search, and manage files and directories with natural language commands β€” safely sandboxed to allowed paths.

Why This Skill Matters

The Filesystem skill is the most fundamental MCP server in the OpenClaw ecosystem. Without it, your agent can't read config files, write reports, organize downloads, or manage project structures. It's the backbone of nearly every automation workflow.

  • Read Any File: Parse configuration files, logs, CSVs, markdown, and code. The agent understands file content and can answer questions about it.
  • Write & Edit: Create new files, append to logs, update config values, write reports β€” all through conversation.
  • Directory Operations: Create folder structures, move/rename files, list directory trees recursively.
  • Search: Find files by name, extension, or content across your entire allowed directory tree.

Security Model

The Filesystem MCP uses a strict allowlist model. You specify exactly which directories the agent can access β€” everything else is blocked. This prevents accidental access to system files, SSH keys, or other sensitive data.

"mcpServers": {
  "filesystem": {
    "command": "npx",
    "args": [
      "-y", "@modelcontextprotocol/server-filesystem",
      "/Users/you/Documents",
      "/Users/you/Projects"
    ]
  }
}

The paths listed in args are the only directories the agent can access. Add or remove paths to control scope.

Top Use Cases

  1. "Read my project's README.md and suggest improvements for clarity and SEO."
  2. "Find all .env files in my projects directory and check if any contain hardcoded API keys."
  3. "Organize my Downloads folder: move PDFs to Documents/PDFs, images to Pictures, and delete files older than 30 days."
  4. "Create a new project structure with src/, tests/, docs/ folders and a basic package.json."
  5. "Watch my ~/logs/ folder and alert me when any log file contains 'ERROR' or 'CRITICAL'."

Available Tools

ToolDescription
read_fileRead complete file contents
write_fileCreate or overwrite a file
edit_fileMake targeted edits to existing files
list_directoryList all files and subdirectories
search_filesRecursively search by name pattern
move_fileMove or rename files/directories
get_file_infoGet metadata (size, modified, permissions)
$ cd ../* END_OF_FILE */