A043-studios/mcp-comfyui-node-framework
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
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:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
๐ License
This project is licensed under the MIT License - see the file for details.
๐ Acknowledgments
- Built on the Model Context Protocol
- Designed for ComfyUI
- Powered by advanced language models
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Made with โค๏ธ for the ComfyUI community