toToolset
Creates an McpToolset from this configuration.
Parameters
Optional suspending callback that, given a ReadonlyContext, returns a map of HTTP headers to attach to each MCP session. Because it is a suspend function, headers or tokens can be minted asynchronously at request time (e.g. fetching an OAuth bearer token) without blocking a thread. When non-null, sessions are not cached across invocations so that headers can vary per-context (e.g. per-user authentication). When null, a single session is opened lazily and reused.
Callbacks invoked for every McpSchema.ProgressNotification received from the MCP server during long-running tool executions.
Throws
if zero or more than one of stdioConnectionParams, sseConnectionParams, and streamableHttpConnectionParams is set.