wan27-image-edit
This server is an MCP service that uses Alibaba Cloud's Wan2.7 image-editing model to edit or fuse 1–9 reference images based on a text prompt, returning generated image URLs.
Accepts 1–9 reference images (public URLs or base64 data URIs) plus a text prompt (≤5000 characters).
Supports model selection:
wan2.7-image-pro(default) orwan2.7-image.Output size options:
1K,2K, or4K(image editing is capped at 2K).Generates 1–4 images per request (
n).Optional watermark on the bottom-right corner and optional random seed for reproducible results.
Returns PNG image URLs valid for 24 hours.
Designed for deployment via
uvxand Alibaba Cloud Function Compute MCP service.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wan27-image-edit Use both reference images: put the hat from image 2 onto the person in image 1."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
wan27-image-edit
万相2.7 图像编辑(多图参考) 的 MCP 服务,封装阿里云百炼(华北2·北京)异步生图接口。
通过 uvx 从 GitHub 直接安装运行,可一键部署到阿里云函数计算(FC)「创建 MCP 服务」页面。
暴露的工具
wan27_image_edit — 传入 1–9 张参考图 + 文字指令,返回生成图像 URL(PNG,24 小时内有效)。
参数 | 说明 | 默认 |
| 文字编辑指令(≤5000 字符),如“把图2的涂鸦喷绘在图1的汽车上” | 必填 |
| 1–9 张图,数组顺序=图1/图2…;公网 URL 或 | 必填 |
|
|
|
|
|
|
| 生成张数 1–4 |
|
| 右下角是否加“AI生成”水印 |
|
| 随机种子 0–2147483647 | 可选 |
Related MCP server: Volcengine Image Generation MCP Server
环境变量
DASHSCOPE_API_KEY(必填):百炼 API Key。WAN_WORKSPACE_ID(可选):业务空间 ID,默认内置ws-bw8c2tma2afa2fsl,请求域名https://{id}.cn-beijing.maas.aliyuncs.com。
本地快速自测(可选)
# 需要 uv(pip install uv)
export DASHSCOPE_API_KEY=sk-xxxx
uvx --from /绝对路径/到/本仓库 wan27-image-edit
# 或用 MCP Inspector 连 STDIO 测试:
npx @modelcontextprotocol/inspector uvx --from . wan27-image-edit部署步骤
1. 推到 GitHub(公开仓库)
在 GitHub 新建一个公开仓库 wan27-image-edit,然后:
cd wan27-image-edit
git init
git add .
git commit -m "init wan2.7 image-edit MCP server"
git branch -M main
git remote add origin https://github.com/nanchenyi/wan27-image-edit.git
git push -u origin main代码里不含任何密钥,公开只是暴露这层薄封装源码。
2. 阿里云 FC「创建 MCP 服务」页面填写
服务名称:
wan27-image-edit安装方式:选
uvx部署方式:打开 极速模式(SSE 会话更稳;按 0.13 元/时计费)
部署地域:华北2(北京)
MCP 服务配置:粘贴下面 JSON,只把
DASHSCOPE_API_KEY换成你自己的真实 Key
{
"mcpServers": {
"wan27-image-edit": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/nanchenyi/wan27-image-edit.git",
"wan27-image-edit"
],
"env": {
"DASHSCOPE_API_KEY": "sk-你的真实Key",
"WAN_WORKSPACE_ID": "ws-bw8c2tma2afa2fsl"
}
}
}
}若页面提供「变量管理 / 服务变量(加密)」,更推荐把
DASHSCOPE_API_KEY作为加密变量托管,配置里用变量引用,避免明文出现在 JSON。
3. 保存后测试
页面「测试」入口选择 SSE / 对应传输类型,调用 wan27_image_edit:
传 prompt + 至少一张公网可访问的 images URL,确认返回图像链接。
常见问题
鉴权失败 / 跨地域报错:北京与新加坡的 API Key、域名不通用,确认 Key 与
cn-beijing域名同属北京地域。current user api does not support synchronous calls:本服务走的是异步接口(带X-DashScope-Async: enable),正常不会出现;若自行改造为同步路径需注意。图像 URL 打不开:链接仅 24 小时有效,请及时下载保存。
启动报
No module named 'mcp.server.fastmcp':依赖已锁定mcp>=1.2.0,<2。mcp 2.x 把FastMCP改名为MCPServer,不要放开这个上限。'latin-1' codec can't encode characters:这是请求头编码错误,与图像 URL / prompt 内容无关。根因是DASHSCOPE_API_KEY(或WAN_WORKSPACE_ID)里混入了非 ASCII 字符——从网页复制 Key 时常带入全角字符、智能引号、零宽空格或结尾空格。服务现已在调用前校验并直接报出「哪个字符、在什么位置」。请重新从百炼控制台复制 Key,确认输入法处于半角、粘贴后首尾无空格。图像 URL 中的中文路径、Signature=、%3D等都在 JSON body 里,不会触发该错误。
Available Tools
1 toolwan27_image_editA
万相2.7 图像编辑(多图参考)。
参数: prompt: 文字指令,描述如何编辑/融合(≤5000 字符)。例如“把图2的涂鸦喷绘在图1的汽车上”。 images: 1-9 张参考图,按数组顺序定义“图1/图2...”。每项为公网可访问 URL 或 data:image/{jpeg|png|webp};base64,<...> 字符串。图像格式 JPEG/JPG/PNG(无透明)/BMP/WEBP, 宽高 [240,8000]px、宽高比 [1:8,8:1]、单张 ≤20MB。 model: wan2.7-image-pro(专业版)或 wan2.7-image(更快)。 size: 输出分辨率规格,1K / 2K / 4K。图像编辑场景 pro 与 image 最高均 2K;4K 仅文生图可用。 n: 生成张数,1-4。 watermark: 是否在右下角加“AI生成”水印,默认 False。 seed: 随机种子 [0,2147483647],相同 seed 结果相对稳定(可选)。
返回: 生成图像的 URL 列表(PNG,链接 24 小时内有效,请及时下载保存)。
Inputs: images (required), prompt (required), n, seed, +3 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
Only one tool exists, so there is no possibility of confusion between overlapping tools. The tool's purpose is clearly defined as image editing with multiple reference images.
With a single snake_case tool name, there is no inconsistent convention to penalize. However, there is not enough variety to fully confirm a naming pattern.
A single tool feels thin for an MCP server, even though it encapsulates a complete image-editing operation. The count is borderline but not extreme.
The tool covers the core image editing workflow with parameters for prompt, reference images, model, size, count, watermark, and seed. Minor gaps exist, such as no explicit output retrieval or model listing, but the essential use case is fully addressed.
Related MCP Connectors
Generate, edit and upscale images with references, batch jobs, cost previews and original downloads.
Generate images and videos (GPT Image, Seedance, Kling, Wan, Qwen) with one API key.
Image generation, image editing and text/image-to-video with credit quotes and connection budgets.
Create images and videos from prompts, with options for image mixing, reference images, and start/…
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables users to generate high-quality images using ModelScope's Qwen-Image model through natural language prompts. Supports async task processing with both image URL and base64 encoded data output options.12MIT
- AlicenseBqualityDmaintenanceEnables AI-powered text-to-image generation using Volcengine's API with support for multiple image sizes, customizable parameters like guidance scale and seed, and flexible output formats.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered image generation using Volcano Engine's SeeDream 4.0 model. Supports custom sizes, reference images, and automatic prompt generation without complex prompting.7 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables generating AI images using BytePlus Seedream models (4.5 and 5.0 Lite) via natural language, supporting text-to-image, reference-based editing, and sequential multi-panel sets.-