Imagine Mcp

io.github.n24q02m由 GitHub 帳號 n24q02m 發布v1.11.6更新於 Oct 24, 2026

MCP server for image/video understanding & generation (Gemini/OpenAI/Grok)

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

已封存的 MCP 伺服器,讓助理理解圖片與影片連結,並透過 Gemini、OpenAI 或 Grok 生成圖片和影片。

可以做什麼
  • 依提示詞、供應商與等級,描述、分類或推理一個以上的圖片與影片連結
  • 以文字提示生成圖片或影片,可選參考圖、長寬比與時長,並用 job id 輪詢影片任務
  • 檢視與調整執行期設定,例如憑證狀態、預設供應商與等級、日誌等級和回應快取有效期
  • 讀取 understand、generate 與 config 工具的內建 Markdown 說明
適用情境
適合助理需要在同一工作階段中檢視圖片或影片並產出新媒體的情況,以同一介面涵蓋三家供應商,並可在便宜快速與高品質等級間切換。請注意本專案已封存,README 建議改用圖片供應商的原生 API;既有安裝仍可運作,但不再有更新或支援。
執行需求
透過 uvx 或 Docker 映像以 stdio 在本機執行,也可自行架設 HTTP 常駐服務。至少需要一組供應商金鑰:GEMINI_API_KEY、OPENAI_API_KEY 或 XAI_API_KEY;stdio 模式下若皆未設定會直接結束。可用 UNDERSTAND_MODELS、GENERATE_MODELS 等選用變數調整模型鏈。需要連線至各供應商網路。
安裝前請注意
供應商金鑰是會計費的機密,理解與生成呼叫都會產生費用。generate 工具會建立媒體,可能寫入輸出檔案。伺服器會抓取媒體連結,但只接受 http 與 https 協定。HTTP 模式下憑證以加密方式存放於使用者家目錄;若使用共用中繼密碼,工作區使用者名稱僅是分區鍵而非機密。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Imagine Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

ARCHIVED 2026-09-13 — This repository is no longer maintained. Use your image provider's native API instead of this MCP server. Existing installations keep working but receive no updates or support.

imagine-mcp

mcp-name: io.github.n24q02m/imagine-mcp

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

[Mode: daemon · http remote relay] [CI] [codecov] [PyPI] [Docker] [License: Apache-2.0]

[Python] [FastMCP] [MCP] [semantic-release] [Renovate]

