远程的;远端的McpToolsetConfig

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)

类型

Link copied to clipboard
class Builder

Fluent Builder for RemoteMcpToolsetConfig该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。

Link copied to clipboard
object Companion

属性(Properties)

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

函数

Link copied to clipboard

返回一个 Builder 使用该实例的属性进行初始化,主要适用于 Java 调用者。建议优先选择这种方式。 copy 来自 Java 的代码: copy 该函数会按位置获取所有属性的值;因此,每当有新属性被添加时,其函数签名(即函数的定义)就会发生变化。

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

创建一个 MCP(Master Control Panel,主控制面板)。 Toolset.