📁

Filesystem MCP

Featured

Model Context Protocol server for secure filesystem operations. Read, write, and manage files with proper access controls.

by Anthropic
Updated about 7 hours ago

Quick Install

Terminal
$ npx @modelcontextprotocol/server-filesystem
Runs MCP server via npx

Filesystem MCP Server

The official Filesystem MCP server provides secure file system operations for Claude.

Installation

npm install -g @modelcontextprotocol/server-filesystem

Configuration

Add to your Claude configuration:

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

Available Tools

read_file

Read contents of a file.

{
  "path": "/path/to/file.txt"
}

write_file

Write content to a file.

{
  "path": "/path/to/file.txt",
  "content": "Hello, World!"
}

list_directory

List contents of a directory.

{
  "path": "/path/to/directory"
}

create_directory

Create a new directory.

{
  "path": "/path/to/new/directory"
}

move_file

Move or rename a file.

{
  "source": "/path/to/source",
  "destination": "/path/to/destination"
}

Security

  • Only directories explicitly allowed can be accessed
  • Symlinks are followed only within allowed directories
  • Parent directory traversal (..) is blocked
  • File permissions are respected

Use Cases

  • Code file management
  • Configuration editing
  • Log file analysis
  • Project scaffolding
  • Batch file operations

Source

GitHub Repository

Raw Content

# Filesystem MCP Server

The official Filesystem MCP server provides secure file system operations for Claude.

## Installation

```bash
npm install -g @modelcontextprotocol/server-filesystem
```

## Configuration

Add to your Claude configuration:

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

## Available Tools

### read_file
Read contents of a file.

```json
{
  "path": "/path/to/file.txt"
}
```

### write_file
Write content to a file.

```json
{
  "path": "/path/to/file.txt",
  "content": "Hello, World!"
}
```

### list_directory
List contents of a directory.

```json
{
  "path": "/path/to/directory"
}
```

### create_directory
Create a new directory.

```json
{
  "path": "/path/to/new/directory"
}
```

### move_file
Move or rename a file.

```json
{
  "source": "/path/to/source",
  "destination": "/path/to/destination"
}
```

## Security

- Only directories explicitly allowed can be accessed
- Symlinks are followed only within allowed directories
- Parent directory traversal (`..`) is blocked
- File permissions are respected

## Use Cases

- Code file management
- Configuration editing
- Log file analysis
- Project scaffolding
- Batch file operations

## Source

[GitHub Repository](https://github.com/modelcontextprotocol/servers)