Skip to main content

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

Project description

imagine-mcp

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

Production-grade MCP server for image and video understanding + generation across Gemini, OpenAI, and Grok.

CI codecov PyPI Docker License: MIT

Python FastMCP MCP semantic-release Renovate

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
  • Leaderboard-ranked models -- Provider ordering auto-refreshed weekly from Artificial Analysis + LMArena leaderboards
  • Zero-config onboarding -- Browser-based credential relay form; no .env files or manual credential plumbing
  • 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
  • Smart stdio proxy -- stdio transport spawns a local HTTP daemon and forwards JSON-RPC frames, sharing credentials across invocations

Setup

With AI Agent -- copy and send this to your AI agent:

Please set up imagine-mcp for me. Follow this guide: https://raw.githubusercontent.com/n24q02m/imagine-mcp/main/docs/setup-with-agent.md

Manual setup -- follow docs/setup-manual.md

Tools

Tool Actions Description
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.
config open_relay, relay_status, relay_skip, relay_reset, relay_complete, warmup, status, set, cache_clear Credential + runtime config: open relay form, check credential state, set runtime knobs (log level, default provider, TTL), clear response cache.
help -- Full Markdown documentation for understand, generate, or config topics.

Model IDs per provider x action x tier are leaderboard-ranked; see docs/models.md (auto-regenerated from src/imagine_mcp/models.py).

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.
  • Relay transport -- Credentials submitted through the local relay form are stored encrypted via mcp-core (config.enc, user-scoped platformdirs).

Build from Source

git clone https://github.com/n24q02m/imagine-mcp.git
cd imagine-mcp
mise run setup      # or: uv sync --group dev
mise run dev        # run http local relay daemon

Contributing

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

License

MIT -- see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imagine_mcp-1.2.0b1.tar.gz (111.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

imagine_mcp-1.2.0b1-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file imagine_mcp-1.2.0b1.tar.gz.

File metadata

  • Download URL: imagine_mcp-1.2.0b1.tar.gz
  • Upload date:
  • Size: 111.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for imagine_mcp-1.2.0b1.tar.gz
Algorithm Hash digest
SHA256 e4958011b972e5066f54b3faa6ecc0360d04f0ea8e1177c25a82f156dffd53bf
MD5 27b101b7e49650f06a8e969a1a809d30
BLAKE2b-256 32c898319f5c61b22fd1f48440d4c296034faa2fbfb6a57924d843959a6cdd5c

See more details on using hashes here.

File details

Details for the file imagine_mcp-1.2.0b1-py3-none-any.whl.

File metadata

  • Download URL: imagine_mcp-1.2.0b1-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for imagine_mcp-1.2.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 13b6df1b14a1a4974664b96851ec0cf7c3d79d9b14b770f4df605a9d1624354e
MD5 345dc42e5a7f35f15bc80b99c9c0c23b
BLAKE2b-256 392b9062a469a0f206f99226ed286905e5b6d6d057c171a755c51be177562352

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page