Class EquinixMcpServer.Builder

java.lang.Object
com.eqixiac.equinix.mcp.server.EquinixMcpServer.Builder
Enclosing class:
EquinixMcpServer

public static final class EquinixMcpServer.Builder extends Object
Builder for EquinixMcpServer.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • session

      public EquinixMcpServer.Builder session(Equinix session)
      Serves over an existing authenticated session (shared token + pool). The session is not closed by EquinixMcpServer.close() - its owner keeps it.
      Parameters:
      session - the session facade to execute through
      Returns:
      this builder
    • credentials

      public EquinixMcpServer.Builder credentials(String accessKey, String secretKey)
      Serves under client credentials; a dedicated Equinix session is created at build() and closed with the server.
      Parameters:
      accessKey - the Equinix API access key (EQUINIX_ACCESS_KEY)
      secretKey - the Equinix API secret key (EQUINIX_SECRET_KEY)
      Returns:
      this builder
    • credentials

      public EquinixMcpServer.Builder credentials(EquinixCredentials 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

      public EquinixMcpServer.Builder sandbox(boolean sandbox)
      Targets the Equinix sandbox environment when a session is created from credentials.
      Parameters:
      sandbox - true for sandbox, false (default) for production
      Returns:
      this builder
    • context

      public EquinixMcpServer.Builder context(ServerContext context)
      Supplies a fully assembled ServerContext - the test seam, and the way to inject pre-built facades. Overrides session / credentials.
      Parameters:
      context - the context to execute against
      Returns:
      this builder
    • toolsets

      public EquinixMcpServer.Builder toolsets(Toolset... toolsets)
      Selects which toolsets to serve. Default: every read-only toolset (Toolset.defaults()) - the mutate toolset is served only when explicitly listed here.
      Parameters:
      toolsets - the toolsets to expose
      Returns:
      this builder
    • toolsets

      public EquinixMcpServer.Builder toolsets(String csv)
      Selects toolsets from a comma-separated id list ("design,ibx"), as used by EQUINIX_MCP_TOOLSETS and --toolsets. Blank selects every read-only toolset (Toolset.defaults()); mutate is served only when named.
      Parameters:
      csv - the comma-separated toolset ids
      Returns:
      this builder
    • additionalTools

      public EquinixMcpServer.Builder additionalTools(ToolRegistration... tools)
      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 same notifications/cancelled handling as the default transport. Tests use this with piped streams.
      Parameters:
      in - the stream the client writes JSON-RPC lines to
      out - 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: StdioServerTransportProvider over the process's stdin/stdout. There is deliberately no HTTP transport. A provider supplied here bypasses this server's notifications/cancelled handling, which reads the stdio input; use stdio(InputStream, OutputStream) to keep it.
      Parameters:
      transportProvider - the transport to serve on
      Returns:
      this builder
    • instructions

      public EquinixMcpServer.Builder instructions(String instructions)
      Overrides the server instructions sent to clients at initialize time.
      Parameters:
      instructions - the instructions text
      Returns:
      this builder
    • build

      public EquinixMcpServer 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