Skip to main content
Glama
openai-image-mcp-secure

openai-image-mcp-secure

by leiting684

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENAI_ORG_IDNo可选:需要指定归属组织时使用,官方 SDK 识别该变量。Optional organization ID recognized by the official SDK for attribution.
OPENAI_API_KEYNo回退用的 OpenAI 项目 API Key,仅在设置了 OPENAI_IMAGE_MCP_ALLOW_ENV_API_KEY=1 且凭据管理器中无保存值时才读取。应使用已绑定 API Organization 下的项目 Key。Fallback API key; normally the key is stored via `manage.py key` in Windows Credential Manager instead.
IMAGE_OUTPUT_DIRNo旧版输出目录设置;策略文件中的 "output_dir" 优先于该变量及其手动保存的目录设置。Legacy output directory; a policy.json "output_dir" takes precedence.
OPENAI_PROJECT_IDNo可选:需要指定归属项目时使用,官方 SDK 识别该变量。Optional project ID recognized by the official SDK for attribution.
OPENAI_IMAGE_MCP_ALLOW_ENV_API_KEYNo仅当凭据库正常但没有保存值、且子进程显式设置 OPENAI_IMAGE_MCP_ALLOW_ENV_API_KEY=1 时,才回退读取 OPENAI_API_KEY。凭据库报错会终止请求,凭据管理器中保存的值始终优先。Only when set to 1 does the server fall back to reading OPENAI_API_KEY from the environment.0

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Generates and edits images with OpenAI's Image API. Every image is saved to the user's image folder at full resolution; the chat receives a smaller preview plus the saved path. Use quality 'low' for quick drafts. Each call costs the user money, so don't generate more images than asked for.

Revisions: when the user asks to change an image already made or shared in this conversation ("make the cat black", "now add sunglasses"), call edit_image with the saved path of the most recent version and a prompt that states only the change plus what must stay the same. Don't call generate_image again, which draws a new, different image. Each revision is saved as a new numbered version (-v2, -v3, ...); to undo, edit an earlier version's path. Use generate_image only for a new image or when the user asks to start over.

By default the newest image model is used; list_image_models shows what the user's key can use. To change their saved default, the user runs uv run manage.py model <id> themselves.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
generate_imageA

Generates new images from a text prompt and saves them to the user's image folder.

For changes to an image that already exists, use edit_image on its saved path instead;
generating again produces a different image rather than a revision.

Args:
    request_id: Optional client-generated UUID. Reuse on retry to prevent a second paid request.
    prompt: What to draw. Be specific about subject, style, composition, and any text to render.
    size: "auto", or WIDTHxHEIGHT such as 1024x1024 (square), 1536x1024 (landscape), or
        1024x1536 (portrait). Only the verified 2.x models allow custom dimensions.
    quality: "low" for fast drafts up to "max". "auto" lets the model choose.
    background: "transparent" needs output_format "png" or "webp".
    output_format: File format of the saved image.
    n: Number of images, 1 to 4. Each one is billed.
    model: A model ID for this request only. Leave empty to use the user's default
        (the newest model unless they pinned one). See list_image_models.
    open_after: Open each saved image in the user's default image viewer. Set it when the
        user asks to see or open the result, when the client cannot display inline previews.
edit_imageA

Revises an existing image, or combines several as references, and saves the result.

This is the tool for follow-up changes ("make it black", "add sunglasses", "remove the
background"): pass the saved path of the latest version from the previous result. The
result is saved as the next numbered version, so earlier versions stay available.

Args:
    request_id: Optional client-generated UUID. Reuse on retry to prevent a second paid request.
    prompt: The change to make, and what must stay the same, for example "Make the cat's
        fur black. Keep the pose, background, and lighting unchanged." For several
        references, describe the new image to build from them.
    image_paths: Full paths to one or more local PNG, JPEG, or WebP files. For a revision,
        the single most recent version.
    mask_path: Optional PNG whose transparent areas mark where to edit the first image.
    size: "auto" or WIDTHxHEIGHT, with the same rules as generate_image.
    quality: "low" for fast drafts up to "max".
    background: "transparent" needs output_format "png" or "webp".
    output_format: File format of the saved image.
    n: Number of results, 1 to 4. Each one is billed.
    model: A model ID for this request only. Leave empty to use the user's default.
    open_after: Open each saved image in the user's default image viewer. Set it when the
        user asks to see or open the result, when the client cannot display inline previews.
    input_fidelity: Use "auto" to omit the API parameter. GPT Image 1.5 accepts low or high,
        1 mini accepts low, and the verified 2.x models require auto here.
list_image_modelsA

Lists the OpenAI image models the user's API key can use, newest first.

Shows which model is used by default and whether the user pinned one.

Args:
    query: Optional words to filter by, such as "2.5" or "flare".
estimate_image_costB

Offline USD quote. Include the intended prompt and reference count (including mask). An omitted prompt budgets the maximum possible UTF-8 prompt. No files are read.

get_usageB

Read recent request statuses, numeric usage, reservations and delivery, optionally by UUID.

get_cost_summaryB

Local lifetime costs grouped by exact model and status, in USD.

get_budget_statusA

Read local policy and remaining day/month capacity in UTC; excludes organization credits.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.8/5.0

Scored across 7 tools

Disambiguation4/5

generate_image and edit_image are clearly distinct (new vs. revision), and list_image_models is unambiguous. The four cost/usage tools overlap somewhat—get_budget_status, get_usage, get_cost_summary, and estimate_image_cost all relate to billing—but their descriptions distinguish current capacity, recent requests, lifetime totals, and pre-request quotes.

Naming Consistency5/5

All tools follow a consistent snake_case verb_noun pattern: generate_image, edit_image, list_image_models, get_budget_status, estimate_image_cost, get_usage, get_cost_summary. No mixing of conventions.

Tool Count5/5

Seven tools is well-scoped for an image generation server with cost and usage management. Each tool covers a distinct responsibility without excessive surface area.

Completeness4/5

Core image generation (generate, edit, list models) and cost/usage management are well covered. Minor gaps exist—no tool to list or delete saved images, or fetch metadata for a saved image—but these are not essential for the primary workflow.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues