You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
filesystem: overlapping roots refreshes can apply out of order and undo a revocation #5097
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.
Pre-existing: out-of-order application already affected valid-to-valid updates on main / 2026.8.31.
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
test(filesystem): expect SDK 1.x's wrapped roots/list error in the #5097
cliffhall commentedon Oct 10, 2026
Fixed on
v2/mainby #5098 and on the release branchv2/release/1.0.0by #5099 (ships in v1.0.0).Merge pull request #5099 from modelcontextprotocol/v2/fix/5097-releas…
fix(filesystem): apply only the newest roots refresh's answer
chore(filesystem): fold the modelcontextprotocol#5097 changeset into …
chore(filesystem): fold the modelcontextprotocol#5101 changeset into …
fix(filesystem): apply only the newest roots refresh's answer
Merge v2/release/1.0.0 into v2/main
chore(changeset): restore the SDK v2 majors, drop fixes shipped in 1.0.0