
Imgx
io.github.somacoffeekyotoPublished by GitHub account somacoffeekyotov1.6.1Updated Oct 24, 2026
AI image generation and editing MCP server. Gemini + OpenAI, iterative editing, undo/redo.
Overview
Lets an AI assistant generate and iteratively edit images through Gemini or OpenAI image models, with session history, undo and redo.
- What you can do
- Exposes image tools to MCP-compatible clients: generate_image creates an image from a text prompt, edit_image edits an existing file with text instructions, and edit_last edits the previous output without needing a path. Session tools cover undo_edit, redo_edit, edit_history, switch_session, clear_history, set_output_dir and list_providers. History and default output live in a .imgx directory, and responses include file paths plus an inline base64 preview.
- When to use it
- Useful when you want image generation or editing inside a coding or chat assistant and want to refine results conversationally instead of re-specifying files each time. It suits workflows needing version control over images, such as iterating on a cover image, slide assets or social media graphics.
- Requirements
- Runs locally over stdio, typically via npx with the imgx-mcp npm package; Node.js 18+ is required. At least one provider key is needed: GEMINI_API_KEY or OPENAI_API_KEY, supplied through the MCP config env section, environment variables, or stored by the imgx config command. Network access to the chosen provider is required.
Installation
In SourceWeft
- Open Imgx in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
imgx-mcp
[npm version] [npm downloads] [Cursor Directory] [License: MIT]
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.
What sets imgx-mcp apart
- No prompt engineering — Your AI agent keeps conversation context and auto-constructs optimized prompts. Say what you need; the agent handles prompt structure, model selection, and platform-specific sizing
- 24 editing techniques built in — Atmosphere, composition, style transfer, element manipulation, and trending styles — bundled as a Skill your agent applies on demand
- Session management with undo/redo — Edit iteratively, step back to any point, branch off, or switch between parallel sessions — version control for images
Quick start
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.
Skill (Claude Code)
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.
Install the skill
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
Claude Desktop supports skills via ZIP upload:
- Download
image-generation-skill.zipfrom the repository (or find it in the npm package underdist/) - In Claude Desktop: Settings > Profile > Customize > Skills > Add Skill
- Upload the ZIP
Update the skill by re-downloading and re-uploading the ZIP after new releases.
What the Skill brings
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.
- Automatic prompt construction — Say "I need a cover image." The AI builds a structured prompt using the Subject-Context-Style framework: what to show, where to place it, how it should look
- 24 editing techniques — Atmosphere adjustment, composition changes, element manipulation, style transfer. "Make it warmer" or "add depth of field" — the AI selects the right instruction for the model
- Intelligent model selection — Starts with the free model. Suggests paid upgrades only when your needs exceed free tier capabilities, and explains what changes
- Platform-aware sizing — "Twitter OGP" or "App Store screenshot" — the AI picks the correct aspect ratio and resolution. Covers social media, OGP, app stores, print, and blog platforms
- Trending style templates — Ghibli, action figure in box, 3D clay, pixel art, chibi, and more. Name the style and the AI applies the right prompt structure
- Multi-image consistency — Design tokens and character DNA templates maintain visual coherence across slide decks, social media series, and brand assets
The image generation models already have these capabilities. The Skill is what makes them accessible without specialized knowledge.
MCP server vs Skill
Recommended: Set up the MCP server (Quick start) + install the skill if you use Claude Code.
MCP tools
The .imgx/ directory holds both edit history and default image output. Its location depends on project root detection:
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).
Iterative editing
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.
Session management
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).
API key setup
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 configuration by tool
Claude Code
.mcp.json in your project root:
Gemini CLI
~/.gemini/settings.json:
Claude Desktop
claude_desktop_config.json:
macOS / Linux:
Windows:
IMGX_PROJECT_ROOT — Set to your project path to save images inside the project (e.g. "C:\\Users\\you\\my-project"). Leave empty to use the global default (~/Pictures/imgx).
Config file location: %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS). After editing, restart Claude Desktop.
Note: Claude Desktop does not support auto-detection (MCP roots / CWD-based
.imgxrcsearch). UseIMGX_PROJECT_ROOTin the config above (per-client), or runimgx config set project-root /path/to/project(shared across all clients).
Codex CLI
.codex/config.toml:
Other tools
The same npx pattern works with Cursor, Windsurf, Continue.dev, Cline, Zed, and other MCP-compatible tools. On Windows, use cmd /c npx instead of npx directly.
Providers
Architecture
imgx separates model-independent and model-dependent concerns:
MCP server and CLI are two entry points into the same core. Both call the same provider functions.
Each provider declares its supported capabilities. Adding a new provider means implementing the ImageProvider interface and registering it — no changes to the MCP or CLI layer.
Capability system
CLI
imgx-mcp also works as a standalone command-line tool.
Install
Requires Node.js 18+.
Usage
CLI options
Configuration
Project config (.imgxrc)
Generate a template with imgx init:
Or create manually:
Project config is shared via Git. Do not put API keys in .imgxrc.
Project root configuration (3 tiers)
Detection priority: env var → MCP roots → .imgxrc upward search → user config projectRoot.
History is saved to <project-root>/.imgx/output-history.json (project-scoped, not shared with other projects). Default image output goes to <project-root>/.imgx/<session-id>/. Relative paths in output and output_dir are resolved against the project root instead of the MCP server's working directory.
Settings resolution
- CLI flags (
--model,--output-dir, etc.) - Environment variables (
IMGX_MODEL,IMGX_OUTPUT_DIR, etc.) - Project config (
.imgxrc— searched from current directory upward) - User config (
~/.config/imgx/config.jsonor%APPDATA%\imgx\config.json) - Provider defaults
Output format
All CLI commands output JSON:
Claude Code plugin
The plugin bundles MCP server + skill in one step. If you prefer not to configure .mcp.json and skill files manually:
Update: /plugin → installed → imgx-mcp → update. If the update shows no changes, uninstall and reinstall.
Uninstall: /plugin uninstall imgx-mcp@somacoffeekyoto-imgx-mcp then /plugin marketplace remove somacoffeekyoto-imgx-mcp.
Development
The build produces two bundles:
dist/mcp.bundle.js— MCP server entry pointdist/cli.bundle.js— CLI entry point
Uninstall
MCP server
Remove the imgx entry from your tool's MCP configuration file.
Skill
Delete the image-generation/ directory from .claude/skills/ or ~/.claude/skills/.
CLI
npm uninstall removes the package but does not delete configuration or generated files. Remove them manually if needed:
Global configuration:
Project history and images: Each project may have a .imgx/ directory containing edit history and generated images. Remove it from each project as needed.
License
MIT — SOMA COFFEE KYOTO
Links
Source: README.md at commit 840585c
Tools
0Version history
1- v1.6.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts