Skip to main content

MCP server for image generation via codex-proxy

Project description

Codex Image Generator

通过 codex-proxy 提供图片生成能力的 MCP 服务。

安装

pipx install codex-image-generator

或者使用 uv:

uvx codex-image-generator

配置

设置环境变量:

# Windows
set CODEX_PROXY_URL=http://10.10.17.52:8080/v1
set CODEX_PROXY_API_KEY=codex-proxy-xxx

# Linux/macOS
export CODEX_PROXY_URL=http://10.10.17.52:8080/v1
export CODEX_PROXY_API_KEY=codex-proxy-xxx

然后写入 Codex 配置:

codex-image-generator --write-config

这会向 ~/.codex/config.toml 追加 MCP 服务配置。

手动配置

如果 --write-config 不适用,可以手动在 ~/.codex/config.toml 中添加:

[mcp_servers.image_generator]
type = "stdio"
command = 'codex-image-generator'
startup_timeout_sec = 120

使用

重启 Codex 后,在对话中让 Codex 生成图片即可,例如:

生成一张白色背景上的红色圆形图片

前提条件

  • codex-proxy 已部署并可通过 CODEX_PROXY_URL 访问
  • 连接的 OpenAI 账号为 ChatGPT Plus 及以上(free 账号不支持图片生成)

支持参数

工具 generate_image 支持以下参数:

  • prompt(必填):图片生成提示词
  • size(可选):图片尺寸,默认 1024x1024
  • output_path(可选):输出路径,默认 output.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_image_generator-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_image_generator-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file codex_image_generator-0.1.0.tar.gz.

File metadata

  • Download URL: codex_image_generator-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for codex_image_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9947ff2cddcc4d266ec5b199c6a79f0779b12fee84e0f4aeac1c1f8b5f07b2e7
MD5 48be06d35ea13879dfddc1f94bcbe057
BLAKE2b-256 37b77de822148aaecbe8752debdbf470c18da7f11f40f62af6a722ae3653a074

See more details on using hashes here.

File details

Details for the file codex_image_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for codex_image_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c065bb1a6cb719f7f1942464a920419e671b5fba92e04e262e07c4d26155908
MD5 d17925778f62e87d28328b3e31ea8360
BLAKE2b-256 4eab88fc72891782e08ffd426c1bd16218e52149c8eb9ec7302d8309c801b79b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page