comfyui_LLM_party

1625

Available Nodes

Mcp_tool

MCP Tool Node Documentation

Overview

The Mcp_tool node in the ComfyUI LLM Party repository is designed to connect with Model Context Protocol (MCP) servers, allowing users to access and utilize a variety of AI tools powered by these servers. By configuring different local or cloud MCP servers, users can experience a wide range of LLM tools globally.

Functionality

The MCP Tool Node enables integration with multiple MCP servers, retrieving available tools, and facilitating their execution within ComfyUI workflows. This node converts tool information from MCP servers into a format compatible with large language models (LLMs), making it possible for these LLMs to use the tools provided by MCP servers effectively.

Inputs

  • is_enable (Boolean):
    • This input specifies whether the node should be active. When set to True, the node initializes connections to the configured MCP servers and fetches the available tools. When set to False, the node remains inactive.

Outputs

  • tool (String):
    • The output is a JSON string that represents the list of tools available from the connected MCP servers. It includes the tools' descriptions, input schemas, and other relevant details required for the tools to be utilized by LLMs in workflows.

Usage in ComfyUI Workflows

  1. Integration with MCP Servers:

    • The MCP Tool Node connects to MCP servers specified in the mcp_config.json configuration file. Through this connection, it retrieves tools that can be used within LLM workflows.
  2. Converting Tools for LLM Compatibility:

    • Once connected, the node translates the tools' metadata into a format that can be employed by large language models. This conversion includes creating function descriptions that are compatible with OpenAI function calls.
  3. Automating Workflows:

    • By using the MCP Tool Node, users can incorporate a wide range of external tools into their workflows without manually configuring each tool. This simplifies the process of building sophisticated workflows that leverage third-party services and functionality.

Special Features and Considerations

  • Real-Time Tool Update:

    • The node dynamically updates the list of available tools based on the current configuration of MCP servers. Users can modify the server configuration to access different tools or toolsets.
  • Error Handling:

    • The node includes mechanisms to handle errors related to server connectivity and tool retrieval, providing feedback to users within ComfyUI's console or output.
  • Configuration Flexibility:

    • Through the mcp_config.json file, users have the flexibility to specify different MCP servers, command paths, arguments, and environment variables, allowing for a tailored integration experience based on specific requirements.
  • Multilingual Support:

    • The node offers support for both English and Simplified Chinese, aligning with user system preferences or explicit configuration options in the associated config.ini file.

The Mcp_tool node is an essential component for users intending to enhance their ComfyUI workflows by leveraging external AI tools. It encapsulates the complexities of integrating with MCP servers, providing a streamlined interface for tool access and utilization.