Skip to main content
Glama

imagengen

impossibl.com — a router for multiple AI models. Test it out with a free $3 account.

ip2.app — develop your custom projects and publish.

An MCP server that generates and edits images via Gemini (Nano Banana), Grok Image, GPT-image, and impossibl.com, for MCP clients — like Claude Code — that have no native image generation capability.

  • Model lists are discovered live from each provider's API, not hardcoded, so new models show up automatically.

  • Defaults to each provider's newest non-top-tier model and a non-maximum quality setting, so a plain "generate an image" request doesn't silently pick the most expensive option.

  • Images are saved to disk; tools return the file path.

Tools

Tool

Purpose

list_image_providers

Reports which providers are configured, their available models, and the resolved default.

text-to-image

Generate an image from a text prompt.

image-to-image

Edit/transform one or more input images from a text prompt.

Related MCP server: io.github.pvliesdonk/image-generation-mcp

Providers & API keys

Provider

Env var

Models (discovered live)

Gemini

GEMINI_API_KEY

Nano Banana family, e.g. gemini-3.1-flash-image, gemini-3-pro-image, gemini-2.5-flash-image

Grok Image

XAI_API_KEY

grok-imagine-image, grok-imagine-image-quality

GPT-image

OPENAI_API_KEY

gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini

impossibl.com

IMPOSSIBL_API_KEY

openai/gpt-image-2 (generation only — see Known limitations)

Set only the keys for the providers you want to use. If none are set, the tools return a clear no_provider_configured error.

Choosing a default provider

  • If exactly one API key is set, it's used automatically.

  • If more than one is set, set IMAGE_PROVIDER_DEFAULT to gemini, grok, gpt-image, or impossibl to avoid being asked every time.

  • If more than one key is set and IMAGE_PROVIDER_DEFAULT is not set, the tools return a needs_provider_choice response — Claude Code is instructed (via the tool descriptions) to check its memory for a previously stated preference, or otherwise ask you, then retry with the provider argument.

Other configuration

Env var

Default

Purpose

IMAGE_OUTPUT_DIR

./output

Where generated/edited images are saved.

Install

npx -y imagengen

Add it to your MCP client:

Claude Code

claude mcp add imagengen \
  -e GEMINI_API_KEY=your-gemini-key \
  -e XAI_API_KEY=your-xai-key \
  -e OPENAI_API_KEY=your-openai-key \
  -e IMPOSSIBL_API_KEY=your-impossibl-key \
  -e IMAGE_PROVIDER_DEFAULT=gemini \
  -- npx -y imagengen

(Omit any -e you don't need. IMAGE_PROVIDER_DEFAULT is optional — see above.)

Claude Desktop / other MCP clients

Add to your MCP config file (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "imagengen": {
      "command": "npx",
      "args": ["-y", "imagengen"],
      "env": {
        "GEMINI_API_KEY": "your-gemini-key",
        "XAI_API_KEY": "your-xai-key",
        "OPENAI_API_KEY": "your-openai-key",
        "IMPOSSIBL_API_KEY": "your-impossibl-key",
        "IMAGE_PROVIDER_DEFAULT": "gemini"
      }
    }
  }
}

Known limitations

  • Grok image edits currently support one input image per call (the documented request shape takes a single image field).

  • The Gemini provider talks to Google's newer "Interactions" image API (/v1beta/interactions); if Google adjusts that response shape, src/providers/gemini.ts may need a small update.

  • impossibl.com only supports text-to-image generation, not editing. Its /v1/images/edits endpoint does not exist (404), and passing an image field to /v1/images/generations is silently ignored rather than performing an edit. Calling image-to-image with provider: "impossibl" returns a clear error.

License

MIT

Available Tools

3 tools
image-to-imageEdit image from text + input image(s)A

Edits or transforms one or more input images according to a text prompt, using Gemini, Grok Image, or GPT-image, and saves the result to disk. (impossibl.com does not support this tool.)

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNoProvider-specific size string, e.g. "1024x1024".
modelNoSpecific model id. Defaults to that provider's latest non-top-tier model. Call list_image_providers to see options.
promptYesNatural-language instruction describing how to edit/transform the input image(s).
qualityNoProvider-specific quality hint (e.g. "low"/"medium"/"high" for gpt-image). Defaults to a non-maximum tier.
filenameNoBase filename (without extension) to save the image as.
providerNoWhich image provider to use. REQUIRED when more than one of GEMINI_API_KEY / XAI_API_KEY / OPENAI_API_KEY / IMPOSSIBL_API_KEY is configured and IMAGE_PROVIDER_DEFAULT is not set. In that case: first check your memory for a stored user preference for a default image provider; if there is none, ask the user which provider to use before calling this tool, then remember their answer for future calls.
aspect_ratioNoAspect ratio such as "16:9" (Gemini only).
input_imagesYesOne or more input images, each as a local file path or a data: URI. Grok supports 1 image per call; Gemini and GPT-image support multiple. impossibl.com does not support image editing at all — do not select it for this tool.

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the save-to-disk behavior, provider limitations (impossibl unsupported), per-provider image count constraints, default model/quality tiers (non-top-tier defaults), and the provider-selection decision flow. Also discloses the memory/ask-user behavior. It doesn't mention auth/permission needs, but the structured schema already documents API key configuration requirements.

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

Conciseness4/5

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

The description is a single tight sentence that packs the essential purpose. However, significant guidance lives inside the provider parameter's schema description rather than the main description, which means the core description alone is minimal. It's not bloated but arguably shifted more responsibility to schema fields than ideal for a 5.

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

Completeness4/5

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

The schema covers all parameters at 100% coverage and documents the tricky provider-selection decision flow. The description handles the main purpose well. Gaps: no output schema describing what gets returned beyond 'saves result to disk,' and details around multiple input images handling are only lightly covered. For a moderately complex 8-param tool with full schema coverage, this is reasonably complete.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema itself documents all 8 parameters. The description adds value by clarifying provider-specific limits (Grok 1 image, Gemini/GPT-image multiple) and noting impossibl doesn't support editing at all — details beyond the raw schema. However, most other params (size, quality, filename, aspect_ratio) are adequately documented in schema and the description doesn't add further meaning beyond that baseline.

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 action: 'Edits or transforms one or more input images according to a text prompt,' naming three provider options and explicitly the save-to-disk behavior. It distinguishes itself from siblings by addressing input-image transformation rather than generation, and it explicitly notes impossibl.com is unsupported, adding clarity about scope.

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 and schema give explicit guidance: when multiple providers are configured, check memory for a stored preference, otherwise ask the user which provider to use. It also explicitly states when NOT to use the tool ('impossibl.com does not support image editing at all — do not select it for this tool'), and the input_images param description notes Grok supports 1 image vs. Gemini/GPT-image multiple, guiding provider selection.

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

list_image_providersList image providersA

Lists which image providers (gemini, grok, gpt-image, impossibl) are configured via API key, their available models (discovered live from each provider), and which provider/model would be used by default.

ParametersJSON Schema
NameRequiredDescriptionDefault
refreshNoBypass the ~1 hour model list cache and re-fetch each configured provider now.

TDQS

A4.3/5.0
Behavior4/5

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

The description discloses important behavioral traits: it discovers models live from each provider, it considers only API-key-configured providers, and it identifies the default. The refresh parameter hint about caching is in the schema. No annotations exist, so the description carries the burden, and it reasonably discloses the live-discovery behavior and default-selection logic.

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

Conciseness4/5

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

One efficient sentence that front-loads the verb and resource while packing in the key behaviors (config-based filtering, live model discovery, default determination). It's dense but not bloated; there's marginal room to trim but no waste present.

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

Completeness4/5

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

For a simple listing tool with one optional parameter and no output schema, the description covers the essential elements: what it lists, how it discovers models, and what default is reported. It doesn't detail return format, but with no output schema and read-like behavior this is a reasonable stopping point. Slight gap on return structure, hence not a 5.

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?

Schema coverage is 100% (single refresh param well documented in schema). The description adds value by explaining that the default provider/model selection is reported and that models are discovered live, providing context beyond the bare schema. Baseline of 3 applies with full coverage, and the description contributes supplementary context, warranting a 4.

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 uses a specific verb ('Lists') with a clear resource ('which image providers are configured via API key'), and elaborates on the specific outputs: available models discovered live, and default provider/model selection. It clearly distinguishes from siblings text-to-image and image-to-image, which are generation tools rather than listing tools.

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 implies this is an informational discovery tool (list configured providers and their models), which clearly contrasts with the sibling generation tools. However, it doesn't explicitly state 'use this to discover available providers before calling text-to-image' or provide when-not-to-use guidance, so there's some implicit rather than explicit usage framing.

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

