Back to MCP directory
publicPublicdnsLocal runtime

image-generator-mcp-server

一个基于TypeScript的MCP服务器,使用OpenAI的DALL-E 3模型根据文本提示生成图像。

article

README

🚀 图像生成器 MCP 服务器

这是一个基于图像提示词生成图像的 MCP 服务器,借助 OPENAIdall-e-3 图像生成模型,能高效地依据提示词生成所需图像。

🚀 快速开始

此图像生成器 MCP 服务器可依据图像提示词生成图像,使用的是 OPENAIdall-e-3 图像生成模型。

✨ 主要特性

工具

  • generate_image - 根据给定提示生成图像
    • 接受 prompt 作为必需参数
    • 接受 imageName 作为必需参数,将生成的图像保存到你桌面的 generated-images 目录中

📦 安装指南

开发环境安装

安装依赖:

npm install

构建服务器:

npm run build

带有自动重建的开发:

npm run watch

与Claude桌面集成安装

要与 Claude 桌面一起使用,请添加以下服务器配置:

在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json 在 Windows 上:%APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "command": "image-generator",
      "env": {
        "OPENAI_API_KEY": "<your-openai-api-key>"
    }
  }
}

请确保将 <your-openai-api-key> 替换为你的实际 OPENAI API 密钥。

调试

由于 MCP 服务器通过 stdio 通信,调试可能具有挑战性。我们推荐使用 MCP Inspector,它作为包脚本可用:

npm run inspector

Inspector 会提供一个访问浏览器中的调试工具的 URL。

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