类 McpServerInfo.Builder<T extends McpServerInfo.Builder<T>>

java.lang.Object
com.github.codeboyzhou.mcp.declarative.server.McpServerInfo.Builder<T>
类型参数:
T - the type of the builder
直接已知子类:
McpSseServerInfo.Builder, McpStreamableServerInfo.Builder
封闭类:
McpServerInfo

public static class McpServerInfo.Builder<T extends McpServerInfo.Builder<T>> extends Object
The builder class for McpServerInfo.
  • 字段详细资料

    • name

      protected String name
      The name of the MCP server. Default value is "mcp-server".
    • version

      protected String version
      The version of the MCP server. Default value is "1.0.0".
    • instructions

      protected String instructions
      The instructions of the MCP server. Default value is "".
    • requestTimeout

      protected Duration requestTimeout
      The request timeout of the MCP server. Default value is 20 seconds.
    • capabilities

      protected McpServerCapabilities capabilities
      The capabilities of the MCP server. Default value is new McpServerCapabilities().
    • changeNotification

      protected McpServerChangeNotification changeNotification
      The change notification of the MCP server. Default value is new McpServerChangeNotification().
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • 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.
      返回:
      the self reference of the builder
    • build

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

      public T name(String name)
      Sets the name of the MCP server.
      参数:
      name - the name of the MCP server
      返回:
      the self reference of the builder
    • version

      public T version(String version)
      Sets the version of the MCP server.
      参数:
      version - the version of the MCP server
      返回:
      the self reference of the builder
    • instructions

      public T instructions(String instructions)
      Sets the instructions of the MCP server.
      参数:
      instructions - the instructions of the MCP server
      返回:
      the self reference of the builder
    • requestTimeout

      public T requestTimeout(Duration requestTimeout)
      Sets the request timeout of the MCP server.
      参数:
      requestTimeout - the request timeout of the MCP server
      返回:
      the self reference of the builder
    • capabilities

      public T capabilities(McpServerCapabilities capabilities)
      Sets the capabilities of the MCP server.
      参数:
      capabilities - the capabilities of the MCP server
      返回:
      the self reference of the builder
    • changeNotification

      public T changeNotification(McpServerChangeNotification changeNotification)
      Sets the change notification of the MCP server.
      参数:
      changeNotification - the change notification of the MCP server
      返回:
      the self reference of the builder