-
Notifications
You must be signed in to change notification settings - Fork 203
Configure per-user rate limits on MCPServer #4550
Copy link
Copy link
Open
Labels
apiItems related to the APIItems related to the APIenhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go codekubernetesItems related to KubernetesItems related to Kubernetesoperator
Description
User Story
As a cluster admin,
I want to configure per-user rate limits on MCPServer,
so that no single user can monopolize a server's tools.
Context
See THV-0057: Rate Limiting for MCP Servers for full design details.
Acceptance Criteria
-
MCPServerSpecincludes arateLimiting.perUserfield withmaxTokensandrefillPeriod - Per-tool per-user limits supported via
rateLimiting.tools[].perUser - CRD admission validation rejects
perUserwhen auth is not enabled - CRD admission validation rejects
rateLimitingwhen neitherglobalnorperUseris set - Operator sets
RateLimitingConfigValidstatus condition at reconciliation time - Unit: User exceeds
maxTokens— next request is rejected with JSON-RPC error-32029andretryAfterSeconds - Unit: User A is rate-limited; User B's bucket is independent
- Unit: Per-tool limit hit on
expensive_tooldoesn't affectother_tool - Unit: Request must pass both server-level per-user and per-tool per-user limits
- Unit: Redis unavailable — request passes through (fail-open)
- E2E: Deploy MCPServer with
perUserrate limit, send traffic, verify rejection after limit exceeded - E2E: Streamable HTTP rejection returns HTTP 429 with
Retry-Afterheader - E2E:
kubectl applywithperUserand no auth config is rejected at admission
Out of Scope
- Global rate limits (STORY-002)
- VirtualMCPServer (STORY-003)
- Observability beyond fail-open counter (STORY-004)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiItems related to the APIItems related to the APIenhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go codekubernetesItems related to KubernetesItems related to Kubernetesoperator