Package com.google.genkit.plugins.mcp
Class MCPPluginOptions.Builder
java.lang.Object
com.google.genkit.plugins.mcp.MCPPluginOptions.Builder
- Enclosing class:
MCPPluginOptions
Builder for MCPPluginOptions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddServer(String serverName, MCPServerConfig config) Adds an MCP server configuration.build()Builds the MCPPluginOptions.Sets the name of the MCP host.rawToolResponses(boolean rawToolResponses) Sets whether to return raw MCP tool responses.requestTimeout(Duration timeout) Sets the request timeout for MCP operations.servers(Map<String, MCPServerConfig> servers) Sets all MCP server configurations at once.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the name of the MCP host.- Parameters:
name- the host name- Returns:
- this builder
-
addServer
Adds an MCP server configuration.- Parameters:
serverName- the name to identify this serverconfig- 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
Sets the request timeout for MCP operations.- Parameters:
timeout- the timeout duration- Returns:
- this builder
-
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
Builds the MCPPluginOptions.- Returns:
- the built options
-