McpToolsetConfig
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
Properties
Maximum length, in characters, of a single resource payload returned by load_mcp_resource. Longer payloads are truncated.
Connection parameters for an MCP server reached over SSE.
Connection parameters for a local MCP server reached over stdio (e.g. one launched via npx or python3).
Connection parameters for an MCP server reached over the Streamable HTTP transport.
Optional filter selecting which of the tools advertised by the server are exposed to the agent. Use ToolFilter.AllowList (or the ToolFilter.allowList helper) to keep tools by name, or ToolFilter.Predicate for context-aware selection that can consult the ReadonlyContext. When null, all tools advertised by the server are exposed. The resource tools added by useMcpResources are ADK's own and are not filtered.
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. They are added only if the server reports the resources capability during the handshake; against a server that does not, they are omitted and a warning is logged, because the MCP client rejects the requests those tools would make. toolFilter does not apply to them: it selects among the tools the server advertises, so enabling this flag and filtering the server's tools are independent choices. Defaults to false.
Functions
Creates an McpToolset from this configuration.