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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhatapprovePullRequest(String, Boolean)did.static final recordOne fork pull request waiting for approval.Nested classes/interfaces inherited from interface ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapprovePullRequest(String jobFullName, Boolean addAuthorToAutoApprovalUsers) getPendingApprovals(String jobName) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jenkins.plugins.mcp.server.McpServerExtension
getSyncPrompts, getSyncResources, getSyncTools
-
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) -
approvePullRequest
@Tool(description="Approves a blocked GitHub fork pull request so it can build. Optionally adds the pull request author to the policy's auto-approval users, so their future pull requests build without asking.", annotations=) public PendingApprovalMcpTools.ApprovalResult approvePullRequest(@ToolParam(description="Full name of the branch job, e.g. 'my-org-repo/PR-42'") String jobFullName, @Nullable @ToolParam(description="Also add the pull request author to the auto-approval users list",required=false) Boolean addAuthorToAutoApprovalUsers) throws IOException - Throws:
IOException
-