mcp-comfyui-node-framework

A043-studios/mcp-comfyui-node-framework

3.1

If you are the rightful owner of mcp-comfyui-node-framework and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The MCP ComfyUI Node Framework is an advanced server framework designed to automatically generate ComfyUI nodes from various sources using AI.

MCP ComfyUI Node Framework

License: MIT Python 3.8+ Node.js 18+

An advanced Model Context Protocol (MCP) server framework for automatically generating ComfyUI nodes from research papers, GitHub repositories, and other sources.

๐Ÿš€ Overview

The MCP ComfyUI Node Framework is a powerful tool that leverages AI to automatically analyze and generate ComfyUI nodes from various sources including:

  • Research Papers (arXiv, academic publications)
  • GitHub Repositories (open source projects)
  • Documentation (API docs, technical specifications)
  • Code Examples (implementation references)

Key Features

  • ๐Ÿค– AI-Powered Analysis: Intelligent content analysis using advanced LLM integration
  • ๐Ÿ”ง Automatic Node Generation: Creates production-ready ComfyUI nodes with proper typing
  • ๐Ÿ“š Multi-Source Support: Works with papers, repositories, and documentation
  • ๐ŸŽฏ Quality Control: Multiple quality levels (draft, development, production)
  • ๐Ÿ”„ Batch Processing: Generate multiple nodes efficiently
  • ๐Ÿ“– Comprehensive Documentation: Auto-generates README, installation guides, and examples
  • ๐Ÿงช Testing Framework: Includes test generation and validation
  • ๐Ÿ”Œ MCP Integration: Full Model Context Protocol compatibility

๐Ÿ› ๏ธ Installation

Prerequisites

  • Python 3.8 or higher
  • Node.js 18 or higher
  • ComfyUI installation (for testing generated nodes)

Quick Install

# Clone the repository
git clone https://github.com/A043-studios/mcp-comfyui-node-framework.git
cd mcp-comfyui-node-framework

# Run the installation script
chmod +x scripts/install.sh
./scripts/install.sh

Manual Installation

# Install Python dependencies
pip install -r requirements.txt

# Install Node.js dependencies
npm install

# Set up environment
chmod +x scripts/setup-env.sh
./scripts/setup-env.sh

โšก Quick Start

1. Configure the Framework

# Copy the template configuration
cp config/mcp-config.template.json config/mcp-config.json

# Edit configuration with your API keys
nano config/mcp-config.json

2. Start the MCP Server

# Start the server
chmod +x scripts/start-server.sh
./scripts/start-server.sh

3. Generate Your First Node

from src.comfyui_mcp_server_v2 import ComfyUIMCPServer

# Initialize the server
server = ComfyUIMCPServer()

# Generate a node from a GitHub repository
result = server.generate_node(
    source="https://github.com/danielgatis/rembg",
    quality_level="production",
    focus_areas="background removal, image segmentation"
)

print(f"Generated {result['nodes_generated']} nodes!")

๐Ÿ“‹ Usage Examples

Generate from Research Paper

# Generate nodes from an arXiv paper
result = server.generate_node(
    source="https://arxiv.org/abs/2301.12345",
    quality_level="production",
    focus_areas="image processing, neural networks"
)

Generate from GitHub Repository

# Generate nodes from a repository
result = server.generate_node(
    source="https://github.com/user/awesome-project",
    quality_level="development",
    focus_areas="computer vision, preprocessing"
)

Batch Generation

# Generate multiple nodes
sources = [
    "https://github.com/danielgatis/rembg",
    "https://arxiv.org/abs/2301.12345",
    "https://github.com/another/project"
]

for source in sources:
    result = server.generate_node(source, quality_level="production")
    print(f"Generated from {source}: {result['nodes_generated']} nodes")

๐ŸŽฏ Generated Node Example

The framework generates complete, production-ready ComfyUI nodes. Here's an example of what gets created:

class RembgBackgroundRemovalNode:
    """ComfyUI Node for AI-powered background removal using rembg"""

    @classmethod
    def INPUT_TYPES(cls):
        return {
            "required": {
                "image": ("IMAGE",),
                "model": (["u2net", "birefnet-general", "isnet-anime"], 
                         {"default": "u2net"}),
                "return_mask": ("BOOLEAN", {"default": False}),
            }
        }

    RETURN_TYPES = ("IMAGE", "MASK")
    FUNCTION = "remove_background"
    CATEGORY = "image/background"
    
    # ... implementation

๐Ÿ“ Project Structure

mcp-comfyui-node-framework/
โ”œโ”€โ”€ README.md                    # This file
โ”œโ”€โ”€ LICENSE                      # MIT License
โ”œโ”€โ”€ INSTALLATION.md             # Detailed installation guide
โ”œโ”€โ”€ requirements.txt            # Python dependencies
โ”œโ”€โ”€ package.json                # Node.js configuration
โ”œโ”€โ”€ src/                        # Core framework source
โ”‚   โ”œโ”€โ”€ comfyui_mcp_server_v2.py    # Main MCP server
โ”‚   โ”œโ”€โ”€ agents/                     # AI agent implementations
โ”‚   โ”œโ”€โ”€ tools/                      # Generation tools
โ”‚   โ””โ”€โ”€ utils/                      # Utility functions
โ”œโ”€โ”€ config/                     # Configuration files
โ”‚   โ”œโ”€โ”€ mcp-config.template.json   # Configuration template
โ”‚   โ””โ”€โ”€ agents.example.json        # Agent configuration
โ”œโ”€โ”€ scripts/                    # Installation and setup scripts
โ”œโ”€โ”€ examples/                   # Example nodes and workflows
โ”‚   โ”œโ”€โ”€ nodes/                      # Generated node examples
โ”‚   โ””โ”€โ”€ workflows/                  # Example ComfyUI workflows
โ”œโ”€โ”€ docs/                       # Documentation
โ””โ”€โ”€ tests/                      # Test suite

๐Ÿ”ง Configuration

MCP Configuration

Edit config/mcp-config.json to configure:

  • LLM API Keys: OpenRouter, OpenAI, etc.
  • Agent Settings: Research, coding, documentation agents
  • Quality Levels: Draft, development, production settings
  • Output Preferences: File organization, naming conventions

Agent Configuration

Customize agent behavior in config/agents.example.json:

{
  "research_agent": {
    "model": "anthropic/claude-3.5-sonnet",
    "temperature": 0.1,
    "max_tokens": 4000
  },
  "coding_agent": {
    "model": "anthropic/claude-3.5-sonnet", 
    "temperature": 0.0,
    "max_tokens": 8000
  }
}

๐Ÿงช Testing Generated Nodes

# Test a generated node
python tests/test_integration.py --node examples/nodes/rembg_background_removal_node.py

# Run full test suite
python -m pytest tests/

๐Ÿ“š Documentation

  • - Detailed setup instructions
  • - Complete configuration reference
  • - Framework API reference
  • - Usage examples and tutorials

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


Made with โค๏ธ for the ComfyUI community