Skip to main content
Glama

Chutes Media MCP

Generate image, video, music, and speech through Chutes from any coding agent, with the asset saved straight into the project you are working on.

CI License npm

Chutes Media MCP at work: an MCP client, the model's live schema, and media saved into the workspace

Chutes Media MCP is a Model Context Protocol (MCP) server and command-line interface (CLI) that give coding agents access to Chutes media models. It ships as an MCP server on standard input/output (stdio), a thin CLI for agents without MCP support, and a bundled Agent Skill for the describe-then-generate workflow.

Instead of hardcoding a payload per model, the server fetches the model's live schema and validates each request before spending a GPU call, then writes the asset and a provenance record into your workspace. It works with Claude Code, Cursor, Cline, Windsurf, Codex, OpenCode, and Claude Desktop.

This is an independent community project. It is not affiliated with, sponsored by, or endorsed by Chutes.

Install

Run the server from npm without installing it globally:

npx -y chutes-media-mcp

Install it globally to put both binaries on your path:

npm install -g chutes-media-mcp

Register the server with Claude Code:

claude mcp add chutes-media --env CHUTES_API_KEY=cpk_your_key -- npx -y chutes-media-mcp

For Cursor, Cline, Windsurf, OpenCode, and Claude Desktop, add the mcpServers entry documented in docs/mcp-and-cli.md. Running from GitHub instead of npm is supported with npx -y github:TheStreamCode/chutes-media-mcp. Upgrading from 1.x? See docs/migration-2.0.md.

Related MCP server: ComfyUI MCP Server

Quick start

  1. Create a Chutes API key at chutes.ai and register the server as shown under Install.

  2. Ask your agent for an asset: "Generate a cinematic hero image of a misty mountain range and save it in this project."

  3. The agent discovers a suitable model, reads its live schema, validates the payload, and saves the result under assets/chutes/image/. The returned path is ready to reference from your code.

The same describe-then-generate flow is available from a shell through the chutes-media CLI. See docs/mcp-and-cli.md for the tool reference, CLI examples, and image editing.

Features

  • Four media kinds (image, video, music, speech), plus image editing when a model exposes an edit cord such as img2img or inpaint.

  • Live model contract: cords and input schema are fetched at runtime, never hardcoded.

  • Payload validation against the live schema before any GPU call is made.

  • Workspace-contained file access; existing assets survive unless overwrite is explicitly set.

  • A provenance sidecar per asset with model, cord, params, and schema hash.

  • Automatic cold-start retry with backoff for models that scale to zero.

  • Progress updates for long video and music jobs.

  • One shared core, so the MCP server and the CLI behave identically.

Requirements

  • Node.js 20.3 or newer for the published server and CLI. Node.js 20 is end-of-life; use Node.js 22 or 24 LTS in production.

  • A Chutes API key.

  • Contributors using the locked toolchain need Node.js ^20.19.0, >= 22.13.0, or >= 24.

Configuration

Variable

Required

Default

Purpose

CHUTES_API_KEY

Yes

none

Chutes API key. Read from the environment; never written to disk.

CHUTES_AUTH_SCHEME

No

raw

How the key is sent in Authorization: raw (the key as-is) or bearer (value prefixed with Bearer and a space). On a 401, try the other value.

CHUTES_API_BASE_URL

No

https://api.chutes.ai

Management API base URL. HTTPS is required except for loopback development; custom endpoints never receive the Chutes API key.

CHUTES_OUTPUT_DIR

No

assets/chutes

Output directory inside the agent's working directory. A <kind>/ subfolder is appended.

CHUTES_WARMUP

No

true

Warm models up before invoking them. Set to false to skip warmup.

CHUTES_COLD_START_RETRIES

No

4

Retries when a cold model returns 503 no-instances. 0 disables retries.

CHUTES_COLD_START_BACKOFF_MS

No

8000

Base backoff between cold-start retries; it grows per attempt.

CHUTES_MAX_ASSET_MB

No

512

Maximum response or local input asset size kept in memory. The maximum is 4096.

CHUTES_PROGRESS_INTERVAL_MS

No

5000

How often progress heartbeats are emitted while a call blocks.

CHUTES_ALLOW_UNKNOWN_PARAMS

No

false

When true, accept parameters that are not in the model schema. The default rejects them so a renamed field fails loudly.

CHUTES_PROVENANCE

