# 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

McpToolsetConfig
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

maxMcpResourceLength
Link copied to clipboard
val maxMcpResourceLength: Int

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

sseConnectionParams
Link copied to clipboard
val sseConnectionParams: McpConnectionParameters.Sse? = null

Connection parameters for an MCP server reached over SSE.

stdioConnectionParams
Link copied to clipboard
val stdioConnectionParams: McpConnectionParameters.Stdio? = null

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

streamableHttpConnectionParams
Link copied to clipboard
val streamableHttpConnectionParams: McpConnectionParameters.StreamableHttp? = null

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

toolFilter
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.

useMcpResources
Link copied to clipboard
val useMcpResources: Boolean = false

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

toToolset
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.