How to Give Your AI Agent Image Generation (MCP Guide, 2026)
Wire image generation into any MCP-compatible agent. Complete setup for Claude Desktop, ChatGPT, and custom agents using remote or local MCP endpoints. Free 25 credits to start.
What Makes an Agent Image-Capable?
An MCP-compatible agent becomes image-capable by connecting to an MCP server that exports image tools. MediaEngine provides those tools through both local (`npx`) and remote (https://mcp.mcpmediaengine.com/mcp) endpoints.
The key difference: **local MCP runs on your machine; remote MCP is HTTP-accessible from anywhere**.
Setup: Claude Desktop (Local)
Step 1: Get Your API Key
Sign up at mcpmediaengine.com and create an API key. You'll receive a live key like `me_live_xyz...` and 25 free credits.
Step 2: Configure Claude Desktop
Open `~/.claude/claude.json` (macOS/Linux) or `%APPDATA%/Claude/claude.json` (Windows) and add:
{
"mcpServers": {
"mediaengine": {
"command": "npx",
"args": ["-y", "mcp-media-engine"],
"env": {
"MEDIAENGINE_API_KEY": "me_live_your_key_here"
}
}
}
}Step 3: Restart Claude
Quit and reopen Claude Desktop. The image tools are now available.
Step 4: Generate an Image
Simply ask Claude: "Generate an image of a sunset over mountains, 16:9 aspect ratio, vibrant colors"
Claude will use the tool and display the result inline.
Setup: ChatGPT (Remote Endpoint)
For ChatGPT or cloud-based agents, use the hosted remote endpoint. No local installation needed.
Configure Your Agent
{
"mcpServers": {
"mediaengine": {
"url": "https://mcp.mcpmediaengine.com/mcp",
"env": {
"MEDIAENGINE_API_KEY": "me_live_your_key_here"
}
}
}
}The remote endpoint works identically to local — same tools, same syntax, no code changes.
Setup: Custom Agents
For Node.js agents or custom deployments:
const client = new MediaEngineClient({ apiKey: process.env.MEDIAENGINE_API_KEY });
// Call image generation directly const result = await client.generateImage({ prompt: 'A watercolor painting of a forest', model: 'nano-banana', aspectRatio: '16:9' });
console.log(result.imageUrl); ```
Available Models
- **nano-banana**: Speed-optimized, 1 credit per image (~7¢)
- **gpt-image-2**: Higher quality, 4 credits per image (~28¢)
- **seedance**: Video-capable, 2-3 credits per frame
Aspect Ratios
1:1, 16:9, 9:16, 21:9, 9:21, 3:2, 2:3, 5:4, 4:5, 4:3, 3:4
Common Pitfalls
**"Tool not found"** — Restart Claude after editing `claude.json`.
**"Invalid API key"** — Verify the key starts with `me_live_` and matches exactly.
**"Network timeout"** — If using remote MCP, check your internet connection; remote should respond in <1s.
**Slow generation** — First generation takes ~7s (warming up). Subsequent calls are faster.
Next Steps
- Explore [async job patterns](/blog/async-media-generation-for-ai-agent-pipelines) for high-volume workflows
- Learn [cost optimization strategies](/blog/how-much-does-ai-image-generation-cost-for-an-automated-content-pipeline)
- Try [img2img style transforms](/blog/ai-image-styles-compared-watercolor-cartoon-claymation)