No

true

Write a <asset>.json sidecar with model, cord, params, and schema hash. Set to false to disable.

Generated assets are saved under ./assets/chutes/<kind>/, relative to wherever the agent runs, so they land inside the project. Output traversal and symlink escapes are rejected, and existing files are preserved unless overwrite is enabled.

Privacy and security

The API key is read from CHUTES_API_KEY and kept in memory. Credential-bearing requests go only to HTTPS Chutes hosts, remote asset URLs are screened against private-network destinations, and file access is contained to the workspace. Query strings and fragments are removed from network-error messages so signed asset URLs do not end up in logs. The project collects no telemetry. See SECURITY.md for reporting.

Troubleshooting

A Chutes request returns 401

The key is missing, invalid, or sent with the wrong authentication scheme. Confirm CHUTES_API_KEY is set for the process that launches the server, then set CHUTES_AUTH_SCHEME to bearer or raw, whichever differs from the current value.

A model returns 503 no-instances

The model is scaled to zero and Chutes has no instance ready. The server retries automatically; raise CHUTES_COLD_START_RETRIES and CHUTES_COLD_START_BACKOFF_MS if the delay is too short, or pick another model of the same kind.

Generation fails with an unknown or rejected parameter

The live model schema changed or the parameter name is wrong. Call describe_media_model again and rebuild the payload from the current schema. CHUTES_ALLOW_UNKNOWN_PARAMS=true is a temporary workaround, not a fix.

An asset write is rejected

Every input and output path must resolve inside the current workspace, and an existing file is not replaced implicitly. Pass the explicit overwrite option (or --overwrite in the CLI) after checking the target path.

Development

Requirements: Node.js ^20.19.0, >= 22.13.0, or >= 24 with npm.

git clone https://github.com/TheStreamCode/chutes-media-mcp
cd chutes-media-mcp
npm ci
npm run check
npm run verify:mcp
npm run release:check

npm run check runs the format check, lint, type check, coverage tests, and the build. npm run verify:mcp starts the built stdio server with a placeholder key and validates the MCP handshake, the instructions and the three tool definitions without calling Chutes. npm run release:check keeps package.json, CHANGELOG.md, CITATION.cff and server.json on the same version. CONTRIBUTING.md covers the Windows path caveat and the opt-in live tests.

Support

Ask usage questions in GitHub Discussions, report reproducible defects in GitHub Issues, and report vulnerabilities privately as described in SECURITY.md.

Contributing

See CONTRIBUTING.md. Pull requests must pass the required CI checks.

License

MIT — see LICENSE. Third-party notices are in NOTICE.


Maintained by Michael Gasperini (Mikesoft). If this project is useful to you, consider sponsoring its maintenance.

Available Tools

3 tools
describe_media_modelDescribe a Chutes media modelA
Read-onlyIdempotent

Fetch a model's live cords and input schemas so you can compose a valid request. ALWAYS call this before generate_media for an unfamiliar model. Returns every cord (e.g. generate, and img2img/inpaint when present) with its required fields, types, defaults and a minimal example payload.

NameRequiredDescriptionDefault
modelYesModel name/slug, e.g. owner/model-slug.

Output Schema

NameRequiredDescription
kindNo
cordsYes
modelYes
taglineNo
invokeBaseUrlNo
supportsEditingYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, idempotent and non-destructive, so the description only needs to add context. It does so by describing the payload content (every cord with required fields, types, defaults, minimal example), which helps the agent plan the follow-up call.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences with the call-before-use instruction front-loaded and no redundant restatement of the name or title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read tool with full schema coverage and an output schema, the definition supplies the missing piece — when to call it and what the return payload contains. Nothing needed for correct invocation is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single 'model' parameter has 100% schema description coverage including the 'owner/model-slug' format, so the schema does the work. The description adds nothing about the parameter itself, which is the baseline 3 case.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Fetch') and resource ('model's live cords and input schemas') with the goal ('compose a valid request'). It is clearly distinguishable from list_media_models (listing) and generate_media (execution).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs 'ALWAYS call this before generate_media for an unfamiliar model,' giving a clear trigger condition. It doesn't mention when list_media_models is the better entry point, so the sibling routing is only partially covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_mediaGenerate media with ChutesA
Destructive

