Class EquinixMcpServer.Builder
java.lang.Object
com.eqixiac.equinix.mcp.server.EquinixMcpServer.Builder
- Enclosing class:
EquinixMcpServer
Builder for
EquinixMcpServer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadditionalTools(ToolRegistration... tools) Registers extra tools alongside the built-in catalog - the seam the Safe Mutation Broker's two-phase mutation tools use.build()Assembles the context, registers the selected tools, and starts serving on the transport (the stdio transport begins reading as soon as a session is created).context(ServerContext context) Supplies a fully assembledServerContext- the test seam, and the way to inject pre-built facades.credentials(EquinixCredentials credentials) Serves under the given credentials object (alternative to the two-string form).credentials(String accessKey, String secretKey) instructions(String instructions) Overrides the server instructions sent to clients at initialize time.sandbox(boolean sandbox) Targets the Equinix sandbox environment when a session is created from credentials.Serves over an existing authenticated session (shared token + pool).stdio(InputStream in, OutputStream out) Serves stdio over the given streams instead of the process's stdin/stdout, with the samenotifications/cancelledhandling as the default transport.Selects which toolsets to serve.Selects toolsets from a comma-separated id list ("design,ibx"), as used byEQUINIX_MCP_TOOLSETSand--toolsets.transportProvider(io.modelcontextprotocol.spec.McpServerTransportProvider transportProvider) Overrides the transport.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
session
Serves over an existing authenticated session (shared token + pool). The session is not closed byEquinixMcpServer.close()- its owner keeps it.- Parameters:
session- the session facade to execute through- Returns:
- this builder
-
credentials
-
credentials
Serves under the given credentials object (alternative to the two-string form).- Parameters:
credentials- the credentials to open the session with- Returns:
- this builder
-
sandbox
Targets the Equinix sandbox environment when a session is created from credentials.- Parameters:
sandbox-truefor sandbox,false(default) for production- Returns:
- this builder
-
context
Supplies a fully assembledServerContext- the test seam, and the way to inject pre-built facades. Overridessession/credentials.- Parameters:
context- the context to execute against- Returns:
- this builder
-
toolsets
Selects which toolsets to serve. Default: every read-only toolset (Toolset.defaults()) - themutatetoolset is served only when explicitly listed here.- Parameters:
toolsets- the toolsets to expose- Returns:
- this builder
-
toolsets
Selects toolsets from a comma-separated id list ("design,ibx"), as used byEQUINIX_MCP_TOOLSETSand--toolsets. Blank selects every read-only toolset (Toolset.defaults());mutateis served only when named.- Parameters:
csv- the comma-separated toolset ids- Returns:
- this builder
-
additionalTools
Registers extra tools alongside the built-in catalog - the seam the Safe Mutation Broker's two-phase mutation tools use. Names must not collide with existing tools.- Parameters:
tools- the additional registrations- Returns:
- this builder
-
stdio
Serves stdio over the given streams instead of the process's stdin/stdout, with the samenotifications/cancelledhandling as the default transport. Tests use this with piped streams.- Parameters:
in- the stream the client writes JSON-RPC lines toout- the stream the server writes JSON-RPC lines to- Returns:
- this builder
-
transportProvider
public EquinixMcpServer.Builder transportProvider(io.modelcontextprotocol.spec.McpServerTransportProvider transportProvider) Overrides the transport. Default:StdioServerTransportProviderover the process's stdin/stdout. There is deliberately no HTTP transport. A provider supplied here bypasses this server'snotifications/cancelledhandling, which reads the stdio input; usestdio(InputStream, OutputStream)to keep it.- Parameters:
transportProvider- the transport to serve on- Returns:
- this builder
-
instructions
Overrides the server instructions sent to clients at initialize time.- Parameters:
instructions- the instructions text- Returns:
- this builder
-
build
Assembles the context, registers the selected tools, and starts serving on the transport (the stdio transport begins reading as soon as a session is created).- Returns:
- the running server
- Throws:
IllegalStateException- when neither a context, session, nor credentials were provided, or when tool names collide
-