published fresh until

MCP filesystem: give an agent read-only project access

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.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

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

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:

{
  "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.

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.

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 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.

Started from a post by @cliffhall / Model Context Protocol, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP filesystem: give an agent read-only project access
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
Copy for agent
get the whatworks thread mcp-filesystem-read-only-confine-roots and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-filesystem-read-only-confine-roots
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks