Back to Browse

Image Generation MCP Server

by User
Developer ToolsLow Risk10.0Local
Free

MCP server for AI image generation via OpenAI, Stable Diffusion (SD WebUI), or placeholders.

About

MCP server for AI image generation via OpenAI, Stable Diffusion (SD WebUI), or placeholders.

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 0 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

3 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

What You'll Need

Set these up before or after installing:

Persistent-state backend URL shared by every pvl-core subsystem that needs state. `memory://` is in-process and lost on restart; `file:///path` persists on one server; `redis://`, `dynamodb://` and `mongodb://` each need their matching extra. When unset, defaults to `file:///data/state` (the volume family Docker images mount), or to `memory://` — with a warning — on a host where that directory is not usable.Optional

Environment variable: IMAGE_GENERATION_MCP_KV_STORE_URL

Comma-separated explicit tool names this instance exposes; every other tool is hidden from listings and cannot be invoked. Names matching no registered tool are inert. Mutually exclusive with `tools_deny`. Takes effect through `apply_tool_visibility`.Optional

Environment variable: IMAGE_GENERATION_MCP_TOOLS_ALLOW

Comma-separated explicit tool names hidden from this instance (absent from listings, cannot be invoked). Names matching no registered tool are inert. Mutually exclusive with `tools_allow`. Takes effect through `apply_tool_visibility`.Optional

Environment variable: IMAGE_GENERATION_MCP_TOOLS_DENY

Rename this server instance; defaults to the project name.Optional

Environment variable: IMAGE_GENERATION_MCP_SERVER_NAME

Replaces the default MCP instructions text sent to clients.Optional

Environment variable: IMAGE_GENERATION_MCP_INSTRUCTIONS

Log level for FastMCP internals and app loggers (DEBUG / INFO / WARNING / ERROR / CRITICAL). The -v CLI flag overrides to DEBUG.Optional

Environment variable: FASTMCP_LOG_LEVEL

Set false for plain or structured JSON log output.Optional

Environment variable: FASTMCP_ENABLE_RICH_LOGGING

Deprecated alias for IMAGE_GENERATION_MCP_SD_WEBUI_HOST; logs a warning when used.Optional

Environment variable: IMAGE_GENERATION_MCP_A1111_HOST

Deprecated alias for IMAGE_GENERATION_MCP_SD_WEBUI_MODEL; logs a warning when used.Optional

Environment variable: IMAGE_GENERATION_MCP_A1111_MODEL

When true, write-tagged tools (image generation, transforms, uploads) are hidden from clients. Set false to enable them.Optional

Environment variable: IMAGE_GENERATION_MCP_READ_ONLY

Directory where generated images are saved. Created automatically on first use.Optional

Environment variable: IMAGE_GENERATION_MCP_SCRATCH_DIR

OpenAI API key. Enables the OpenAI provider (gpt-image-2, gpt-image-1.5, dall-e-3) when set.Required

Environment variable: IMAGE_GENERATION_MCP_OPENAI_API_KEY

Google API key. Enables the Gemini provider (gemini-3.1-flash-image and others) when set. Get a key at https://aistudio.google.com/apikey.Required

Environment variable: IMAGE_GENERATION_MCP_GOOGLE_API_KEY

