Back to MCP directory
publicPublicdnsLocal runtime

image-creator-mcp

一个基于OpenAI API的图像生成MCP服务器,提供通过文本提示创建、编辑和组合图像的功能,支持多种模型和参数配置,可集成到兼容的MCP客户端中使用。

article

README

🚀 图像生成

本项目是一个图像生成服务器,借助API可实现图像的创建与编辑,为图像生成需求提供高效解决方案。

🚀 快速开始

📦 安装指南

运行以下命令安装所需的依赖:

npm install

启动服务

可以通过以下命令启动开发服务器:

npm run dev

或者构建生产版本后启动:

npm run build && npm start

📚 详细文档

配置

项目的配置文件位于 config.json,以下是默认配置:

{
  "port": 5050,
  "openai_key": "your_openai_api_key",
  "storage_path": "./storage"
}

参数说明

| 属性 | 详情 | |------|------| | port | 服务监听的端口,默认为5050 | | openai_key | OpenAI API密钥,用于图像生成 | | storage_path | 图片存储路径 |

📄 HTTP API 文档

创建新图像

POST http://localhost:5050/api/create-image
Content-Type: application/json

{
  "prompt": "描述图片的内容",
  "filename": "图片文件名",
  "width": 800,
  "height": 600,
  "background": "#ffffff"
}

编辑现有图像

POST http://localhost:5050/api/edit-image
Content-Type: application/json

{
  "prompt": "编辑描述",
  "filename": "existing-image.png",
  "width": 1024,
  "height": 768,
  "background": "transparent"
}

删除图像

DELETE http://localhost:5050/api/delete-image
Content-Type: application/json

{
  "filename": "要删除的图片名"
}

🐳 Docker 支持

构建镜像

docker build -t image-generator .

运行容器

docker run -d --name image-server -e OPENAI_API_KEY="your_api_key" image-generator:latest

💻 开发

运行开发服务器

npm run dev

执行测试

npm test

📄 许可证

MIT License

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