dynamic_mcp_tool ================ .. py:module:: dynamic_mcp_tool .. autoapi-nested-parse:: Dynamic MCP Discovery and Installation Tool. This tool leverages the haive-mcp repository's 992 server database to: 1. RAG search through MCP server documentation and metadata 2. Let agent pick the right server based on capabilities 3. Install it dynamically using FastMCP 4. Set up watch dog for server updates Integrates with AugLLMConfig pattern and uses FastMCP for modern MCP server setup. Classes ------- .. autoapisummary:: dynamic_mcp_tool.DynamicMCPTool dynamic_mcp_tool.MCPServerInstallRequest dynamic_mcp_tool.MCPServerInstallResult dynamic_mcp_tool.MCPServerListTool Functions --------- .. autoapisummary:: dynamic_mcp_tool.create_mcp_discovery_tools Module Contents --------------- .. py:class:: DynamicMCPTool(engine: haive.core.engine.aug_llm.AugLLMConfig, **kwargs) Bases: :py:obj:`langchain_core.tools.BaseTool` Tool for dynamic MCP server discovery, installation, and management. This tool: 1. Uses RAG to search the 992 MCP server database 2. Presents options to the user/agent 3. Installs selected servers using FastMCP 4. Returns ready-to-use MCP client configuration .. py:attribute:: args_schema :type: type[pydantic.BaseModel] Pydantic model class to validate and parse the tool's input arguments. Args schema should be either: - A subclass of pydantic.BaseModel. - A subclass of pydantic.v1.BaseModel if accessing v1 namespace in pydantic 2 - a JSON schema dict .. py:attribute:: description :type: str :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ Discover and install MCP servers dynamically based on capability requirements. Use this tool when you need to add new capabilities to your agent by finding and installing Model Context Protocol (MCP) servers. The tool searches through 992 documented MCP servers, analyzes their capabilities, and can install them automatically. Examples: - "I need database access capabilities" - "Find servers that can work with GitHub" - "Install filesystem operations server" - "Get me weather data integration" """ .. raw:: html
Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. .. py:attribute:: doc_loader .. py:attribute:: engine .. py:attribute:: installed_servers :type: dict[str, dict] .. py:attribute:: name :type: str :value: 'dynamic_mcp_installer' The unique name of the tool that clearly communicates its purpose. .. py:class:: MCPServerInstallRequest(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Request to install an MCP server. .. py:attribute:: auto_install :type: bool :value: None .. py:attribute:: capability_description :type: str :value: None .. py:attribute:: max_servers :type: int :value: None .. py:attribute:: use_fastmcp :type: bool :value: None .. py:class:: MCPServerInstallResult(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` Result of MCP server installation. .. py:attribute:: error_message :type: str | None :value: None .. py:attribute:: installation_path :type: str .. py:attribute:: server_config :type: dict[str, Any] .. py:attribute:: server_name :type: str .. py:attribute:: success :type: bool .. py:attribute:: tools_available :type: list[str] .. py:class:: MCPServerListTool(dynamic_mcp_tool: DynamicMCPTool, **kwargs) Bases: :py:obj:`langchain_core.tools.BaseTool` Tool to list currently installed MCP servers. .. py:attribute:: description :type: str :value: 'List all currently installed and available MCP servers' Used to tell the model how/when/why to use the tool. You can provide few-shot examples as a part of the description. .. py:attribute:: dynamic_mcp_tool .. py:attribute:: name :type: str :value: 'list_mcp_servers' The unique name of the tool that clearly communicates its purpose. .. py:function:: create_mcp_discovery_tools(engine: haive.core.engine.aug_llm.AugLLMConfig) -> list[langchain_core.tools.BaseTool] Create MCP discovery and management tools.