Roots decide the blast radius
Before adding the server, list the exact directories the client should see. A narrow project root is safer than a broad home-folder grant.
MCP Server
Reference ServerLocal FilesMIT Licenseby Anthropic · modelcontextprotocol/servers
Filesystem MCP Server is the reference implementation that ships alongside the Model Context Protocol specification. It gives AI agents sandboxed, read-write access to specific directories on your local machine — with strong guarantees that nothing outside your whitelisted paths can be touched.
Think of it as a minimal, auditable stand-in for the filesystem primitives every coding agent needs: read, write, list, move, search. Because it is maintained by Anthropic as a reference server, it tends to track protocol updates first and serves as the canonical example for new MCP authors.
Quick Install
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/projectOfficial spec handoff
The official MCP docs now make roots and resources central to how clients expose local context. For this server, the practical question is not "can the agent read files"; it is "which roots are safe, reviewable, and temporary."
Before adding the server, list the exact directories the client should see. A narrow project root is safer than a broad home-folder grant.
A client may show files as resources, but write access still needs explicit tool behavior and review in the MCP client.
Filesystem edits are strongest when the next step is a GitHub diff, PR, or issue trail that a human can inspect.
Read the contents of any file inside allowed roots. Returns UTF-8 text with line numbers and handles large files with streaming.
Create new files or overwrite existing ones. Most MCP clients confirm destructive writes with a diff preview before applying.
Get a tree view of any directory with file sizes and modified timestamps. Useful for agents to orient themselves in an unfamiliar repo.
Glob or regex search across all allowed roots. Ideal for "find every file that still imports lodash" or "locate all TODO comments".
Atomic file and directory moves. The agent can batch-rename files or reorganize folder structures in a single confirmed operation.
The server refuses any path outside the directories you pass at startup — including symlink escape attempts and ".." traversal.
Execution Brief
Use this page as a rollout checklist, not just reference text.
Tool Mapping Lens
Catalog-oriented pages work best when users can map discovery, evaluation, and rollout in a clear path instead of reading an undifferentiated list.
Use this board for Filesystem MCP Server before rollout. Capture inputs, apply one decision rule, execute the checklist, and log outcome.
Input: Objective
Deliver one measurable improvement with filesystem mcp server claude code local file access setup
Input: Baseline Window
20-30 minutes
Input: Fallback Window
8-12 minutes
| Decision Trigger | Action | Expected Output |
|---|---|---|
| Input: one workflow objective and release owner are defined | Run preview execution with fixed acceptance criteria. | Go or hold decision backed by repeatable evidence. |
| Input: output quality below baseline or retries increase | Limit scope, isolate root issue, and rerun controlled test. | One confirmed correction path before wider rollout. |
| Input: checks pass for two consecutive replay windows | Promote to broader traffic with fallback path active. | Stable rollout with low operational surprise. |
tool=filesystem mcp server claude code local file access setup objective= preview_result=pass|fail primary_metric= next_step=rollout|patch|hold
Filesystem MCP Server is one of the reference servers published by Anthropic in the modelcontextprotocol/servers monorepo. It implements the standard set of filesystem primitives that almost every AI agent eventually needs: read, write, list, search, move, and get metadata for files.
The server runs as a subprocess launched by your MCP client (Claude Code, Cursor, Continue, Windsurf, and others). You pass it a list of allowed directories at startup, and those become the only paths the AI can touch. Everything else on disk is invisible — the server returns a permission error even for read operations outside those roots.
Because it is a reference implementation, it is intentionally small, dependency-light, and easy to audit. It is also the template most community MCP servers fork from, so understanding it is a shortcut to understanding the protocol itself.
It pairs especially well with other MCP servers. Filesystem + GitHub MCP lets an agent clone a repo, modify files locally, and push a PR. Filesystem + Postgres MCP lets an agent read a SQL file from disk and execute it against your dev database. The composability is where MCP earns its keep.
Choose the directory you want to expose — usually a single project root. Never expose your home directory or /etc. The server respects symlinks but cannot escape the allowed roots.
Register it with your MCP client. For Claude Code: claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/myproject. For Cursor or Windsurf, add the equivalent entry to their MCP config JSON.
Verify with a read-only prompt: "List every TypeScript file in this project and count lines." If the agent can complete the task, the server is wired up correctly.
Graduate to write operations. Start with a throwaway scratch directory, confirm the client asks for approval on each write, and then extend to your real project once you trust the flow.
Treat this page as a decision map. Build a shortlist fast, then run a focused second pass for security, ownership, and operational fit.
When a team keeps one shared selection rubric, tool adoption speeds up because evaluators stop debating criteria every time a new option appears.
Outcome: A tedious 30-minute IDE-wide refactor compressed into a 90-second agent workflow, with a clear diff trail for code review.
Outcome: A 15-minute codebase tour reduced to 60 seconds, producing a written artifact you can drop into your team docs.
Filesystem MCP Server is one of the reference Model Context Protocol servers maintained by Anthropic in the modelcontextprotocol/servers repository. It exposes a set of filesystem tools — read_file, write_file, list_directory, move_file, search_files, get_file_info — to any MCP client such as Claude Code, Cursor, or Windsurf, but only within directories you whitelist at startup.
Run it with npx via your MCP client. For Claude Code: claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /Users/you/code /Users/you/docs. Every path you pass becomes an allowed root; the server refuses any operation outside those roots.
Yes if you scope it properly. The server only operates inside the directories you pass as CLI arguments — it cannot escape them even via symlinks or ".." traversal. Most MCP clients also prompt before destructive actions (write, move, delete). Start with a single project directory, and add more roots only as needed.
It handles text files efficiently with streamed reads. For very large files, prefer search_files with a pattern over read_file. Binary files can be read but most agents will refuse to process non-UTF8 content; use a dedicated tool for images or PDFs instead.
Claude Code ships with its own Read/Write/Edit tools that already cover most local workflows. The Filesystem MCP Server is more useful when you want the same agent to touch directories outside your project root, or when you use clients that do not ship with file tools (Continue, some IDE plugins, custom agents).
Batch renaming files across a directory tree, searching a legacy repo for a specific pattern, migrating config files between projects, generating documentation by reading a whole folder, or letting a non-coding agent (e.g. a research assistant) drop notes into a specific Obsidian vault.
Send the exact workflow you are solving and we will prioritize a new comparison or rollout guide.