# Filesystem MCP server

Secure file operations with configurable access controls — read, write, search and move files in directories you explicitly allow.

## At a glance

Filesystem is the official MCP reference server in the Dev Tools & Git category. It runs locally over stdio via `npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/directory`, and declares no required credentials. It exposes 13 tools, including read_text_file, read_media_file and read_multiple_files. It scores A (93/100) on the MCP Skills Hub health score as of Oct 28, 2026.

## Install

### How to install Filesystem in Claude Code

1. Add the server

```bash
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/directory
```

2. Verify it's connected

```bash
claude mcp list
```

3. Sharing it with your team?

   Add `--scope project` to write it to .mcp.json in the repository root, which you can commit (with the secrets left as environment variables).

4. Use it in a session

   Ask Claude to use the tools this server exposes (e.g. read_text_file, read_media_file, read_multiple_files). It discovers them automatically.

### How to install Filesystem in Claude Desktop

1. Open your MCP config

   macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json

2. Add this server

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

3. Restart Claude Desktop

   The tools appear under the 🔌 menu once the app reloads.

### How to install Filesystem in Cursor

1. Create / edit .cursor/mcp.json in your project

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

2. Enable it

   Cursor Settings → MCP → toggle the server on. Tools become available to the Composer/Agent.

### How to install Filesystem in Codex CLI

1. Add to ~/.codex/config.toml

```toml
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
```

2. Run Codex

   Codex loads MCP servers from config.toml on startup and exposes their tools to the agent.

### How to install Filesystem in Windsurf

1. Edit ~/.codeium/windsurf/mcp_config.json

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

2. Reload

   Windsurf → Cascade → refresh MCP servers. Cascade can now call the tools.

### How to install Filesystem in Cline

1. Open Cline → MCP Servers → Configure

   Adds to cline_mcp_settings.json.

2. Add the server

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

### How to install Filesystem in VS Code

1. Create .vscode/mcp.json

```json
{
  "servers": {
    "filesystem": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/directory"
      ]
    }
  }
}
```

2. Start it

   VS Code shows a ▶ Start action above the server entry. Agent mode (Copilot Chat) can then use the tools.

## Tools

- `read_text_file` — Read complete contents of a file as text
- `read_media_file` — Read a file and return it as a base64-encoded content block with its MIME type
- `read_multiple_files` — Read multiple files simultaneously
- `write_file` — Create new file or overwrite existing (exercise caution with this)
- `edit_file` — Make selective edits using advanced pattern matching and formatting
- `create_directory` — Create new directory or ensure it exists
- `list_directory` — List directory contents with [FILE] or [DIR] prefixes
- `list_directory_with_sizes` — List directory contents with [FILE] or [DIR] prefixes, including file sizes
- `move_file` — Move or rename files and directories
- `search_files` — Recursively search for files/directories that match or do not match patterns
- `directory_tree` — Get recursive JSON tree structure of directory contents
- `get_file_info` — Get detailed file/directory metadata
- `list_allowed_directories` — List all directories the server is allowed to access

Source repository: https://github.com/modelcontextprotocol/servers

---

Source: https://mcp-skills-hub.vercel.app/mcps/official-filesystem · MCP Skills Hub · data as of 2026-10-28T12:31:05Z
