ComfyUI Node

MCP Tools Stack

The boring glue node that makes MCP work in ComfyUI

By godmt·Created 2 months ago·Updated 6 days ago· 6
MCP Tools Stack
    • mcp_tools
    • tools_json

    Every other node in this pack's MCP family outputs one thing: a single mcp_tool. And the OpenAI Compatible LLM node takes exactly one mcp_tools list. Something has to bridge that gap, and that something is MCPToolsStack - the plumber of the family. It collects any number of MCP_TOOL inputs (remote, local, presets, all of them) into a single list you feed to the LLM node.

    Without it you'd be stuck building workflows with exactly one tool. With it, you connect a Tavily search preset and a DeepWiki preset and a local time server to one stack, and the LLM sees all three. The README's example workflows all route through it, and honestly, most of the time you'll add it to a workflow because the chain demands it, not because you thought about it. That's what glue nodes are for.

    How it works

    The clever part is the dynamic inputs. You connect a tool to tool_1 and the node's frontend JS automatically adds a tool_2 input, then tool_3, and so on. The Python side accepts arbitrary tool_N slots so the UI can keep spawning them. There's also hidden backward-compat handling for old workflows that used a single tool or tools input - the stack sorts everything into a stable order and merges it into one list.

    Two outputs: mcp_tools is the list you wire into the LLM node's mcp_tools input, and tools_json is a pretty-printed JSON dump of everything the stack collected. That second output is genuinely handy - when a tool isn't behaving, glance at tools_json to see what actually got built.

    Installing it

    Same pack, same story: ComfyUI Manager → search "OpenAI Compatible LLM", or

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

    Restart. Light dependencies (requests, python-dotenv), nothing else to download. The dynamic-input JS ships inside the pack.

    Where people get burned

    Not much to trip on here, which is the point of a glue node. The one real gotcha: if you connect tools but the LLM never calls any of them, the problem is upstream - check that your api_base_url is /v1/responses (MCP tools require the Responses API) and that the LLM's prompt actually mentions the tools. The stack is faithfully doing its job; the signal is just lost before it gets to the model. Use tools_json to confirm the tools list is actually populated and look right before you go chasing anything else.

    CategoryLLM/OpenAI Compatible/MCP

    Inputs (0)

    No inputs

    Outputs (2)

    NameTypeDescription
    mcp_toolsMCP_TOOLSList of Remote MCP and/or Local MCP tools for the OpenAI Compatible LLM node.
    tools_jsonSTRINGPretty-printed JSON representation of the tools list for debugging.