Class McpServerInfo.Builder<T extends McpServerInfo.Builder<T>>

java.lang.Object
com.github.thought2code.mcp.annotated.server.McpServerInfo.Builder<T>
Type Parameters:
T - the type of the builder
Direct Known Subclasses:
McpSseServerInfo.Builder, McpStreamableServerInfo.Builder
Enclosing class:
McpServerInfo

public static class McpServerInfo.Builder<T extends McpServerInfo.Builder<T>> extends Object
The builder class for McpServerInfo.
  • Field Details

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • self

      protected T self()
      Returns the self reference of the builder, which is used to chain the method calls and ensure the subclasses of McpServerInfo can also inherit the builder methods with parameterized type.
      Returns:
      the self reference of the builder
    • build

      public McpServerInfo build()
      Builds a new instance of McpServerInfo with the specified configuration.
      Returns:
      a new instance of McpServerInfo
    • name

      public T name(String name)
      Sets the name of the MCP server.
      Parameters:
      name - the name of the MCP server
      Returns:
      the self reference of the builder
    • version

      public T version(String version)
      Sets the version of the MCP server.
      Parameters:
      version - the version of the MCP server
      Returns:
      the self reference of the builder
    • instructions

      public T instructions(String instructions)
      Sets the instructions of the MCP server.
      Parameters:
      instructions - the instructions of the MCP server
      Returns:
      the self reference of the builder
    • requestTimeout

      public T requestTimeout(Duration requestTimeout)
      Sets the request timeout of the MCP server.
      Parameters:
      requestTimeout - the request timeout of the MCP server
      Returns:
      the self reference of the builder
    • capabilities

      public T capabilities(McpServerCapabilities capabilities)
      Sets the capabilities of the MCP server.
      Parameters:
      capabilities - the capabilities of the MCP server
      Returns:
      the self reference of the builder
    • changeNotification

      public T changeNotification(McpServerChangeNotification changeNotification)
      Sets the change notification of the MCP server.
      Parameters:
      changeNotification - the change notification of the MCP server
      Returns:
      the self reference of the builder