Add merge_request_iid parameter to save_pipeline MCP tool

What does this MR do and why?

Consolidates merge request pipeline creation into the save_pipeline MCP tool (under the :ci toolset) per maintainer feedback, rather than introducing a separate tool in the :merge_requests toolset.

When merge_request_iid is provided to save_pipeline (and pipeline_id is absent), the tool delegates execution to MergeRequests::CreatePipelineService to create a pipeline properly linked to the merge request.

Changes

  • Add merge_request_iid integer parameter to SavePipelineService schema.
  • Update SavePipelineService#perform_v0_1_0 to execute MergeRequests::CreatePipelineService when merge_request_iid is present.
  • Enforce mutual exclusion between merge_request_iid and pipeline_id / ref / action.
  • Enforce granular token authorization on create_merge_request_pipeline.
  • Add unit specs covering merge request pipeline creation, url identification, permissions, and validation errors.
  • Document the new merge_request_iid parameter in doc/user/model_context_protocol/mcp_server_tools.md.

Closes #604238 (closed)

Edited by Pavan Kumar Sadashiv

Merge request reports

Loading
Loading