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
[BUG] 90%+ idle CPU after first MCP tool call — anyio cancel scope busy-loop in streamable HTTP client #1226
After the first request that triggers an MCP tool call, the lightspeed-stack process burns 90%+ CPU indefinitely while fully idle (no incoming requests). Restarting the container resolves it until the next MCP tool call.
After an MCP tool call completes, the MCP streamable HTTP client's cleanup calls tg.cancel_scope.cancel(). Tasks in the scope are stuck in _must_cancel state (they're trying to write to already-closed streams), causing AnyIO's _deliver_cancellation() to re-schedule itself via call_soon() on every event loop tick without ever converging.
The upstream fix for this is at modelcontextprotocol/python-sdk#2147. Upgrading the mcp dependency once that's merged should resolve the idle CPU spike.
Activity
akshan-main commentedon Feb 25, 2026
The upstream fix for this is at modelcontextprotocol/python-sdk#2147. Upgrading the
mcpdependency once that's merged should resolve the idle CPU spike.