Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Comfy Mcp Server

    A server using FastMCP framework to generate images based on prompts via a remote Comfy server.

    31 stars
    Python
    Updated Oct 1, 2025
    comfyui
    mcp-server

    Table of Contents

    • Overview
    • Prerequisites
    • Configuration
    • Usage
    • Example Claude Desktop Config
    • Functionality
    • generate_image(prompt: str, ctx: Context) -> Image | str
    • generate_prompt(topic: str, ctx: Context) -> str
    • Dependencies
    • License

    Table of Contents

    • Overview
    • Prerequisites
    • Configuration
    • Usage
    • Example Claude Desktop Config
    • Functionality
    • generate_image(prompt: str, ctx: Context) -> Image | str
    • generate_prompt(topic: str, ctx: Context) -> str
    • Dependencies
    • License

    Documentation

    Comfy MCP Server

    smithery badge

    A server using FastMCP framework to generate images based on prompts via a remote Comfy server.

    Overview

    This script sets up a server using the FastMCP framework to generate images based on prompts using a specified workflow. It interacts with a remote Comfy server to submit prompts and retrieve generated images.

    Prerequisites

    • uv package and project manager for Python.
    • Workflow file exported from Comfy UI. This code includes a sample Flux-Dev-ComfyUI-Workflow.json which is only used here as reference. You will need to export from your workflow and set the environment variables accordingly.

    You can install the required packages for local development:

    bash
    uvx mcp[cli]

    Configuration

    Set the following environment variables:

    • COMFY_URL to point to your Comfy server URL.
    • COMFY_WORKFLOW_JSON_FILE to point to the absolute path of the API export json file for the comfyui workflow.
    • PROMPT_NODE_ID to the id of the text prompt node.
    • OUTPUT_NODE_ID to the id of the output node with the final image.
    • OUTPUT_MODE to either url or file to select desired output.

    Optionally, if you have an Ollama server running, you can connect to it for prompt generation.

    • OLLAMA_API_BASE to the url where ollama is running.
    • PROMPT_LLM to the name of the model hosted on ollama for prompt generation.

    Example:

    bash
    export COMFY_URL=http://your-comfy-server-url:port
    export COMFY_WORKFLOW_JSON_FILE=/path/to/the/comfyui_workflow_export.json
    export PROMPT_NODE_ID=6 # use the correct node id here
    export OUTPUT_NODE_ID=9 # use the correct node id here
    export OUTPUT_MODE=file

    Usage

    Comfy MCP Server can be launched by the following command:

    bash
    uvx comfy-mcp-server

    Example Claude Desktop Config

    json
    {
      "mcpServers": {
        "Comfy MCP Server": {
          "command": "/path/to/uvx",
          "args": [
            "comfy-mcp-server"
          ],
          "env": {
            "COMFY_URL": "http://your-comfy-server-url:port",
            "COMFY_WORKFLOW_JSON_FILE": "/path/to/the/comfyui_workflow_export.json",
            "PROMPT_NODE_ID": "6",
            "OUTPUT_NODE_ID": "9",
            "OUTPUT_MODE": "file",
          }
        }
      }
    }

    Functionality

    generate_image(prompt: str, ctx: Context) -> Image | str

    This function generates an image using a specified prompt. It follows these steps:

    1. Checks if all the environment variable are set.

    2. Loads a prompt template from a JSON file.

    3. Submits the prompt to the Comfy server.

    4. Polls the server for the status of the prompt processing.

    5. Retrieves and returns the generated image once it's ready.

    generate_prompt(topic: str, ctx: Context) -> str

    This function generates a comprehensive image generation prompt from specified topic.

    Dependencies

    • mcp: For setting up the FastMCP server.
    • json: For handling JSON data.
    • urllib: For making HTTP requests.
    • time: For adding delays in polling.
    • os: For accessing environment variables.
    • langchain: For creating simple LLM Prompt chain to generate image generation prompt from topic.
    • langchain-ollama: For ollama specific modules for LangChain.

    License

    This project is licensed under the MIT License - see the LICENSE file for details.

    Similar MCP

    Based on tags & features

    • BI

      Biothings Mcp

      Python·
      25
    • FH

      Fhir Mcp Server

      Python·
      55
    • MC

      Mcp Aoai Web Browsing

      Python·
      30
    • DA

      Davinci Resolve Mcp

      Python·
      327

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • BI

      Biothings Mcp

      Python·
      25
    • FH

      Fhir Mcp Server

      Python·
      55
    • MC

      Mcp Aoai Web Browsing

      Python·
      30
    • DA

      Davinci Resolve Mcp

      Python·
      327

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k