Data as of

MCP Filesystem Server for Claude Code: Setup & Config

MCP Filesystem Server gives Claude Code file and directory operations within explicitly allowed paths.

What you can do with MCP Filesystem in Claude Code

Scoped local file operations, content search, and directory trees in a Go binary or library.

  • Read several project files in a single request.
  • Generate directory trees and inspect file metadata.

Before you start: MCP Filesystem in Claude Code

  • Go for the documented go install method
  • Install github.com/mark3labs/mcp-filesystem-server@latest
  • Allowed directories supplied at launch

Replace the example allowed paths. The README also documents Docker and embedding the filesystemserver package in Go applications.

MCP Filesystem Claude Code configuration

  1. Choose Claude Code configuration scope

    For MCP Filesystem Server, open Project scope: .mcp.json at the repository root. Project JSON: merge into mcpServers; user scope: use the CLI.

  2. Add MCP Filesystem Server to Claude Code

    Use the mcp-filesystem-server entry below in mcpServers. Keep MCP Filesystem Server's documented stdio connection fields and your other Claude Code entries.

  3. Check MCP Filesystem Server in Claude Code

    MCP Filesystem Server: Inspect claude mcp list and /mcp status.

Config file · Project scope: .mcp.json at the repository root

JSON
{
  "mcpServers": {
    "mcp-filesystem-server": {
      "type": "stdio",
      "command": "mcp-filesystem-server",
      "args": [
        "/path/to/allowed/directory",
        "/another/allowed/directory"
      ],
      "env": {}
    }
  }
}

CLI (POSIX shell)
claude mcp add-json --scope project 'mcp-filesystem-server' '{"type":"stdio","command":"mcp-filesystem-server","args":["/path/to/allowed/directory","/another/allowed/directory"],"env":{}}'

MCP Filesystem tools available to Claude Code

MCP Filesystem's stored tool list documents 14 tools; compare it with Claude Code's connected tool list, because the stored list is not a live check.

read_file

For MCP Filesystem's read_file, review the permission request and arguments in Claude Code before approval.

Read all content from a specified file.

read_multiple_files

For MCP Filesystem's read_multiple_files, review the permission request and arguments in Claude Code before approval.

Read several paths in one operation.

write_file

For MCP Filesystem's write_file, review the permission request and arguments in Claude Code before approval.

Create a file or replace its existing content.

copy_file

For MCP Filesystem's copy_file, review the permission request and arguments in Claude Code before approval.

Copy a file or directory to another path.

move_file

For MCP Filesystem's move_file, review the permission request and arguments in Claude Code before approval.

delete_file

For MCP Filesystem's delete_file, review the permission request and arguments in Claude Code before approval.

modify_file

For MCP Filesystem's modify_file, review the permission request and arguments in Claude Code before approval.

list_directory

For MCP Filesystem's list_directory, review the permission request and arguments in Claude Code before approval.

create_directory

For MCP Filesystem's create_directory, review the permission request and arguments in Claude Code before approval.

tree

For MCP Filesystem's tree, review the permission request and arguments in Claude Code before approval.

search_files

For MCP Filesystem's search_files, review the permission request and arguments in Claude Code before approval.

Find files and directories whose names match a pattern.

search_within_files

For MCP Filesystem's search_within_files, review the permission request and arguments in Claude Code before approval.

Find text inside files across a directory tree.

get_file_info

For MCP Filesystem's get_file_info, review the permission request and arguments in Claude Code before approval.

Inspect metadata for a file or directory.

list_allowed_directories

For MCP Filesystem's list_allowed_directories, review the permission request and arguments in Claude Code before approval.

MCP Filesystem: full stored tool descriptions

Troubleshooting MCP Filesystem in Claude Code

  • If MCP Filesystem Server fails to start, check mcp-filesystem-server, the working directory, and Claude Code's selected scope; inspect claude mcp list and /mcp.
  • MCP Filesystem Server uses stdio here: Claude Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
  • Known limitation: The tool set includes overwriting and deletion, not only reads.
  • Known limitation: Docker needs a volume mount to modify host files.
  • General Claude Code troubleshooting lives in the /clients/claude-code guide.

MCP Filesystem Server — details. Claude Code guide

Frequently asked questions

Register MCP Filesystem Server with the displayed claude mcp add-json --scope project command, or merge the JSON into .mcp.json at the repository root.