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:
-
MCP Tools Base Infrastructure - New
GraphqlServicebase class that extendsBaseServicewith versioning support for GraphQL-based MCP tools -
Versioning System -
Versionableconcern that enables semantic versioning for GraphQL operations, allowing tools to evolve while maintaining backward compatibility -
GraphQL Tool Base Class -
McpToolBasethat 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
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