Image generation in Claude Desktop: MCP server setup
Open Settings → Developer → Edit Config, add one mcpServers entry to claude_desktop_config.json, then quit and reopen Claude. The Image MCP Server’s 8 image tools appear in the conversation. Claude is very good at deciding what an image should look like and completely unable to produce one. One server entry closes that gap: generate, edit, cut out, upscale and vectorise, with a URL handed back in the same message.
You
Make a hero image for a page about slow coffee. Wide, warm, no text in the picture.
Claude
→ generate_image({ aspectRatio: "21:9" })
Here it is — hosted at a URL you can drop straight into your markup. Want it cut out, or upscaled for print?
Four steps, once
- 1
Create an API key
Sign in and open the dashboard. Keys start with
sk-img-gen-and are shown once — copy it before you close the dialog. - 2
Open the config file
The quickest route is Settings → Developer → Edit Config, which opens the file for you. The per-platform paths are in the next section if you would rather open it directly.
- 3
Paste the server entry
Use the JSON on the right. If you already have an
mcpServersblock, addimagemcpalongside what is there. - 4
Quit and reopen Claude
A full quit, not just closing the window. On reopening, the image tools appear in the tool list.
{
"mcpServers": {
"imagemcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.imagemcpserver.com/mcp",
"--header",
"x-api-key:sk-img-gen-your_key_here"
]
}
}
}Config paths by platform
If the file does not exist yet, create it — the JSON above is a complete file on its own.
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Config file or connector?
Claude Desktop can also add remote MCP servers as custom connectors under Customize → Connectors. Anthropic’s help centre now documents a Request headers field there for servers that authenticate with an API key, so either route can carry this server’s key. They differ in where the connection comes from and who holds the key.
Custom connector + request header
Add the endpoint URL, choose No sign in under Authentication, and put x-api-key: sk-img-gen-… under Request headers. Skip the OAuth options — this server has no OAuth flow to complete. Free plans are limited to one custom connector, and on Team and Enterprise plans only owners can add one, with everyone who uses it sharing that key.
Config file + mcp-remote
The bridge passes an arbitrary header through from your own machine, with your own key and no plan or admin requirement. Slightly more setup, and it needs Node.js for npx.
ChatGPT has a custom-connector route as well, but its connector form takes a URL rather than request headers, so the key travels in the query string there. The ChatGPT MCP connector guide covers that trade-off and the API routes around it.
One difference worth knowing either way
Custom connectors are brokered through your Claude account: the connection to the MCP server originates from Anthropic’s infrastructure, not from your machine. A server configured in claude_desktop_config.json uses your own network instead. That distinction matters if you ever point a client at something behind a VPN or a corporate firewall.
Check it worked
Ask Claude a question that forces a tool call rather than a guess:
“How many image credits do I have left?”
Claude should call get_user_info and answer with a real number. That call is free, so it costs nothing to test the connection. If it answers from memory or says it cannot, the server is not loaded.
If it is not loading
The JSON is invalid
A trailing comma or a missing brace makes Claude skip the whole file silently — every server disappears, not just the one you edited. Paste it into any JSON validator.
Claude was not fully quit
On macOS, closing the window leaves the app running. Use Quit, then reopen.
Node is missing
The config runs npx. Check with node --version in a terminal.
The key is wrong or revoked
Test it directly: curl the /v1/me endpoint with the key and see whether you get an account back.
Things worth asking once it is connected
“Generate three logo concepts for a bakery as SVG, then show me the code for each.”
text_to_svg × 3
“Upscale this product photo to high resolution, then remove the background.”
upscale_image → remove_background
“Make a 9:16 version of this hero image by extending the scene vertically.”
edit_image
“Generate six product shots in the same style — use this one as the reference.”
multicall + referenceImages
“Compress every image in this folder to WebP at quality 75.”
multicall + compress_image
“Which models can I use, and what does each one cost?”
list_models
Once Claude Desktop is connected
Claude Desktop gets the server’s 8 image tools, plus 3 utility tools for the credit balance, the model list and batching: 11 MCP tools in all. The ones most setups reach for first are the AI image generation API, Background removal API and AI SVG generator API; each page covers what the tool does and what a call costs. If the protocol itself is new to you, what is MCP explains how a client like Claude Desktop finds these tools and calls them.
- generate_image · 8–30 creditsAI image generation APIText-to-image and image-to-image, any live model
- remove_background · 8 creditsBackground removal APICut the subject out in one call
- text_to_svg · 5 creditsAI SVG generator APIGenerate editable vector SVG from a prompt
- Use caseAI featured images for blog postsThe complete workflow, with the calls in order and what each one costs.
Setting up another client too? The Claude Code MCP setup and ChatGPT MCP connector setup guides use the same endpoint and key in a different config shape.
Claude Desktop setup questions
How do I add an MCP server to Claude Desktop?
Open Settings, go to the Developer section and click Edit Config — that opens claude_desktop_config.json directly, which is easier than hunting for the file. Add an mcpServers entry, save, then quit Claude completely and reopen it. The tools appear in the conversation once the server loads.
Where does the Claude Desktop config file live?
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. Windows: %APPDATA%\Claude\claude_desktop_config.json. Linux builds use ~/.config/Claude/claude_desktop_config.json. If the file does not exist yet, create it — the JSON on this page is a complete file on its own.
Can I add this as a custom connector instead?
Anthropic’s help centre now documents a Request headers field for custom connectors, for servers that authenticate with an API key rather than OAuth. Add the endpoint under Customize → Connectors, choose No sign in under Authentication, and add x-api-key: sk-img-gen-… under Request headers. Do not pick an OAuth option: this server has no OAuth flow to complete. On Team and Enterprise plans only owners can add the connector, and everyone who uses it shares that key.
Do I need to install anything first?
Node.js, because the config uses npx to run the mcp-remote bridge. Nothing else — there is no package to install globally and no local server to keep running.
Claude does not see the tools. What went wrong?
Three usual causes: the config file has a trailing comma or other JSON error, Claude was not fully quit and reopened (closing the window is not enough on macOS), or the API key in the header is wrong. Check the developer settings for the server’s status, then ask Claude to list its tools.
Is my API key safe in that file?
It sits in a local config file on your own machine, in plain text, the same way every MCP server credential does. Treat it like an SSH config: do not commit it, and rotate the key from the dashboard if it leaks. Keys can be revoked individually.
Does this cost anything to try?
A little. New accounts start with 0 credits; the Testing plan is $5 once for 100 — three to twelve generations depending on the model, twelve background removals, or a hundred compressions.
Sources & references