Sister projects from n24q02m (click to expand)
ProjectTaglineTag
agent-chat-pluginPeer AI agents chat in a shared folder — no human relay, no orchestrator, wor...Tooling
better-code-review-graphKnowledge graph for token-efficient code reviews -- semantic search and call-...MCP
better-drive2-way Google Drive sync with .driveignore filter — rclone engine, Windows trayTooling
better-email-mcpIMAP/SMTP email for AI agents -- read, send, organize folders, and manage att...MCP
better-godot-mcpComposite MCP server for Godot Engine -- 17 composite tools for AI-assisted g...MCP
better-notion-mcpMarkdown-first Notion for AI agents -- pages, databases, blocks, and comments...MCP
better-semantic-releaseDrop-in python-semantic-release fork with built-in release-safety guards (orp...Tooling
better-telegram-mcpTelegram for AI agents -- messages, chats, media, and contacts across both bo...MCP
better-workspace-mcpGoogle Workspace MCP server (Docs/Drive/Calendar/Gmail/Sheets/Slides/Tasks/Ch...MCP
claude-pluginsClaude Code plugin marketplace for the n24q02m MCP servers -- install web sea...Marketplace
imagine-mcpImage and video understanding + generation for AI agents -- across Gemini, Op...MCP
jules-task-archiverChrome Extension for bulk operations on Jules tasks via batchexecute API -- a...Tooling
mcp-coreShared foundation for building MCP servers -- Streamable HTTP transport, OAut...MCP
mnemo-mcpPersistent AI memory with hybrid search and embedded sync. Open, free, unlimi...MCP
qwen3-embedLightweight Qwen3 text embedding and reranking via ONNX Runtime and GGUFLibrary
skretSecrets without the server.CLI
tacetA self-distilling neuro-symbolic cascade that amortises LLM cost across knowl...Tooling
web-coreShared web infrastructure package for search, scraping, HTTP security, and st...Library
wet-mcpOpen-source MCP server for AI agents: web search, content extraction, and lib...MCP

Table of contents

[imagine-mcp server]

Features

  • 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 for gemini / openai / grok at poor (cheap/fast) or rich (high quality); swap via parameter
  • Open model passthrough -- Understanding routes through litellm; pass any provider/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 of understand responses with configurable TTL
  • Dual transport -- pure stdio with provider env vars (default) or HTTP multi-user with paste-token relay form

Install

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

bash
# uvx -- recommended, runs the published PyPI packageuvx imagine-mcp
# Dockerdocker run -it --rm ghcr.io/n24q02m/imagine-mcp:latest

Add it to an MCP client by pointing the client at the uvx imagine-mcp command and supplying at least one provider key (see Configuration):

json
{  "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 the Setup docs.

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

Install MCP server imagine-mcp following the steps at https://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/imagine-mcp/setup-with-agent.md

Smithery

imagine-mcp ships a smithery.yaml so it can be installed and run through Smithery. 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; see Configuration).

Configuration

Two transports (default stdio; opt into http with --http, MCP_TRANSPORT=http, or TRANSPORT_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 on 127.0.0.1 by default, or multi-user remote (per-JWT-sub credential isolation) when PUBLIC_URL + MCP_DCR_SERVER_SECRET are set. In HTTP mode credentials are entered through a browser form at /authorize.

Provider keys

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

Env varProviderGet a key at
GEMINI_API_KEYGemini (image + video)aistudio.google.com/apikey
OPENAI_API_KEYOpenAI (image)platform.openai.com/api-keys
XAI_API_KEYGrok / xAI (image + video)console.x.ai

When a tool is called without an explicit provider, the first key present wins in the order XAI_API_KEY -> OPENAI_API_KEY -> GEMINI_API_KEY.

Model chains (optional)

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 litellm provider/model entries; the order is the fallback order.

Env varPurpose
UNDERSTAND_MODELSOrdered model chain for understand (litellm fallback). Empty and no explicit model -> understand fails loud (no built-in default).
GENERATE_MODELSOrdered model chain for generate. The first entry selects the native provider + model. Empty -> the provider's own minimal built-in default.
GENERATE_PROVIDER_PRIORITYCSV of provider names reordering generation auto-fallback. Defaults to grok,openai,gemini.

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

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

Runtime knobs

config(action="set", key=..., value=...) adjusts log_level, default_provider, default_tier, and cache_ttl_seconds at runtime.

CLI

The imagine-mcp console command installed by the package takes no subcommands -- it starts the MCP server directly. Transport is selected by a single flag or its environment-variable equivalents:

bash
imagine-mcp            # stdio transport (default); reads provider keys from env varsimagine-mcp --http     # HTTP daemon; credentials via the browser setup form
InvocationEquivalent envResult
imagine-mcpMCP_TRANSPORT unsetstdio, single-user, env-var credentials
imagine-mcp --httpMCP_TRANSPORT=http (or TRANSPORT_MODE=http)HTTP daemon -- local 127.0.0.1 self-host, or multi-user remote when PUBLIC_URL + MCP_DCR_SERVER_SECRET are set

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 when PUBLIC_URL is set; see Configuration.

Remote (HTTP mode)

An HTTP deployment serves clients that support remote HTTP MCP servers. It is OAuth-gated -- an unauthenticated request returns 401 with a WWW-Authenticate: Bearer challenge -- and credentials are provisioned through the browser setup form. Point an HTTP-capable MCP client at https://<your-host>/mcp and complete the OAuth flow to connect. To stand one up, see Deploy to Cloudflare.

Documentation

Full docs at mcp.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

Tools

4 MCP tools (understand, generate, config, help), plus config__open_relay (framework-injected by mcp-core):

ToolActionsDescription
understand--Describe or reason over one or more image/video URLs. media_urls: list[str], prompt: str, provider, tier, max_tokens.
generate--Generate an image or video from a text prompt. media_type: image|video, optional reference_image_url, optional job_id (video poll), aspect_ratio, duration_seconds.
configsetup_status, setup_skip, setup_reset, setup_complete, warmup, status, set, cache_clear (relay_status/relay_skip/relay_reset/relay_complete honored as deprecated aliases)Credential + runtime config: check credential state, set runtime knobs (log level, default provider, TTL), clear response cache.
help--Full Markdown documentation for understand, generate, or config topics.
config__open_relay--Framework-injected helper (mcp-core); opens the browser credential form.

Model choice is caller-driven (litellm provider/model passthrough or a *_MODELS env chain) -- see Model chains above.

Comparison

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

Capabilityimagine-mcpEverArt MCPfal.ai MCPReplicate Flux MCP
Image/video understandingYes (describe / classify / reason over image + video URLs)NoNoNo
Image generationYes (text-to-image + image-to-image via reference_image_url)Yes (single generate_image)Yes (text/image-to-image, edit, inpaint)Yes (single generate_image)
Video generationYes (text-to-video + image-to-video, async job_id poll)NoYes (text/image-to-video)No
Multi-provider backendsYes (Gemini / OpenAI / Grok, auto-fallback)No (EverArt only)No (fal.ai only)No (Replicate Flux only)
Quality/cost tiersYes (poor cheap-fast vs rich high-quality per provider)NoNoNo
Self-hostable / open sourceYes (Apache-2.0, stdio + HTTP self-host)Yes (MIT, archived)Yes (MIT)Yes (MIT, archived)

Security

  • SSRF + LFI prevention -- All media_urls and reference_image_url are validated at the dispatch boundary; only http:// and https:// 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 via mcp-core (AES-GCM, machine-bound key) at ~/.imagine-mcp/config.json.

Workspace username (HTTP setup form)

The browser credential form has an optional workspace username field. Entering the same username always lands you in the same per-sub bucket, 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 /authorize round-trip. Leaving it blank keeps the previous per-authorize behaviour.

Trust boundary: when the form is gated by a shared 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.

Build from Source

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

Deploy to Cloudflare

[Deploy to Cloudflare]

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 the Workers Paid plan -- required for Containers (the Cloudflare free tier does not include Containers) -- and the wrangler CLI.

  1. git clone https://github.com/n24q02m/imagine-mcp && cd imagine-mcp
  2. wrangler login
  3. Create the KV namespace (imagine is KV-only -- no D1 or Vectorize), then paste the returned id into wrangler.jsonc (the <imagine-kv-namespace-id> placeholder):
    wrangler kv namespace create imagine-kv
  4. Push the container image to your Cloudflare managed registry (CF Containers cannot pull from external registries directly), then set <YOUR_ACCOUNT_ID> in wrangler.jsonc:
    docker pull ghcr.io/n24q02m/imagine-mcp:betadocker tag ghcr.io/n24q02m/imagine-mcp:beta imagine-mcp:betawrangler containers push imagine-mcp:beta   # prints registry.cloudflare.com/<ACCOUNT_ID>/imagine-mcp:beta
  5. Point the remaining wrangler.jsonc placeholders at your own domain: <YOUR_PUBLIC_URL> (the vars.PUBLIC_URL, e.g. https://imagine.example.com) and <YOUR_WORKER_DOMAIN> (the routes custom-domain pattern, e.g. imagine.example.com).
  6. Set secrets. CREDENTIAL_SECRET (stable JWT signing key + per-user vault key) and MCP_DCR_SERVER_SECRET (proof of an intentional multi-user deploy) are required; MCP_RELAY_PASSWORD gates the browser setup form's login. Provider keys are optional server defaults -- users normally paste their own through the setup form instead:
    wrangler secret put CREDENTIAL_SECRETwrangler secret put MCP_DCR_SERVER_SECRETwrangler secret put MCP_RELAY_PASSWORDwrangler secret put GEMINI_API_KEY       # optional provider defaultwrangler secret put OPENAI_API_KEY       # optional provider defaultwrangler secret put XAI_API_KEY          # optional provider default
  7. wrangler deploy, then open your Worker domain and finish setup in the browser relay form.

The http container image already runs multi-user (MCP_TRANSPORT=http is baked into the image target). Storage maps to Cloudflare via MCP_STORAGE_BACKEND=cf-kv (encrypted credential vault) with IMAGINE_OUTPUT_MODE=base64, which forces base64 responses so no media path is written to the ephemeral container filesystem.

Deployment

The Cloudflare deployment is CD-managed: publishing a release triggers the deploy-cf job in .github/workflows/cd.yml, which checks out the released tag, builds the http-slim container image tagged with the released version, pushes it to Cloudflare's managed registry, deploys the Worker + Container stack, and gates on a canary -- a failed canary fails the job rather than landing a bad deploy, so the live image always corresponds to a released, immutable image tag. Hand-running wrangler deploy against that deployment breaks the release-to-tag correspondence and is not the supported path; to run your own instance instead, see Deploy to Cloudflare.

The job is currently gated off: the repository Actions variable CF_HOSTED_ENABLED is set to false, so releases do not auto-deploy and no hosted endpoint is operated. Self-hosting (above) is the active HTTP path.

Trust Model

This plugin implements TC-Local (machine-bound, single trust principal). See mcp-core trust model for full classification.

ModeStorageEncryptionWho can read your data?
stdio (default)~/.imagine-mcp/config.jsonAES-GCM, machine-bound keyOnly your OS user (file perm 0600)
HTTP self-hostSame as stdioSameOnly you (admin = user)

Contributing

See CONTRIBUTING.md for the full development workflow, commit convention, and release process. Issues + Discussions welcome.

License

Apache-2.0 -- see LICENSE.

來源:README.md,提交 fae631e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.11.6最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分