Skip to content
Back to search

mcp-image

MCP server for AI image generation and editing with automatic prompt optimization and quality presets. Supports Nano Banana (Gemini), OpenAI GPT Image, and BytePlus Seedream.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/shinpr/mcp-image with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/shinpr/mcp-image'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/shinpr--mcp-image/badge.svg)](/listings/shinpr--mcp-image)

HTML

<a href="/listings/shinpr--mcp-image"><img src="/api/listings/shinpr--mcp-image/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

You need Node.js 22 or later, an MCP-compatible client, and an API key for one image provider.

1. Get an API key

All three providers generate and edit images. Gemini is the default and requires the least configuration.

| Provider | Image size | Output format | Setup | |----------|------------|---------------|-------| | Gemini (default) | 1K, 2K, 4K | Automatic | [Get a key](https://aistudio.google.com/apikey), then set `GEMINI_API_KEY` | | OpenAI | 1K, 2K, 4K | PNG or JPEG | [Get a key](https://platform.openai.com/api-keys), then set `IMAGE_PROVIDER=openai` and `OPENAI_API_KEY` | | BytePlus Seedream | 1K, 2K | PNG or JPEG | [Get an AP region key](https://console.byteplus.com/ark/region:ark+ap-southeast-1/apikey), then set `IMAGE_PROVIDER=seedream` and `ARK_API_KEY` |

Google Search grounding is available with Gemini only. OpenAI may require organization verification before it can generate images.

The examples below use Gemini. Replace the provider settings if you prefer OpenAI or Seedream.

2. Configure your MCP client

Codex

Add this to `~/.codex/config.toml`:

[mcp_servers.mcp-image]
command = "npx"
args = ["-y", "mcp-image"]

[mcp_servers.mcp-image.env]
GEMINI_API_KEY = "your_gemini_api_key_here"
IMAGE_OUTPUT_DIR = "/absolute/path/to/images"

Cursor

Add this to `~/.cursor/mcp.json` for all projects, or `.cursor/mcp.json` in a project:

{
  "mcpServers": {
    "mcp-image": {
      "command": "npx",
      "args": ["-y", "mcp-image"],
      "env": {
        "GEMINI_API_KEY": "your_gemini_api_key_here",
        "IMAGE_OUTPUT_DIR": "/absolute/path/to/images"
      }
    }
  }
}

Claude Code

Run this in your project directory:

claude mcp add mcp-image --env GEMINI_API_KEY=your-api-key --env IMAGE_OUTPUT_DIR=/absolute/path/to/images -- npx -y mcp-image

Add `--scope user` after `mcp-image` to make it available in every project.

Never commit API keys to version control. Use an absolute `IMAGE_OUTPUT_DIR` in MCP configuration because the server's working directory depends on the client. If omitted, images are written to `./output` relative to that working directory.

3. Generate an image

Restart your MCP client after changing its configuration, then ask your AI assistant:

Generate a product photo of a ceramic coffee mug on a wooden desk.

The generated file is saved in the configured output directory and returned to the assistant as an MCP resource.

<details> <summary>Run mcp-image from a local checkout</summary>

pnpm install
pnpm run build

Configure the MCP client to run the local build instead of `npx -y mcp-image`:

node /absolute/path/to/mcp-image/dist/index.js

</details>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 247 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # MCP Image Generator 🍌
  2. > Generate and edit images from Codex, Cursor, Claude Code, or any MCP client. mcp-image adds visual direction to your request before sending it to Gemini, OpenAI, or BytePlus Seedream.
  3. [![npm version](https://badge.fury.io/js/mcp-image.svg)](https://www.npmjs.com/package/mcp-image)
  4. [![npm downloads](https://img.shields.io/npm/dm/mcp-image.svg)](https://www.npmjs.com/package/mcp-image)
  5. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  6. Tell it what image to create or what to change in an existing image, and what it is for. The result is saved to disk and returned to your assistant.
  7. ## What It Does
  8. Before generating an image, mcp-image rewrites short requests into more specific prompts. It keeps what you asked for and fills in what the image needs for its use, such as lighting and camera angle for a photo or layout for a poster. Text you want in the image stays as you wrote it, in your language. The more detail you provide, the less it changes.
  9. **You ask:**
  10. > "A photo of a roast chicken dinner for a recipe site. It should look like it was actually cooked, and it should be partway through being carved so you can tell how juicy it is."
  11. **mcp-image sends to the image model:**
  12. > "... a freshly roasted whole chicken resting on a rustic, seasoned wooden carving board. The chicken features **deeply bronzed, blistered, and crispy skin** ... It is **partway carved, with one breast cleanly sliced open** to reveal **tender, steaming-hot white meat glistening with natural juices pooling** slightly onto the board ... **shallow depth of field** with a softly blurred background."
  13. ![Roast chicken, generated with prompt enhancement](assets/roast-chicken-optimized.jpg)
  14. *Generated with Gemini using the default `fast` quality preset.*
  15. What carried through:
  16. - `for a recipe site`: one clear subject, with everything else kept subordinate
  17. - `actually cooked`: blistered, uneven browning, rising steam, and drippings on the knife
  18. - `partway through being carved`: one breast sliced open, with the cut piece still resting against the bird
  19. - `how juicy it is`: juices pooling on the board and shallow depth of field around the cut
  20. <details>
  21. <summary>Compare the same request with prompt enhancement turned off</summary>
  22. <img src="assets/roast-chicken-plain.jpg" alt="Baseline result with prompt enhancement turned off" width="480">
  23. *Baseline from the same request, with prompt enhancement disabled.*
  24. Set `SKIP_PROMPT_ENHANCEMENT=true` to send the original prompt to the image model unchanged.
  25. </details>
  26. ## Quick Start
  27. You need Node.js 22 or later, an MCP-compatible client, and an API key for one image provider.
  28. ### 1. Get an API key
  29. All three providers generate and edit images. Gemini is the default and requires the least configuration.
  30. | Provider | Image size | Output format | Setup |
  31. |----------|------------|---------------|-------|
  32. | Gemini (default) | 1K, 2K, 4K | Automatic | [Get a key](https://aistudio.google.com/apikey), then set `GEMINI_API_KEY` |
  33. | OpenAI | 1K, 2K, 4K | PNG or JPEG | [Get a key](https://platform.openai.com/api-keys), then set `IMAGE_PROVIDER=openai` and `OPENAI_API_KEY` |
  34. | BytePlus Seedream | 1K, 2K | PNG or JPEG | [Get an AP region key](https://console.byteplus.com/ark/region:ark+ap-southeast-1/apikey), then set `IMAGE_PROVIDER=seedream` and `ARK_API_KEY` |
  35. Google Search grounding is available with Gemini only. OpenAI may require organization verification before it can generate images.
  36. The examples below use Gemini. Replace the provider settings if you prefer OpenAI or Seedream.
  37. ### 2. Configure your MCP client
  38. #### Codex
  39. Add this to `~/.codex/config.toml`:
  40. ```toml
  41. [mcp_servers.mcp-image]
  42. command = "npx"
  43. args = ["-y", "mcp-image"]
  44. [mcp_servers.mcp-image.env]
  45. GEMINI_API_KEY = "your_gemini_api_key_here"
  46. IMAGE_OUTPUT_DIR = "/absolute/path/to/images"
  47. ```
  48. #### Cursor
  49. Add this to `~/.cursor/mcp.json` for all projects, or `.cursor/mcp.json` in a project:
  50. ```json
  51. {
  52. "mcpServers": {
  53. "mcp-image": {
  54. "command": "npx",
  55. "args": ["-y", "mcp-image"],
  56. "env": {
  57. "GEMINI_API_KEY": "your_gemini_api_key_here",
  58. "IMAGE_OUTPUT_DIR": "/absolute/path/to/images"
  59. }
  60. }
  61. }
  62. }
  63. ```
  64. #### Claude Code
  65. Run this in your project directory:
  66. ```bash
  67. claude mcp add mcp-image --env GEMINI_API_KEY=your-api-key --env IMAGE_OUTPUT_DIR=/absolute/path/to/images -- npx -y mcp-image
  68. ```
  69. Add `--scope user` after `mcp-image` to make it available in every project.
  70. Never commit API keys to version control. Use an absolute `IMAGE_OUTPUT_DIR` in MCP configuration because the server's working directory depends on the client. If omitted, images are written to `./output` relative to that working directory.
  71. ### 3. Generate an image
  72. Restart your MCP client after changing its configuration, then ask your AI assistant:
  73. ```text
  74. Generate a product photo of a ceramic coffee mug on a wooden desk.
  75. ```
  76. The generated file is saved in the configured output directory and returned to the assistant as an MCP resource.
  77. <details>
  78. <summary>Run mcp-image from a local checkout</summary>
  79. ```bash
  80. pnpm install
  81. pnpm run build
  82. ```
  83. Configure the MCP client to run the local build instead of `npx -y mcp-image`:
  84. ```bash
  85. node /absolute/path/to/mcp-image/dist/index.js
  86. ```
  87. </details>
  88. ## More Examples
  89. ### Edit an existing image
  90. Give the assistant an absolute path to the source image:
  91. ```text
  92. Edit /path/to/image.jpg so the person is facing right.
  93. ```
  94. ### Control the result
  95. - `Generate a high-quality product photo of a smartphone with clear text on the screen.`
  96. - `Generate a cinematic desert landscape in a 21:9 aspect ratio.`
  97. - `Keep the knight's appearance consistent with the previous image.`
  98. See the [tool reference](#tool-reference) for the options your assistant can pass explicitly.
  99. ## Configuration
  100. Changing the provider changes both prompt enhancement and image generation. The way you ask for an image stays the same.
  101. ### Quality
  102. `IMAGE_QUALITY` accepts `fast` (default), `balanced`, or `quality`. Set it in the MCP server environment:
  103. ```bash
  104. IMAGE_QUALITY=balanced
  105. ```
  106. Use `fast` to try ideas quickly, `balanced` for everyday use, and `quality` for complex scenes or images where small details matter. Higher settings can take longer and cost more; results vary by provider.
  107. All three providers support these presets for generation and editing. You can override the default with the `quality` option on each request.
  108. ### Environment variables
  109. | Variable | Default | Description |
  110. |----------|---------|-------------|
  111. | `IMAGE_PROVIDER` | `gemini` | Default provider: `gemini`, `openai`, or `seedream` |
  112. | `GEMINI_API_KEY` | - | API key for Gemini |
  113. | `OPENAI_API_KEY` | - | API key for OpenAI |
  114. | `ARK_API_KEY` | - | ModelArk AP API key for Seedream |
  115. | `IMAGE_OUTPUT_DIR` | `./output` | Directory where generated images are saved; use an absolute path in MCP configuration |
  116. | `IMAGE_QUALITY` | `fast` | Default quality preset: `fast`, `balanced`, or `quality` |
  117. | `SKIP_PROMPT_ENHANCEMENT` | `false` | Set to `true` to send prompts through unchanged |
  118. You can configure keys for more than one provider and switch per request. A request-level `provider` option takes precedence over `IMAGE_PROVIDER`.
  119. ## Tool Reference
  120. Your MCP client calls this tool for you. Open the reference when you need to check an option or provider limitation.
  121. <details>
  122. <summary><code>generate_image</code> parameters</summary>
  123. | Parameter | Type | Required | Description |
  124. |-----------|------|----------|-------------|
  125. | `prompt` | string | Yes | Image description or editing instruction |
  126. | `quality` | string | No | `fast`, `balanced`, or `quality`; overrides `IMAGE_QUALITY` |
  127. | `provider` | string | No | `gemini`, `openai`, or `seedream`; overrides `IMAGE_PROVIDER` |
  128. | `inputImagePaths` | string[] | No | Absolute paths to input images for editing |
  129. | `fileName` | string | No | Output filename; `.png`, `.jpg`, or `.jpeg` selects the format for OpenAI and Seedream |
  130. | `aspectRatio` | string | No | `1:1` (default), `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`, `1:4`, `1:8`, `4:1`, or `8:1` |
  131. | `imageSize` | string | No | `1K`, `2K`, or `4K`; availability depends on the provider |
  132. | `blendImages` | boolean | No | Add blending guidance when combining visual elements |
  133. | `maintainCharacterConsistency` | boolean | No | Keep a character's appearance consistent across images |
  134. | `useWorldKnowledge` | boolean | No | Add context for historical figures, landmarks, and factual scenes |
  135. | `useGoogleSearch` | boolean | No | Gemini only. Use Google Search grounding for current information |
  136. | `purpose` | string | No | Intended use, such as `cookbook cover` or `social media post` |
  137. | `category` | string | No | Kind of image: `photo`, `illustration`, `asset`, `ui-screen`, `graphic-design`, `diagram`, or `pattern-texture`. Your assistant sets it when the kind is clear |
  138. </details>
  139. ## Troubleshooting
  140. ### API key not found
  141. Check that the key for the selected provider is present in the MCP server's environment:
  142. - Gemini: `GEMINI_API_KEY`
  143. - OpenAI: `OPENAI_API_KEY`
  144. - Seedream: `ARK_API_KEY`
  145. Restart the MCP client after changing its configuration.
  146. ### Input image file not found
  147. Use absolute paths and make sure the MCP server can read the files. Input images can be PNG, JPEG, or WebP and must be no larger than 10 MiB each. Seedream editing accepts PNG and JPEG only.
  148. ### Provider rejects a request
  149. Check the requested size in the provider table. `useGoogleSearch` works with Gemini only, and Seedream does not support 4K. For OpenAI permission errors, check your [organization settings](https://platform.openai.com/settings/organization/general). For quota or rate-limit errors, check the selected provider account.
  150. ## Image Generation Prompt Skill
  151. This repository also includes an [Agent Skill](https://agentskills.io) for assistants that already have access to an image generation tool. It teaches the prompt-writing approach used by mcp-image and works independently of this server.
  152. Install it with:
  153. ```bash
  154. npx mcp-image skills install --path <skills-directory>
  155. ```
  156. For example, use `~/.codex/skills`, `~/.cursor/skills`, or `~/.claude/skills` as the destination.
  157. ## License
  158. MIT License. See [LICENSE](LICENSE) for details.
  159. ---
  160. Need help? [Open an issue](https://github.com/shinpr/mcp-image/issues) or check [Troubleshooting](#troubleshooting).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.