McpToolsetConfig

data class McpToolsetConfig(val stdioConnectionParams: McpConnectionParameters.Stdio? = null, val sseConnectionParams: McpConnectionParameters.Sse? = null, val streamableHttpConnectionParams: McpConnectionParameters.StreamableHttp? = null, val toolFilter: List<String>? = null, val useMcpResources: Boolean = false, val maxMcpResourceLength: Int = DEFAULT_MAX_RESOURCE_LENGTH)

Configuration for an McpToolset, used to construct one via toToolset.

Exactly one of stdioConnectionParams, sseConnectionParams, or streamableHttpConnectionParams must be set; toToolset throws if zero or more than one are provided.

Constructors

Link copied to clipboard
constructor(stdioConnectionParams: McpConnectionParameters.Stdio? = null, sseConnectionParams: McpConnectionParameters.Sse? = null, streamableHttpConnectionParams: McpConnectionParameters.StreamableHttp? = null, toolFilter: List<String>? = null, useMcpResources: Boolean = false, maxMcpResourceLength: Int = DEFAULT_MAX_RESOURCE_LENGTH)

Properties

Link copied to clipboard

Maximum length, in characters, of a single resource payload returned by load_mcp_resource. Longer payloads are truncated.

Link copied to clipboard

Connection parameters for an MCP server reached over SSE.

Link copied to clipboard

Connection parameters for a local MCP server reached over stdio (e.g. one launched via npx or python3).

Link copied to clipboard

Connection parameters for an MCP server reached over the Streamable HTTP transport.

Link copied to clipboard
val toolFilter: List<String>? = null

Optional allowlist of tool names; when set, only tools whose name appears in the list will be exposed to the agent. When null, all tools advertised by the server are exposed.

Link copied to clipboard

When true, resource-related tools (list_mcp_resources, list_mcp_resource_templates, load_mcp_resource) are added to the toolset, granting the agent access to MCP resources exposed by the server. Defaults to false.

Functions

Link copied to clipboard
fun toToolset(headerProvider: (ReadonlyContext) -> Map<String, String>? = null, progressConsumers: List<(McpSchema.ProgressNotification) -> Unit> = emptyList()): McpToolset

Creates an McpToolset from this configuration.