Draft: MCP Servers in AI Catalog PoC

What does this MR do and why?

This MR introduces Model Context Protocol (MCP) server support in the AI Catalog as a proof of concept. MCP servers allow AI agents to be extended with external tools and data sources through a standardized protocol.

Related discussion: #584281 (comment 2995570648)

Demo: the video is here (internal Slack): https://gitlab.slack.com/archives/C08T5J1KXKQ/p1769546916417669

When we were implementing Implement MCP client that uses Gitlab MCP server (!206445 - merged), we kept external MCP servers in mind, so this MR comes down to:

  • Providing UI/UX to add an MCP server to AI Catalog
  • Providing UI/UX to associate an agent with MCP servers from the catalog
  • Displaying MCP servers in a project's Automate section, so a user could have a place to connect to servers that require OAuth
  • Providing the ability to connect to the servers via OAuth
  • Propagate ai-catalog-item-version-id from Duo Chat UI up to McpConfigService
  • Find all MCP servers related to the catalog item and build MCP configs for Workhorse and DWS to consume

Key Changes

Database Layer

  • New tables:
    • ai_catalog_mcp_servers - Stores MCP server configurations (name, description, URL, transport type, authentication settings)
    • ai_catalog_items_mcp_servers - Join table linking AI catalog items (agents) to MCP servers
    • ai_catalog_mcp_servers_users - Stores user-specific OAuth tokens for MCP server authentication

Backend

  • Added new routes for AI Catalog (draw :ai_catalog)
  • New models: Ai::Catalog::McpServer, Ai::Catalog::ItemsMcpServer, Ai::Catalog::McpServersUser
  • GraphQL mutation for creating MCP servers (aiCatalogMcpServerCreate)

Frontend (AI Catalog UI)

  • New MCP tab in the AI Catalog navigation alongside Agents and Flows
  • MCP Server management:
    • List view with pagination (AiCatalogMcpServerList)
    • List item component showing server details (URL, transport, auth type)
    • Form for creating/editing MCP servers with OAuth support
  • Agent integration:
    • Agents can now be associated with MCP servers
    • Agent details page displays connected MCP servers
    • Agent form includes MCP server selector

MCP Server Properties

  • Transport: HTTP (currently the only supported transport)
  • Authentication types: OAuth or No authentication
  • OAuth support: Optional client ID/secret with dynamic client registration fallback

Technical Details

  • Database schema follows GitLab conventions with organization-level sharding
  • Frontend uses Vue components with GitLab UI library
  • GraphQL queries extended to fetch MCP server associations for agents

Screenshots/Screencasts

Not applicable for PoC

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Igor Drozdov

Merge request reports

Loading