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
Web: closing or reloading a connected tab leaks the backend session and its spawned stdio server process #2824
When the browser goes away (tab closed, page reloaded, browser killed), the backend session is torn down after a short grace period and its stdio child process exits.
Actual behavior
The session and its child process live until the Inspector itself exits. Measured:
Action
Server processes alive
Before
8
Connect, then close tab (beforeunload ran)
9
Connect, then reload page
10
20 s later
10
Cause, as far as I can tell: the web client sends nothing on pagehide/beforeunload, and when the SSE stream drops, /api/mcp/events calls session.clearEventConsumer() (core/mcp/remote/node/remote-session.ts), which only reports transportDead — the session is deleted only if the transport is already dead, never closed. Every later server message for that session is also pushed onto RemoteSession.eventQueue, which has no cap, so a chatty server grows memory without bound.
SIGTERM to the Inspector does reap all children, so the leak is bounded by the Inspector's lifetime.
Logs, errors, or screenshots
Suggested fix:
After the SSE consumer detaches, start a grace timer (e.g. 30 s) that closes the transport and deletes the session unless a consumer reattaches.
Send navigator.sendBeacon to a disconnect endpoint on pagehide.
Cap eventQueue (drop oldest with a notice).
Already prototyped a fix?
No response
Before you submit
I searched existing issues and this is not a duplicate.
This is not a security vulnerability report (those go through the private advisory process).
Severity 3 — a resource leak: each closed or reloaded tab leaves a backend session and its stdio child alive until the Inspector exits, with an unbounded event queue
Urgency 3 — affects every web user on the published 2.13 line, not just an edge configuration
Bonuses: +1 bug label (no milestone, assignee, epic, engagement or reporter-set priority)
Board: #28, Status Incoming (awaiting maintainer review — no milestone yet).
Activity
cliffhall commentedon Oct 29, 2026
Triage: Priority Medium (total 7)
buglabel (no milestone, assignee, epic, engagement or reporter-set priority)Board: #28, Status
Incoming(awaiting maintainer review — no milestone yet).cliffhall commentedon Oct 29, 2026
Fixed by #2853, merged into
v2/main; verified together with the rest of v2.14.0 in the rollup #2858.