A Model Context Protocol Server for GitLab: Exposing Flaky Job Signals and Merge-Request Metrics
Seyed Ebrahim Haghshenas · Inquiry Queen s Undergraduate Research Conference Proceedings · 2025
The Model Context Protocol (MCP) is a resource-oriented standard that enables client applications to request structured contextual data from external systems. In simple terms, MCP functions as a consistent interface where client tools can “order” specific information items, and the server returns them in a structured format. This research project developed an MCP server that integrates with GitLab APIs to expose software engineering signals as consumable MCP resources, facilitating downstream analysis by model-driven clients such as Cline, Roo, or Claude Code. Two primary categories of MCP resources were implemented. The first identifies flaky jobs within continuous integration pipelines by detecting instances where jobs fail and later succeed on the same code revision, providing structured metadata including commit identifiers, pipeline context, and job logs. The second category extracts merge-request heuristics and metrics, such as time-to-first-review, time-to-merge, comment activity, reviewer overlap, and code change size, enabling consistent access to project-level development signals. Several limitations of MCP were observed. Straightforward improvements include extending GitLab endpoint coverage, refining caching strategies, introducing webhook-driven updates to reduce data staleness and hardening authentication for enterprise environments. Long-term challenges involve real-time event streaming at scale and exposing GitLab POST endpoints in a safe manner, possibly for use cases like code review (look at merge requests and approve or make suggestions) or even authoring new code. The findings indicate that MCP can effectively serve as a standardized interface for exposing targeted software engineering resources, while highlighting future directions in scalability, accuracy, and enterprise readiness.