tooluniverse.mcp_client_tool moduleΒΆ
MCP Client Tool for ToolUniverse
This module provides a tool that acts as a client to connect to an existing MCP server, supporting all MCP functionality including tools, resources, and prompts.
- class tooluniverse.mcp_client_tool.BaseMCPClient[source]ΒΆ
Bases:
object
Base MCP client with common functionality shared between MCPClientTool and MCPAutoLoaderTool. Provides session management, request handling, and async cleanup patterns.
- class tooluniverse.mcp_client_tool.MCPClientTool[source]ΒΆ
Bases:
BaseTool
,BaseMCPClient
A tool that acts as an MCP client to connect to existing MCP servers. Supports both HTTP and WebSocket transports.
- class tooluniverse.mcp_client_tool.MCPProxyTool[source]ΒΆ
Bases:
MCPClientTool
A proxy tool that automatically forwards tool calls to an MCP server. This creates individual tools for each tool available on the MCP server.
- class tooluniverse.mcp_client_tool.MCPServerDiscovery[source]ΒΆ
Bases:
object
Helper class to discover and create tool configurations for MCP servers.
- async static discover_server_tools(server_url, transport='http')[source]ΒΆ
Discover all tools available on an MCP server and return tool configurations.
- static create_mcp_tools_config(server_configs)[source]ΒΆ
Create tool configurations for multiple MCP servers.
- Parameters:
server_configs (List[Dict[str, str]]) β List of server configurations, each containing: - server_url: URL of the MCP server - transport: βhttpβ or βwebsocketβ (optional, defaults to βhttpβ) - server_name: Name prefix for tools (optional)
- Returns:
List of tool configurations that can be loaded into ToolUniverse
- Return type:
- class tooluniverse.mcp_client_tool.MCPAutoLoaderTool[source]ΒΆ
Bases:
BaseTool
,BaseMCPClient
An advanced MCP tool that automatically discovers and loads all tools from an MCP server. It can register discovered tools as individual ToolUniverse tools for seamless usage.
- register_tools_in_engine(engine)[source]ΒΆ
Register discovered tools directly in the ToolUniverse engine