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
roots/list from the server can race the client's handler registration → -32601 Method not found #1797
Connecting to server-everything, the same roots/list succeeds and returns the configured roots. Same client, same settings — only the timing of the server's request differs.
Cause
InspectorClient advertises the roots capability at Client construction time (core/mcp/inspectorClient.ts:587-589), so the server sees roots support in the initialize result and may issue roots/list as soon as it receives notifications/initialized.
The roots/listrequest handler, however, is not registered until core/mcp/inspectorClient.ts:1369-1374, which runs after:
await this.client.connect(this.transport) (:1173 / :1200) — connect() is what sends notifications/initialized
await this.fetchServerInfo() (:1215)
dispatchTypedEvent("connect") and the optional await client.setLoggingLevel(...) (:1220)
That leaves a window in which the server has been told we support roots but the SDK Client has no handler registered, and it replies -32601.
The same window applies to the other peer-request handlers registered in that block: sampling/createMessage (:1292), elicitation/create (:1360), and the receiver-task handlers tasks/list / tasks/get / tasks/result / tasks/cancel (:1385-1413).
server-filesystem requests roots immediately on initialized (that is how it learns its allowed directories) and loses the race; server-everything requests them later and wins. The user-visible consequence is not just a red entry in the Protocol view — server-filesystem silently falls back to its CLI-argument directories instead of the roots configured in the Inspector.
Fix
Register the peer-request handlers beforeclient.connect(...). None of them depend on server capabilities — they read only constructor-set state (this.roots, this.sample, this.elicit, this.receiverTasks).
The notification handlers further down that block (:1430+) that gate on this.capabilities?.tools?.listChanged etc. genuinely need post-initialize data and must stay where they are.
Tests
Integration coverage that a server issuing roots/list immediately on notifications/initialized gets the configured roots rather than -32601.
Activity
review: round-1 fixes — pre-connect roots/list_changed, wider timing …
review: round-2 fixes — correct the roots/list_changed premise (#1797)
review: round-3 fix — drop stale comments inside the roots handler (#…
fix(cli): advertise roots so roots/set is actually serviceable (#1797)
fix(cli,tui): advertise the roots configured in mcp.json (#1797)
review: round-6 fixes — document roots in the CLI README, harden clea…
review: round-7 fix — cleanRoots also throws on a non-string name (#1797
fix(core): normalize roots in setRoots() too (#1797)
review: round-9 fixes — normalize roots in the constructor too (#1797)
review: round-10 fixes — copy at both rootsChange dispatches (#1797)
review: round-11 doc fixes; merge v2/main (#1797)
35 remaining items
review: round-47 — fix the doc's count, catch the closed-promise chain (
review: round-48 — scope the catch, guard the close, index the test (#…
review: round-49 — pin the best-effort close, unorphan the doc (#1797)
review: round-50 — sweep the queues start-clean, unify the close (#1797)
review: round-51 — pin the sweep's ordering, name the category (#1797)
review: round-52 — say what the sweep prevents, scope the close doc (#…
review: round-53 — give each close site its real harm, pin it (#1797)
review: round-54 — the mildest site isn't mild from every caller (#1797)
fix(core): don't roll back a subscribe a newer refresh superseded (#1797
fix(core): reconcile the stream badge when a re-listen this call owne…
fix(core): order the subscription writes, retry instead of stranding
fix(core): register peer-request handlers before connect (#1797) (#1798)
cliffhall commentedon Jul 27, 2026
Fixed by #1798 (merged into
v2/main).