Nodes/OpenAI Compatible LLM/MCP Tavily Remote Tool
ComfyUI Node

MCP Tavily Remote Tool

Let your ComfyUI LLM search the web before it writes a prompt

By godmt·Created 2 months ago·Updated 7 days ago· 6
MCP Tavily Remote Tool
    • mcp_tool
    tavily_api_key_envTAVILY_API_KEY
    auth_modequery_param
    allowed_toolstavily_search
    default_parameters_json

    Here's the problem this node solves: your LLM's knowledge has a cutoff, and image prompting is one of the places that hurts most. "Write me a prompt in the style of the latest Ideogram release" is an answer your model will happily hallucinate if it hasn't seen the release. MCPTavilyRemoteTool is a preset that gives your ComfyUI LLM live web search via Tavily's official Remote MCP server - so it can check what actually exists before it writes a word.

    The README's own example nails the use case: have the model search for current info on Ideogram 4's prompt format and summarize what matters for prompt generation. Current-event-aware prompting, checking product references, verifying a style actually shipped - that's the sweet spot. It's the pack's most immediately useful tool, and it needs a Tavily API key (free tier exists) to do anything.

    How it works

    The node reads your Tavily key from an environment variable at runtime, then builds a Remote MCP tool definition and hands it to the OpenAI Compatible LLM node. Depending on auth_mode, it either appends ?tavilyApiKey=<key> to https://mcp.tavily.com/mcp/ or sends Authorization: Bearer <key> as a header. The Responses API server then calls Tavily on demand. Because the key is read from the environment, your workflow JSON never stores it.

    The one hard requirement, same as every MCP tool in this pack: the LLM node must be on /v1/responses. Remote MCP tools don't exist on the chat completions path.

    The inputs that matter

    • tavily_api_key_env - the environment variable holding your key, default TAVILY_API_KEY. The node raises a clear error if it's empty, which beats debugging a silent 401.
    • auth_mode - query_param (default) or authorization_header. Tavily's own examples lean on the query parameter, and the header mode is the cleaner option if your setup tolerates it. Try the default first.
    • allowed_tools - defaults to tavily_search, which is usually all you want. The server also offers tavily_extract, tavily_map, and tavily_crawl if you need page extraction or site mapping.
    • default_parameters_json - optional defaults like {"max_results":5,"search_depth":"basic"}, sent as Tavily's DEFAULT_PARAMETERS header.

    Output is one mcp_tool, and the wiring is the familiar chain: MCP Tavily Remote Tool → MCP Tools Stack → OpenAI Compatible LLM.

    Installing it

    The pack: ComfyUI Manager → "OpenAI Compatible LLM", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/godmt/comfyui-openai-llm.git
    

    restart, then set TAVILY_API_KEY (or whichever var you name in tavily_api_key_env) in your environment or a .env file. The pack itself pulls in only requests and python-dotenv - the heavy lifting is Tavily's API.

    Where people get burned

    "Tavily didn't search" is the #1 report, and the README's checklist is worth memorizing: api_base_url must be /v1/responses, the key must actually be set, allowed_tools should say tavily_search, and the preset has to be connected through a stack. If you're debugging and unsure what tools exist, leave allowed_tools empty once and read the raw response - the tool names will be right there. And same security note as every node here: remote MCP tools run with require_approval: "never" and the key is sent to your API server as part of the tool definition. Fine for a trusted local server; worth knowing before you point this at some random hosted endpoint.

    CategoryLLM/OpenAI Compatible/MCP

    Inputs (4)

    NameTypeDefaultDescription
    tavily_api_key_envSTRINGTAVILY_API_KEYEnvironment variable containing your Tavily API key.
    auth_modeCOMBOquery_paramauthorization_header sends Authorization: Bearer ... in tool headers. query_param appends ?tavilyApiKey=... and is a fallback for Tavily setups that require URL query auth.
    allowed_toolsSTRINGtavily_searchTavily tool allowlist. Common names include tavily_search, tavily_extract, tavily_map, and tavily_crawl. Leave empty to expose all.
    default_parameters_jsonoptSTRINGOptional Tavily default parameters header. This is sent as the DEFAULT_PARAMETERS MCP header when provided.

    Outputs (1)

    NameTypeDescription
    mcp_toolMCP_TOOLA Tavily Remote MCP tool definition. Connect to MCP Tools Stack, then to OpenAI Compatible LLM.