Class PendingApprovalMcpTools

java.lang.Object
io.jenkins.plugins.github_pr_approval.PendingApprovalMcpTools
All Implemented Interfaces:
ExtensionPoint, io.jenkins.plugins.mcp.server.McpServerExtension

@OptionalExtension(requirePlugins="mcp-server") public class PendingApprovalMcpTools extends Object implements io.jenkins.plugins.mcp.server.McpServerExtension
Exposes the pending fork pull requests as MCP tools, so an assistant can list what is waiting and approve it without opening the Jenkins UI.

Only registers when the MCP Server plugin is installed (OptionalExtension); the plugin works the same without it. Every call runs as the MCP caller, so the same permissions the web UI enforces apply here too.

  • Constructor Details

    • PendingApprovalMcpTools

      public PendingApprovalMcpTools()
  • Method Details

    • getPendingApprovals

      @Tool(description="Lists the GitHub fork pull requests that are blocked waiting for external approval before they can build. Scans every multibranch project, or just one when its full name is given.", annotations=) public List<PendingApprovalMcpTools.PendingApproval> getPendingApprovals(@Nullable @ToolParam(description="Full name of a multibranch project to limit the search to, e.g. 'my-org-repo'; omit to scan them all",required=false) String jobName)
    • approvePullRequests

      @Tool(description="Approves blocked GitHub fork pull requests so they can build. Optionally adds each pull request author to the policy's auto-approval users, so their future pull requests build without asking. Each job is reported on independently: a bad job name does not stop the others.", annotations=) public List<PendingApprovalMcpTools.ApprovalResult> approvePullRequests(@ToolParam(description="Full names of the branch jobs, e.g. 'my-org-repo/PR-42'") List<String> jobFullNames, @Nullable @ToolParam(description="Also add each pull request author to the auto-approval users list",required=false) Boolean addAuthorToAutoApprovalUsers) throws IOException
      Throws:
      IOException