Add rake task to verify MCP server setup
The check_oauth_discovery method was using Rails.application.routes.recognize_path to detect the MCP endpoint, which always fails because MCP is a Grape API endpoint mounted as a Rack application, not a Rails route. Replace with a check for the API::Mcp::Base Grape class and its registered routes.
Also add the rake task entry in duo.rake and spec coverage.
Changelog: added EE: true
~/dev/gdk/gitlab (lkorbasiewicz-mcpcheck-rake) $ bin/rake 'gitlab:duo:verify_mcp_server_setup'
═══════════════════════════════════════════════════════════════
GitLab MCP Server Setup Verification
═══════════════════════════════════════════════════════════════
This task verifies that the MCP server endpoint (/api/v4/mcp)
is correctly configured and accessible on this instance.
Collecting system information...
GitLab 18.11.0-pre (EE) — http://gdk.test:3000
✔ License: Ultimate — :mcp_server feature is available.
✔ Duo availability: 'On by default' (duo_features_enabled=true, lock=false)
✔ duo_features_enabled: true
✗ instance_level_ai_beta_features_enabled: false
The MCP server requires experiment and beta features to be enabled. Enable via: Admin > GitLab Duo > Turn on experiment and beta features.
✔ MCP Grape API endpoint is loaded (API::Mcp::Base).
Endpoint: http://gdk.test:3000/api/v4/mcp
OAuth discovery: http://gdk.test:3000/.well-known/oauth-authorization-server/api/v4/mcp
Dynamic registration: http://gdk.test:3000/oauth/register
ℹ No instance-level access rules configured (Ai::FeatureAccessRule).
All users with appropriate license will have access to Duo features.
ℹ No username provided. Skipping user-specific checks.
Re-run with: rake gitlab:duo:verify_mcp_server_setup[username]
═══════════════════════════════════════════════════════════════
✗ 1 check(s) failed. MCP server may not work.
═══════════════════════════════════════════════════════════════
═══════════════════════════════════════════════════════════════
DIAGNOSTIC SUMMARY (sanitize before sharing with support)
═══════════════════════════════════════════════════════════════
{
"system": {
"gitlab_version": "18.11.0-pre",
"gitlab_revision": "af6737553b2",
"gitlab_edition": "EE",
"rails_env": "development",
"timestamp": "2026-03-19T15:53:40Z",
"instance_url": "http://gdk.test:3000",
"user": null
},
"license": {
"status": "PASS",
"message": "License: Ultimate — :mcp_server feature is available."
},
"duo_availability": {
"status": "PASS",
"message": "Duo availability: 'On by default' (duo_features_enabled=true, lock=false)"
},
"duo_features_enabled": {
"status": "PASS",
"message": "duo_features_enabled: true"
},
"instance_level_ai_beta_features_enabled": {
"status": "FAIL",
"message": "instance_level_ai_beta_features_enabled: false",
"detail": "The MCP server requires experiment and beta features to be enabled. Enable via: Admin > GitLab Duo > Turn on experiment and beta features."
},
"oauth_discovery": {
"status": "PASS",
"message": "MCP Grape API endpoint is loaded (API::Mcp::Base).",
"detail": "Endpoint: http://gdk.test:3000/api/v4/mcp\n OAuth discovery: http://gdk.test:3000/.well-known/oauth-authorization-server/api/v4/mcp\n Dynamic registration: http://gdk.test:3000/oauth/register"
},
"instance_access_rules": {
"status": "INFO",
"message": "No instance-level access rules configured (Ai::FeatureAccessRule).",
"detail": "All users with appropriate license will have access to Duo features."
}
}
NOTE: Review the above output and remove any sensitive information
before sharing with GitLab support.
~/dev/gdk/gitlab (lkorbasiewicz-mcpcheck-rake) $
gdk switch lkorbasiewicz-mcpcheck-rake
bin/rake 'gitlab:duo:verify_mcp_server_setup'
bin/rake 'gitlab:duo:verify_mcp_server_setup[root]'
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
ŁUKASZ KORBASIEWICZ (5109a2e5) at 19 Mar 16:24
Add rake task to verify MCP server setup
ŁUKASZ KORBASIEWICZ (b3c6775a) at 19 Mar 11:47
Edit GitLab Duo Agent Platform.md
ŁUKASZ KORBASIEWICZ (ee92b941) at 19 Mar 11:46
Apply 1 suggestion(s) to 1 file(s)
@jpcyiza is there a better place for this request? We have a Customer that would like to be able to select a default namespace even if instance level is "Off by default"
Adding a missing link
Please verify the check list and ensure to tick them off before the MR is merged.
LGTM!
Thanks! cc @juan-silva
We have a Customer interested in the ability to select a default namespace in Self-Managed (internal ZD ticket)
We have another Customer reporting this as a DAP adoption blocker - @ohoral @ealcantara shall we add severity2 ?
Thanks again @faleksic I cleaned it up a little and added all (I hope) missing links
ŁUKASZ KORBASIEWICZ (aeeb7fa0) at 11 Mar 14:54
Add missing links