loading…
Search for a command to run...
loading…
Image Edit RMCP is a powerful Model Context Protocol service that provides OpenAI-like image editing capabilities for text-based models. This Rust-based service
Image Edit RMCP is a powerful Model Context Protocol service that provides OpenAI-like image editing capabilities for text-based models. This Rust-based service enables traditional language models to "see" and process images through comprehensive visual understanding tools. The service offers multi
图像处理功能:
简单图床:内置图像上传和存储功能,支持通过 URL 访问处理后的图像
秘钥生成:提供 API 密钥生成和管理界面
https://image.cd.actrue.cn/kB7XMqsX31s90JPV/mcp (httpstream)https://image.cd.actrue.cn/kB7XMqsX31s90JPV/uploadhttps://image.cd.actrue.cn/secret
特别注意:需要开启长时间运行模式。AI 生成图像功能耗时较长,建议在使用时保持耐心。
提示词:
https://muse-ai.oss-cn-hangzhou.aliyuncs.com/img/fd7409815bb94bddba84191e21a803a2.png
查看这张图片
提示词:
https://muse-ai.oss-cn-hangzhou.aliyuncs.com/img/fd7409815bb94bddba84191e21a803a2.png
裁剪出图中的太阳
裁剪完成后展示出原图和裁剪结果
提示词:
https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-Image/image2512/arena.png#center
识别图中文字
并且展示图片
# 使用 rustup 安装 Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 或从系统包管理器安装
# macOS: brew install rust
# Ubuntu/Debian: sudo apt install rustc cargo
复制环境变量模板并配置您的 API 密钥:
cp .env.example .env
编辑 .env 文件:
# ModelScope API 密钥(必填)
MODELSCOPE_API_KEY=your_api_key_here
# 服务器端口
MCP_PORT=3000
# 安全密钥(用于图床上传)
SECRET_KEY=your_secret_key_here
# 缓存目录
CACHE_DIR=~/.cache/image-edit-rmcp
# 缓存 URL(用于生成公开访问链接)
CACHE_URL=http://localhost:3000
# 克隆项目(如果尚未克隆)
# git clone <repository-url>
# cd image-edit-rmcp
# 安装依赖并构建
cargo build --release
# 运行服务
cargo run --release
服务将在 http://localhost:3000 启动。
使用http://localhost:3000/{SECRET_KEY}/mcp 访问mcp服务
fetch_image - 从 URL 获取图像功能:从指定 URL 下载图像,分析图像内容,并生成描述。
输入参数:
url (string): 图像 URL(必需)focus (string, 可选): 需要特别关注的内容输出:
rotate_image - 旋转图像功能:按指定方向旋转图像。
输入参数:
url (string): 图像 URL(必需)direction (enum): 旋转方向,可选值:Right90: 顺时针旋转 90°Left90: 逆时针旋转 90°Flip180: 旋转 180°输出:
crop_image - 裁剪图像功能:按百分比坐标裁剪图像。
输入参数:
url (string): 图像 URL(必需)left (float, 可选): 左侧百分比(0-100),默认 0top (float, 可选): 顶部百分比(0-100),默认 0right (float, 可选): 右侧百分比(0-100),默认 100bottom (float, 可选): 底部百分比(0-100),默认 100输出:
get_image_info - 获取图像信息功能:获取图像的基本信息。
输入参数:
url (string): 图像 URL(必需)输出:
width: 图像宽度(像素)height: 图像高度(像素)total_pixels: 总像素数mime_type: MIME 类型size: 文件大小(字节)aspect_ratio: 宽高比(可选)ocr_extract - OCR 文字提取功能:从图像中提取文字内容。
输入参数:
image_url (string): 图像 URL(必需)输出:
generate_image - AI 生成图像功能:基于文本描述生成图像。
输入参数:
prompt (string): 图像描述(必需)negative_prompt (string, 可选): 不希望出现的内容aspect_ratio (string, 可选): 宽高比,可选值:1:1、16:9、9:16、4:3、3:4、3:2、2:3,默认 1:1resolution (string, 可选): 分辨率,可选值:1k、2k、4k,默认 1ksteps (u32, 可选): 采样步数输出:
edit_image - AI 编辑图像功能:基于文本指令编辑现有图像。
输入参数:
image_url (string): 待编辑图像 URL(必需)prompt (string): 编辑指令(必需)size (string, 可选): 输出图像尺寸steps (u32, 可选): 采样步数输出:
image 库(支持 PNG、JPEG、GIF、BMP、WebP)图像处理流程:
image 库进行解码和处理(旋转、裁剪)AI 功能集成:
缓存机制:
MCP 协议集成:
主要依赖(见 Cargo.toml):
rmcp: MCP 协议实现axum: Web 框架image: 图像处理reqwest: HTTP 客户端serde: JSON 序列化tokio: 异步运行时Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"image-edit-rmcp": {
"command": "npx",
"args": []
}
}
}