Class MCPServerConfig.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • transportType

      public MCPServerConfig.Builder transportType(MCPServerConfig.TransportType transportType)
      Sets the transport type.
      Parameters:
      transportType - the transport type
      Returns:
      this builder
    • command

      public MCPServerConfig.Builder command(String command)
      Sets the command for STDIO transport.
      Parameters:
      command - the command to execute
      Returns:
      this builder
    • args

      public MCPServerConfig.Builder args(String... args)
      Sets the command arguments.
      Parameters:
      args - the arguments
      Returns:
      this builder
    • args

      public MCPServerConfig.Builder args(List<String> args)
      Sets the command arguments.
      Parameters:
      args - the arguments
      Returns:
      this builder
    • env

      public MCPServerConfig.Builder env(String key, String value)
      Adds an environment variable.
      Parameters:
      key - the variable name
      value - the variable value
      Returns:
      this builder
    • env

      Sets all environment variables.
      Parameters:
      env - the environment variables
      Returns:
      this builder
    • url

      public MCPServerConfig.Builder url(String url)
      Sets the URL for HTTP transport.
      Parameters:
      url - the server URL
      Returns:
      this builder
    • disabled

      public MCPServerConfig.Builder disabled(boolean disabled)
      Sets whether this server is disabled.
      Parameters:
      disabled - true to disable
      Returns:
      this builder
    • build

      public MCPServerConfig build()
      Builds the MCPServerConfig.
      Returns:
      the built configuration