Back to MCP directory
publicPublicdnsLocal runtime

4o-image

一个集成4o-image API的MCP服务器,支持通过文本生成和编辑图像。

article

README

🚀 4o-image MCP 服务器

本项目是一个集成 4o-image API 的 MCP 服务器实现。它让 LLM 和其他 AI 系统能通过标准化协议生成和编辑图像,用户只需使用简单的文本提示,就能创建高质量的艺术作品、3D 角色和自定义图像。

npm 版本 Node.js 版本 许可证: MIT

✨ 主要特性

  • 文本到图像生成:根据文本描述生成图像。
  • 图像编辑:使用文本提示对现有图像进行转换。
  • 实时进度更新:获取生成状态反馈。
  • 浏览器集成:自动在默认浏览器中打开生成的图像。

📦 安装指南

获取 API 密钥

  1. 4o-image.app 注册账户。
  2. 从用户仪表盘获取 API 密钥。
  3. 运行服务器时将 API 密钥设置为环境变量。

在 Claude Desktop 中使用

claude_desktop_config.json 中添加以下内容:

{
  "mcpServers": {
    "4o-image": {
      "command": "npx",
      "args": [
        "-y",
        "4oimage-mcp"
      ],
      "env": {
        "API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

💻 使用示例

基础用法

以下是一个使用此 MCP 服务器与 Claude 的示例:

生成一张在日落时沙滩上奔跑的狗的图像

Claude 将使用 MCP 服务器生成图像,该图像会自动在默认浏览器中打开。你还会在 Claude 的响应中获得图像的直接链接。

高级用法

对于图像编辑,你可以提供一个基础图像并提示 Claude 进行修改:

将这张图片中的天空改为更有戏剧性的暴风雨云层

📚 详细文档

工具

generateImage

  • 根据文本提示生成图像,支持可选的图像编辑功能。
  • 输入:
    • prompt(字符串,必需):所需图像的文本描述。
    • imageBase64(字符串,可选):待编辑或风格迁移的基础图像的 Base64 编码。

📄 许可证

此 MCP 服务器根据 MIT 许可证发布。你可以在不受限制的情况下使用、修改和分发软件,但需遵守 MIT 许可证的条款和条件。

READY-TO-PASTE CONFIG

MCP client config generator

Choose your client, fill the required environment variables, then copy a config generated from this server's published metadata

terminal
data_object

This entry does not contain a standard command or remote URL, so a safe client config cannot be generated automatically

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client