Skip to main content
Glama

openai-image-gen

语言:English | 中文

基于 FastMCP 的 MCP 服务器,将多个图像生成后端 (如 sensenovamodelscope)分别暴露为独立的 MCP 工具。每个后端的模型别名、 支持尺寸、参数描述均在 config.yaml 中独立配置。

安装

一行命令通过 uvx 启动(无需本地克隆)

包推送到 git 远程后,任何装有 uv 的机器都可以用一行命令启动:

# 公开仓库
uvx --from git+https://github.com/<you>/openai-image-gen.git openai-image-gen

# 私有仓库(ssh)
uvx --from git+ssh://git@github.com/<you>/openai-image-gen.git openai-image-gen

本地安装(开发模式)

git clone <repo-url> && cd openai-image-gen
uv tool install .
# 然后
openai-image-gen

Related MCP server: ai-image-gen-mcp

配置

服务器按以下顺序查找配置文件:

  1. 命令行 --config-dir <path>(或 --config-dir=<path>

  2. 环境变量 $OPENAI_IMAGE_GEN_CONFIG_DIR

  3. $XDG_CONFIG_HOME/openai-image-gen(回退到 ~/.config/openai-image-gen

首次启动 — 如果配置文件不存在,服务器会在解析到的位置写入示例 config.yaml 并退出。编辑文件设置 base_urlapi_key(用 env:VAR_NAME 引用环境变量中的密钥),然后重新启动。

API 密钥通过名称在 config.yaml 中引用(如 env:SENSENOVA_API_KEY),启动时 解析。本地运行时把真实密钥放在项目目录的 .env 文件中,部署时则放在 shell 环境变量中。

.env 示例:

SENSENOVA_API_KEY=sk-...
MODELSCOPE_API_KEY=ms-...

在 opencode 中使用

添加到 ~/.config/opencode/opencode.json

{
  "openai-image-gen": {
    "type": "local",
    "command": [
      "uvx", "--from", "git+https://github.com/<you>/openai-image-gen.git",
      "openai-image-gen"
    ],
    "enabled": true,
    "timeout": 600000
  }
}

暴露的工具

config.yaml 中每个后端会注册一个工具:

  • list_models — 列出所有配置的后端、工具名和模型。

  • <backend>_generate_image — 生成(可选保存)图片。具体参数 schema、模型 别名、支持尺寸在 config.yaml 中按后端定义。

License

MIT — 见 LICENSE

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bookandmusic/mcp-openai-image-gen'

If you have feedback or need assistance with the MCP directory API, please join our Discord server