Filesystem MCP Server
Official reference server for reading, writing, searching and moving files, limited to the directories you allow. Version 2.4.1 (Nov 27, 2026, reference servers v2.6.0): on Windows, update to 2.4.1 or later; the directory-listing tools now check a listed folder before and after reading it and refuse a path with a junction or symlink on it, narrowing the Windows gap left by GHSA-rq2p-q7c4-6g27 (a swap made and undone during the read is still not detected on Windows; macOS and Linux are unchanged). It also explains empty search_files results and refuses to move a directory into itself with a clear reason. Version 2.4.0 (Nov 18, 2026, reference servers v2.5.0) is a security update: the directory-listing tools (list_directory, list_directory_with_sizes, directory_tree, search_files) now list the folder that was checked, so a folder swapped for a symlink can no longer reveal the names of files outside the allowed directories (GHSA-rq2p-q7c4-6g27). Since v2.5.0 every reference server can also serve Streamable HTTP on this computer with --transport streamable-http (127.0.0.1:3001 by default); stdio stays the default. Over HTTP it needs the allowed directories on the command line. Version 2.3.0 (Nov 11, 2026, reference servers v2.4.0) is a security update: reads now stay with the file that was checked, so a folder swapped for a symlink mid-read can no longer return a file from outside the allowed directories (GHSA-p9cv-8g75-4xcg; on Windows this narrows the race without fully closing it), and move_file only moves the source it checked (GHSA-7m4x-rv66-mxhh). It also adds --read-only-dir for per-directory read-only access and refuses Windows alternate-data-stream and device-name paths. Version 2.2.0 (Nov 4, 2026) added append_file and copy_file, a --read-only mode, --confine-roots and file:// resources. Version 2.0.1 (Oct 24, 2026) fixed four earlier symlink and look-alike path flaws. Since 2.0.0 it needs Node 24 or newer. Because these servers run on your own Node.js, the maintainers ask you to use Node 24.22.1 or 26.12.1 or later (the October 2026 Node security releases); check with node --version. If you pinned an old date version (2025.x or 2026.x), npm will not offer 2.x as an upgrade, so request @modelcontextprotocol/[email protected] explicitly.
Install
npx -y @modelcontextprotocol/server-filesystem /Users/username/Desktop /path/to/other/allowed/dirExample config (Cursor / Claude Desktop)
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}The same mcpServers block works in Cursor, Claude Desktop and Devin Desktop. VS Code (Copilot) uses a "type" field, Claude Code is easiest with claude mcp add, and Codex uses TOML: see the setup guide for your app. On Windows, wrap npx with cmd /c (fix).
At a glance
| Repository | modelcontextprotocol/servers/tree/main/src/filesystem |
| GitHub stars | 92,372 (shared monorepo) |
| Last commit | 2026-11-27 (3 days ago) |
| Status | maintained |
| Security advisories | Latest advisory published 2026-11-18: GHSA-rq2p-q7c4-6g27 (low), fixed in 2.4.0. 9 published advisories found as of 2026-11-30. Details |
| Clients mentioned in README | Claude Desktop, VS Code |
| Auth | None detected in README |
| Language / License | TypeScript / NOASSERTION |
Security advisories
Latest: GHSA-rq2p-q7c4-6g27, published 2026-11-18 low
Symlink swap after validation lets the directory-listing tools return entry names from outside allowedDirectories
Fixed in: 2.4.0 or later. Update before using it.
9 published advisories found (newest 5 shown)
- 2026-11-18: GHSA-rq2p-q7c4-6g27 (low): Symlink swap after validation lets the directory-listing tools return entry names from outside allowedDirectories
- 2026-11-11: GHSA-p9cv-8g75-4xcg (medium): Symlink swap after validation lets read_text_file return files outside allowedDirectories
- 2026-11-11: GHSA-7m4x-rv66-mxhh (medium): server-filesystem: `move_file`'s same-device rename leaves the source unpinned — a swapped source parent moves an outside file into the allowed directories, where it becomes readable
- 2026-10-25: GHSA-hhwq-wxfx-cj7g (low): @modelcontextprotocol/server-filesystem list_directory_with_sizes follows symlinks and leaks outside-directory file metadata
- 2026-10-25: GHSA-53mr-w429-c597 (low): Parent-Directory Fallback TOCTOU in @modelcontextprotocol/server-filesystem Permits Arbitrary File Write Outside allowedDirectories
Checked 2026-11-30 in the repo's GitHub security advisories and OSV.dev for @modelcontextprotocol/server-filesystem (npm). This server lives in a shared repository, so only advisories that mention it are counted. No advisory doesn't prove a server is safe. How to stay updated.
Common problems
- MCP server not showing in Claude Desktop
- Fix "spawn npx ENOENT" when starting an MCP server
- MCP servers fail on Windows with npx (use cmd /c)
- "MCP error -32000: Connection closed": what it means and how to fix it
- MCP server crashes because the client uses an old Node version
- Claude Desktop on Windows: ENOENT with ${APPDATA} in the path