Skip to content

filesystem: overlapping roots refreshes can apply out of order and undo a revocation #5097

Description

@cliffhall

Problem

The filesystem server handles each notifications/roots/list_changed by calling listRoots() and applying the answer, with no ordering between refreshes. The SDK dispatches notification handlers without waiting for earlier ones, so when a client sends two roots/list_changed in quick succession, the two roots/list responses can resolve out of order, and the older answer is applied last. The same applies between the initial roots/list (after initialized) and a roots/list_changed that arrives while it is still outstanding.

Since #5094 a withdrawn root revokes access, so the stale-answer case matters more: a newer empty (or all-invalid) answer can revoke access and then an older answer that still listed the root can restore it.

Expected

Roots refreshes take effect in the order the client announced them: tag each refresh (a generation counter incremented per notification and for the initial load) and discard an answer that is no longer the latest; or serialize refreshes behind each other and behind the initial load. A protocol-level regression test with overlapping updates whose answers resolve out of order (delay the first answer).

Activity

  1. added this to the v2.0.0 milestone on Oct 10, 2026
  2. added
    bugSomething isn't working
    server-filesystemReference implementation for the Filesystem MCP server - src/filesystem
    on Oct 10, 2026
  3. self-assigned this
    on Oct 10, 2026
  4. cliffhall commented on Oct 10, 2026

    @cliffhall
    MemberAuthor

    Fixed on v2/main by #5098 and on the release branch v2/release/1.0.0 by #5099 (ships in v1.0.0).

  5. added a commit that references this issue on Oct 10, 2026
  6. added 3 commits that reference this issue on Oct 11, 2026
    a13e809
    be9a555
    9f3197e
  7. modified the milestones: v2.0.0, v1.0.0 on Oct 11, 2026
  8. added 3 commits that reference this issue on Oct 12, 2026
    423fe6b
    5ecca0c
    5b400a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingserver-filesystemReference implementation for the Filesystem MCP server - src/filesystemv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions