Package com.google.genkit.plugins.mcp
Class MCPPluginOptions
java.lang.Object
com.google.genkit.plugins.mcp.MCPPluginOptions
Configuration options for the MCP plugin.
This class allows configuration of MCP server connections, including:
- Multiple MCP servers with different transports (STDIO, HTTP)
- Connection timeouts and retry settings
- Raw tool response handling
Example usage:
MCPPluginOptions options = MCPPluginOptions.builder().name("my-mcp-host")
.addServer("filesystem",
MCPServerConfig.stdio("npx", "-y", "@modelcontextprotocol/server-filesystem", "/tmp"))
.addServer("weather", MCPServerConfig.http("http://localhost:3001/mcp"))
.requestTimeout(Duration.ofSeconds(30)).build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for MCPPluginOptions. -
Method Summary
Modifier and TypeMethodDescriptionstatic MCPPluginOptions.Builderbuilder()Creates a new builder for MCPPluginOptions.getName()Gets the name of the MCP host.Gets the request timeout.Gets the configured MCP servers.booleanWhether to return raw MCP tool responses.
-
Method Details
-
builder
Creates a new builder for MCPPluginOptions.- Returns:
- a new builder
-
getName
Gets the name of the MCP host.- Returns:
- the host name
-
getServers
Gets the configured MCP servers.- Returns:
- map of server name to configuration
-
getRequestTimeout
Gets the request timeout.- Returns:
- the request timeout
-
isRawToolResponses
public boolean isRawToolResponses()Whether to return raw MCP tool responses.- Returns:
- true if raw responses should be returned
-