RunComfy MCP Server
MCP server to generate AI videos and images using the RunComfy APIs.
Setup
- Install dependencies:
cd mcp-servers/runcomfy
bun install
-
Get your API key from: https://www.runcomfy.com/profile
-
Add the configuration to your
~/.windsurf/mcp_config.json:
{
"mcpServers": {
"runcomfy": {
"command": "bun",
"args": [".../mcp-runcomfy/index.js"],
"env": {
"RUNCOMFY_API_KEY": "YOUR_API_KEY_HERE"
}
}
}
}
- Restart Windsurf
Available tools
runcomfy_generate_video
Generate an AI video. Parameters:
prompt(required): Video descriptionmodel: wan-2.1, wan-2.1-720p, animatediff, svd, kling, minimaximage_url: Image URL for image-to-video modelsduration: Duration in secondsaspect_ratio: 16:9, 9:16, 1:1seed: Seed for reproducibility
runcomfy_generate_image
Generate an AI image (text-to-image). Parameters:
prompt(required): Image descriptionmodel: flux-2-proaspect_ratio: 16:9, 9:16, 1:1seed: Seed for reproducibilityinputs: Advanced model-specific inputs (object)
runcomfy_edit_image
Edit an image (image-to-image). Parameters:
prompt(required): Edit instructionmodel: flux-2-dev-edit, flux-kontext-pro-edit, qwen-edit-next-sceneimage_url: Single image URL (some models)image_urls: Multiple image URLs (some models)aspect_ratio: 16:9, 9:16, 1:1seed: Seed for reproducibilityinputs: Advanced model-specific inputs (object)
runcomfy_check_status
Check the status of a request.
runcomfy_get_result
Get the result (video URL) of a completed request.
runcomfy_cancel
Cancel a queued request.
runcomfy_list_models
List available models plus curated alias maps for video and image.
runcomfy_download_media
Download a generated media to local disk. Parameters:
url: Direct HTTPS URL to the media filerequest_id: Resolve the media URL from a completed request (via/v1/requests/{request_id}/result)kind: Preferred output kind when resolving fromrequest_id(imageorvideo)index: Optional index if multiple outputs exist (0-based)output_dir: Directory to save into (defaults to a temp folder)filename: Optional filename overrideoverwrite: Overwrite if file exists (defaultfalse)return_mode: How to return the downloaded media (defaultpath)path: Return only JSON withsaved_pathresource_link: Also return aresource_linkpointing tofile://...embedded: Also return an embeddedresourcewith base64blob
Usage example
// Generate video
runcomfy_generate_video({
prompt: "A calm person breathing slowly, teal glow, dark background",
model: "wan-2.1",
aspect_ratio: "1:1"
})
// Check status
runcomfy_check_status({ request_id: "abc123" })
// Get result
runcomfy_get_result({ request_id: "abc123" })
// Generate image
runcomfy_generate_image({
prompt: "A minimal flat illustration of a calm person breathing, teal and navy",
model: "flux-2-pro",
aspect_ratio: "1:1"
})
// Edit image
runcomfy_edit_image({
prompt: "Change the background to a dark gradient and add a subtle teal glow",
model: "flux-2-dev-edit",
image_urls: ["https://example.com/input.png"]
})
// Download result media by URL
runcomfy_download_media({
url: "https://example.com/output.png",
output_dir: "/tmp",
filename: "output.png",
overwrite: true
})
// Download result media by request_id
runcomfy_download_media({
request_id: "abc123",
kind: "image",
index: 0
})
// Download and return a resource_link
runcomfy_download_media({
request_id: "abc123",
kind: "image",
return_mode: "resource_link"
})
// Download and return an embedded base64 resource
runcomfy_download_media({
request_id: "abc123",
kind: "image",
return_mode: "embedded"
})