Implement GraphQL MCP integration

What does this MR do and why?

Implement GraphQL MCP integration based on this design document.

AI Summary

This MR implements GraphQL MCP (Model Context Protocol) integration for GitLab, introducing a versioned framework for GraphQL-based tools. The implementation adds infrastructure for creating versionable GraphQL tools and includes a working example tool for retrieving project issues.

Key features:

  1. MCP Tools Base Infrastructure - New GraphqlService base class that extends BaseService with versioning support for GraphQL-based MCP tools
  2. Versioning System - Versionable concern that enables semantic versioning for GraphQL operations, allowing tools to evolve while maintaining backward compatibility
  3. GraphQL Tool Base Class - McpToolBase that handles GraphQL query execution, error processing, and response formatting

Technical implementation:

  • Version-specific GraphQL queries and variable building (currently v0.1.0)
  • Automatic fallback to latest version when not specified
  • Comprehensive error handling for GraphQL syntax and business logic errors
  • Integration with existing MCP tools manager
  • Full test coverage for all new components
Note: I will add query and mutation tool example in a follow up MR, as this MR is already big.

References

#577212

Screenshots or screen recordings

video1672221310.mp4

How to set up and validate locally

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 Naman Jagdish Gala

Merge request reports

Loading