- Home
- MCP servers
- ComfyMCP Studio
ComfyMCP Studio
- python
0
GitHub Stars
python
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"tuannguyen14-comfyai-mcp-gameassets": {
"command": "python",
"args": [
"-m",
"server.main"
],
"env": {
"OUTPUT_DIR": "./output",
"BACKEND_TYPE": "comfyui",
"COMFYUI_HOST": "127.0.0.1",
"COMFYUI_PORT": "8188",
"UNITY_ASSETS_DIR": "C:/Projects/MyGame/Assets",
"COMFYUI_CHECKPOINT": "sd_xl_base_1.0.safetensors"
}
}
}
}ComfyMCP Studio is an MCP server that enables automated generation of 2D game assets through AI workflows powered by ComfyUI. You can generate icons, characters, tilesets, top-down assets, and more, then export outputs to Unity or batch process assets with presets and post-processing. This server is designed to streamline asset creation for games by combining reliable AI pipelines with convenient MCP tooling.
How to use
You run this MCP server as part of your MCP client setup. The server exposes a set of tools that you invoke from your MCP workflow to generate game assets, manage presets, and export results to your Unity project. Use the provided tooling to generate icons, characters, tilesets, top-down assets, and more, then post-process assets or export to Unity as needed.
Typical usage flow:
- Start the MCP server locally and verify it is reachable by your MCP client.
- Use the available tools to generate assets from prompts and presets tailored for your game style.
- Post-process results (resize, remove backgrounds, add outlines) if needed.
- Export generated assets to a Unity project folder for immediate use.
How to install
# Navigate to the project path
cd path/ComfyAI-MCP-GameAssets
# Create a virtual environment
python -m venv venv
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Configure environment variables and startup options by copying and editing the example configuration file. You will set the backend type, ComfyUI host/port, and the Stable Diffusion checkpoint to use, plus an output directory and Unity assets path.
# Copy example config to actual config
cp .env.example .env
# Example environment configuration inside .env
BACKEND_TYPE=comfyui
COMFYUI_HOST=127.0.0.1
COMFYUI_PORT=8188
COMFYUI_CHECKPOINT=sd_xl_base_1.0.safetensors
OUTPUT_DIR=./output
UNITY_ASSETS_DIR=C:/Projects/MyGame/Assets
Configuration
The server reads your configuration from the environment and uses your ComfyUI setup. Ensure ComfyUI is running and accessible at the specified host and port, and that the chosen checkpoint exists in ComfyUI. You should also confirm the output directory exists or is creatable by the server.
# Start ComfyUI (example)
python main.py --listen 0.0.0.0 --port 8188
# Example: ensure the checkpoint exists in ComfyUI
# Path example: ComfyUI/models/checkpoints/\n
auto-detected by the server from COMFYUI_CHECKPOINT
Run as MCP server (Windsurf)
To run this as an MCP server, create or update your MCP configuration to include the following server entry. This runs the server as a local process that MCP can manage and orchestrate.
{
"mcpServers": {
"comfymcp_studio": {
"command": "python",
"args": ["-m", "server.main"],
"cwd": "path/ComfyAI-MCP-GameAssets",
"env": {
"BACKEND_TYPE": "comfyui",
"COMFYUI_HOST": "127.0.0.1",
"COMFYUI_PORT": "8188"
}
}
}
}
Configuration and tools
This server provides a set of tools to generate assets and manage outputs. You can list presets, generate assets in batch, and export results to Unity.
# Example tools described in the system:
# - ping
# - list_available_presets
# - generate_sprite
# - generate_icons
# - generate_tileset
# - generate_character
# - generate_character_animations
# - generate_with_viewpoint
# - generate_topdown_asset
# - process_image
# - create_sprite_atlas
# - export_to_unity
# - batch_generate
Troubleshooting
If you encounter issues starting the MCP server, verify that the MCP entry points are correctly configured and that ComfyUI is reachable at the specified host/port. Check that the checkpoint file exists in ComfyUI and that required ControlNet models are installed if you use viewpoint features.
Common problems and fixes:
- HTTP 400 when calling prompt-related endpoints usually indicate a missing or misnamed ControlNet model. Ensure the model exists in ComfyUI/model/controlnet and that the exact name matches what you pass in prompts.
- If top-down outputs are not as expected, increase control strength and use topdown presets to improve consistency.
Available tools
ping
Check backend health from MCP client to ensure the server is reachable.
list_available_presets
List preset names and their configurations to quickly browse asset styles.
generate_sprite
Create a single sprite image from a prompt for quick iterations.
generate_icons
Generate batch icons and optionally create an atlas.
generate_tileset
Produce tileable textures based on a theme for seamless level design.
generate_character
Generate a character asset driven by prompts.
generate_character_animations
Create multiple poses from a single reference image for character animation.
generate_with_viewpoint
ControlNet depth-guided generation to lock camera angles.
generate_topdown_asset
Convenience wrapper for top-down assets (props, characters, tiles, etc.).
process_image
Resize, remove background, and add outlines to assets.
create_sprite_atlas
Combine images into a single spritesheet.
export_to_unity
Export outputs into a Unity project folder for immediate use.
batch_generate
Run multiple prompts in a batch to generate many assets efficiently.