Filesystem MCP Server

Secure, sandboxed filesystem access enabling agents to list, read, write, create, move, delete, search files and directories within allowed paths.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
4 · 2.9k · 67 current installs · 70 all-time installs
bySiddharth Menon@BuddhaSource
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
!
Purpose & Capability
The name/description match the instructions: it is a filesystem MCP server. However the registry entry contains no implementation or install spec; all functionality is delegated to an external npm package (and a GitHub repo referenced in SKILL.md). The skill claims a 'built-in security sandbox' and fine-grained enforcement but provides no local code or proof of that behavior in the registry. That mismatch (claims of enforcement + no local implementation/details) is a red flag.
!
Instruction Scope
SKILL.md instructs agents to list, read, write, move, delete, and search files — including examples touching system paths like /var/log and searching file contents for patterns such as 'API_KEY'. Those actions are within a filesystem tool's purpose, but the instructions lack concrete, verifiable sandbox/enforcement details (how symlinks, traversal, or root paths are handled). The docs also encourage content-search of files (which can reveal secrets) and show use of npx -y which will download/execute code automatically. The instructions therefore allow high-impact operations without documented safeguards.
!
Install Mechanism
There is no registry-level install spec; the SKILL.md tells operators to install or run @modelcontextprotocol/server-filesystem via npm / npx or clone a GitHub repo. Using npx (especially with -y) will fetch and execute code from the public npm registry at runtime, which is expected for a tool but is an execution risk and should be verified. The referenced sources (npm package and GitHub repo) are not included or validated in the registry entry, and no integrity/verification guidance is provided.
Credentials
The skill does not request any environment variables, credentials, or config paths in the registry (good). However its examples show scanning for secrets (e.g., searching for 'API_KEY') and accessing system-level paths. While these capabilities are coherent with a filesystem tool, they are powerful and can expose secrets if misconfigured. The registry does not request unrelated credentials, so requested secrets are proportionate — but the examples encourage sensitive searches.
Persistence & Privilege
Flags are default: always:false, user-invocable:true, model invocation allowed. The skill does not request persistent elevated privileges or modify other skills' configs in the registry. Autonomous invocation is allowed (platform default) but not by itself a concern here.
What to consider before installing
This skill is instruction-only and claims to be a secure, sandboxed filesystem server but provides no code or verified install in the registry — it only tells you to install/run an external npm package (via npx) or clone a GitHub repo. Before installing or using it: 1) Verify the npm package and GitHub repo (owner, recent commits, maintainers) and inspect the code for the sandbox/enforcement you expect; do not run npx -y blindly. 2) Avoid granting the server broad allowed directories (e.g., /, /var, your home) — restrict allowed paths to the minimal directories needed. 3) Test the package in an isolated environment (container or VM) and confirm directory traversal, symlink, and permission behaviors. 4) If you plan to use automated agents with this skill, require explicit confirmations for destructive actions and audit logs. 5) If you cannot verify the upstream package or source, treat this skill as untrusted and avoid using it with sensitive data or system paths.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk9737w5vpc0rwatpjr3wgdvqnn815ax6

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Filesystem MCP Server

Secure File Operations for AI Agents

Official MCP reference implementation providing safe, sandboxed filesystem access with fine-grained permission controls.

Why Filesystem MCP?

🔒 Security-First Design

  • Sandboxed Access: Agents can only access explicitly allowed directories
  • Permission Controls: Read-only, write, or full access per directory
  • Path Validation: Prevents directory traversal and unauthorized access
  • Audit Trail: All operations logged for security review

🤖 Essential for Agent Workflows

Most agent tasks involve files:

  • Reading documentation
  • Writing code files
  • Analyzing logs
  • Generating reports
  • Managing project files
  • Organizing content

📦 Zero External Dependencies

Pure implementation using Node.js built-in modules. No external API dependencies or rate limits.

Installation

# Official reference implementation
npm install -g @modelcontextprotocol/server-filesystem

# Or build from source
git clone https://github.com/modelcontextprotocol/servers
cd servers/src/filesystem
npm install
npm run build

Configuration

Add to your MCP client config:

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

Arguments = allowed directories (one or more paths)

Permission Modes

Read-Only Access:

"args": ["--read-only", "/path/to/docs"]

Full Access (default):

"args": ["/path/to/workspace"]

Example Configurations

Development Workspace

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/dev/projects",
        "/Users/dev/workspace"
      ]
    }
  }
}

Documentation Access (Read-Only)

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "--read-only",
        "/Users/docs/knowledge-base"
      ]
    }
  }
}

Available Tools

Directory Operations

1. List Directory (list_directory)

Agent: "What files are in my Projects folder?"
Agent: "Show contents of /workspace/src"

Returns:

  • File names
  • File types (file, directory, symlink)
  • File sizes
  • Last modified timestamps

2. Create Directory (create_directory)

Agent: "Create a new folder called 'components'"
Agent: "Make directory /workspace/tests"

3. Move/Rename (move_file)

Agent: "Rename old-name.txt to new-name.txt"
Agent: "Move report.pdf to /Documents/Reports/"

File Operations

4. Read File (read_file)

Agent: "Read the contents of config.json"
Agent: "Show me the README.md file"

Supports:

  • Text files (UTF-8)
  • JSON, YAML, XML
  • Markdown, code files
  • Large files (streaming)

5. Write File (write_file)

