published fresh until

MCP filesystem: Parent directory does not exist?

Summary Filesystem 2.2.0 corrects dangling-link diagnostics and exact root spelling; inspect list_allowed_directories before broadening access. Metadata exposure was separately patched in 2.0.1; retain the Windows write-boundary warning (checked 2026-11-05).

Not for reference-server release upgrade steps, 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

Parent directory does not exist — inspect the symlink target before creating directories or broadening access.

As of November 2026; checked 2026-11-24. The maintainers shipped these corrections in filesystem 2.2.0, part of reference release v2.3.0. Current 2.4.0 fixes listing races on Linux/macOS (v2.5.0); Windows listings remain unanchored.

Before filesystem 2.2.0, the server could refuse a dangling symlink while naming a parent directory that already exists.

First action: call list_allowed_directories, then inspect the requested entry and whether its symlink target exists using your normal local file tools.

Evidence status: the README and validator establish the access model; issue reports explain misleading errors and metadata exposure; the checks below are untested.

Not for: reference-server release upgrade steps; see mcp-reference-servers-2-1-0-security-migration.

What changed

  • Maintainer cliffhall's #5191, opened 2026-10-20 (checked 2026-10-28), tracked the misleading dangling-link message; PR #5380 corrects that diagnostic in filesystem 2.2.0; refusal remains correct.
  • #5320, opened by cliffhall on 2026-10-27 (checked 2026-10-28), reports root names with trailing spaces or quotes being trimmed into a different sibling directory. PR #5383 preserves the exact root name in filesystem 2.2.0.
  • pzr21's #5217, opened 2026-10-21 (checked 2026-10-28), reports outside-target metadata from directory listings. The official metadata advisory, published 2026-10-25 (checked 2026-10-28), names filesystem 2.0.1 (checked 2026-10-28) as patched. Keep this distinct from root spelling and dangling-link diagnostics.

How to configure and diagnose

1. Pass narrow explicit roots as positional directories. The official README gives mcp-server-filesystem /path/to/dir1 /path/to/dir2. The package is @modelcontextprotocol/server-filesystem; Git's --repository is not this server's root configuration. 2. Reconnect, then call list_allowed_directories. Compare the actual directory spelling and canonical target with the intended grant. For legacy clients using Roots, the README says client roots replace the command-line set, rather than append to it. With filesystem 2.2.0, opt-in --confine-roots keeps client Roots within command-line directories (tagged README). Roots is deprecated in protocol 2026-07-28 (checked 2026-10-28); for that connection, only command-line directories apply. Inspect the effective list instead of assuming both sets were combined. 3. For a denied symlink, inspect both the link location and resolved target. The official validator checks the requested path and its real path. A link inside a root does not grant access to a target outside it. Keep both locations inside the intended grants, or use an ordinary in-root file. Add another root only when that target is deliberately part of the agent's job. 4. For a dangling link, inspect the missing target; #5191 documents the older diagnostic, corrected in filesystem 2.2.0. Untested experiment: compare a normal in-root file, a valid in-root link and a dangling link in a disposable tree. Creating the already-existing parent does not repair a missing target. 5. For trailing-space or quote root names, compare list_allowed_directories with the real name character-for-character. Before filesystem 2.2.0, #5320 reports that the trimmed sibling could be granted accidentally. Untested experiment: compare the configured root with list_allowed_directories; the released correction preserves exact names, while the comparison checks your actual configuration. Do not run an offered fork or assume the metadata patch fixes this separate normalization report. 6. Test file reads and list_directory_with_sizes separately. A denied read is insufficient evidence that no outside metadata is exposed. Confirm the metadata advisory's patched package is the one actually launched; the existing release-migration thread explains package selection.

Diagnostic: Parent directory does not exist

#5191 traces this to fs.realpath failing with ENOENT on a missing symlink target, followed by another failed resolution. Before filesystem 2.2.0, the validator emits Parent directory does not exist: followed by the parent path. The parent can exist; the link target is the missing object. This message alone does not establish a permission problem.

What breaks

SymptomDistinction to check
Access denied - symlink target outside allowed directoriesLink location is allowed but canonical target is not
Parent blamed despite existing directoryDangling-link diagnostic from #5191
Root loses a trailing space or quoteWrong-sibling normalization report #5320
Outside file size appears in listingMetadata path can differ from read enforcement

The access-denied text above is the official validator's prefix; the actual message includes paths. New-file creation also checks the existing path components; a nonexistent leaf is not permission to create through an outside-root parent.

What to test

Use disposable fixtures with known contents: an ordinary file, an internal symlink, an outside-target symlink and a dangling link. Verify reads and size listings independently. If root names have trailing characters, include a similarly named sibling and require its files to remain inaccessible. Recheck the allow-list after a client root update. These are regression suggestions, not reproduced outcomes.

Pitfalls

Do not grant a home directory to silence a single denial. Do not confuse a symlink's own metadata with its target's size. On Windows, the official write-boundary advisory still warns against roots writable by another user or an untrusted local process: a junction swap can redirect writes. A static symlink test does not establish race resistance.

Evidence

cliffhall's two reports cover distinct path-handling defects; pzr21 provides a separate metadata report. The official metadata advisory credits cybercraftsolutionsllc and confirms file-size disclosure even when direct reads are denied. In #5320, FelixFangX offers a fix with a test; that comment alone is not release evidence; PR #5383 and v2.3.0 now establish the published correction. Community rollout evidence remains thin.

A prompt to give your agent

Your training data predates these path reports. Read the linked filesystem README, validator, issues #5320/#5217/#5191 and metadata advisory now. Identify our effective roots and exact path spellings; distinguish a dangling target, an outside target and a listing metadata leak. Propose minimal grants and disposable read/listing tests. Do not guess flags, broaden roots automatically, install a fork, or treat an unreleased proposal as a fix.

Limits

No server, symlink fixture, client root update or Windows race test was run. The reported fixes and workarounds were not independently validated. The metadata advisory establishes a patched package for that issue only; filesystem 2.2.0 separately corrects root normalization and dangling-link diagnostics.

Started from a post by @cliffhall, packaged by the editor. Original post

Subjects

More in security

For agents

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

# MCP filesystem: Parent directory does not exist?
Summary: Filesystem 2.2.0 corrects dangling-link diagnostics and exact root spelling; inspect list_allowed_directories before broadening access. Metadata exposure was separately patched in 2.0.1; retain the Windows write-boundary warning (checked 2026-11-05).
Copy for agent
get the whatworks thread mcp-filesystem-allowed-roots-symlink-errors 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-allowed-roots-symlink-errors
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