imagent
Integrates with OpenAI's GPT Image models to generate and edit images, including variations, transparent backgrounds, SVG and GIF output, masks, and multi-reference image editing.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
imagent
Image generation for your agents.
An MCP server that lets coding agents (Claude Code, Claude Desktop, Cursor, Windsurf, VS Code and any other MCP client) generate, edit and post-process images and save them straight into your project.
It currently runs on OpenAI's GPT Image models (gpt-image-2.6-flare / gpt-image-2.6-sunburst). The provider layer is pluggable, so other backends can be added without changing the tools.
Tools
Tool | What it does | Costs money? |
| Text → image. PNG/JPEG/WebP, transparent backgrounds, SVG vector output, short GIF animations, custom sizes up to 3840px, 1–N variations. | Yes |
| Image(s) + instruction → new image. Restyle, recolor, remove backgrounds, add or remove objects, or make a new asset that matches up to 16 reference images. Supports | Yes |
| Local, deterministic ops: resize, crop, trim, pad, rotate, flip, blur, grayscale, flatten, and convert/compress to png/jpeg/webp/gif. Good for exact sizes (favicons, OG images, sprites). | No |
| Dimensions, format, size, frame count, and whether the image actually has transparent pixels. | No |
Every result includes the saved file path, dimensions, a transparency check and a small preview image, so the agent can look at what it made and iterate.
Related MCP server: MCP Image Generator
Quick start
You need an OpenAI API key with image access.
Claude Code
claude mcp add imagent -e OPENAI_API_KEY=sk-... -- npx -y @1mrnewton/imagentCursor (~/.cursor/mcp.json) / Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"imagent": {
"command": "npx",
"args": ["-y", "@1mrnewton/imagent"],
"env": { "OPENAI_API_KEY": "sk-..." }
}
}
}Using Bun? Swap npx -y for bunx.
Generating at high quality can take 30–90 seconds. If your client times out, raise its MCP tool timeout (e.g.
MCP_TOOL_TIMEOUT=180000for Claude Code).
Configuration
All settings are environment variables:
Variable | Default | |
| — | Required. |
|
| Where files go when no absolute |
|
| Default model for |
|
| Default model for |
|
| Default quality: |
|
| Text model that writes SVG code when |
|
| Most images per call, so a looping agent can't drain your credits. |
|
| Longest edge of the preview returned to the model. |
|
| OpenAI request timeout. |
| — | Optional, e.g. for a proxy or gateway. |
Behavior notes
Never overwrites an existing file unless
overwrite: true. It savesname-v2.pnginstead.output_pathending in/is treated as a directory, and the file gets an automatic name from the prompt.The
output_pathextension picks the format whenformatisn't given (hero.webp→ WebP).Inputs can be local paths,
~/paths,file://,http(s)://ordata:URLs. SVG and GIF inputs are converted to PNG before editing.SVG output is generate-only with
n=1. An image model draws a reference and a text model (svg_model) writes the SVG. GIF output is generate-only.Without
size,edit_imageresizes its result back to the source dimensions, so edited assets drop in as replacements.Previews are small JPEGs, with transparent areas shown on a checkerboard, to keep the agent's context small.
Transparent backgrounds need PNG, WebP or GIF.
Costs
OpenAI bills image output by quality and size, plus input tokens for prompts and reference images. See OpenAI's pricing page for current rates. Draft with quality: "low" and make finals at high. process_image and inspect_image are always free.
Development
bun install
bun run dev # run the server over stdio
bun run inspect # open the MCP Inspector against it
bun run typecheck
bun run build # bundle to dist/ (runs on Node ≥ 20 or Bun)To point a client at your local checkout instead of npm:
{ "command": "bun", "args": ["run", "/absolute/path/to/imagent/src/index.ts"], "env": { "OPENAI_API_KEY": "sk-..." } }Adding a provider
Implement
ImageProviderfromsrc/providers/types.ts(generateandedit).Register it in
src/providers/index.ts.Select it with
IMAGENT_PROVIDER=<id>.
The tools, file handling, previews and process_image stay the same for every provider.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate on-brand images from your AI agent: design, edit, and render templates over MCP.
Image infrastructure for agents. Upload, transform, and deliver images through MCP, CLI, or API.
Edit images over MCP with object removal, background removal, and guided generative edits.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants and MCP clients to generate and edit images, automatically enriching prompts with visual details and quality presets across Gemini, OpenAI, and BytePlus Seedream, with results saved to disk.2,138 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables any MCP client to create and edit images from natural-language requests, automatically enriching short prompts with composition, lighting, and camera details while supporting Gemini, OpenAI, and BytePlus Seedream with fast, balanced, or quality presets.2,138 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents and other MCP clients to generate images from text prompts and edit, restyle, or extend existing images through an OpenAI-compatible /v1/images API. Results are returned both inline as image content blocks and as files saved to disk, so agents can view and reuse them within a normal task.28 npm1MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP clients to generate and edit images from natural-language requests, automatically enriching prompts with details like composition, lighting, and camera angle. It supports quality presets and multiple providers, including Gemini, OpenAI, and BytePlus Seedream.2,138 npmMIT