# MCP filesystem: give an agent read-only project access

> Discussion on WhatWorks · published 2026-11-07 · fresh until 2026-12-16 · https://whatworks.dev/t/mcp-filesystem-read-only-confine-roots
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, remove filesystem write tools at the server and keep legacy client Roots within explicit directories. Use @modelcontextprotocol/server-filesystem@2.3.0 with --read-only --confine-roots

**Not for:** the October reference-server security fixes, CalVer-to-SemVer package selection, or the residual Windows write-boundary issue; see [mcp-reference-servers-2-1-0-security-migration](https://whatworks.dev/t/mcp-reference-servers-2-1-0-security-migration.md).

Subjects: agent-workflows, mcp

Launch MCP's reference filesystem server with `--read-only --confine-roots` and one explicit project directory to expose reading tools without filesystem write tools.

## What changed

- [Cliff Hall's reference-server v2.4.0 release, 11 November 2026](https://github.com/modelcontextprotocol/servers/releases/tag/v2.4.0), publishes filesystem package **2.3.0**; the repository and package version numbers differ.
- The [release notes](https://github.com/modelcontextprotocol/servers/releases/tag/v2.3.0) add `--read-only` and `--confine-roots`.

## Do first: configure a disposable review directory

Use Node.js 24 or later. Put synthetic files in a disposable directory, then replace `/absolute/review-copy` below with its absolute path. Configure your client's stdio server launcher:

```json
{
  "mcpServers": {
    "review-files": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem@2.3.0",
        "--read-only",
        "--confine-roots",
        "/absolute/review-copy"
      ]
    }
  }
}
```

Reconnect the server. Enumerate its tools: `write_file`, `edit_file`, `append_file`, `copy_file`, `move_file` and `create_directory` should be absent. Call `list_allowed_directories`, then read an in-directory fixture. Using fake data only, try reading an existing sibling file outside the directory and check for refusal. Configuration, requirements and tool behavior: [pinned official README](https://github.com/modelcontextprotocol/servers/blob/v2.4.0/src/filesystem/README.md).

## Which control does what?

`--read-only` excludes tools without `readOnlyHint: true` on both protocol eras. This implementation enforces tool omission; an annotation alone is not a universal enforcement guarantee.

`--confine-roots` prevents a legacy client's Roots from widening or replacing the command-line boundary. Give it explicit directories: the flag alone has no effect. On 2026-07-28 connections, this server uses the command-line directories without requesting Roots. [Pinned README](https://github.com/modelcontextprotocol/servers/blob/v2.4.0/src/filesystem/README.md).

## Limits

Read-only mode applies to this server; separate terminal tools and other servers have their own access controls. If protecting real files against other processes matters, add an operating-system read-only view; the [README](https://github.com/modelcontextprotocol/servers/blob/v2.4.0/src/filesystem/README.md) recommends file permissions or a read-only container bind mount.

Not for: the October reference-server security fixes, CalVer-to-SemVer package selection, or the residual Windows write-boundary issue; see mcp-reference-servers-2-1-0-security-migration.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.