Skip to main content
Glama
andyluu98

ai-image-gpt-mcp

by andyluu98

ai-image-gpt-mcp

Standalone MCP server + CLI for ChatGPT image generation (image only).

A trimmed, image-focused fork of ai-slides-mcp: all the slide / PowerPoint features are removed, and the image-generation path is made reliable (one call = one image = one exact returned path, no re-generation).

What it does

  • aigpt gen "<prompt>" generates an image via the ChatGPT backend and saves it.

  • MCP tools generate_image and login_status for use inside Claude Code, Codex, etc.

  • Multi-account login with quota-aware selection.

Related MCP server: glm-image-mcp-server

The reliability fix

The original tool returned images into a directory with an auto-generated name, which made callers guess where the file landed and sometimes re-generate the same image (wasting quota). This fork fixes that:

  • aigpt gen "..." --out shot.png saves to exactly shot.png and prints its absolute path on stdout (one line). Use that path directly.

  • --out <dir> still works for a directory of n images.

  • The MCP generate_image returns absolute paths in {"paths": [...]}.

One generation call produces one image. Never re-run a call to "find" the file.

Install

Requires Python 3.12+ and uv.

git clone https://github.com/andyluu98/ai-image-gpt-mcp.git
cd ai-image-gpt-mcp
uv sync

Login (2-step OAuth with ChatGPT)

uv run aigpt login
# A browser opens -> log into ChatGPT -> you land on a platform.openai.com page.
# Copy the FULL callback URL, then:
uv run aigpt login --callback "<paste the URL here>"

uv run aigpt accounts   # check logged-in accounts + live quota

Generate

# one exact file
uv run aigpt gen "a red apple on white, minimal" --out shot.png

# skip prompt auto-expansion (faster, more literal) + set reasoning effort
uv run aigpt gen "..." --out shot.png --no-enhance --thinking standard

# a directory of N images
uv run aigpt gen "..." --n 2 --out ./images

# aspect ratio: 16:9 (default), 1:1, 9:16, 4:3, 3:4, or WxH
uv run aigpt gen "..." --aspect 9:16 --out portrait.png

--thinking (auto/standard/extended/max) raises image reasoning effort; higher renders text (e.g. Vietnamese diacritics) better but is slower.

Register as an MCP server

Same shape for Claude Code, Codex, Antigravity:

{
  "mcpServers": {
    "ai-image-gpt": {
      "command": "uv",
      "args": ["run", "--directory", "<absolute path to this repo>", "aigpt-mcp"]
    }
  }
}

Exposed tools: generate_image, login_status.

Disclaimer

This tool talks to the ChatGPT web backend (vendored chatgpt2api), not an official OpenAI API. Using it may violate OpenAI's Terms of Service and can get your account rate-limited or banned. For experimentation only. You are responsible for your use.

Credits

Available Tools

2 tools
generate_imageA

Generate image(s) from a text prompt at the given aspect ratio (16:9, 1:1, 3:4, 4:3, 9:16, or WxH). Generates ONCE and returns the exact ABSOLUTE file path(s) saved, e.g. {"paths": ["C:/.../img-....png"]}. Callers should use the returned path directly and never re-generate to "find" the file.

Images are saved into out_dir (created if missing) as img--.png.

When enhance is True (default), the prompt is auto-expanded via the ChatGPT text path before drawing. style='slide' = clean editorial look; style='fintech' = light-blue dashboard look; style='auto' is the general default.

thinking sets reasoning effort: 'auto' (ChatGPT default) or 'standard'/ 'extended'/'max' (increasing). Higher effort improves rendered-text fidelity (e.g. Vietnamese diacritics) at the cost of speed.

brand_colors (list of hex like ['#10B981']) forces a palette; reserve_corner (e.g. 'top-left') keeps a corner clear for a logo and bans model-drawn logos/text. With enhance=False these still apply via the offline template.

