What Is Filesystem MCP Server?

Filesystem MCP Server exposes local filesystem operations — reading, writing, and listing files and directories — to MCP-compatible clients with configurable directory-level access controls. It is maintained by Anthropic as part of the official modelcontextprotocol/servers monorepo.


Quick Facts

FieldValue
Package@modelcontextprotocol/server-filesystem
Installnpx @modelcontextprotocol/server-filesystem /path/to/allowed/dir
Compatible withClaude Code, Claude Desktop
Statusactive
GitHubhttps://github.com/modelcontextprotocol/servers/tree/main/src/filesystem

What You Can Do With It

  • Read files: Retrieve the contents of any file within an allowed directory for review or analysis.
  • Write files: Create or overwrite files at a specified path, enabling automated code generation or content updates.
  • List directories: Enumerate files and subdirectories to give the model awareness of project structure.
  • Local code editing: Make targeted edits to source files directly on disk without leaving your Claude workflow.

How to Set It Up

Step 1: Verify Node.js is installed

node --version
Requires Node.js 18 or later.

**Step 2: Run the server directly (one-off test)**

```bash
npx @modelcontextprotocol/server-filesystem /path/to/allowed/dir

Replace /path/to/allowed/dir with the absolute path you want to expose. You can pass multiple directories as additional arguments.

Step 3: Add to Claude Desktop config

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on Windows/Linux:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/dir"
      ]
    }
  }
}

Step 4: Add to Claude Code config

In your project root, edit or create .claude/mcp.json:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/dir"
      ]
    }
  }
}

Restart the client after saving the config file.


Works Best With

This server is documented as compatible with Claude Code and Claude Desktop. Claude Code is the more natural fit for local code editing workflows — tasks like reading source files, writing patches, and navigating project trees map directly to Claude Code’s agentic coding loop. Claude Desktop works well for document management, config editing, and any file-centric task that doesn’t require a full development environment.


Known Limitations

  • No authentication: Access is controlled solely by which directories you pass as arguments. Any process or model session with access to the running server can read and write within those paths. Do not expose sensitive directories (e.g., ~, /etc, credential stores).
  • No granular file-level permissions: Access control is directory-scoped only. You cannot whitelist specific files within a directory.
  • No remote filesystem support: The server operates on the local machine where it runs. Network drives, S3 buckets, and remote paths are not supported.
  • Symlink behavior: Symlinks that resolve outside an allowed directory may or may not be followed depending on server version — verify this against the current release if your project uses symlinks.
  • No rate limiting: There are no built-in request throttles. Long-running agentic sessions making rapid file writes can cause unintended bulk changes.

Community Resources

This article contains affiliate links. We may earn a commission at no extra cost to you. Learn more.

Share: X