Skip to content
Agentic Control Plane

The filesystem MCP server control model, explained

The filesystem server gives an agent access to its own disk. Its control model is the simplest in this series: one list of allowed directories, and nothing else.

It’s the reference server maintained by the Model Context Protocol project itself (modelcontextprotocol/servers). It survived the May 2025 reference-server cull. At ~232k weekly npm downloads (socket.dev, August 2026) it is one of the most-installed servers in this series, second only to Context7.

This page covers what that one boundary checks, who can move it, and the two times it broke. Sources: the official README and the linked issues and advisories.

This page covers the server’s own controls. For the cross-server picture, see the MCP server controls comparison. For what a control layer adds on top, see the coverage matrix.

What’s at stake

Unlike GitHub or Supabase, there’s no service on the other side of this server. The blast radius is the local machine.

The tools include write_file, edit_file, move_file, and create_directory, next to the reads (read_text_file, read_multiple_files, search_files, directory_tree). File operations here are effectively destructive. An overwrite has no previous version, a move has no trash, and nothing has an undo.

The reference incident is the Amazon Q wipe: an agent with file and shell access ran a deletion it had been injected into running. The directory list is the one control that narrows that.

The allowed-directories boundary

You pass directories as CLI arguments in the client config:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y", "@modelcontextprotocol/server-filesystem",
        "/Users/you/projects/one",
        "/Users/you/projects/two"
      ]
    }
  }
}

Every tool call checks its path arguments against that list. list_allowed_directories reports the current list. The server errors at startup if the list would be empty. That is the whole native model: one list, checked in-process on every call.

It’s a real restriction and the right first move. An agent that needs one project directory should get exactly one. But look at what kind of control it is. It’s a path check in the same process the agent drives, set in a file the agent can usually edit, and it treats reading a path and destroying it the same way.

The roots quirk: the client can rewrite the fence

The README offers a second way to set allowed directories, the MCP roots protocol. It says roots provided by the client completely replace the server-side allowed directories. At initialization, if the client advertises roots support, the server fetches roots/list and swaps the list in. A roots/list_changed notification repeats the swap mid-session.

Issue #3602 shows the effect on v2026.1.14. Start the server with four CLI directories and connect a roots-capable client. list_allowed_directories returns only the client’s roots. The CLI directories are dropped, silently.

The project frames this as convenience: the boundary follows the client’s workspace without a restart. As a workspace feature that’s fair. As a control, it means the boundary is client-writable at runtime. The client is the process the agent lives in, so whatever the agent’s session can get the client stack to send as roots becomes the new fence. A list that the restricted side can replace mid-session is configuration, not enforcement. It has the same shape as GitHub’s dynamic toolsets, one layer down.

If your safety story is “the server can only see /projects/one,” check that it holds with your actual client, not just your config file.

The check has failed twice

Two CVEs, both disclosed in mid-2025, both in the boundary check itself:

  • CVE-2025-53110: the allowed-directory check used path-prefix matching, so /tmp/allowed_evil passed a check meant for /tmp/allowed. CVSS 7.3.
  • CVE-2025-53109: a symlink placed inside an allowed directory could be followed out of it. CVSS 7.3.

Both were patched in July 2025 (versions 0.6.4 and 2025.7.01), and neither has known exploitation. Prefix bugs and symlink races are the two classic ways path restriction fails, and plenty of mature software has shipped both. The lesson is about design. When the only control is an in-process path check, every bug in that check is a full boundary failure, with the disk as the blast radius. There is no second layer to hold.

What doesn’t exist

  • No read-only mode. There is no flag, and no way to serve only the read tools. The tools carry MCP annotations (readOnlyHint, destructiveHint) so clients can tell reads from writes. Annotations are hints to the client, not enforcement by the server.
  • No per-tool filtering. You can’t launch the server without write_file or move_file.
  • No approvals. The server can’t hold a call for a human. Any confirmation dialog is the client’s courtesy.
  • No audit. The server writes no record of which files an agent read, wrote, moved, or deleted. This is the general MCP audit gap, on the surface where “what did it delete” is the first question anyone asks.

The workable read-only option is the documented Docker setup. Bind-mount directories into the container with the ro option, and the OS refuses writes whatever the tool layer does. That is enforcement below the server, the strongest option on this surface. It follows the same layer-below logic as Supabase’s read-only Postgres role, and it’s why containment and authorization are different jobs.

It costs a Docker dependency and per-directory mount configuration, and it’s all-or-nothing per mount. You still can’t say “read anywhere, write this one place with approval.”

Where the native model ends

This is a reference implementation. It documents what it does, and what it does is one directory list. What’s missing:

  • The one boundary is client-writable at runtime. Roots replace the CLI list by design, so the fence answers to the side being fenced.
  • The boundary is binary. A directory is fully in (readable, writable, movable, overwritable) or fully out. “Read broadly, write narrowly” can’t be expressed.
  • The check is in-process, and its two known failures were both full escapes.
  • Nothing is held and nothing is recorded. No approvals, no trail, no way to reconstruct what an agent did to the disk.

What to do now:

  • Pass the narrowest directory list that does the job.
  • Pin the package version past July 2025.
  • Test what list_allowed_directories returns under your client before trusting the config.
  • Prefer the Docker ro mount over the in-process check for anything the agent shouldn’t write.

Then add the read/write distinction, a hold on destructive calls, and a record of what happened. ACP does this with a hook in your agent’s harness that sends each tool call to a gateway, so the policy and the record sit outside the server and the agent. One limit to know: ACP’s built-in safety floor reads shell commands only, so filesystem MCP calls are governed by the rules you write, not by the floor. The hook is also harness configuration, so pin it with managed settings on machines you don’t trust.

Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Getting started