ParametersJSON Schema
NameRequiredDescriptionDefault
nNo
styleNoauto
aspectNo16:9
promptYes
enhanceNo
out_dirNoout
thinkingNoauto
brand_colorsNo
reserve_cornerNo

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full responsibility and does so admirably. It discloses that generation happens ONCE, where and how files are saved (out_dir, img-<timestamp>-<i>.png), that enhance auto-expands prompts via ChatGPT, what each style looks like, the effect of thinking levels on text fidelity, and that brand_colors/reserve_corner apply even when enhance=False. This is rich, non-obvious behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Despite being about 200 words, every sentence contributes functional value. The description is front-loaded with the core purpose and critical usage rule, then organizes parameter details into clear, scannable paragraphs. There is no repetition or fluff; it's appropriately dense for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 9 parameters, no annotations, and no output schema, the description covers the key aspects: return format (JSON with absolute paths), file-saving behavior, generation-once guarantee, and the effects of each parameter. It even mentions edge cases like enhance=False still applying brand_colors. This is very complete for the tool's scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no descriptions (0% coverage), so the text must compensate. The description explains aspect ratio values, enhance, style meanings, thinking levels, brand_colors, reserve_corner, and out_dir. It implies the 'n' parameter via 'image(s)' and the -<i>.png pattern, but doesn't explicitly state that n controls the count. Still, the explanation covers the vast majority of the 9 parameters with practical meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource statement: 'Generate image(s) from a text prompt at the given aspect ratio.' It also lists the allowed aspect ratios and gives a concrete example of the returned paths. This clearly distinguishes the tool from its only sibling (login_status) and fully conveys its purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context, especially the explicit instruction to use the returned path directly and never re-generate to 'find' the file. It also explains how enhance, style, thinking, brand_colors, and reserve_corner affect output. There are no relevant alternative tools to compare against, so explicit when-not-to-use guidance isn't necessary, but the provided constraints are valuable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

login_statusA

Check logged-in ChatGPT accounts. Cheap + hint-based (no network probe): returns {authed, accounts:[{email, type, alive, restore_at}], ready_count}. ready_count is from persisted hints; for live quota run the CLI aigpt accounts.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully carries the burden. It discloses that the tool is hint-based, performs no network probe, and derives ready_count from persisted hints, making the data's potential staleness transparent. It also details the exact return structure, which is crucial in absence of an output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact yet information-dense. It front-loads the purpose, then adds key behavioral notes and return shape, and finishes with a practical caveat and pointer. Every sentence adds value; there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with no output schema, the description covers all essentials: what it does, its limitations, the exact return value, and when to use an alternative. This is fully self-contained and leaves no critical gaps for an AI agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and the schema is trivially covered at 100%. Per the rubric, 0 params earn a baseline of 4. The description adds nothing about parameters because there is nothing to add, but this is appropriate given the tool's design.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Check logged-in ChatGPT accounts.' The verb 'check' and resource 'logged-in ChatGPT accounts' are specific, and the description also outlines the return shape, removing ambiguity. It is easily distinguished from the sibling generate_image tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly frames when to use this tool: 'Cheap + hint-based (no network probe),' and provides a direct alternative for live data: 'for live quota run the CLI `aigpt accounts`'. This gives the agent a clear decision path between this tool and the recommended alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv0.1.0
    • First observedgenerate_image
    • First observedlogin_status

TDQS

A4.8/5.0
Disambiguation5/5

The two tools serve entirely different functions: one checks authentication status, the other generates images. There is no overlap or ambiguity between them.

Naming Consistency5/5

Both tool names follow the same verb_noun snake_case pattern: login_status and generate_image. The naming is clear, predictable, and consistent.

Tool Count4/5

With only two tools, the server is minimal but appropriately scoped for its single-purpose image generation functionality. The login_status helper supports the main generate_image tool without unnecessary bloat.

Completeness5/5

The tool set covers the core lifecycle of image generation: checking authentication and generating images with extensive options for style, aspect ratio, enhancement, and thinking effort. There are no obvious gaps for the stated domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

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/andyluu98/ai-image-gpt-mcp'

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