imagine-mcp

by n24q02m

Not rated
GitHub

About

Image and video understanding and generation

Details

Author
n24q02m
Categories
Design, Media, Other, AI

Setup

Install imagine-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/n24q02m/imagine-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

Image and video understanding + generation for AI agents -- across Gemini, OpenAI, and Grok.

- Features
-
Install
-
Smithery
-
Configuration
-
CLI
-
Remote (HTTP mode)
-
Documentation
-
Tools
-
Comparison
-
Security
-
Build from Source
-
Deploy to Cloudflare
-
Trust Model
-
Contributing
-
License

- Multimodal understanding-- Describe, classify, or reason over images and videos (Gemini handles mixed image + video in one call)
- Image generation-- Text-to-image and image-to-image (edit / inpaint) across Gemini Imagen, OpenAI gpt-image, Grok Imagine
- Video generation-- Text-to-video and image-to-video (Gemini Veo 3.1, Grok Imagine Video)
- 3 providers x 2 tiers-- Same interface forgemini/openai/grokatpoor(cheap/fast) orrich(high quality); swap via parameter
- Open model passthrough-- Understanding routes through litellm; pass anyprovider/model, or configure an ordered model chain (no hardcoded catalog)
- Degraded mode-- Server starts with zero credentials and surfaces remaining providers as you add keys
- Response cache-- Disk-based caching ofunderstandresponses with configurable TTL
- Dual transport-- pure stdio with provider env vars (default) or HTTP multi-user with paste-token relay form

Run withuvx(no install step) or pull the container image:

# uvx -- recommended, runs the published PyPI package uvx imagine-mcp # Docker docker run -it --rm ghcr.io/n24q02m/imagine-mcp:latest

Add it to an MCP client by pointing the client at theuvx imagine-mcpcommand and supplying at least one provider key (seeConfiguration):

{ "mcpServers": { "imagine": { "command": "uvx", "args": ["imagine-mcp"], "env": { "GEMINI_API_KEY": "AIza..." } } } }

For per-client snippets (Claude Code, Codex, Gemini CLI, Cursor, Windsurf) and the browser-based HTTP setup, see theSetup docs.

Install with an AI agent-- paste this to your AI coding agent:

Install MCP serverimagine-mcpfollowing the steps athttps://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/imagine-mcp/setup-with-agent.md

imagine-mcp ships asmithery.yamlso it can be installed and run throughSmithery. The entry launches the published PyPI package over stdio (uvx --python 3.13 imagine-mcp) with an empty config schema -- no setup fields are required at deploy time. Provider keys are supplied at runtime through the server's own credential flow (env vars in stdio mode, or the browser setup form in HTTP mode; seeConfiguration).

Two transports (defaultstdio; opt intohttpwith--http,MCP_TRANSPORT=http, orTRANSPORT_MODE=http):

- stdio(default) -- single-user, reads credentials from env vars only. Exits if none of the three provider keys are set.
- http-- HTTP daemon. Local self-host on127.0.0.1by default, or multi-user remote (per-JWT-sub credential isolation) whenPUBLIC_URL+MCP_DCR_SERVER_SECRETare set. In HTTP mode credentials are entered through a browser form at/authorize.

All optional -- the server starts in degraded mode and surfaces whichever providers have a key. Set at least one.

When a tool is called without an explicitprovider, the first key present wins in the orderXAI_API_KEY->OPENAI_API_KEY->GEMINI_API_KEY.

Model choice passes straight through to litellm (understand) or the native provider SDK (generate) -- there is no hardcoded model catalog. Each chain is a CSV of litellmprovider/modelentries; the order is the fallback order.

Understanding is routed through litellm (provider/modelpassthrough), so any litellm provider works -- supply that provider's<PROVIDER>_API_KEY. Generation stays on the native provider SDKs (Gemini, OpenAI, Grok). Example:

{ "mcpServers": { "imagine": { "command": "uvx", "args": ["imagine-mcp"], "env": { "UNDERSTAND_MODELS": "gemini/<model-id>,openai/<model-id>", "GEMINI_API_KEY": "AIza...", "OPENAI_API_KEY": "sk-..." } } } }

config(action="set", key=..., value=...)adjustslog_level,default_provider,default_tier, andcache_ttl_secondsat runtime.

Theimagine-mcpconsole command installed by the package takesno subcommands-- it starts the MCP server directly. Transport is selected by a single flag or its environment-variable equivalents:

imagine-mcp # stdio transport (default); reads provider keys from env vars imagine-mcp --http # HTTP daemon; credentials via the browser setup form

In stdio mode the server exits if none of the provider keys are set. The remote HTTP bind knobs (MCP_HOST,MCP_PORT) apply only whenPUBLIC_URLis set; seeConfiguration.

An HTTP deployment serves clients that support remote HTTP MCP servers. It is OAuth-gated -- an unauthenticated request returns401with aWWW-Authenticate: Bearerchallenge -- and credentials are provisioned through the browser setup form. Point an HTTP-capable MCP client athttps://<your-host>/mcpand complete the OAuth flow to connect. To stand one up, seeDeploy to Cloudflare.

Full docs atmcp.n24q02m.com/servers/imagine-mcp/setup/:

- Setup-- install methods for Claude Code, Codex, Gemini CLI, Cursor, Windsurf, mcp.json
-
Modes overview-- stdio / local-relay / remote-relay / remote-oauth
-
Multi-user setup-- per-JWT-sub credential model

Model choice is caller-driven (litellmprovider/modelpassthrough or a_MODELSenv chain) -- seeModel chainsabove.

How imagine-mcp stacks up against direct competitors in each pillar:

- SSRF + LFI prevention-- Allmedia_urlsandreference_image_urlare validated at the dispatch boundary; onlyhttp://andhttps://schemes reach the providers.file://,ftp://,gopher://, and scheme-less URLs are rejected.
- No credentials in errors-- Provider-side errors are sanitized before being returned.
- Degraded start-- Missing credentials do not prevent the server from starting; affected actions surface actionable errors instead of crashing at boot.
- Credential storage-- Credentials submitted through the browser credential form are stored encrypted viamcp-core(AES-GCM, machine-bound key) at~/.imagine-mcp/config.json.

The browser credential form has an optionalworkspace usernamefield. Entering the same username always lands you in the same per-subbucket, so your provider keys stay reachable across a re-authorization and across devices, instead of being tied to the one-off subject minted for each/authorizeround-trip. Leaving it blank keeps the previous per-authorize behaviour.

Trust boundary: when the form is gated by ashared*MCP_RELAY_PASSWORD, the username is a partition key, not a secret -- anyone who knows that password can type any username and reach that bucket. That is fine for a trusted group; an untrusted multi-tenant deployment needs a per-user secret or delegated OAuth instead.

One-time migration:existing users must re-enter their credentials once after this change. Nothing is deleted; credentials stored under the old random subject are simply no longer addressed.

git clone https://github.com/n24q02m/imagine-mcp.git cd imagine-mcp mise run setup # or: uv sync --group dev mise run dev # run the server in stdio mode (add --http for the HTTP daemon)

Run your own imagine instance serverless on Cloudflare (Worker + Container + KV). Storage is KV-only -- the per-user credential vault lives in KV, and generation returns base64 only because the container filesystem is ephemeral (IMAGINE_OUTPUT_MODE=base64).

Prerequisites:a Cloudflare account on theWorkers Paid plan-- required for Containers (the Cloudflare free tier does not include Containers) -- and thewranglerCLI.
- git clone https://github.com/n24q02m/imagine-mcp && cd imagine-mcp
- wrangler login
- Create the KV namespace (imagine is KV-only -- no D1 or Vectorize), then paste the returned id intowrangler.jsonc(the<imagine-kv-namespace-id>placeholder):

wrangler kv namespace create imagine-kv
docker pull ghcr.io/n24q02m/imagine-mcp:beta docker tag ghcr.io/n24q02m/imagine-mcp:beta imagine-mcp:beta wrangler containers push imagine-mcp:beta # prints registry.cloudflare.com/<ACCOUNT_ID>/imagine-mcp:beta
wrangler secret put CREDENTIAL_SECRET wrangler secret put MCP_DCR_SERVER_SECRET wrangler secret put MCP_RELAY_PASSWORD wrangler secret put GEMINI_API_KEY # optional provider default wrangler secret put OPENAI_API_KEY # optional provider default wrangler secret put XAI_API_KEY # optional provider default

Thehttpcontainer image already runs multi-user (MCP_TRANSPORT=httpis baked into the image target). Storage maps to Cloudflare viaMCP_STORAGE_BACKEND=cf-kv(encrypted credential vault) withIMAGINE_OUTPUT_MODE=base64, which forces base64 responses so no media path is written to the ephemeral container filesystem.

This plugin implementsTC-Local(machine-bound, single trust principal). Seemcp-core trust modelfor full classification.

SeeCONTRIBUTING.mdfor the full development workflow, commit convention, and release process. Issues + Discussions welcome.

Hosted remote MCP server for AI image and video generation from one Streamable HTTP endpoint.

Style-locking AI image engine with a hosted MCP server. Define one master style and generate unlimited matching images.

Generate professional fashion & product visuals — images and videos, virtual try-on, product-to-model, image editing and HD upscaling — right inside your chat, using your own account.

AI Video, Image & Audio Generation with over 150 models

Convert photos to LEGO-style brick mosaic previews with AI-powered color quantization. MCP server for Claude, Cursor, and other AI agents.

Official Cannon Studio MCP for AI video, image, 3D, audio, workflow, pricing, model, and developer API guidance.

a specialised AI text remover for photos and graphics

Official FLUX MCP server from Black Forest Labs. Generate, edit, vary, and browse FLUX.2 images directly in any MCP-compatible client

MCP server for OpenAI GPT image generation and editing

Generate green-screen assets and convert them into transparent PNGs.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.