Metadata-Version: 2.4
Name: comfyui-mcp
Version: 0.0.3
Project-URL: Documentation, https://github.com/ModdingFox/comfyui_mcp#README.md
Project-URL: Issues, https://github.com/ModdingFox/comfyui_mcp/issues
Project-URL: Source, https://github.com/ModdingFox/comfyui_mcp
Author-email: Tyst Marin <moddingfox@foxtek.us>
License-Expression: MIT
License-File: LICENSE.txt
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.11
Requires-Dist: comfyui-utils>=0.0.1
Requires-Dist: fastmcp>=2.13.0.2
Requires-Dist: jsonargparse
Description-Content-Type: text/markdown

# comfyui-mcp

A Model Context Protocol(MCP) server that exposes [ComfyUI](https://github.com/comfyanonymous/ComfyUI) workflows as callable MCP tools. Built using [FastMCP](https://pypi.org/project/fastmcp/) and [comfyui-utils](https://pypi.org/project/comfyui-utils/).

[![PyPI Version](https://img.shields.io/pypi/v/comfyui-mcp.svg)](https://pypi.org/project/comfyui-mcp/)
[![Python Versions](https://img.shields.io/pypi/pyversions/comfyui-mcp.svg)](https://pypi.org/project/comfyui-mcp/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.txt)
[![CI](https://github.com/ModdingFox/comfyui_mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/ModdingFox/comfyui_mcp/actions)

---

## Installation
Contents of this package require Python 3.11 or higher.

```bash
pip install comfyui-mcp
```

---

## Quick Start
```bash
mcpo --port 8000 --api-key "AwesomeKey" -- python3 -m comfyui_mcp.server
````

---

## Architecture Overview
```bare
src/comfyui_mcp/
```
- \_\_about\_\_.py: # Version and license metadata
- argument_parser.py: CLI argument definitions using pydantic
- base_types.py: Shared type aliases 
- function_utils.py: Dynamic function wrapper generation
- workflow_loader.py: Load workflows from disk or ComfyUI API
- workflow_utils.py: Workflow preparation and invocation
- server.py: FastMCP server entry point

## How It Works
1. Workfllow discovery: fetch remote or local JSON.
2. Tool generation: parameters mapped into callable MCP tools.
3. Execution: runs workflow via ComfyUI API and returns image URLs as Markdown.
4. Batching: repeated invocations, seed randomization.

---

## Development
```bash
pip setup -hatch
hatch test
hatch build
hatch run release
```

---

## Contributing
1. Fork the repo on GitHub.
2. Make changes, add tests, and build
3. Run `hatch test` to ensure all passes
4. Submit a PR
