muse-image-mcp
An MCP server for generating, editing, and iteratively refining images with Meta Muse, returning local file paths.
Generate images from text prompts (1–10 per call).
Edit images using local files or http(s) URLs as references.
Refine images conversationally using response_id/previous_response_id.
Control output format (png/webp/jpeg), aspect ratio (size), reasoning strength (high/low), filename prefix, and model per call.
Pass new or experimental parameters via extra_params; switch models without waiting for a server release.
Save images to disk and return absolute paths, keeping image bytes out of the conversation context.
See estimated cost per call (US$0.01 per image).
Use with any MCP-capable agent (Claude Code, Claude Desktop, Cursor).
Provides image generation and editing powered by Meta's Muse image model through the Meta Model API. Offers tools for text-to-image generation (up to 10 images per call), editing based on reference images from local files or HTTP(S) URLs, and multi-turn conversational refinement using response IDs. Supports model switching, custom parameters, aspect-ratio sizing, output formats (png/webp/jpeg), reasoning strength selection, and per-call cost estimation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@muse-image-mcpgenerate an image of a red fox in a snowy forest"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
muse-image-mcp
An MCP server that gives any MCP-capable agent — Claude Code, Claude Desktop, Cursor — image generation powered by the Meta Muse image model.
What it does
Three tools, covering the full loop of working with images in a conversation:
Tool | What it's for |
| Text to image. 1–10 images per call. |
| Edit from reference images — local files or URLs. |
| Conversational refinement. Keep saying "make it warmer" and it remembers. |
Related MCP server: minimax-image-mcp
Why this server
Your context window survives. Every tool writes images to disk and returns an absolute file path — never the image bytes. Generating a dozen images costs you a dozen lines of context instead of a dozen megabytes of base64. When you actually want to look at an image, open the path with a file-reading tool.
Multi-turn refinement without state. iterate_image returns a response_id; feed it back as previous_response_id and the next turn continues the same conversation. The server itself stores nothing — conversation state lives on Meta's side, so the server stays restartable and stateless.
New models don't require a new release. Switch models with MUSE_MODEL or a per-call model parameter, and pass parameters this server has never heard of through extra_params. Fields that determine request structure are protected from being overwritten; everything else is a deliberate escape hatch.
You always know what it cost. Every response ends with the estimated cost of that call.
Requirements
Node.js >= 20.12.0
A Meta Muse API key
Getting an API key
Muse Image runs on the Meta Model API, so you register with Meta — not with this project:
Go to https://dev.meta.ai and sign in to the Meta Model API dashboard.
Open API keys.
Click Create API key and copy the value.
That value is what you pass as MUSE_API_KEY below. Meta's own documentation calls this variable MODEL_API_KEY; this server reads it as MUSE_API_KEY, talks to https://api.meta.ai/v1, and defaults to the model muse-image-1.0.
Reference: Model API docs · Image generation · Muse Image announcement
Keep the key out of source control — use the MCP config's env block or a .env file, both described below.
Install
Option 1: npx (recommended — no clone required)
claude mcp add muse-image --scope user --env MUSE_API_KEY=your-key -- npx -y muse-image-mcpnpx fetches and runs the latest version on demand — nothing to install first.
--scope userapplies it to every project; use--scope localfor the current project only.-yskips npx's install prompt. Without it the server hangs on an interactive question and the handshake fails.Everything after
--is the launch command;--envbefore it belongs toclaude mcp add.
For other MCP clients (Claude Desktop, Cursor), write the config by hand:
{
"mcpServers": {
"muse-image": {
"command": "npx",
"args": ["-y", "muse-image-mcp"],
"env": { "MUSE_API_KEY": "your-key" }
}
}
}On Windows, if npx can't be found, use "command": "cmd" with "args": ["/c", "npx", "-y", "muse-image-mcp"].
Option 2: Local clone (when you want to change the code)
git clone https://github.com/kevintsai1202/muse-image-mcp.git
cd muse-image-mcp
npm install
npm run build
claude mcp add muse-image --scope user --env MUSE_API_KEY=your-key -- node <your-clone-path>/dist/index.jsAfter installing
Start a new session — MCP servers are loaded at session start, so an existing session won't pick it up. Then confirm with claude mcp list, which should show muse-image: ... - Connected, and check that the three mcp__muse-image__* tools are available.
Configuring the API key
Precedence is the env block in your MCP config > a .env file.
Using the MCP config env block (the only route when installed via npx)
See --env MUSE_API_KEY=your-key above.
Using a .env file
The server searches these locations in order and uses the first one that exists:
<package root>/.env— convenient for a local clone~/.muse-image-mcp/.env— the only location you control when installed via npx
MUSE_API_KEY=your-keyNote that .env is not read from the directory you launched Claude Code in — an MCP server's working directory is decided by the client, which makes it a poor place for configuration. When installed via npx the package itself lives in a hashed npm cache directory that gets cleaned up, so a .env there would be pointless.
Environment variables
All of these work in either .env or your MCP config's env block.
Variable | Required | Default | Description |
| Yes | — | API key. Without it the server exits immediately and explains itself on stderr |
| No |
| Global default model ID |
| No |
| JSON object string — global default extra parameters |
| No |
| Output directory, created if missing |
| No |
| API base URL |
| No |
| Per-request timeout in milliseconds |
The
cwdinMUSE_OUTPUT_DIR's default is the working directory the MCP client launched the server from. In Claude Code that's the project root of your session, so images land in that project'sgenerated-images/. If your client behaves differently, or you want a fixed location, setMUSE_OUTPUT_DIRto an absolute path.Since v0.1.0 the default output directory changed from
muse-output/togenerated-images/. The old directory is not deleted or migrated automatically.
Switching models and passing new parameters
When a new model ships you don't have to wait for this project to update — switch models with an environment variable, send new parameters through extra_params.
Switching models
Globally, in .env or your MCP config:
MUSE_MODEL=muse-image-2.0Per call, just ask for it in conversation and the agent will pass model:
{ "prompt": "a red fox", "model": "muse-image-2.0" }Passing new parameters
Global defaults as a JSON object string:
MUSE_EXTRA_PARAMS={"quality":"ultra"}Per-call overrides via extra_params, merged with the global setting — the per-call value wins:
{ "prompt": "a red fox", "extra_params": { "style_preset": "anime" } }Protected core fields
model, prompt, response_format, images, input, store, and previous_response_id determine the structure of the request and cannot be overwritten by extra_params. Setting them there has no effect, and the response will end with a warning listing the ignored keys.
To change models, use the model parameter or MUSE_MODEL — not extra_params.
Outside those core fields, extra_params does override same-named regular parameters, including n, size, output_format, and reasoning_strength. The tool schema's validation for these (for example n being limited to 1–10) does not apply on this path — that's a deliberate escape hatch so a future model that changes parameter semantics isn't blocked by today's limits. When overriding n this way, watch your image count and cost.
Tools
Every tool saves images locally and returns absolute paths, never the image content itself — this keeps base64 out of your conversation context. Open the path with a file-reading tool when you want to see the image.
generate_image — text to image
Parameter | Required | Default | Description |
| Yes | — | Image description |
| No | 1 | Number of images, 1–10 |
| No | — | Aspect ratio string such as |
| No |
|
|
| No |
|
|
| No |
| Output filename prefix |
| No | — | Model ID; omit to use the server default (see |
| No | — | Object of extra parameters, merged with |
edit_image — edit from reference images
Parameter | Required | Default | Description |
| Yes | — | Image description |
| Yes | — | Array of local file paths (png/jpg/jpeg/webp/gif) or http(s) URLs. Local files are base64-encoded automatically |
| No | 1 | Number of images, 1–10 |
| No | — | Aspect ratio string such as |
| No |
|
|
| No |
|
|
| No |
| Output filename prefix |
| No | — | Model ID; omit to use the server default |
| No | — | Same merge and protection rules as above |
iterate_image — conversational refinement
Parameter | Required | Description |
| Yes | This turn's instruction |
| No | The id returned by the previous turn; omit to start a new conversation |
| No | Reference images for the first turn |
| No | Defaults to |
| No | Aspect ratio string such as |
| No |
|
| No | Defaults to |
| No | Model ID; omit to use the server default |
| No | Same merge and protection rules as above |
This tool has no n parameter — the /v1/responses endpoint returns one image per turn. It does support size and output_format, but they travel inside the request's tools entry rather than at the top level; see the findings below.
The response always includes a response_id. Pass it as previous_response_id on the next call to continue the same conversation. This server stores no conversation state; Meta does.
Findings from /v1/responses
Request body: per-image settings live inside tools
reasoning_strength, size and output_format are not top-level parameters on this endpoint — they belong to the image_generation tool entry. Sending reasoning_strength at the top level is not merely ignored; the API rejects the whole request:
HTTP 400 — unknown parameter `reasoning_strength`The correct shape:
{
"model": "muse-image-1.0",
"input": "now make the background deep navy",
"store": true,
"previous_response_id": "resp_abc123",
"tools": [
{ "type": "image_generation", "reasoning_strength": "low", "size": "1024x1536", "output_format": "png" }
]
}Versions up to 0.1.0 sent reasoning_strength at the top level, which made iterate_image fail on every call. generate_image and edit_image were never affected — they use /images/generations and /images/edits, where these are legitimate top-level parameters.
This also corrects an earlier claim in this README: size and output_format are supported here. Specifying output_format: "png" returns a genuine PNG (verified by the base64 header) rather than the endpoint's webp default. Only n is genuinely unavailable — one image per turn.
scripts/probe-responses-api.mjs reproduces all of this against the live API, one hypothesis per case.
Response shape
Meta doesn't publish the response schema for /v1/responses. The original implementation was an educated guess modeled on OpenAI's Responses convention; it was later verified against real API calls. The actual structure:
{
"model": "muse-image-1.0",
"id": "resp_6aa4c23f99592ae0ac454928",
"object": "response",
"status": "completed",
"output": [
{ "type": "reasoning", "summary": [{ "type": "summary_text", "text": "..." }] },
{ "type": "message", "role": "assistant", "content": [{ "type": "output_text", "text": "" }] },
{ "type": "image_generation_call", "id": "ig_...", "status": "completed", "result": "<base64 image data>" }
]
}Differences from the guessed shape:
idlocation:raw.idwas correct, confirmed by testing. No change needed.Image data location: not in any
b64_jsonfield, but in theresultfield of theoutput[]entry wheretype === "image_generation_call", as raw base64 with no data URL prefix.src/muse-client.ts'sextractB64Imagesnow recognizes bothb64_json(kept for other possible shapes) and this verified shape.No
output_formatfield: the response has none. The original fallback default of"png"was wrong — since the iterate request doesn't send anoutput_formatparameter, Meta applies the same default as/images/generations, which iswebp. The returned base64 decodes to a genuine WebP file (RIFF/WEBP header). The fallback is now"webp".
Multi-turn conversation is verified
Two real API calls were made in sequence: one iterate_image to obtain a response_id, then a second call using that id as previous_response_id. The second turn returned only the one image generated in that turn — it did not re-send the first turn's image. extractB64Images's deep-traversal logic needed no changes for this.
(The test tooling in that run didn't capture the second turn's raw response byte-for-byte, so this conclusion rests on filesystem evidence — exactly one output file, with no -2/-3 suffixes — rather than a byte-level comparison. The pinning test added in tests/muse-client.test.ts uses the real response shape verified earlier.)
Pricing
US$0.01 per generated image, regardless of reasoning_strength. Every tool response discloses the estimated cost of that call.
This server is free and MIT-licensed — you pay Meta for API usage, nothing else.
Development
npm test # Unit tests (never hits the real API)
npm run build # Compile to dist/
npm run smoke # Real-API smoke test; needs MUSE_E2E=1 and a real key. Generates 6 images, about US$0.06License
MIT © Kevin Tsai
Available Tools
3 toolsedit_imageMuse 依圖改圖A
以 Meta Muse 模型依既有圖片與指令生成新圖。images 可填本機檔案路徑或 http(s) 網址,本機檔案會自動轉成 base64,呼叫端不需自行處理。結果存到本機並回傳絕對路徑。每張圖片成本 US$0.01。
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | 生成張數,1 到 10,預設 1 | |
| size | No | 長寬比字串,例如 "1792x1024"、"1024x1536"。注意:這是長寬比而非精確像素解析度 | |
| model | No | 模型 ID,省略則使用伺服器設定的預設模型 | |
| images | Yes | 參考圖片,可為本機檔案路徑(png/jpg/jpeg/webp/gif)或 http(s) 網址 | |
| prompt | Yes | 修改指令,描述你要如何改這張圖 | |
| extra_params | No | 傳給 API 的額外參數(物件),用於新模型的特殊參數。會與伺服器全域設定合併,單次設定優先。與請求核心欄位(model、prompt、response_format 等)衝突的 key 會被忽略並在回應中提示。 | |
| output_format | No | 輸出格式,預設 png | |
| filename_prefix | No | 輸出檔名前綴,預設 muse-edit | |
| reasoning_strength | No | 推理強度,預設 high(品質較佳但較慢) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses that local paths are auto-encoded to base64 (caller needn't handle it), that results are written to disk and an absolute path is returned, and that each image costs US$0.01. Missing only failure behavior and any auth/rate-limit context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four tightly packed sentences, each earning its place: purpose, input handling, output location, and cost. The purpose is front-loaded and no sentence is redundant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a nine-parameter tool with a nested extra_params object and no output schema, the description covers the essentials: what it produces, where output goes, and cost. It does not address error handling or synchronous-vs-async behavior, but the rich schema fills most parameter detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all nine parameters, establishing a baseline of 3. The description reinforces the images parameter (local path or URL with automatic base64 conversion), but this largely overlaps the schema rather than adding new meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource: generate a new image from an existing image plus a prompt using the Meta Muse model. This implicitly separates it from generate_image (which presumably starts from scratch), but it never names or contrasts with siblings such as iterate_image, leaving that distinction to inference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It implies you use this when an existing image exists ('依既有圖片'), but offers no explicit when-to-use guidance and no routing between edit_image, iterate_image, and generate_image. An agent must guess which sibling to pick for a given modification workflow.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageMuse 文字生圖A
以 Meta Muse 模型從文字描述生成圖片。圖片會存到本機並回傳絕對路徑(不回傳圖片內容本身,需要看圖請用檔案讀取工具開啟該路徑)。size 參數是長寬比而非精確像素解析度。每張圖片成本 US$0.01。
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | 生成張數,1 到 10,預設 1 | |
| size | No | 長寬比字串,例如 "1792x1024"、"1024x1536"。注意:這是長寬比而非精確像素解析度 | |
| model | No | 模型 ID,省略則使用伺服器設定的預設模型 | |
| prompt | Yes | 圖片描述,英文通常效果較佳 | |
| extra_params | No | 傳給 API 的額外參數(物件),用於新模型的特殊參數。會與伺服器全域設定合併,單次設定優先。與請求核心欄位(model、prompt、response_format 等)衝突的 key 會被忽略並在回應中提示。 | |
| output_format | No | 輸出格式,預設 png | |
| filename_prefix | No | 輸出檔名前綴,預設 muse | |
| reasoning_strength | No | 推理強度,預設 high(品質較佳但較慢) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and delivers high-value behavior: output is written to local disk and only an absolute path is returned (not image bytes), the size field is an aspect ratio rather than pixel dimensions, and there is a per-image cost of US$0.01. Those are exactly the traits an agent cannot get from the schema; it doesn't cover failure modes or auth, hence not a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each carrying distinct and load-bearing information (purpose, return-value behavior, size semantics, cost), with the core purpose front-loaded and zero filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema and no annotations, so the description must (and does) explain the non-obvious return contract — a file path instead of image content — plus cost. Given full parameter coverage elsewhere, the only missing context is edge-case/error behavior and whether existing files are overwritten.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so every parameter including n, size, model, extra_params, output_format and reasoning_strength is already documented. The description's note that size is an aspect ratio duplicates the schema's own wording, so it adds essentially nothing beyond structured data — baseline 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource — generating images from text via the Meta Muse model — which an agent can distinguish from edit_image/iterate_image by the 'from text description' framing. It stops short of explicitly naming or contrasting the siblings, so it lands at clear-but-undifferentiated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies its use case (text-to-image) and even routes the agent downstream ('to view the image, use the file reading tool on that path'), but gives no explicit when-to-use vs edit_image/iterate_image guidance or prerequisites. Usage is inferable rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
iterate_imageMuse 對話式迭代修圖A
以對話方式多輪迭代修改圖片。回傳中一定包含 response_id;下一輪修改時把它填入 previous_response_id 即可延續同一段對話,本 server 不保存任何對話狀態。每張圖片成本 US$0.01。
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | 模型 ID,省略則使用伺服器設定的預設模型 | |
| images | No | 首輪參考圖,本機路徑或 http(s) 網址 | |
| prompt | Yes | 本輪的修改指令 | |
| extra_params | No | 傳給 API 的額外參數(物件),用於新模型的特殊參數。會與伺服器全域設定合併,單次設定優先。與請求核心欄位(model、prompt、response_format 等)衝突的 key 會被忽略並在回應中提示。 | |
| filename_prefix | No | 輸出檔名前綴,預設 muse-iter | |
| reasoning_strength | No | 推理強度,預設 high | |
| previous_response_id | No | 上一輪回傳的 response_id;省略代表開始一段新對話 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It usefully discloses statelessness, the response_id/previous_response_id continuation mechanism, and cost per image, though auth/rate limits and full return behavior are not covered.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with purpose, then continuation mechanics, then cost. No filler or redundant framing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, yet the description only states that response_id is always included and does not explain the image output or other return fields. For a seven-parameter tool with nested extra_params and no annotations, this leaves meaningful gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all seven parameters are already documented in the schema. The description restates the previous_response_id workflow and cost but adds little parameter-specific semantics beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 多輪迭代修改圖片. The multi-round iterative scope implicitly distinguishes it from generate_image and edit_image, but no sibling is named explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance versus generate_image or edit_image. The multi-round dialogue context is implied by the description but not framed as routing guidance.
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.
3 tool updates
v0.1.0- First observed
edit_image - First observed
generate_image - First observed
iterate_image
TDQS
Scored across 3 tools
generate_image (text-to-image) is clearly distinct, but edit_image (single-turn edit from existing images) and iterate_image (multi-turn conversational edit) overlap in purpose. The descriptions do clarify the difference via the response_id/previous_response_id mechanic, so an agent can likely distinguish them.
All three tools follow a consistent verb_noun pattern: generate_image, edit_image, iterate_image. The convention is predictable and uniform.
Three tools is on the lean side but appropriate for a focused image generation/editing service. Each tool covers a distinct mode (create, single edit, iterative edit), though the surface feels slightly thin.
The core image workflow (generate, edit, iterate) is covered, and tool outputs return file paths with clear semantics. Missing extras like batch generation, upscaling, or listing past generations are minor gaps an agent can work around.
Related MCP Connectors
Edit images over MCP with object removal, background removal, and guided generative edits.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate AI images and videos from any compatible MCP client.
AI image, video, voice and music generation over MCP, routed to Veo 3.1, Seedance 2.0 and more.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered image generation using Google's Gemini 2.5 Flash Image Preview model, supporting text-to-image and image-to-image generation through the MCP interface.-
- AlicenseAqualityAmaintenanceEnables image generation via MiniMax's API through MCP, supporting text-to-image, batch generation, aspect ratios, seed reproducibility, and image-to-image with character references.129MIT
- AlicenseNot gradedqualityBmaintenanceGenerates and edits images using OpenAI image models via MCP tools.MIT
- AlicenseAqualityBmaintenanceGenerates and edits images using OpenAI GPT Image or Google Gemini models, saving every result to disk and returning local file paths so AI assistants can continue working with the images. It enables prompt-based image creation, editing, inpainting, multi-image composition, and model listing through MCP tools.131Apache 2.0