Run a generation and save the asset into the workspace. params is the payload you composed from describe_media_model. For editing, params may reference workspace file paths (e.g. image, mask) which the server reads and encodes. The asset is saved under output_dir (default ./assets/chutes//) and the saved path is returned. Long video/music jobs block with progress updates.

NameRequiredDescriptionDefault
cordNoOperation/cord (e.g. img2img); defaults to the primary one.
kindYes
modelYes
paramsYesPayload matching the cord's input schema.
filenameNo
overwriteNoExplicitly replace an existing asset and sidecar.
output_dirNoOutput directory relative to CWD.
timeout_msNo

Output Schema

NameRequiredDescription
cordYes
costNo
kindYes
pathYes
bytesYes
modelYes
durationMsYes
schemaHashNo
contentTypeYes
provenancePathNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds valuable context beyond the destructive=true/openWorld=true annotations: default save location, that the saved path is returned, that the server reads and base64-encodes referenced workspace files, and that long video/music jobs block with progress updates. It does not explain what happens when an asset already exists (overwrite semantics live only in the schema) or any rate/cost limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense sentences, front-loaded with the core action and outcome, then parameter guidance, then output location, then long-job behavior. No filler or repetition of schema fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given an output schema exists and annotations cover the safety profile, the description supplies the essential operational context: the describe_media_model dependency, file-path based editing, where results land, and blocking behavior for long jobs. It stops short of covering overwrite/conflict behavior and timeout handling for a destructive tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 50% schema description coverage, the description meaningfully compensates for the most important parameters: it explains that `params` is a cord-specific payload sourced from describe_media_model and may reference workspace paths, and it clarifies `output_dir` semantics with a default. Other params (cord, filename, overwrite, timeout_ms, kind, model) remain unexplained in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and outcome: run a generation and save the resulting asset into the workspace. By naming `params` as the payload composed from describe_media_model, it clearly positions itself as the execution step versus the sibling list/describe tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells the agent to compose `params` using describe_media_model first and notes that editing workflows may pass workspace file paths for the server to read and encode. It gives clear context but does not state when *not* to use it or compare against the siblings directly.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_media_modelsList Chutes media modelsA
Read-onlyIdempotent

List available Chutes media-generation models (image / video / music / speech), optionally filtered by kind or a free-text query. Use this to discover a model, then call describe_media_model before generate_media.

NameRequiredDescriptionDefault
kindNo
limitNo
queryNoFree-text filter on the model name.

Output Schema

NameRequiredDescription
countYes
modelsYes

TDQS

A4.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, non-destructive and openWorld, so the safety profile is fully covered. The description adds the useful discovery-role context, but says nothing about result volume, default page size, ordering, or what happens when limit is omitted — the practical behaviors an agent still needs to guess at.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero padding, with the capability statement front-loaded and the routing advice second. Every clause carries information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no explanation, and the sibling workflow is spelled out. The only gap is pagination/default-limit behavior, which matters for a list tool with a 200-item cap but is not covered anywhere in the description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 33%, so the description must carry weight, and it does: it explains that kind narrows to the four media types and that query is a free-text filter applied to discovery. Only limit is left unaddressed, though its bounds are self-documenting in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (List) and resource (Chutes media-generation models), and enumerates the domains covered (image / video / music / speech). It is immediately distinguishable from describe_media_model, which it names as a separate, narrower step.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit workflow: discover a model here, then call describe_media_model, then generate_media. This tells the agent both when to use this tool and which sibling to reach for next, leaving nothing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updates
    • First observeddescribe_media_model
    • First observedgenerate_media
    • First observedlist_media_models

TDQS

A4.5/5.0

Scored across 3 tools

Disambiguation5/5

The three tools form a clear discovery-to-execution pipeline: list models, inspect a model's schema, then generate. Each has a distinct purpose and the descriptions explicitly guide sequencing, leaving little room for misselection.

Naming Consistency5/5

All tool names use consistent snake_case with verb-led phrasing: list_media_models, describe_media_model, generate_media. The pattern is predictable and readable throughout.

Tool Count5/5

Three tools are well-scoped for a media-generation workflow: discovery, schema inspection, and generation. Each tool earns its place, and the set avoids unnecessary surface area.

Completeness4/5

The core workflow is covered: list models, inspect live schemas, and generate/save assets with progress updates. Minor gaps exist around asset management or job cancellation/status, but the main generation lifecycle is complete enough for agents to work with.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers