Filesystem MCP Server
The official reference MCP server for filesystem access, letting an agent read, write, edit, move and search files inside directories you explicitly allow through MCP Roots.
Overview
Filesystem is one of the official Model Context Protocol reference servers. It gives an MCP client read/write access to the local filesystem, scoped to an explicit allowlist of directories, so agents can browse, edit and search files without arbitrary access to the whole disk.
How it works
- Allowed directories are set either via command-line arguments at startup, or dynamically via MCP Roots (the recommended method), which lets a client update the allowlist at runtime without restarting the server.
- Every filesystem tool declares MCP tool annotations (
readOnlyHint,idempotentHint,destructiveHint) so clients can tell read-only operations from destructive ones likewrite_fileormove_file. - Tools cover reading (single/multiple files, media files as base64), writing, editing with dry-run diff preview, directory listing/tree, search by glob pattern, and file metadata.
Examples
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/Desktop"]
}
}
}
Installation
You need Node.js 18+.
- Add the server to your MCP client's config, listing the exact directories it's allowed to touch as arguments (see the sidebar example).
- Restart your client.
- If your client supports MCP Roots, you can update the allowed directories at runtime instead of restarting.
- Ask the agent to list or read a file in an allowed directory to confirm it's working.
Related assets
Awesome MCP Servers
The largest community catalog of MCP servers: thousands of entries across dozens of categories (databases, browser automation, cloud, communication and more), tagged by language and scope.
Context7
Pulls updated, version-specific documentation and code examples straight from the source into your prompt, so agents stop citing outdated APIs or hallucinating ones that don't exist.
Playwright MCP
Microsoft's official MCP server for browser automation, driving Playwright through structured accessibility snapshots instead of screenshots, so any MCP client can browse, click and fill forms without a vision model.