Class McpServerBuilder

java.lang.Object
com.commercetools.api.models.mcp_server.McpServerBuilder
All Implemented Interfaces:
Builder<McpServer>

public class McpServerBuilder extends Object implements Builder<McpServer>
McpServerBuilder
Example to create an instance using the builder pattern

     McpServer mcpServer = McpServer.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .key("{key}")
             .authenticationMode(McpServerAuthenticationMode.CLIENT_CREDENTIALS)
             .state(McpServerState.ENABLED)
             .mcpServer(mcpServerBuilder -> mcpServerBuilder)
             .build()
 
  • Constructor Details

    • McpServerBuilder

      public McpServerBuilder()
  • Method Details

    • id

      public McpServerBuilder id(String id)

      Unique identifier of the MCP Server.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public McpServerBuilder version(Long version)

      Current version of the MCP Server.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public McpServerBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the MCP Server was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public McpServerBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the MCP Server was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      IDs and references that last modified the MCP Server.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • withLastModifiedBy

      public McpServerBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the MCP Server.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • lastModifiedBy

      public McpServerBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the MCP Server.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the MCP Server.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • withCreatedBy

      public McpServerBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the MCP Server.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • createdBy

      public McpServerBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the MCP Server.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • key

      public McpServerBuilder key(String key)

      User-defined unique identifier of the MCP Server within a Project.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • name

      Name of the MCP Server.

      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • withName

      Name of the MCP Server.

      Parameters:
      builder - function to build the name value
      Returns:
      Builder
    • name

      public McpServerBuilder name(@Nullable LocalizedString name)

      Name of the MCP Server.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • description

      Description of the MCP Server.

      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • withDescription

      Description of the MCP Server.

      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • description

      public McpServerBuilder description(@Nullable LocalizedString description)

      Description of the MCP Server.

      Parameters:
      description - value to be set
      Returns:
      Builder
    • authenticationMode

      public McpServerBuilder authenticationMode(McpServerAuthenticationMode authenticationMode)

      Determines how AI agents authenticate when connecting to the MCP Server.

      Parameters:
      authenticationMode - value to be set
      Returns:
      Builder
    • state

      public McpServerBuilder state(McpServerState state)

      State of the MCP Server. A Disabled MCP Server rejects all AI agent tool requests.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • mcpServer

      public McpServerBuilder mcpServer(McpServerConfig mcpServer)

      Configuration of the MCP Server connection.

      Parameters:
      mcpServer - value to be set
      Returns:
      Builder
    • mcpServer

      Configuration of the MCP Server connection.

      Parameters:
      builder - function to build the mcpServer value
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the MCP Server.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the MCP Server.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the MCP Server was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the MCP Server was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the MCP Server.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the MCP Server.

      Returns:
      createdBy
    • getKey

      public String getKey()

      User-defined unique identifier of the MCP Server within a Project.

      Returns:
      key
    • getName

      @Nullable public LocalizedString getName()

      Name of the MCP Server.

      Returns:
      name
    • getDescription

      @Nullable public LocalizedString getDescription()

      Description of the MCP Server.

      Returns:
      description
    • getAuthenticationMode

      public McpServerAuthenticationMode getAuthenticationMode()

      Determines how AI agents authenticate when connecting to the MCP Server.

      Returns:
      authenticationMode
    • getState

      public McpServerState getState()

      State of the MCP Server. A Disabled MCP Server rejects all AI agent tool requests.

      Returns:
      state
    • getMcpServer

      public McpServerConfig getMcpServer()

      Configuration of the MCP Server connection.

      Returns:
      mcpServer
    • build

      public McpServer build()
      builds McpServer with checking for non-null required values
      Specified by:
      build in interface Builder<McpServer>
      Returns:
      McpServer
    • buildUnchecked

      public McpServer buildUnchecked()
      builds McpServer without checking for non-null required values
      Returns:
      McpServer
    • of

      public static McpServerBuilder of()
      factory method for an instance of McpServerBuilder
      Returns:
      builder
    • of

      public static McpServerBuilder of(McpServer template)
      create builder for McpServer instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder