Class MCPPluginOptions.Builder

java.lang.Object
com.google.genkit.plugins.mcp.MCPPluginOptions.Builder
Enclosing class:
MCPPluginOptions

public static class MCPPluginOptions.Builder extends Object
Builder for MCPPluginOptions.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • name

      public MCPPluginOptions.Builder name(String name)
      Sets the name of the MCP host.
      Parameters:
      name - the host name
      Returns:
      this builder
    • addServer

      public MCPPluginOptions.Builder addServer(String serverName, MCPServerConfig config)
      Adds an MCP server configuration.
      Parameters:
      serverName - the name to identify this server
      config - the server configuration
      Returns:
      this builder
    • servers

      Sets all MCP server configurations at once.
      Parameters:
      servers - map of server name to configuration
      Returns:
      this builder
    • requestTimeout

      public MCPPluginOptions.Builder requestTimeout(Duration timeout)
      Sets the request timeout for MCP operations.
      Parameters:
      timeout - the timeout duration
      Returns:
      this builder
    • rawToolResponses

      public MCPPluginOptions.Builder rawToolResponses(boolean rawToolResponses)
      Sets whether to return raw MCP tool responses.

      When true, tool responses are returned in their raw MCP format. When false (default), responses are processed for better Genkit compatibility.

      Parameters:
      rawToolResponses - true to return raw responses
      Returns:
      this builder
    • build

      public MCPPluginOptions build()
      Builds the MCPPluginOptions.
      Returns:
      the built options