RemoteMcpToolsetConfig

data class RemoteMcpToolsetConfig(val transport: McpTransportConfig, val toolFilter: ToolFilter? = null, val useMcpResources: Boolean = false, val maxMcpResourceLength: Int = DEFAULT_MAX_MCP_RESOURCE_LENGTH)

Common configuration for a remote Streamable HTTP MCP toolset.

This is the portable MCP entry point for JVM and Android. Platform-specific transports and MCP SDKs are selected internally. JVM callers do not add an extra MCP SDK. On Android, ADK declares kotlin-sdk-client and ktor-client-okhttp as compileOnly, so the app must add those artifacts itself. JVM-only stdio and legacy SSE continue to use McpToolset.McpToolsetConfig.

A configured headerProvider is invoked before tool discovery and again before each tool call (matching ADK Python). An IllegalArgumentException from that provider or from a ToolFilter.Predicate during Toolset.getTools is wrapped in McpToolException.McpToolLoadingException.

val toolset =
RemoteMcpToolsetConfig(
transport = McpTransportConfig.StreamableHttp("https://example.com/mcp"),
)
.toToolset(headerProvider = { mapOf("Authorization" to "Bearer token") })

Constructors

Link copied to clipboard
constructor(transport: McpTransportConfig, toolFilter: ToolFilter? = null, useMcpResources: Boolean = false, maxMcpResourceLength: Int = DEFAULT_MAX_MCP_RESOURCE_LENGTH)

Types

Link copied to clipboard
class Builder

Fluent builder for RemoteMcpToolsetConfig, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns a Builder initialized with this instance's properties, primarily for Java callers. Prefer it over copy from Java: copy takes every property positionally, so its signature changes whenever a property is added.

Link copied to clipboard
fun toToolset(headerProvider: suspend (ReadonlyContext) -> Map<String, String>? = null, progressConsumers: List<(McpProgressUpdate) -> Unit> = emptyList()): Toolset

Creates an MCP Toolset.