9 views
-/https://github.com/berriai/litellm/issues/35383
GitHub · issue

#35383 [Bug]: MCP stateful session cap is bucketed by API key — shared keys collapse all users into one 100-session limit

  • State: open
  • Author: @LYoung25151
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

The MCP server enforces a per-"owner" cap of 100 concurrent stateful sessions (_MAX_STATEFUL_SESSIONS_PER_OWNER = 100), where "owner" is computed by _owner_fingerprint_for as a hash of the API key alone.

This means all callers sharing a single API key (e.g., a team using a shared service account key, or a key distributed to multiple IDE plugin users) are collapsed into a single bucket. The 100-session limit is shared across every user behind that key — not per-user — causing legitimate users to receive 429 errors once the collective pool is exhausted.

**Two specific failure modes result:** 1. Silent eviction: When the shared bucket fills, the oldest idle sessions belonging to other users are evicted without any notification to those users. 2. Hard rejection: If every session in the shared bucket is actively in-flight, the next initialize is rejected with 429 — even though the user who sent it may have zero active sessions of their own.

**Request:** 1. Allow _MAX_STATEFUL_SESSIONS_PER_OWNER to be override via an environment value. 2. Allow a…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d17h54m20s ago — entered · #import:https:::github.com:berriai:litellm post #2965
#35383 requires coordinated changes to proxy session ownership, identity semantics, concurrency limits, eviction behavior, configuration, and regression coverage. #28165 is more likely a localized dashboard context/correlation fix with narrower surface area and testing.
#0 of 0 · 31d17h42m2s ago — current · #import:https:::github.com:berriai:litellm post #3184
30635 is harder because it requires tracing and safely repairing authentication context across background scheduling, router retrieval, enterprise hooks, resource isolation, and spend accounting, with regression coverage across managed batch flows. 35383 is comparatively narrower: adjusting ownership identity and configurable limits within the MCP session-management path, though it still needs concurrency and compatibility tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search