SM

shinpr/mcp-image

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

197 stars 43 forks 质量 85 趋势 15MIT

MCP服务器,支持AI图像生成和编辑,支持自动提示优化和高质量预设。支持Nano Banana(Gemini)、OpenAI GPT图片和BytePlus Seedream。

概览

从Codex、光标、Claude Code 或任何MCP客户端生成和编辑图像。MCP-image在发送给Gemini、OpenAI或BytePlus Seedream之前,会为你的请求添加视觉方向。 告诉它要创建哪个镜像,或者在现有镜像中要更改什么,以及它的用途。结果会被保存到磁盘并返回给你的助手。 在生成图像之前,mcp-image 会将简短请求重写成更具体的提示。它保留你请求的内容,并填充构图、光照和摄像机角度等细节。你提供越多细节,变化越小。 “一张烤鸡晚餐的照片,放给一个食谱网站。看起来应该像是真正烹饪的,切到一半,这样你才能看出有多多汁。” "...一只精美烤制的整只鸡,静静地放在一块质朴的木砧板上。一条腿部分雕刻,露出雕刻刀周围......专注于雕刻的鸡肉。

概述(AI 翻译)

从Codex、Cursor、Claude Code或任何MCP客户端生成和编辑图像。MCP-image在发送给Gemini、OpenAI或BytePlus Seedream之前,为你的请求添加视觉方向。

告诉它要创建哪个镜像,或者在现有镜像中要更改什么,以及它的用途。结果会被保存到磁盘并返回给你的助手。

它的作用

在生成图像之前,mcp-image 会将简短请求重写成更具体的提示。它保留你请求的内容,并填充构图、光照和摄像机角度等细节。你提供越多细节,变化越小。

你问:

“一张烤鸡晚餐的照片,供一个食谱网站用。它应该看起来像是真正煮熟的,切到一半,这样你才能看出它的多汁。”

mcp-image 发送到图像模型:

"…一只新鲜烤熟的整只鸡放在质朴调味的木雕板上。鸡肉有深深的古铜色、起泡和酥脆的鸡皮…它部分雕刻,一块胸肉干净利落地切开,露出嫩滑、热气腾腾的白肉,闪着光泽,自然汁液微微汇聚在砧板上…

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP Image Generator 🍌

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.

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.

What It Does

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.

You ask:

“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.”

mcp-image sends to the image model:

“… 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.”

Generated with Gemini using the default fast quality preset.

What carried through:

  • for a recipe site: one clear subject, with everything else kept subordinate
  • actually cooked: blistered, uneven browning, rising steam, and drippings on the knife
  • partway through being carved: one breast sliced open, with the cut piece still resting against the bird
  • how juicy it is: juices pooling on the board and shallow depth of field around the cut

Quick Start

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
在 GitHub 查看完整 README

安装

npx -y mcp-image
新手?先看 mcpskill.org 教程 →

配置

{ "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" } } } }