Agentic MR Review: Expand review context beyond MR diffs to include full repository access and external ticket context (e.g. Jira)

Problem to Solve

The Agentic MR Review flow currently limits its context to the MR diff. This means the agent cannot:

  1. Access the broader repository to understand project conventions, coding standards, naming patterns, or architectural decisions — leading to generic language nit-picks rather than convention-aware feedback
  2. Access external ticket context (e.g. Jira stories, acceptance criteria) to validate whether the code actually satisfies the business requirements it was written for
  3. Handle multi-repo or cross-package dependency scenarios effectively — producing low-value or confused output when changes span multiple repositories or packages

Customer feedback:

"Context limited to MR diffs. Without broader repository access, the reviewer raises generic language nit-picks rather than convention-aware feedback. Multi-repo and cross-package dependency scenarios produce low-value or confused output. Linking to Jira ticket context is absent, constraining reviews to narrow logical issues."

Intended Users

  • Development teams who want AI code review that understands their project's conventions and standards
  • Teams using Jira who want the agent to validate code against acceptance criteria, not just syntax and logic
  • Platform teams building custom review flows that need richer context

User Experience Goal

The Agentic MR Review agent should be able to:

  1. Read relevant files from the repository (not just the diff) to understand conventions and patterns
  2. Optionally fetch linked external ticket details (e.g. Jira story, acceptance criteria) and use them to validate the code change
  3. Produce feedback that is specific to the project's conventions, not generic best-practice advice

Proposal

Broader Repository Access

  • Allow the review agent to access the full repository (or a configurable subset) via existing file-reading tools (read_file, list_dir, etc.)
  • Allow flow authors to configure which paths or files the agent should read for context (e.g. CONTRIBUTING.md, docs/architecture/, style guide files)
  • Consider supporting a review-context.md or similar convention file that teams can maintain to guide the agent

External Ticket Context (Jira and others)

  • Enable Custom Flows to connect to external MCP servers (e.g. Jira MCP) to fetch ticket details at review time
  • Pass the linked issue/ticket URL or ID as input to the flow, allowing the agent to retrieve acceptance criteria and validate the code against them
  • This is currently blocked by the absence of external MCP support in Custom Flows running in sandbox mode (see related issues)

Multi-Repo Support

  • Allow the agent to access related repositories or packages when reviewing changes that span multiple repos
  • Provide tooling for the agent to understand cross-package dependency relationships

Benefits

  1. Convention-aware feedback — reviews reflect the project's actual standards, not generic advice
  2. Business requirement validation — agent can check code against acceptance criteria, not just logic
  3. Higher-value output — reduces noise from generic nit-picks, increases signal from meaningful feedback
  4. Competitive parity — matches the context-awareness of IDE-based tools that have full repo access

Permissions and Security

  • Repository access should respect existing GitLab permissions
  • External MCP connections should be explicitly configured and audited
  • Sensitive files (e.g. secrets, credentials) should be excluded from agent context by default

Availability

  • GitLab.com (SaaS)
  • Self-Managed
  • Dedicated
  • #588653 (closed) — Allow custom agents and flows to be used as automatic MR reviewers
  • #587478 (closed) — Flows should gracefully skip repo-level MCP config in sandbox mode
  • #592244 — MCP and API Functions for Inline Merge Request Comments