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
[Feature]: MCP HTTP: make the session cap (100) and idle TTL (30 min) configurable #2283
Version: 0.87.7 (also 0.86.18; code unchanged on main)
What happens packages/server/src/mcp-http.ts uses maxSessions = opts.maxSessions ?? 100 and sessionTtlMs = opts.sessionTtlMs ?? 30 * 60 * 1000. Nothing in the project config or environment reaches these options, so a project-bound HTTP server always caps at 100 sessions.
We run one ok start --only server on a Linux host for three long-running agents (two MCP clients plus short-lived scripts). Some clients open a new session per task and never send DELETE /mcp. Within a busy day the server reached 100 sessions. From then on every new initialize got 503 Too many active MCP sessions until idle sessions expired, so all agents lost TX access for up to 30 minutes. The server is still healthy at that point.
Ask (any one would solve it)
A config key or env var for maxSessions and sessionTtlMs.
When the cap is hit, evict the least-recently-used idle session instead of refusing the new one.
At minimum, document the cap and the 30-minute TTL in the MCP reference, so client authors know to send DELETE.
I have a small patch for the configurability ask ready: OK_MCP_MAX_SESSIONS and OK_MCP_SESSION_TTL_MS read at boot, plus the docs rows and a Session limits section in the MCP reference (branch feat/mcp-http-session-limits-env on my fork, xubenqiang/open-knowledge, commit 8d17080, 13 new unit tests passing).
GitHub is refusing PR creation from my account on this repository (createPullRequest returns FORBIDDEN), so I could not open it here. If a maintainer wants it, the branch is ready to pull; otherwise ignore this note.
Activity
xubenqiang commentedon Oct 26, 2026
I have a small patch for the configurability ask ready:
OK_MCP_MAX_SESSIONSandOK_MCP_SESSION_TTL_MSread at boot, plus the docs rows and a Session limits section in the MCP reference (branchfeat/mcp-http-session-limits-envon my fork,xubenqiang/open-knowledge, commit 8d17080, 13 new unit tests passing).GitHub is refusing PR creation from my account on this repository (
createPullRequestreturns FORBIDDEN), so I could not open it here. If a maintainer wants it, the branch is ready to pull; otherwise ignore this note.