AI image generation and editing via CLI or MCP. Text-based editing, multi-provider.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
AI image generation and editing MCP server. Works with Claude Code, Gemini CLI, Cursor, Windsurf, and any MCP-compatible tool.
Generate images from text, edit existing images with text instructions, iterate on results β all from your AI coding environment.
Add to your tool's MCP config (.mcp.json, settings.json, etc.):
That's it. Your AI agent can now generate and edit images.
Windows: Replace
"command": "npx"with"command": "cmd"and prepend"/c"to the args array.
For Claude Code users, imgx-mcp includes an image-generation skill β a guided prompt that teaches Claude how to use the MCP tools effectively. With the skill installed, type /image-generation to start a guided workflow.
Copy the skill directory from the npm package or GitHub repository to your project:
Or place skill files manually:
The skill files are included in the npm package under skills/ and in the GitHub repository.
Personal skill (all projects): Place in
~/.claude/skills/image-generation/instead of.claude/skills/.
Claude Desktop supports skills via ZIP upload:
image-generation-skill.zip from the repository (or find it in the npm package under dist/)Update the skill by re-downloading and re-uploading the ZIP after new releases.
The MCP server gives the AI the ability to generate and edit images. The Skill adds the knowledge of how to use those tools well β so you don't need to learn prompt syntax, model specifications, or service-specific parameters.
The image generation models already have these capabilities. The Skill is what makes them accessible without specialized knowledge.
| MCP server | Skill | |
|---|---|---|
| What it does | Exposes image tools to AI agents | Guided prompt for using the tools |
| Works with | Any MCP-compatible tool | Claude Code, Claude Desktop |
| Install | Add to .mcp.json | Copy skill files to project |
| Team sharing | Commit .mcp.json to repo | Commit .claude/skills/ to repo |
Recommended: Set up the MCP server (Quick start) + install the skill if you use Claude Code.
| Tool | Description |
|---|---|
generate_image | Generate an image from a text prompt |
edit_image | Edit an existing image with text instructions |
edit_last | Edit the last generated/edited image (no input path needed) |
undo_edit | Undo the last edit, reverting to the previous image in the session |
redo_edit | Redo a previously undone edit |
edit_history | Show all sessions and their edit history with metadata |
switch_session | Switch to a different editing session |
clear_history | Clear project history (optionally delete image files) |
set_output_dir | Change the default output directory (optionally move existing files) |
list_providers | List available providers and capabilities |
The .imgx/ directory holds both edit history and default image output. Its location depends on project root detection:
| Project root | .imgx/ location | History |
|---|---|---|
| Detected | <project-root>/.imgx/ | <project-root>/.imgx/output-history.json |
| Not detected | ~/Pictures/imgx/ (images only) | ~/.config/imgx/output-history.json (global) |
All clients that resolve to the same project root share the same history. Each session gets its own subdirectory. File paths are returned in the response. Inline image preview is included in MCP responses (base64).
The edit_last tool uses the output of the previous generate_image or edit_image call as input. This enables a conversational workflow:
No need to specify file paths between steps.
Each generate_image call starts a new session. Subsequent edit_last calls are added to the same session, forming an edit chain. Each session has its own output directory.
Undo / Redo β Step backward and forward through the edit chain:
After undo, calling edit_last branches from the current position (abandoned entries and their files are deleted from disk).
File naming β edit_last generates sequential filenames based on the origin file:
Session switching β Use edit_history to see all sessions, then switch_session to resume a previous session. The edit_last tool will use the current position in the switched session.
Output directory β edit_last inherits the output directory from the session. If generate_image was called with output_dir, all subsequent edit_last calls in that session output to the same directory. The output_dir path is recorded as session metadata in output-history.json. This only affects where image files are saved β history always stays in .imgx/ (or the global config directory).
Set up at least one provider:
Gemini β get a key from Google AI Studio (free tier available for gemini-2.5-flash-image):
OpenAI β get a key from OpenAI Platform:
Keys are stored in ~/.config/imgx/config.json (Linux/macOS) or %APPDATA%\imgx\config.json (Windows). Alternatively, pass keys via the env section in your MCP config, or set environment variables:
Only include the API keys for providers you want to use. At least one is required.
.mcp.json in your project root:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/imgx-2)<a href="https://allmcps.com/mcp/imgx-2"><img src="https://allmcps.com/api/badge/imgx-2?style=directory" alt="Imgx on AllMCPs" /></a>