Agent: "Create a file called notes.txt with meeting notes"
Agent: "Write the generated code to src/index.ts"

6. Edit File (edit_file)

Agent: "Replace 'version: 1.0' with 'version: 2.0' in package.json"
Agent: "Add a new function to utils.js"

7. Get File Info (get_file_info)

Agent: "When was report.pdf last modified?"
Agent: "What's the size of data.csv?"

Returns:

  • File size (bytes)
  • Creation time
  • Last modified time
  • Permissions
  • File type

Advanced Operations

8. Search Files (search_files)

Agent: "Find all Python files in the project"
Agent: "Search for files containing 'API_KEY'"

Search by:

  • File name pattern (glob)
  • File content (regex)
  • File type
  • Date modified

9. Delete File (delete_file)

Agent: "Delete the temporary log files"
Agent: "Remove old-backup.zip"

Safety:

  • Requires confirmation for large files
  • Cannot delete files outside allowed directories
  • Logged for audit

Agent Workflow Examples

Code Generation

Human: "Create a React component for a login form"

Agent:
1. create_directory("/workspace/components")
2. write_file("/workspace/components/LoginForm.tsx", generated_code)
3. write_file("/workspace/components/LoginForm.test.tsx", test_code)
4. "Created LoginForm component at components/LoginForm.tsx"

Log Analysis

Human: "Analyze error logs and summarize issues"

Agent:
1. list_directory("/var/log/app")
2. read_file("/var/log/app/error.log")
3. search_files(pattern="ERROR", path="/var/log/app")
4. generate_summary()
5. write_file("/reports/error-summary.md", summary)

Project Organization

Human: "Organize my documents by type"

Agent:
1. list_directory("/Documents")
2. For each file:
   - get_file_info(file)
   - Determine file type
   - create_directory("/Documents/[type]")
   - move_file(file, destination_folder)

Documentation Generation

Human: "Generate API documentation from code comments"

Agent:
1. search_files(pattern="*.ts", path="/src")
2. For each file:
   - read_file(file)
   - extract_doc_comments()
3. Generate markdown docs
4. write_file("/docs/API.md", generated_docs)

Security Model

Sandbox Enforcement

What Agents CAN Do:

  • ✅ Access explicitly allowed directories
  • ✅ Create/read/write files within allowed paths
  • ✅ List directory contents
  • ✅ Search within allowed paths

What Agents CANNOT Do:

  • ❌ Access parent directories (../)
  • ❌ Access system files (/etc/, /sys/)
  • ❌ Follow symlinks outside allowed paths
  • ❌ Execute binaries or scripts
  • ❌ Modify file permissions

Path Validation

Allowed: /Users/dev/projects
Agent tries: /Users/dev/projects/src/index.ts → ✅ Allowed
Agent tries: /Users/dev/projects/../secret → ❌ Blocked
Agent tries: /etc/passwd → ❌ Blocked

Best Practices

  1. Principle of Least Privilege

    • Grant only necessary directories
    • Use --read-only when write not needed
  2. Never Allow Root Access

    • Don't add / or system directories
    • Restrict to user workspace
  3. Audit Agent Actions

    • Review MCP server logs regularly
    • Monitor for unexpected file access patterns
  4. Separate Sensitive Data

    • Keep credentials, keys in separate directories
    • Don't include in allowed paths

Use Cases

📝 Content Management

Agents generate blog posts, reports, documentation and save to organized folders.

🤖 Code Assistants

Read project files, generate code, create tests, update configurations.

📊 Data Analysis

Read CSV/JSON data files, analyze, generate reports and visualizations.

🗂️ File Organization

Scan directories, categorize files, move to appropriate folders, cleanup duplicates.

📚 Knowledge Base

Index markdown files, search documentation, extract information, update wikis.

🔍 Log Analysis

Parse log files, identify errors, generate summaries, create alerts.

Performance

Large Files

  • Streaming for files >10MB
  • Incremental reads supported
  • Memory-efficient processing

Directory Scanning

  • Recursive search optimized
  • Glob pattern matching
  • Ignore patterns (e.g., node_modules/)

Concurrent Operations

  • Safe for parallel file access
  • Atomic write operations
  • File locking where needed

Troubleshooting

"Permission denied" Error

  • Verify path is in allowed directories
  • Check filesystem permissions
  • Ensure MCP server has read/write access

"Path not found" Error

  • Confirm directory exists
  • Check for typos in path
  • Verify path format (absolute vs relative)

Read-Only Mode Issues

  • Can't write in --read-only mode
  • Reconfigure server with write access if needed

vs Other File Access Methods

MethodSecurityAgent IntegrationSetup
Filesystem MCP✅ Sandboxed✅ Auto-discoveredSimple
Direct FS Access❌ Full system❌ ManualNone
File Upload/Download✅ Manual control⚠️ LimitedComplex
Cloud Storage API✅ API-level⚠️ Requires SDKComplex

Resources

Advanced Configuration

{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": [
        "/path/to/filesystem-server/build/index.js",
        "/workspace",
        "/documents"
      ],
      "env": {
        "MAX_FILE_SIZE": "10485760",
        "ENABLE_LOGGING": "true",
        "LOG_PATH": "/var/log/mcp-filesystem.log"
      }
    }
  }
}

Safe, secure filesystem access for agents: From code generation to log analysis, Filesystem MCP is the foundation for agent file operations.

Files

1 total
Select a file
Select a file to preview.

Comments

Loading comments…