Class DefaultMcpServer.MCPCause

java.lang.Object
hudson.model.Cause
io.jenkins.plugins.mcp.server.extensions.DefaultMcpServer.MCPCause
Enclosing class:
DefaultMcpServer

public static class DefaultMcpServer.MCPCause extends Cause
A Cause that indicates a Jenkins build was triggered via MCP call.

This is useful for the end user to understand that the call was trigger through this plugin's code and not some manual user intervention.

And among others, it allows plugins like ... to offer custom badges

See Also:
  • Constructor Details

    • MCPCause

      public MCPCause(String addr)
  • Method Details

    • getAddr

      @Exported(visibility=3) public String getAddr()
    • getUserId

      @Exported(visibility=3) public String getUserId()
      The Jenkins user who initiated the MCP request, when available.

      The MCP cause precedes the standard Cause.UserIdCause in the build's cause list. Exporting the same user ID here preserves the identity expected by existing Pipelines that inspect the first cause, without changing cause ordering or removing the dedicated user cause.

    • getUserName

      @Exported(visibility=3) public String getUserName()
      The initiating user's current Jenkins display name, when available.
    • getShortDescription

      public String getShortDescription()
      Specified by:
      getShortDescription in class Cause