public static final class McpServer.Builder extends GeneratedMessage.Builder<McpServer.Builder> implements McpServerOrBuilderRepresents an MCP Server. MCP Servers act as endpoints that expose a collection of tools that can be invoked by agents.
Protobuf type google.cloud.apiregistry.v1.McpServer
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > McpServer.BuilderImplements
McpServerOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
addAllUrls(Iterable<String> values)
public McpServer.Builder addAllUrls(Iterable<String> values)The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Parameter | |
|---|---|
| Name | Description |
values |
Iterable<String>The urls to add. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
addUrls(String value)
public McpServer.Builder addUrls(String value)The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe urls to add. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
addUrlsBytes(ByteString value)
public McpServer.Builder addUrlsBytes(ByteString value)The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes of the urls to add. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
build()
public McpServer build()| Returns | |
|---|---|
| Type | Description |
McpServer |
|
buildPartial()
public McpServer buildPartial()| Returns | |
|---|---|
| Type | Description |
McpServer |
|
clear()
public McpServer.Builder clear()| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
clearCapabilities()
public McpServer.Builder clearCapabilities()The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
clearDescription()
public McpServer.Builder clearDescription()Optional. A human-readable description of the MCP Server's functionality.
string description = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
clearDisplayName()
public McpServer.Builder clearDisplayName()Optional. A human readable name for the MCP server.
string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
clearName()
public McpServer.Builder clearName() Identifier. The resource name of the MCP Server.
Format:
projects/{project}/locations/{location}/mcpServers/{mcp_server}.
Example:
projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
for 1p
projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
2p
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
clearState()
public McpServer.Builder clearState()Output only. The state of the MCP Server.
.google.cloud.apiregistry.v1.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
clearUrls()
public McpServer.Builder clearUrls()The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
getCapabilities()
public Struct getCapabilities()The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Returns | |
|---|---|
| Type | Description |
Struct |
The capabilities. |
getCapabilitiesBuilder()
public Struct.Builder getCapabilitiesBuilder()The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Returns | |
|---|---|
| Type | Description |
Builder |
|
getCapabilitiesOrBuilder()
public StructOrBuilder getCapabilitiesOrBuilder()The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Returns | |
|---|---|
| Type | Description |
StructOrBuilder |
|
getDefaultInstanceForType()
public McpServer getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
McpServer |
|
getDescription()
public String getDescription()Optional. A human-readable description of the MCP Server's functionality.
string description = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
String |
The description. |
getDescriptionBytes()
public ByteString getDescriptionBytes()Optional. A human-readable description of the MCP Server's functionality.
string description = 3 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for description. |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getDisplayName()
public String getDisplayName()Optional. A human readable name for the MCP server.
string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
String |
The displayName. |
getDisplayNameBytes()
public ByteString getDisplayNameBytes()Optional. A human readable name for the MCP server.
string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for displayName. |
getName()
public String getName() Identifier. The resource name of the MCP Server.
Format:
projects/{project}/locations/{location}/mcpServers/{mcp_server}.
Example:
projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
for 1p
projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
2p
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Returns | |
|---|---|
| Type | Description |
String |
The name. |
getNameBytes()
public ByteString getNameBytes() Identifier. The resource name of the MCP Server.
Format:
projects/{project}/locations/{location}/mcpServers/{mcp_server}.
Example:
projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
for 1p
projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
2p
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes for name. |
getState()
public State getState()Output only. The state of the MCP Server.
.google.cloud.apiregistry.v1.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
State |
The state. |
getStateValue()
public int getStateValue()Output only. The state of the MCP Server.
.google.cloud.apiregistry.v1.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Returns | |
|---|---|
| Type | Description |
int |
The enum numeric value on the wire for state. |
getUrls(int index)
public String getUrls(int index)The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the element to return. |
| Returns | |
|---|---|
| Type | Description |
String |
The urls at the given index. |
getUrlsBytes(int index)
public ByteString getUrlsBytes(int index)The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Parameter | |
|---|---|
| Name | Description |
index |
intThe index of the value to return. |
| Returns | |
|---|---|
| Type | Description |
ByteString |
The bytes of the urls at the given index. |
getUrlsCount()
public int getUrlsCount()The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Returns | |
|---|---|
| Type | Description |
int |
The count of urls. |
getUrlsList()
public ProtocolStringList getUrlsList()The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Returns | |
|---|---|
| Type | Description |
ProtocolStringList |
A list containing the urls. |
hasCapabilities()
public boolean hasCapabilities()The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the capabilities field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeCapabilities(Struct value)
public McpServer.Builder mergeCapabilities(Struct value)The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Parameter | |
|---|---|
| Name | Description |
value |
Struct |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
mergeFrom(McpServer other)
public McpServer.Builder mergeFrom(McpServer other)| Parameter | |
|---|---|
| Name | Description |
other |
McpServer |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public McpServer.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public McpServer.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
setCapabilities(Struct value)
public McpServer.Builder setCapabilities(Struct value)The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Parameter | |
|---|---|
| Name | Description |
value |
Struct |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
setCapabilities(Struct.Builder builderForValue)
public McpServer.Builder setCapabilities(Struct.Builder builderForValue)The capabilities that a server may support. Known capabilities defined in https://modelcontextprotocol.io/specification/2025-06-18/schema#servercapabilities and additional capabilities defined by the servers.
.google.protobuf.Struct capabilities = 6;
| Parameter | |
|---|---|
| Name | Description |
builderForValue |
Builder |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
|
setDescription(String value)
public McpServer.Builder setDescription(String value)Optional. A human-readable description of the MCP Server's functionality.
string description = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe description to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setDescriptionBytes(ByteString value)
public McpServer.Builder setDescriptionBytes(ByteString value)Optional. A human-readable description of the MCP Server's functionality.
string description = 3 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for description to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setDisplayName(String value)
public McpServer.Builder setDisplayName(String value)Optional. A human readable name for the MCP server.
string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe displayName to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setDisplayNameBytes(ByteString value)
public McpServer.Builder setDisplayNameBytes(ByteString value)Optional. A human readable name for the MCP server.
string display_name = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for displayName to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setName(String value)
public McpServer.Builder setName(String value) Identifier. The resource name of the MCP Server.
Format:
projects/{project}/locations/{location}/mcpServers/{mcp_server}.
Example:
projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
for 1p
projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
2p
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Parameter | |
|---|---|
| Name | Description |
value |
StringThe name to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setNameBytes(ByteString value)
public McpServer.Builder setNameBytes(ByteString value) Identifier. The resource name of the MCP Server.
Format:
projects/{project}/locations/{location}/mcpServers/{mcp_server}.
Example:
projects/12345/locations/us-central1/mcpServers/google:bigquery.googleapis.com:mcp
for 1p
projects/12345/locations/us-central1/mcpServers/apphub:starbucks for
2p
string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
| Parameter | |
|---|---|
| Name | Description |
value |
ByteStringThe bytes for name to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setState(State value)
public McpServer.Builder setState(State value)Output only. The state of the MCP Server.
.google.cloud.apiregistry.v1.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
StateThe state to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setStateValue(int value)
public McpServer.Builder setStateValue(int value)Output only. The state of the MCP Server.
.google.cloud.apiregistry.v1.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe enum numeric value on the wire for state to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |
setUrls(int index, String value)
public McpServer.Builder setUrls(int index, String value)The base URL of the MCP server. Example: [geolocation.googleapis.com/mcp].
repeated string urls = 4;
| Parameters | |
|---|---|
| Name | Description |
index |
intThe index to set the value at. |
value |
StringThe urls to set. |
| Returns | |
|---|---|
| Type | Description |
McpServer.Builder |
This builder for chaining. |