Class 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticationMode(McpServerAuthenticationMode authenticationMode) Determines how AI agents authenticate when connecting to the MCP Server.build()builds McpServer with checking for non-null required valuesbuilds McpServer without checking for non-null required valuescreatedAt(ZonedDateTime createdAt) Date and time (UTC) the MCP Server was initially created.IDs and references that created the MCP Server.createdBy(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the MCP Server.description(LocalizedString description) Description of the MCP Server.Description of the MCP Server.Determines how AI agents authenticate when connecting to the MCP Server.Date and time (UTC) the MCP Server was initially created.IDs and references that created the MCP Server.Description of the MCP Server.getId()Unique identifier of the MCP Server.getKey()User-defined unique identifier of the MCP Server within a Project.Date and time (UTC) the MCP Server was last updated.IDs and references that last modified the MCP Server.Configuration of the MCP Server connection.getName()Name of the MCP Server.getState()State of the MCP Server.Current version of the MCP Server.Unique identifier of the MCP Server.User-defined unique identifier of the MCP Server within a Project.lastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the MCP Server was last updated.lastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the MCP Server.IDs and references that last modified the MCP Server.mcpServer(McpServerConfig mcpServer) Configuration of the MCP Server connection.mcpServer(Function<McpServerConfigBuilder, Builder<? extends McpServerConfig>> builder) Configuration of the MCP Server connection.name(LocalizedString name) Name of the MCP Server.Name of the MCP Server.static McpServerBuilderof()factory method for an instance of McpServerBuilderstatic McpServerBuildercreate builder for McpServer instancestate(McpServerState state) State of the MCP Server.Current version of the MCP Server.withCreatedBy(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the MCP Server.Description of the MCP Server.IDs and references that last modified the MCP Server.Name of the MCP Server.
-
Constructor Details
-
McpServerBuilder
public McpServerBuilder()
-
-
Method Details
-
id
Unique identifier of the MCP Server.
- Parameters:
id- value to be set- Returns:
- Builder
-
version
Current version of the MCP Server.
- Parameters:
version- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the MCP Server was initially created.
- Parameters:
createdAt- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the MCP Server was last updated.
- Parameters:
lastModifiedAt- value to be set- Returns:
- Builder
-
lastModifiedBy
public McpServerBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the MCP Server.
- Parameters:
builder- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the MCP Server.
- Parameters:
builder- function to build the lastModifiedBy value- Returns:
- Builder
-
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
IDs and references that created the MCP Server.
- Parameters:
builder- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the MCP Server.
- Parameters:
createdBy- value to be set- Returns:
- Builder
-
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
Name of the MCP Server.
- Parameters:
name- value to be set- Returns:
- Builder
-
description
public McpServerBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) 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
Description of the MCP Server.
- Parameters:
description- value to be set- Returns:
- Builder
-
authenticationMode
Determines how AI agents authenticate when connecting to the MCP Server.
- Parameters:
authenticationMode- value to be set- Returns:
- Builder
-
state
State of the MCP Server. A
DisabledMCP Server rejects all AI agent tool requests.- Parameters:
state- value to be set- Returns:
- Builder
-
mcpServer
Configuration of the MCP Server connection.
- Parameters:
mcpServer- value to be set- Returns:
- Builder
-
mcpServer
public McpServerBuilder mcpServer(Function<McpServerConfigBuilder, Builder<? extends McpServerConfig>> builder) Configuration of the MCP Server connection.
- Parameters:
builder- function to build the mcpServer value- Returns:
- Builder
-
getId
Unique identifier of the MCP Server.
- Returns:
- id
-
getVersion
Current version of the MCP Server.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the MCP Server was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the MCP Server was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the MCP Server.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the MCP Server.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the MCP Server within a Project.
- Returns:
- key
-
getName
Name of the MCP Server.
- Returns:
- name
-
getDescription
Description of the MCP Server.
- Returns:
- description
-
getAuthenticationMode
Determines how AI agents authenticate when connecting to the MCP Server.
- Returns:
- authenticationMode
-
getState
State of the MCP Server. A
DisabledMCP Server rejects all AI agent tool requests.- Returns:
- state
-
getMcpServer
Configuration of the MCP Server connection.
- Returns:
- mcpServer
-
build
builds McpServer with checking for non-null required values -
buildUnchecked
builds McpServer without checking for non-null required values- Returns:
- McpServer
-
of
factory method for an instance of McpServerBuilder- Returns:
- builder
-
of
create builder for McpServer instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-