McpToolRegistryProvider
A provider for creating tool registries that connect to Model Context Protocol (MCP) servers.
This class facilitates the integration of MCP tools into the agent framework by:
Connecting to MCP servers through various transport mechanisms (stdio, SSE)
Retrieving available tools from the MCP server
Transforming MCP tools into the agent framework's Tool interface
Registering the transformed tools in a ToolRegistry
Properties
Functions
Link copied to clipboard
Creates a default server-sent events (SSE) transport from a provided URL.
Link copied to clipboard
Creates a default standard input/output transport for a provided process.
Link copied to clipboard
suspend fun fromClient(mcpClient: Client, mcpToolParser: McpToolDescriptorParser = DefaultMcpToolDescriptorParser): ToolRegistry
Creates a ToolRegistry with tools from an existing MCP client.
Link copied to clipboard
suspend fun fromTransport(transport: Transport, mcpToolParser: McpToolDescriptorParser = DefaultMcpToolDescriptorParser, name: String = DEFAULT_MCP_CLIENT_NAME, version: String = DEFAULT_MCP_CLIENT_VERSION): ToolRegistry
Creates a ToolRegistry with tools from an MCP server using provided transport for communication.