SD WebUI base URL (such as http://localhost:7860). Enables the SD WebUI provider when set. Compatible with AUTOMATIC1111, Forge, reForge, and Forge-neo.Optional

Environment variable: IMAGE_GENERATION_MCP_SD_WEBUI_HOST

SD WebUI checkpoint name, used for model-aware preset detection (SD 1.5 / SDXL / Lightning) and checkpoint override. Unset uses the instance's current model.Optional

Environment variable: IMAGE_GENERATION_MCP_SD_WEBUI_MODEL

Provider used when no keyword triggers auto-selection: auto, openai, gemini, sd_webui, or placeholder. auto picks the first configured provider.Optional

Environment variable: IMAGE_GENERATION_MCP_DEFAULT_PROVIDER

Maximum number of transformed image results (resize, crop, convert) kept in memory. Set 0 to disable caching.Optional

Environment variable: IMAGE_GENERATION_MCP_TRANSFORM_CACHE_SIZE

Comma-separated provider names that cost money; generate_image asks for confirmation (client elicitation) before using them. An empty value falls back to this default; to disable confirmation, set a value that names no provider (such as none).Optional

Environment variable: IMAGE_GENERATION_MCP_PAID_PROVIDERS

Directory for style preset files (Markdown with YAML front matter). Created automatically if it does not exist.Optional

Environment variable: IMAGE_GENERATION_MCP_STYLES_DIR

Allow reading input images from local filesystem paths. Off by default: only URLs and uploads are accepted.Optional

Environment variable: IMAGE_GENERATION_MCP_ALLOW_LOCAL_FILE_INPUT

Maximum accepted input image size in bytes.Optional

Environment variable: IMAGE_GENERATION_MCP_MAX_INPUT_IMAGE_BYTES

HTTP timeout in seconds when fetching remote image URLs (fetch_image and URL inputs).Optional

Environment variable: IMAGE_GENERATION_MCP_FETCH_TIMEOUT_S

Link lifetime in seconds when the caller requests no explicit TTL.Optional

Environment variable: IMAGE_GENERATION_MCP_TRANSFER_TTL_DEFAULT_S

Ceiling in seconds a caller-requested link TTL is clamped to.Optional

Environment variable: IMAGE_GENERATION_MCP_TRANSFER_TTL_MAX_S

Post-success grace window in seconds: a served token's TTL shrinks to this so a stalled transfer can retry within it.Optional

Environment variable: IMAGE_GENERATION_MCP_TRANSFER_GRACE_TTL_S

Crashed-handler reclaim window in seconds for an in-flight reservation.Optional

Environment variable: IMAGE_GENERATION_MCP_TRANSFER_LEASE_S

Maximum size in bytes of a single upload.Optional

Environment variable: IMAGE_GENERATION_MCP_TRANSFER_MAX_UPLOAD_BYTES

Public base URL of the deployed server, e.g. `https://mcp.example.com`. Required for OIDC. Also the fallback source of the MCP Apps domain when `app_domain` is unset.Optional

Environment variable: IMAGE_GENERATION_MCP_BASE_URL

Single shared bearer token; enables bearer auth unless `bearer_tokens_file` is set, which takes precedence.Required

Environment variable: IMAGE_GENERATION_MCP_BEARER_TOKEN

OIDC discovery document URL, e.g. `https://auth.example.com/.well-known/openid-configuration`.Optional

Environment variable: IMAGE_GENERATION_MCP_OIDC_CONFIG_URL

OIDC client identifier registered with the provider.Optional

Environment variable: IMAGE_GENERATION_MCP_OIDC_CLIENT_ID

OIDC client secret registered with the provider.Required

Environment variable: IMAGE_GENERATION_MCP_OIDC_CLIENT_SECRET

Expected `aud` claim; tokens issued for another audience are rejected.Optional

Environment variable: IMAGE_GENERATION_MCP_OIDC_AUDIENCE

Scopes a caller must present, space- or comma-separated. Defaults to `openid` in oidc-proxy mode.Optional

Environment variable: IMAGE_GENERATION_MCP_OIDC_REQUIRED_SCOPES

Scopes advertised to MCP clients in protected-resource metadata, space- or comma-separated. Overrides the default `openid offline_access`; `oidc_required_scopes` is always added on top. Set this when the registered client is not permitted `offline_access`, or to have clients request extra claim scopes (e.g. `groups`) without also requiring them in every token.Optional

Environment variable: IMAGE_GENERATION_MCP_OIDC_ADVERTISED_SCOPES

Signing key for issued JWTs; used in oidc-proxy mode only. When unset, the key is derived deterministically from `oidc_client_secret`, so tokens survive a restart — but rotating that secret invalidates every issued token. Set this explicitly to decouple token validity from secret rotation. Generate with `openssl rand -hex 32`.Required

Environment variable: IMAGE_GENERATION_MCP_OIDC_JWT_SIGNING_KEY

Validate the access token instead of the id token.Optional

Environment variable: IMAGE_GENERATION_MCP_OIDC_VERIFY_ACCESS_TOKEN

MCP Apps iframe domain, used for CSP sandboxing. Overrides the host derived from `base_url`.Optional

Environment variable: IMAGE_GENERATION_MCP_APP_DOMAIN

Explicit auth-mode override, accepting `remote` or `oidc-proxy` (case- and whitespace-insensitive). When unset the mode is auto-detected from which auth variables are set; the override exists because having all four OIDC variables set is ambiguous between those two modes. Other values are ignored with a warning.Optional

Environment variable: IMAGE_GENERATION_MCP_AUTH_MODE

Path to a TOML file mapping bearer tokens to subjects; overrides the single-token `bearer_token` mode.Optional

Environment variable: IMAGE_GENERATION_MCP_BEARER_TOKENS_FILE

Subject assigned to the single-token bearer mode; ignored when `bearer_tokens_file` is set, since mapped mode carries per-token subjects.Optional

Environment variable: IMAGE_GENERATION_MCP_BEARER_DEFAULT_SUBJECT

Mount path for the MCP endpoint.Optional

Environment variable: IMAGE_GENERATION_MCP_HTTP_PATH

Run the server process as this UID; the container entrypoint chowns writable paths to match.Optional

Environment variable: PUID

Run the server process as this GID; pair with PUID to match the owner of a mounted volume.Optional

Environment variable: PGID

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-pvliesdonk-image-generation-mcp": {
      "env": {
        "PGID": "your-pgid-here",
        "PUID": "your-puid-here",
        "FASTMCP_LOG_LEVEL": "your-fastmcp-log-level-here",
        "IMAGE_GENERATION_MCP_BASE_URL": "your-image-generation-mcp-base-url-here",
        "IMAGE_GENERATION_MCP_AUTH_MODE": "your-image-generation-mcp-auth-mode-here",
        "IMAGE_GENERATION_MCP_HTTP_PATH": "your-image-generation-mcp-http-path-here",
        "IMAGE_GENERATION_MCP_READ_ONLY": "your-image-generation-mcp-read-only-here",
        "IMAGE_GENERATION_MCP_A1111_HOST": "your-image-generation-mcp-a1111-host-here",
        "IMAGE_GENERATION_MCP_A1111_MODEL": "your-image-generation-mcp-a1111-model-here",
        "IMAGE_GENERATION_MCP_SCRATCH_DIR": "your-image-generation-mcp-scratch-dir-here",
        "IMAGE_GENERATION_MCP_SERVER_NAME": "your-image-generation-mcp-server-name-here",
        "IMAGE_GENERATION_MCP_BEARER_TOKEN": "your-image-generation-mcp-bearer-token-here",
        "IMAGE_GENERATION_MCP_INSTRUCTIONS": "your-image-generation-mcp-instructions-here",
        "IMAGE_GENERATION_MCP_KV_STORE_URL": "your-image-generation-mcp-kv-store-url-here",
        "IMAGE_GENERATION_MCP_OIDC_AUDIENCE": "your-image-generation-mcp-oidc-audience-here",
        "IMAGE_GENERATION_MCP_SD_WEBUI_HOST": "your-image-generation-mcp-sd-webui-host-here",
        "IMAGE_GENERATION_MCP_OIDC_CLIENT_ID": "your-image-generation-mcp-oidc-client-id-here",
        "IMAGE_GENERATION_MCP_OPENAI_API_KEY": "your-image-generation-mcp-openai-api-key-here",
        "IMAGE_GENERATION_MCP_SD_WEBUI_MODEL": "your-image-generation-mcp-sd-webui-model-here",
        "IMAGE_GENERATION_MCP_EVENT_STORE_URL": "your-image-generation-mcp-event-store-url-here",
        "IMAGE_GENERATION_MCP_OIDC_CONFIG_URL": "your-image-generation-mcp-oidc-config-url-here",
        "IMAGE_GENERATION_MCP_DEFAULT_PROVIDER": "your-image-generation-mcp-default-provider-here",
        "IMAGE_GENERATION_MCP_OIDC_CLIENT_SECRET": "your-image-generation-mcp-oidc-client-secret-here",
        "IMAGE_GENERATION_MCP_OIDC_JWT_SIGNING_KEY": "your-image-generation-mcp-oidc-jwt-signing-key-here",
        "IMAGE_GENERATION_MCP_OIDC_REQUIRED_SCOPES": "your-image-generation-mcp-oidc-required-scopes-here",
        "IMAGE_GENERATION_MCP_OIDC_VERIFY_ACCESS_TOKEN": "your-image-generation-mcp-oidc-verify-access-token-here"
      },
      "args": [
        "image-generation-mcp"
      ],
      "command": "uvx"
    }
  }
}

Reviews

No reviews yet

Be the first to review this server!