Nodes/OpenAI Compatible LLM/MCP Local Command Tool
ComfyUI Node

MCP Local Command Tool

The ComfyUI MCP node that actually runs code on your machine

By godmt·Created 2 months ago·Updated 6 days ago· 6
MCP Local Command Tool
    • mcp_tool
    server_labellocal
    commanduvx
    args_json[]
    allowed_tools
    env_json{}
    startup_timeout_sec15
    tool_timeout_sec60

    This is the node in the pack that gives your LLM real hands - and it's the one you should treat with the most respect. The Remote MCP nodes hand the model a connection to a server somewhere out there. This one launches a local MCP server on your machine via npx, uvx, or python, lets the LLM call its tools, then tears it down. Think: the model checks the actual time, reads a file, runs a calculation - the boring, factual stuff that LLMs are hopeless at from memory alone.

    Concretely, the pack's own example is a time server: run uvx mcp-server-time --local-timezone=Asia/Tokyo and let the LLM ask it for the current time in Tokyo instead of guessing. Same idea scales to anything with an MCP stdio server - file tools, browser tools, whatever you trust.

    How it works

    During an execution the OpenAI Compatible LLM node takes the local MCP definition and runs a real handshake: it spawns the command, does the MCP initialize dance over stdin/stdout, lists the available tools, converts them to function tools the LLM can call, executes tools/call when the model asks, and feeds results back. Then it shuts the process down - the pack explicitly tries to leave no child processes behind, with process-tree termination as a Windows fallback.

    The inputs that matter

    • command - the launcher: npx, uvx, python, or an absolute path. This is a big one because it's arbitrary code execution by definition. The LLM is going to run whatever this launches.
    • args_json - the arguments as a JSON array. Example: ["mcp-server-time", "--local-timezone=Asia/Tokyo"].
    • server_label - a short stable prefix for the exposed tool names, e.g. time__get_current_time.
    • allowed_tools - leave empty to expose everything the server has, or list the few you want. I'd strongly recommend listing.

    Worth setting: startup_timeout_sec (default 15, for slow first-time uvx/npx downloads) and tool_timeout_sec (default 60, per tool call). env_json passes extra environment variables to the spawned process.

    Output is a single mcp_tool, wired MCP Local Command Tool → MCP Tools Stack → OpenAI Compatible LLM, with the LLM node on /v1/responses.

    Installing it

    Same pack as the rest: ComfyUI Manager, search "OpenAI Compatible LLM", or

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

    then restart. Dependencies are light (requests, python-dotenv) - but the command you run is a dependency too. uvx needs uv installed (pip install uv), and the first run of any npx/uvx server downloads its packages, which is why the timeout matters.

    Where people get burned

    Test the command in a terminal first. The README says it plainly: if uvx mcp-server-time --local-timezone=Asia/Tokyo fails in your shell, it fails in ComfyUI too, and you'll be debugging a dark node instead of a clear error. Other classics: forgetting /v1/responses so tools never appear, and an LLM that won't call a tool because the prompt never mentions it.

    Then the security bit, said once and loudly: this node runs arbitrary commands on your machine with your user privileges. The ecosystem's own history - the LLMVISION infostealer that shipped as a "helpful" node and ended in a federal conviction - is the cautionary tale. Use it with servers you trust and allowlists you've narrowed. This is the highest-risk node in the pack, and it's not close.

    CategoryLLM/OpenAI Compatible/MCP

    Inputs (7)

    NameTypeDefaultDescription
    server_labelSTRINGlocalShort stable label used to prefix exposed tool names, e.g. time__get_current_time.
    commandSTRINGuvxCommand to launch the stdio MCP server, such as npx, uvx, python, or an absolute executable path.
    args_jsonSTRING[]JSON array of command arguments. Example: ["mcp-server-time", "--local-timezone=Asia/Tokyo"].
    allowed_toolsSTRINGOptional allowlist of MCP tool names. Leave empty to expose all tools from this local MCP server. You may use original names or exposed server_label__tool names.
    env_jsonoptSTRING{}Extra environment variables for the MCP process as a JSON object. Values are strings.
    startup_timeout_secoptINT151–300Timeout for launching and initializing the MCP server.
    tool_timeout_secoptINT601–1800Timeout for each MCP tool call.

    Outputs (1)

    NameTypeDescription
    mcp_toolMCP_TOOLA local stdio MCP server definition. The LLM node starts it only during execution and then terminates it.