Skip to main content
AgentsUse

MCP server, by Model Context Protocol

Filesystem MCP Server

Node.js MCP server for file operations scoped to explicitly allowed directories.

stdio (local process)Checked 2026-11-03Config checked

Quick facts

Transport
stdio (local process)
Runs as
npx (@modelcontextprotocol/server-filesystem)
Review state
Config checked against the official source on 2026-11-03; not locally tested by AgentsUse.

What it does

The server exposes file operations to an MCP client with access limited to directories you allow. Command-line arguments set the allowed directories, and the README says they are the only method that works on every protocol version. A 2025-era client that supports Roots can replace them at runtime, but Roots is deprecated as of protocol version 2026-07-28 and a 2026-07-28 connection cannot use it. The server never falls back to open access: started with no directories, it fails at initialization when a 2025-era client without Roots support connects, and on a 2026-07-28 connection, which has no initialization step, it answers every tool call with an error saying so.

Tool annotations separate read-only operations from writes, mark idempotent calls, and flag destructive operations such as overwrites and moves. All tools report openWorldHint false, since access stays inside the allowed local directories.

Distribution is an npm package, with a Docker option that mounts directories under /projects, including read-only mounts.

Configuration

Run with npx and pass one or more allowed directory paths as arguments. The Docker image takes bind mounts under /projects.

MCP config (placeholders)
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
    }
  }
}

Source: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem. Placeholders only. Replace them in your own environment, and never commit real keys to a repository.

The official documentation lists no required environment variables.

Tools and features on record

  • read_text_file Config checked

    Reads a file as UTF-8 text, with optional head or tail line limits.

  • write_file and edit_file Config checked

    Creates or overwrites files, and applies targeted text edits with dry-run diff previews.

  • search_files and directory_tree Config checked

    Recursively searches with glob patterns and returns directory contents as a JSON tree.

  • list_allowed_directories Config checked

    Lists the directories the server is currently allowed to access.

Harness notes: scope is dynamic, repeat behavior is per tool

From the Harness pillar: what the vendor documentation says about running this server inside an agent harness.

  • Allowed directories come from launch arguments or from client Roots. Roots replace the configured list entirely when present, and they can change while the server runs. Scope checks belong in the harness on every call, rather than only at connect time. With no allowed directory from either source, the server fails at startup.
  • Repeat behavior is documented per tool: create_directory is idempotent, edit_file is destructive and not idempotent, and move_file fails if the destination already exists. Set retry policy per tool from these hints.
  • read_multiple_files returns content for reads that succeed and an error entry for reads that fail. One bad path does not fail the batch, so validation runs per entry.
Serves: SecurityServes: Reliability

Source: Filesystem MCP server README (scope, tool annotations), checked 2026-10-08.

Security notes

Security notes
  • Access is limited to the allowed directories: those passed as command-line arguments or, for a 2025-era client only, supplied through Roots, which replace the command-line list when provided. The README says the server needs at least one allowed directory to operate, and a 2026-07-28 client cannot supply one through Roots, so pass directories on the command line.
  • Write tools can overwrite and move files. Scope to the smallest directory set that works, and use read-only Docker mounts when writes are not needed.
  • Tools claim no network access. openWorldHint is false for every filesystem tool.

An MCP server runs with the permissions of the process you start it from. Scope credentials to the narrowest access the job needs, and review what the client will send before connecting anything sensitive.

Stacks featuring this server

Sources and freshness

Checked 2026-11-03. Config-checked means the configuration and feature list trace to the official source above; it does not mean AgentsUse ran the server. Send corrections through the contact page. Back to the MCP server index.