Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOG_LEVELNoLogging level (logs go to stderr).INFO
OUTPUT_DIRNoDefault save directory for generated images.
XAI_API_KEYNoAPI key for xAI provider.
GEMINI_API_KEYNoAPI key for Gemini provider (GOOGLE_API_KEY also accepted).
GOOGLE_API_KEYNoAlternative API key for Gemini provider.
OPENAI_API_KEYNoAPI key for OpenAI provider.
IMAGE_MCP_MODELNoDefault model for the custom provider.
OPENAI_BASE_URLNoPoint the openai preset at a compatible proxy.
IMAGE_MCP_CONFIGNoExtra config file path.
TOGETHER_API_KEYNoAPI key for Together provider.
DEEPINFRA_API_KEYNoAPI key for DeepInfra provider.
FIREWORKS_API_KEYNoAPI key for Fireworks provider.
IMAGE_MCP_API_KEYNoAPI key for the custom provider.
IMAGE_MCP_RETRIESNoRetry attempts for 429/5xx/network errors.3
IMAGE_MCP_TIMEOUTNoPer-request timeout in seconds.300
IMAGE_MCP_BASE_URLNoBase URL for the custom provider.
OPENROUTER_API_KEYNoAPI key for OpenRouter provider.
IMAGE_MCP_CACHE_DIRNoWhere the model cache lives.~/.cache/opencode-image-mcp
IMAGE_MCP_LOG_LEVELNoAlternative logging level.INFO
IMAGE_MCP_MODEL_TTLNoModel-list cache TTL in seconds.86400
SILICONFLOW_API_KEYNoAPI key for SiliconFlow provider.
IMAGE_MCP_OUTPUT_DIRNoDefault save directory for generated images (alternative to OUTPUT_DIR).

Instructions

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

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

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

Tools

Functions exposed to the LLM to take actions

NameDescription
list_providersA

List configured image providers and whether their API key is present.

A provider only appears as configured: true once its key env var is set. Use the returned id values as the prefix in provider:model specs.

list_modelsA

Discover image-capable models offered by configured providers.

Queries each provider's model endpoint, filters to image models, and caches the result on disk. Set refresh=true to bypass the cache. Pass provider to query just one provider.

add_providerA

Register any OpenAI-compatible image endpoint and remember it for later.

Use this when the user names an endpoint like https://api.example.com/v1. The server probes {base_url}/models, figures out which models can produce images, saves the provider to the config file, and makes it available to generate_image immediately and on every future run.

Parameters

id: Short handle used in provider:model specs (e.g. example). Lowercase letters, digits, - and _. base_url: The OpenAI-compatible API root, e.g. https://api.example.com/v1. api_key: Optional bearer token, stored in the gitignored config file so it survives restarts. Prefer api_key_env if you would rather keep the secret in an environment variable. api_key_env: Name of an env var holding the key (ignored when api_key is given). Leave both unset for endpoints that need no auth. default_model: Model id to use by default. If omitted and exactly one image model is found, it is selected automatically. dialect: auto (default), images (/images/generations) or chat (/chat/completions with image modalities). auto uses the Images API and transparently falls back to chat-completions on 404/405. make_default: Also set this provider's model as the global default model. discover: Set false to skip the /models probe (required for endpoints that do not implement it).

Returns the discovered models plus any warnings; inspect models and, if there are several, call set_default_model to choose one.

remove_providerA

Remove a provider (including built-in presets) from the config file.

set_default_modelA

Persist the model used when generate_image is called without one.

model is a provider:model spec or an alias, e.g. example:flux-schnell. The choice is saved to the config file so it applies to future runs.

generate_imageA

Generate an image, or edit existing images, via an OpenAI-compatible provider.

Model selection

model accepts three forms:

  • provider:model — explicit, e.g. openrouter:google/gemini-3.1-flash-image-preview, openai:gpt-image-1, xai:grok-imagine-image-2.0. Fastest and unambiguous.

  • a bare model id — searched across every configured provider's catalogue (run list_models first). Ambiguous ids raise an error listing candidates.

  • an alias — defined in providers.json (e.g. nb2).

If omitted, the configured default model is used.

Editing

Pass input_image_path (and optionally input_image_paths) and the prompt becomes an edit instruction. Requirements vary by provider.

Output

Images are always written to disk and their paths returned. Set return_image_content=true to additionally embed the images in the tool result so the model can look at them.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.4/5.0

Scored across 6 tools

Disambiguation5/5

Each tool serves a distinct function: discovery (list_models, list_providers), provider lifecycle management (add_provider, remove_provider), configuration (set_default_model), and the core action (generate_image). There is no overlap or ambiguity in purpose.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: list_models, list_providers, add_provider, remove_provider, set_default_model, generate_image. The naming style is uniform and predictable.

Tool Count5/5

Six tools is well-scoped for an image generation MCP server. Each tool earns its place and covers provider management, model discovery, default selection, and generation without redundancy.

Completeness5/5

The tool surface covers the full lifecycle: configure providers (add/remove/list), discover models (list_models), set defaults, and generate/edit images. No obvious gaps exist for the server's stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues