Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENAI_ORG_IDNoForwarded as organization
OPENAI_API_KEYYesAuth
OPENAI_BASE_URLNoOverride for proxies / enterprise routes
OPENAI_PROJECT_IDNoForwarded as project
GPT_IMAGE_2_MCP_DEBUGNoSet to '1' to emit verbose debug logs on stderr.
GPT_IMAGE_2_OUTPUT_DIRNoGlobal default for where images are saved. Absolute paths used as-is, relative resolved from CWD.
GPT_IMAGE_2_SESSION_MAXNoMax concurrent in-memory edit sessions, LRU-evicted beyond this (default 20; '0' = no cap).
GPT_IMAGE_2_SESSION_TTL_MSNoIdle TTL before an edit session is swept (default 3600000 = 1h; '0' = never expire).
OPENAI_RESPONSES_EDIT_MODELNoHost model used by the Responses-API fallback edit route (default gpt-4.1-mini).
OPENAI_FORCE_RESPONSES_EDITSNoSet to '1' to pin edits to the Responses-API fallback route instead of /v1/images/edits.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
generate_imageA

Generate an image from a text prompt using OpenAI's gpt-image-2 model. The image is written to disk and also returned inline so you can see it. gpt-image-2 handles photoreal, illustrations, infographics, multilingual text (incl. CJK), and complex structured visuals. It does NOT support transparent backgrounds. Sizes accept presets or any custom "WxH" where edges are multiples of 16, max edge 3840px, aspect ratio within 1:3–3:1, total pixels 655K–8.29M.

edit_imageA

Edit or compose images with gpt-image-2. Give 1–8 input images plus a text prompt; optionally include a PNG mask whose transparent regions mark what to change (mask applies to the first image). Great for: swap backgrounds, retouch products, combine multiple reference images into one composition, maintain a character across scenes. gpt-image-2 always processes inputs at high fidelity (no input_fidelity knob needed). The edited image is saved to disk and returned inline.

start_edit_sessionA

Begin a stateful multi-turn edit session. Returns a session_id you then pass to continue_edit_session to iteratively refine the image (each turn uses the previous turn's output as the input). Use end_edit_session when done.

continue_edit_sessionA

Apply another edit turn to an existing session. The previous turn's output image is used as the input. Use short, focused prompts like "make the sky more orange" or "add a small boat on the horizon"; include "keep everything else the same" to limit drift. Returns the new image and the updated session.

end_edit_sessionA

Free an iterative-edit session. Safe to skip — sessions are in-memory only and are discarded on server restart — but calling this frees memory sooner and keeps list_edit_sessions tidy.

list_edit_sessionsA

List active iterative-edit sessions (in-memory only, discarded on server restart). Useful to recover a session_id after a client reconnect.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/Borys520/gpt-image-2-mcp'

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