[go: up one dir, main page]

Skip to content

Control access to MCP with beta features setting

What does this MR do and why?

This allows users to control access to MCP server using instance and namespace beta features setting.

References

#568129

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Run GDK with SaaS simulation.
  2. Generate a new PAT via the UI.
  3. In rails console, set the token scopes to ["mcp"].
    PersonalAccessToken.first.update(scopes: ["mcp"])
  4. In rails console, enable the feature flags
    Feature.enable(:mcp_server)
  5. Enable AI Beta Features settings in a top level group, e.g. GitLab Duo (doc)
  6. 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"
      }
    }
    '
  7. Disable AI Beta Features settings in a top level group, e.g. GitLab Duo (doc)
  8. 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.

Edited by Tan Le

Merge request reports

Loading