Add MCP server rate limit settings to the admin Network page
What does this MR do and why?
Adds a GitLab MCP server rate limits section to Admin > Settings > Network so administrators can enable and tune the MCP server throttle, which ships disabled and could previously only be set through the settings API or a Rails console. It also documents the limit for administrators and adds a troubleshooting entry for the 429 a client receives when it is throttled.
The MCP limit applies in addition to the authenticated API rate limit, not instead of it: every POST /api/v4/mcp request counts against both.
Implementation notes
- The fieldset follows
_dependency_proxy_limits.html.haml, not the shared_network_rate_limits.html.haml. The shared partial renders unauthenticated fields too, and there is no unauthenticated MCP throttle. - The three settings,
throttle_authenticated_mcp_enabled,_requests_per_periodand_period_in_seconds, already exist on master and are already permitted. This MR adds only the view. - The section anchor is
js-mcp-limits-settings, so production change requests can link to it. - The
429troubleshooting entry was checked on a running instance. A refused request returnstext/plain(Retry laterby default), not a JSON-RPC message, so a client typically shows a generic error. It is logged only by Workhorse, not inapi_json.logorauth.log. - For #629885 (closed): the GitLab.com per-plan values are documented on the MCP server page, and
doc/user/gitlab_com/rate_limits.mdlinks to them rather than repeating the table, so there is one place to maintain them.
References
- Epic: gitlab-org#22800 (closed)
- Closes #629884 (closed)
- Closes #629885 (closed)
- Throttle settings: #629883 (closed)
Screenshots or screen recordings
| Before | After |
|---|---|
| No MCP section on the Network page | ![]() |
How to set up and validate locally
These steps test the admin setting, which is how GitLab Self-Managed and GitLab Dedicated limit MCP requests. Run them with SaaS mode off. GitLab.com does not use this setting. Its MCP limits come from the rate_limiter_mcp_limits_<plan>_{info,enforce} feature flags, so do not enable this setting in SaaS mode.
-
Go to Admin > Settings > Network and expand GitLab MCP server rate limits. It sits between Files API rate limits and Search rate limits.
-
Select Enable authenticated MCP server request rate limit, set Max authenticated MCP server requests per period per user to
3, and select Save changes. The page reloads at the#js-mcp-limits-settingsanchor. -
Confirm the values persisted in
rails console:ApplicationSetting.current.rate_limits.slice('throttle_authenticated_mcp_enabled', 'throttle_authenticated_mcp_requests_per_period') -
Wait about 60 seconds for the application settings cache to expire, then send more than three requests with a personal access token that has the
mcpscope:curl --request POST "https://gdk.test:3443/api/v4/mcp" \ --header "PRIVATE-TOKEN: <token>" --header "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' --includeThe fourth request returns
429withRateLimit-Name: throttle_authenticated_mcpand aRetry-Afterheader. -
Select Learn more in the section description. It opens the new Enable authenticated MCP server request rate limit section.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