text-to-imageGenerate image from textA

Generates an image from a text prompt using Gemini, Grok Image, GPT-image, or impossibl.com, and saves it to disk.

ParametersJSON Schema
NameRequiredDescriptionDefault
nNoNumber of images to generate. Default 1.
sizeNoProvider-specific size string, e.g. "1024x1024".
modelNoSpecific model id. Defaults to that provider's latest non-top-tier model. Call list_image_providers to see options.
promptYesText description of the image to generate.
qualityNoProvider-specific quality hint (e.g. "low"/"medium"/"high" for gpt-image). Defaults to a non-maximum tier.
filenameNoBase filename (without extension) to save the image as.
providerNoWhich image provider to use. REQUIRED when more than one of GEMINI_API_KEY / XAI_API_KEY / OPENAI_API_KEY / IMPOSSIBL_API_KEY is configured and IMAGE_PROVIDER_DEFAULT is not set. In that case: first check your memory for a stored user preference for a default image provider; if there is none, ask the user which provider to use before calling this tool, then remember their answer for future calls.
aspect_ratioNoAspect ratio such as "16:9" (Gemini only).

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It does state the side effect of 'saves it to disk,' which is meaningful behavioral context. However, it doesn't disclose rate limits, authentication requirements, costs, whether files may overwrite existing files, or failure modes. The schema mentions checking for user preference and asking the user, which helps, but that's schema content, not description.

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 a single, efficient sentence that packs in the verb, resource, providers, and side effect with zero wasted words. It's front-loaded and every element earns its place.

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

Completeness4/5

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

This is a moderately complex tool with 8 parameters and no output schema, but the schema descriptions are rich (100% coverage) and cover the tricky provider-selection logic extensively. The description adds the essential context: providers list and disk persistence. While it could mention that model/quality/defaults differ by provider, the schema already hints at this, so combined coverage is reasonably complete. A note about return/error behaviors would push this higher.

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?

Schema coverage is 100%, so the baseline is 3, and the description adds value beyond the schema by naming the concrete providers and noting the disk-save behavior. The descriptions add the cross-reference to list_image_providers for discovering model options, which complements the schema. For a high-coverage schema, the description provides useful extra framing about provider-specific defaults without duplicating schema content.

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

Purpose4/5

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

The description clearly states the action (generates an image from a text prompt), names the four available providers, and notes it saves to disk. It distinguishes itself from the sibling image-to-image tool since it specifies 'from a text prompt.' However, it doesn't explicitly contrast with siblings, and 'using Gemini, Grok Image, GPT-image, or impossibl.com' is somewhat redundant given the provider enum in the schema.

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

Usage Guidelines3/5

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

The description implies text-to-image generation without explicit when-to-use or when-not-to-use guidance versus the sibling image-to-image tool. The provider parameter's schema provides substantial context about asking the user which provider to use, but that's structured data rather than description content. No explicit guidance on when to choose this over alternatives or prerequisites is given in the description itself.

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. 3 tool updatesv0.2.2
    • First observedimage-to-image
    • First observedlist_image_providers
    • First observedtext-to-image

TDQS

A3.9/5.0
Disambiguation5/5

The three tools are clearly distinct: one lists available providers, one does text-to-image generation, and one does image-to-image editing/transformation. The descriptions make it obvious which tool to use for each task, and the coverage of providers in each is well documented.

Naming Consistency3/5

The naming pattern is inconsistent: 'list_image_providers' uses snake_case with a verb_noun pattern, while 'text-to-image' and 'image-to-image' use a hyphenated adjective-noun naming convention that describes the task rather than an action. The latter two don't follow a verb-leading pattern.

Tool Count4/5

Three tools is a compact, well-scoped set that covers the core capabilities of an image generation server: discovery/configuration, generation, and editing. It's on the lean side but appropriate for the narrow domain; each tool serves a distinct and necessary purpose.

Completeness3/5

The server covers the primary workflows (discover providers, generate, edit). However, there are notable gaps: no tool to view/retrieve generated images or their metadata, no batch generation, no image style/variation features, and no way to delete or manage saved images. The core generate/edit flows work but retrieval and management are missing.

Maintenance

ActivitySlowing
ResponsivenessSyncing

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/danton721/imagengen'

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