Filesystem MCP Server

🔍 Read-only MCP server for secure filesystem exploration, searching, and analysis

Local serverstdio

What is the Filesystem MCP Server?

🔍 Read-only MCP server for secure filesystem exploration, searching, and analysis

What you get

Secure filesystem MCP server for reading, writing, searching, diffing, and patching files.

A secure, production-ready Model Context Protocol server that gives AI assistants controlled access to the local filesystem. All operations are sandboxed to explicitly allowed directories with path traversal prevention, sensitive file blocking, and optional Bearer token authentication.

  • 18 filesystem tools — — read, write, search, diff, patch, hash, and bulk operations with structured output schemas
  • Security-first — — path validation, symlink escape prevention, sensitive file denylist, localhost-only CORS, Host header validation for loopback HTTP binds, optional API key auth
  • Dual transport — — stdio for local use, Node Streamable HTTP for networked/multi-session deployments
  • Structured output — — all tools return typed outputSchema / structuredContent for reliable LLM parsing
  • Self-documenting — — 6 built-in resources (internal://instructions, internal://tool-catalog, etc.) and 4 built-in prompts (get-help, compare-files, analyze-path, get-tool-help)

Configuration and credentials

  • Node.js >= 24

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
rootsList allowed workspace roots. Call first — all other tools are scoped to these directories.
findFind files by glob pattern. Returns matching files with metadata.
treeRender a directory tree with bounded recursion. Returns ASCII tree + structured JSON.
readRead text file contents. Use head/tail to preview first/last N lines of large files.
read_many
statGet file/directory metadata: size, modified, permissions, mime, tokenEstimate.
stat_many
grepSearch file contents (grep-like). Returns matching lines with optional context.
mkdir

How to install the Filesystem MCP Server

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@j0hanz/filesystem-mcp@latest"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Node.js >= 24

Example prompts to try

  • “Use Filesystem to Tools.”
  • “Use Filesystem to roots.”
  • “Use Filesystem to find.”

Frequently asked questions

🔍 Read-only MCP server for secure filesystem exploration, searching, and analysis Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.