Put MCP Server access behind beta features setting
What does this MR do and why?
This MR puts MCP Server access behind the instance beta features setting.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Generate a new PAT via the UI.
- In rails console, set the token scopes to
["mcp"].PersonalAccessToken.first.update(scopes: ["mcp"]) - In rails console, enable the feature flags
Feature.enable(:mcp_server) Feature.enable(:mcp_server_new_implementation) - In rails console, ensure the AI Features Beta setting is enabled.
ApplicationSetting.first.update(instance_level_ai_beta_features_enabled: true) - Verify the API request to MCP server is successful.
curl --request POST \ --url http://gdk.test:8080/api/v4/mcp \ --header "Authorization: Bearer $GITLAB_TOKEN" \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": 2.0, "method": "tools/call", "id": 1, "params": { "name":"get_mcp_server_version" } } ' - In rails console, ensure the AI Features Beta setting is disabled.
ApplicationSetting.first.update(instance_level_ai_beta_features_enabled: false) - Verify the same API request to MCP server returns 404 Not Found.
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.
Related to #568129 (closed)
Edited by Tan Le