chutes-media-mcp
Generates images, videos, music, and speech via the Chutes API, saving assets directly into the project workspace.
README
chutes-media-mcp
Generate image, video, music and speech through Chutes from inside any coding agent — Claude Code, Cursor, Cline, Windsurf, Codex, OpenCode, Claude Desktop — and have the generated asset saved straight into the project you're working on.
It ships as:
- an MCP server (
chutes-media-mcp, stdio) — the primary, universal interface, - a thin CLI (
chutes-media) — a fallback for shells and agents without MCP support, and - an optional Agent Skill (
skill/chutes-media) documenting the describe→generate workflow (auto-loaded by Claude Code; usable as reference by any agent).
Both frontends are thin adapters over one shared, transport-agnostic core, so they behave identically.
Not officially affiliated with or endorsed by Chutes. "Chutes" belongs to its respective owners; this is an independent, open-source community tool.
Features
- 🎨 Four media kinds: image, video, music, speech — plus image editing (img2img / inpaint) when a model exposes an edit cord.
- 🔎 describe → generate workflow: the live model schema is fetched and handed to the agent; payloads are never hardcoded.
- 💾 Saves assets into your project (default
./assets/chutes/<kind>/) and returns the path. - ✅ Validates the payload against the live schema before spending a GPU call.
- 🧾 Provenance + guardrails: writes a sidecar (model, params, schema hash) next to each asset, rejects unknown params, and verifies the returned media type matches what you asked for.
- 🔁 Automatic cold-start retry with backoff for models scaled to zero.
- 📡 Progress updates during long video/music jobs (MCP progress notifications / CLI stderr).
- 🧩 Works everywhere: MCP server or CLI, same behavior.
How it works: describe → generate
Chutes models differ wildly (FLUX vs Qwen-Image vs Wan vs LTX vs ACE-Step vs a TTS model), so payloads are never hardcoded. The flow is always:
list_media_models— discover a model for the kind you want.describe_media_model— fetch the model's live cords and input schema.generate_media— submit the payload you composed; the asset is saved into the workspace.
The server owns all the plumbing: auth, cold-start warmup + retry, blocking invocation with progress, downloading, saving, light validation, and best-effort cost reporting.
Requirements
- Node.js ≥ 20
- A Chutes API key (
CHUTES_API_KEY). Create one in your Chutes account.
Install
An MCP server isn't "installed" like an app — it's registered as a command in your MCP client's config (see Use as an MCP server). Pick whichever way of providing that command suits you:
1. npx from npm — recommended (no install):
npx chutes-media-mcp # MCP server (stdio)
npx -p chutes-media-mcp chutes-media --help # CLI bin
2. Global install:
npm install -g chutes-media-mcp
# then `chutes-media-mcp` (server) and `chutes-media` (CLI) are on your PATH
3. Directly from GitHub (no npm needed): builds on install via the prepare script.
npx -y github:TheStreamCode/chutes-media-mcp
4. From source (for development):
git clone https://github.com/TheStreamCode/chutes-media-mcp
cd chutes-media-mcp && npm install && npm run build
# then point your client at: node /abs/path/dist/mcp/server.js
The package ships two bins:
chutes-media-mcp(the MCP server) andchutes-media(the CLI).
Configuration
| Variable | Required | Default | Purpose |
|---|---|---|---|
CHUTES_API_KEY |
✅ | — | Your Chutes API key. Read from the environment; never written to disk. |
CHUTES_AUTH_SCHEME |
raw |
How the key is sent in Authorization: raw (the key as-is) or bearer (prefixed Bearer ). On a 401, try flipping this. |
|
CHUTES_API_BASE_URL |
https://api.chutes.ai |
Management API base URL. | |
CHUTES_OUTPUT_DIR |
assets/chutes |
Output directory (relative to the agent's CWD). A <kind>/ subfolder is appended. |
|
CHUTES_WARMUP |
true |
Warm models up before invoking. Set false to skip. |
|
CHUTES_COLD_START_RETRIES |
4 |
Retries when a cold model returns 503 no-instances (0 disables). |
|
CHUTES_COLD_START_BACKOFF_MS |
8000 |
Base backoff between cold-start retries (grows per attempt). | |
CHUTES_PROGRESS_INTERVAL_MS |
5000 |
How often progress heartbeats are emitted while a call blocks. | |
CHUTES_ALLOW_UNKNOWN_PARAMS |
false |
When true, allow params not in the model schema. Default rejects them so a renamed/unknown field fails loudly. |
|
CHUTES_PROVENANCE |
true |
Write a <asset>.json provenance sidecar (model, cord, params, schema hash). Set false to disable. |
Generated assets are saved to ./assets/chutes/<kind>/ by default, relative to wherever the agent is
running — so they land inside the project being worked on.
Use as an MCP server
Claude Code:
claude mcp add chutes-media --env CHUTES_API_KEY=cpk_your_key -- npx -y chutes-media-mcp
Cursor / Cline / Windsurf / OpenCode / Claude Desktop (generic mcpServers config):
{
"mcpServers": {
"chutes-media": {
"command": "npx",
"args": ["-y", "chutes-media-mcp"],
"env": { "CHUTES_API_KEY": "cpk_your_key" }
}
}
}
To run without npm, replace the args with
["-y", "github:TheStreamCode/chutes-media-mcp"].
Tools
list_media_models—{ kind?, query?, limit? }→ matching models.describe_media_model—{ model }→ every cord with required fields, types, defaults, a minimal example payload, and a top-levelsupportsEditing. Call this before generating.generate_media—{ model, kind, params, cord?, output_dir?, filename?, timeout_ms? }→ runs the generation and returns{ path, kind, model, cord, bytes, contentType, cost?, durationMs }.paramsis what you composed from the described schema.
Example agent workflow
"Generate a hero image of a misty mountain range and drop it into the landing page."
The agent calls describe_media_model on an image model, composes
{ prompt: "misty mountain range at dawn, cinematic", width: 1024, height: 1024 }, calls
generate_media, gets back ./assets/chutes/image/<model>-<timestamp>.png, and references that path
in index.html.
Use as a CLI
export CHUTES_API_KEY="cpk_your_key" # PowerShell: $env:CHUTES_API_KEY = "cpk_..."
# Discover models
chutes-media list --kind image
chutes-media list --query flux
# Inspect a model's schema
chutes-media describe owner/model-slug
# Generate (inline JSON, @file, or a path to a .json file for --params)
chutes-media generate --kind image --model owner/model-slug \
--params '{"prompt":"a red bicycle on a cobblestone street"}'
Progress is printed to stderr; the JSON result (including the saved path) is printed to
stdout, so agents can parse it.
Image editing (img2img / inpaint)
Chutes has no platform-wide edit endpoint. Editing exists only when a model publishes an edit
cord (e.g. img2img, inpaint) or is a dedicated edit model. describe_media_model reports
supportsEditing and lists those cords. To use one, reference a workspace file in params (a single
field like image, or an array like image_b64s) — the server reads the file and base64-encodes it:
chutes-media generate --kind image --model owner/edit-capable --cord img2img \
--params '{"prompt":"make it snowy","image":"assets/chutes/image/scene.jpg","strength":0.6}'
When a model has no edit cord, only generation is available.
Agent Skill (optional)
The MCP server already ships instructions (the describe→generate workflow), so any client receives guidance on connect — no skill required.
For Claude Code you can additionally install the bundled Agent Skill
(skill/chutes-media) for richer, auto-loaded guidance:
npx -p chutes-media-mcp chutes-media install-skill # → ~/.claude/skills/chutes-media
npx -p chutes-media-mcp chutes-media install-skill --project # → ./.claude/skills/chutes-media
(Or copy the folder into your skills directory manually.) Agents without skill auto-loading don't need it — the tool descriptions and server instructions already guide them.
Cost
Chutes prices by compute units. When a model exposes the cost via a response header it is returned as
cost; otherwise cost is omitted. Check the Chutes pricing for per-model
rates.
💡 Many public models scale to zero and may return
503 no-instancesuntil they warm up. The server retries automatically; if a model stays cold, pick another of the same kind.
Development
See CONTRIBUTING.md for setup, the build/test commands, and the Windows #-path
caveat. Quick version:
npm install
npm run typecheck
npm run test
npm run build
Security
Never commit your API key. See SECURITY.md for how the key is handled and how to report vulnerabilities.
Author
Built by Michael Gasperini — founder of Mikesoft, building small, focused, privacy-aware developer tools.
If this project is useful to you, consider sponsoring its development. 💛
License
MIT © Michael Gasperini (Mikesoft)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。