Large Language ModelsGenerate imagesGenerate videos
Image Generation MCP for Claude Code: Setup and Best Servers
Claude Code writes your pages but cannot draw their images. This article walks through registering an image generation MCP server, choosing the right scope, comparing the most-used servers, and connecting PicassoIA for images and video, with fixes for common errors.
Claude Code can build a landing page in minutes, but it cannot draw the hero image for it. Ask for a banner, a product mockup, or a set of blog thumbnails and you get SVG code, a placeholder path, or a polite "I can't generate images." An image generation MCP server closes that gap. Once it is registered, Claude Code calls an image model as a tool, saves the file inside your repo, and wires it into the HTML or markdown it is already editing, all in one session.
This article shows how the pieces connect, the exact commands to register a server, a side-by-side comparison of the options people actually use, and how to hook up PicassoIA's connector for images and video. The commands follow the current Claude Code documentation. Anything I could not confirm, such as a private server URL, appears as a placeholder instead of a guess.
Why Claude Code Needs an Image Tool
The gap in a text-only agent
Claude Code works in your terminal, reads your files, runs commands, and edits code. That loop is fast until the first <img> tag. Then you leave the session, open a separate generator, download a file, rename it, drop it in the right folder, and paste the path back. Every hop breaks the flow, and the prompt you wrote never sees the page it was meant for.
What the MCP layer adds
MCP, the Model Context Protocol, is an open standard that lets an AI client call external tools. An image server exposes one or more tools, usually something like generate_image, and Claude Code lists them under a predictable name: mcp__<server-name>__<tool-name>. A server called image-gen with a generate_image tool shows up as mcp__image-gen__generate_image.
With that in place, a single request does the whole job:
Claude Code reads the page and writes an image prompt that fits it
The server sends the prompt to a model provider
The file lands in your project folder, or a URL comes back
Claude Code edits the markup to point at the image and writes the alt text
💡 Tip: Keep the server name short and lowercase. You will see it in every tool call and permission prompt, and image-gen reads better than a long product name.
How the Connection Works
Client, server, provider
Three parts are involved, and mixing them up causes most setup confusion.
Part
What it is
Example
Client
The app that calls tools
Claude Code
Server
A process or hosted endpoint that speaks MCP
mcp-image, a PicassoIA connector
Provider
The platform that runs the image model
OpenAI, Google, Replicate, PicassoIA
The server is the translator. It accepts a tool call from Claude Code, turns it into a request the provider accepts, and hands the result back. Claude Code supports four transports: stdio, http, sse, and ws. In practice you pick between two. stdio starts a local process on your machine, usually through npx. http points at a remote URL that someone else keeps running.
Where the image lands
Servers handle output in two ways, and the difference matters. Some save the file to disk and return the path. mcp-image writes to a folder you set, and create-image-mcp returns file metadata rather than base64 data. Others return a URL or inline image data.
Claude Code's documentation states that images in tool results count against the MAX_MCP_OUTPUT_TOKENS limit. A warning appears at 10,000 tokens and the default ceiling is 25,000. A server that returns a short path or a URL stays far under that line. One that returns large inline images can hit it fast.
Setup in Five Steps
Install Claude Code and confirm it runs with claude --version.
Create an account with an image provider and copy the access credential it gives you.
Everything before -- belongs to Claude Code. Everything after it goes to the server untouched. Forget the -- and the CLI tries to read your server's flags as its own. The exact variable name comes from the server's README, because each provider uses its own.
For a hosted server, switch the transport to http:
⚠️ Windows users: On native Windows, outside WSL, servers launched with npx need a wrapper: claude mcp add --transport stdio image-gen -- cmd /c npx -y mcp-image. Without it the server can fail to start.
Choose a scope
Scope
Stored in
Who sees it
Use it for
local (default)
~/.claude.json, under your project
Only you, one project
Trying a new server
project
.mcp.json in the repo root
Everyone who clones the repo
Team-standard tooling
user
~/.claude.json, top level
Only you, every project
Personal tools
Add --scope project or --scope user to the command. When the same name exists in several scopes, local wins over project, and project wins over user.
Project scope suits image work because a whole team gets the same setup. Do not commit credentials, though. .mcp.json supports ${VAR} expansion in command, args, env, url, and headers, so the file carries a reference and each developer supplies the value from their own shell:
Claude Code asks for approval before it runs a server from a project .mcp.json, so a teammate's first session shows a pending approval status until they accept it.
Check the connection
Run claude mcp list. Each server gets a status: Connected, Failed to connect, Needs authentication, or Pending approval. claude mcp get image-gen prints the details of one server. Inside a session, /mcp opens the same panel, and /mcp reconnect all retries anything that failed.
Then test with a small request: "Generate one 16:9 image of a ceramic mug on a wooden desk and save it to public/images/test.jpg." If the tool call appears as mcp__image-gen__generate_image and a file shows up in the folder, the server works.
Best Servers Compared
The table below comes from each project's own listing, so check the README for current options before you install. I have not benchmarked image quality across them, because quality depends on the model behind a server far more than on the server itself.
Server
Models behind it
Install
Output
Best for
mcp-image
Gemini (default), OpenAI, BytePlus Seedream
npx -y mcp-image
Saved to IMAGE_OUTPUT_DIR
One server, three providers
create-image-mcp
OpenAI GPT Image
npm install -g @gpriday/create-image-mcp
Saved to disk, path returned
OpenAI users who need masks and inpainting
Replicate community servers
Models hosted on Replicate
Python package from PyPI
Varies by server
Wide model choice, batch jobs
FLUX community servers
FLUX models
Local Python script
Varies by server
Self-managed setups
PicassoIA connector
PicassoIA image and video models
Connector or http URL
Result URLs after polling
Images and video in one place
Local servers you run yourself
mcp-image exposes a single generate_image tool that handles text-to-image and editing from an input image. It offers fast, balanced, and quality presets, and aspect ratios up to 21:9. You set one credential for whichever provider you choose, plus an absolute output folder.
create-image-mcp is OpenAI only. Its create_image tool supports sizes up to 4K, quality settings, transparency, several variations per call, and masks for inpainting. It saves to disk and replies with a path, which keeps the token cost small.
Replicate community servers such as mcp-server-replicate expose text-to-image, image-to-image, and editing across whatever Replicate hosts, and one of them processes up to 5 images at a time. Pick this route when you want to switch models often.
The trade-off with every local server is upkeep. You manage Node or Python versions, you pay the provider directly, and you update the package yourself.
Hosted servers and connectors
A hosted server removes the install step. You add a URL and a credential, and the provider runs everything else. Claude Code retries a dropped remote connection up to five times with growing delays, so brief outages heal without your help. The cost is dependence on someone else's uptime and plan rules.
Claude Code also loads connectors from your claude.ai account when you sign in with it. They sit at the lowest precedence, below local, project, and user servers, and setting ENABLE_CLAUDEAI_MCP_SERVERS=false switches them off.
Using PicassoIA From Claude Code
PicassoIA gives you image generation, editing, and video behind one connector, which suits projects that need a still image and a matching short clip.
What the connector exposes
The PicassoIA connector offers nine tools: generate_image, edit_image, generate_video_picassoia, generate_video_seedance, get_generation, list_generations, list_models, get_account, and cancel_generation.
Generation is asynchronous. A generate call returns a predict_id as soon as a GPU accepts the job, and get_generation reports the status until it reads succeeded or failed. Claude Code runs that polling loop for you once you ask for the result.
The developer API behind it follows a Replicate-style design. The base URL is https://api.picassoia.com/v1, authentication is a Bearer secret that starts with pia_sk_, and the main endpoints are POST /v1/models/{owner}/{name}/predictions and GET /v1/predictions/{id}. Plan around these limits:
5 concurrent predictions per account, shared across every secret and MCP connection
4,000 characters per prompt
10 MB per request body
3 hours before a prediction times out
💡 Check your plan first. PicassoIA lists API and MCP access on its pricing page, and the details can differ between plans. Confirm that your plan includes it before you build a workflow around it.
Video with audio, listed for clips up to 10 seconds
The wider PicassoIA catalog holds many more image models, including GPT Image 2, Seedream 5 Lite, Flux 2 Pro, and Nano Banana 2. Try a prompt in the web app first, pick the look you like, then ask Claude Code to reproduce it.
For the text side of the job, the same catalog lists Claude Sonnet 5 and Claude Opus 4.7, handy for drafting prompt variations before you paste them into a session.
Adding video to the loop
A still image and a short clip often belong together, such as a hero photo and a looping banner. Ask Claude Code to generate the still with PicassoIA Image, then pass the result to a video tool as the starting frame. Run one video at a time, because each job takes a share of your five concurrent slots.
How to Use PicassoIA Image
Check access. Open your PicassoIA account and confirm API and MCP access on your plan.
Connect. Add the PicassoIA connector to your claude.ai account, or register an http server with the URL from your account's MCP connections page at picassoia.com/en/mcp/accounts. PicassoIA does not publish that URL on its public pages, so copy it from your account.
Verify. Run claude mcp list, or type /mcp in a session, and confirm PicassoIA shows as connected.
List models. Ask: "List the PicassoIA models my account can use." Claude Code calls list_models.
Generate. Ask for the image with a size and a destination, for example "16:9 hero image of a walnut desk in morning light, save it as public/images/hero.jpg."
Download. Claude Code polls get_generation, then fetches the result URL into your folder and updates the markup.
Image prompts inside Claude Code have one advantage over a web form: the agent can see your file. Use that. Describe the job of the image, not only its content, and name the file path and the size so nothing needs a second round.
Weak request
Strong request
"Make a nice header image"
"16:9 header for the pricing page, a ceramic cup on a walnut desk, window light from the left, no text"
"Add some pictures"
"Generate 3 images, one per section heading in features.html, and save them in public/images/"
"Fix the image"
"Edit hero.jpg: warmer tones, remove the cable in the lower left corner"
Three habits save the most time:
Ask for one image first. Check the style, then request the rest in a batch of five or fewer.
Request alt text in the same message. Claude Code writes it while the scene is fresh in context.
Save the rules once. Put them in your project's CLAUDE.md file so every session starts with the same defaults.
## Images
- Generate images with the image-gen server, 16:9 unless the layout says otherwise
- Save to public/images/ with lowercase hyphenated names
- Write one-sentence alt text that describes the scene
- Photographic style, natural light, no text inside the image
💡 Tip: Name the output folder in CLAUDE.md, not in every prompt. That single line stops files from landing in your repo root.
Fixing Common Errors
Server shows as failed
Run the server command by hand in a normal terminal. A missing Node install, a typo in the package name, or an unset environment variable shows up immediately. Next, check that -- sits between the Claude options and the server command. On Windows, add the cmd /c wrapper from earlier. If the server is just slow to start, raise the startup limit, for example MCP_TIMEOUT=10000 claude, which is measured in milliseconds. Then run /mcp reconnect all.
Images blow past the token limit
If a tool result trips the warning at 10,000 tokens, the server is probably returning inline image data. Switch to a server that saves to disk or returns a URL. Raising the ceiling with MAX_MCP_OUTPUT_TOKENS=50000 claude works as a last resort, but it spends context you would rather keep for code.
Slow or stuck generations
Claude Code moves tool calls that run longer than two minutes into a background task, which you can watch in /tasks. With an asynchronous connector, a slow job is usually a full queue. Asking for twelve images at once on an account limited to five concurrent predictions means seven of them wait. Request five at a time, and use cancel_generation for a job you no longer need.
Make Your First Image Today
The setup takes about ten minutes: one command, one scope choice, one test prompt. After that, every page Claude Code builds can ship with its own photographs instead of placeholder boxes.
Start small. Try a prompt in PicassoIA Image, refine one result with PicassoIA Image Editor Pro, then animate your favorite with PicassoIA Video. When the look is right, hand the same prompt to Claude Code and let it run the loop inside your project. Browse the full model list at picassoia.com/en/all-models and create your own images with Picasso IA today.