Skip to main content

Prerequisites

  • Node.js 22+ recommended for the local package
  • For ordinary generate_image, configure one of these backends. generate_video and all five Skills require MeiGen Cloud:
    • MeiGen Cloud — an API key from the desktop API Keys page
    • ComfyUI — a running ComfyUI server (installation guide)
    • OpenAI-Compatible API — your own key from any provider (Together AI, Fireworks AI, OpenAI, etc.)
You don’t need a provider to get started. Gallery search, prompt enhancement, and inspiration tools work without any API key.

Ask an AI assistant to install it

Copy into a local Codex, Claude Code, Cursor or other assistant that can edit MCP configuration:
See remote setup for Codex HTTP and ChatGPT web instructions.

Installation

Prefer zero installation? The remote MCP endpoint needs no Node.js or local npx process — configure an HTTP-capable MCP host at https://www.meigen.ai/api/mcp over HTTP.

Claude Code Plugin

1

Install the plugin

Restart Claude Code after installation (close and reopen, or open a new terminal tab).
2

Configure a provider

Start a new Claude Code session and run /meigen:setup. Use the guide to choose a provider; enter credentials yourself in private host settings or local configuration, never in the conversation. The plugin can supply MCP configuration: inspect the existing server and avoid adding a duplicate.Alternatively, set environment variables directly (see Provider Configuration below).
3

Start using it

Ask Claude to generate images or videos naturally:
  • “Generate a minimalist logo for a coffee shop”
  • “Animate this photo into a 5-second clip”
  • “Search the gallery for cyberpunk cityscapes”
  • “Enhance this prompt: a cat in space”
Also listed on the community wshobson/agents marketplace. Third-party listings can lag behind the main release. Inspect the installed package and add an MCP entry only if it is missing.

Cursor / VS Code / Windsurf / Roo Code

One command writes the right MCP config file for each editor:
The init helper writes a configuration that follows the latest npm release. To pin this version, edit its generated args to meigen@2.0.0; running the helper from a pinned package does not itself pin the generated entry. Set credentials in the MCP process environment or private host settings, then restart.

Codex CLI, IDE extension and local Codex desktop host

Remote HTTP is recommended for MeiGen Cloud and Skills. For a local process, merge this into ~/.codex/config.toml instead of a remote entry:
Set MEIGEN_API_TOKEN in the environment that launches Codex. For public-only setup without a key, omit env_vars until the variable exists. Codex does not automatically load a project’s .env.local. You can first register the command with codex mcp add meigen -- npx -y meigen@2.0.0, then add the environment forwarding and timeouts to its existing table. meigen init codex is not supported. A 240-second tool timeout is suitable for Skills; long generic video generation can require more. Restart/reconnect, inspect codex mcp list and /mcp, then make an actual list_skills call. See the official Codex configuration guide. ChatGPT web does not share this local setup; it supports public queries only with the current MeiGen authentication.

Hermes Agent (NousResearch)

Hermes is a first-class MCP client. Add to ~/.hermes/config.yaml:
Set timeout to 2700, not the Hermes default (120s). Long video generations — especially reference-video continuation — can run past 15 minutes. A shorter timeout disconnects Hermes while the job is still running server-side, after credits have already been deducted. connect_timeout: 120 covers the first slow npx download.If a session disconnects mid-generation, query check_generation with the original generationId or persisted UUID requestId. If recovery calls for resubmission, keep the same ID and exact inputs; a new ID creates a new paid attempt. Use wait=false/download=false for composed MeiGen steps; see workflow recovery.

Standalone CLI (no MCP host required)

For shell scripts, CI pipelines, or anyone who wants AI image generation without an MCP host:
Generated images save to ~/Pictures/meigen/ by default — see Output Directories to change where files land.

OpenClaw

MeiGen is also distributed as the meigen-ai-design bundle and the creative-toolkit Skill. These are separate distribution artifacts with independent versions. Follow the repository installation guide for the supported install command and current bundle layout. Inspect the installed manifest and configure exactly one MCP connection; a standalone Skill does not prove that its MCP server is connected.

Other MCP-Compatible Hosts

For any host that consumes stdio MCP, add this to its config file:

Provider Configuration

These provider choices apply to ordinary image generation. Skills always require MeiGen Key and purchased credits. Configure one or more providers. When multiple are available, the plugin selects in order: MeiGen → ComfyUI → OpenAI-compatible. You can override this per-request.

MeiGen Cloud

The easiest way to get started. MeiGen’s hosted API gives you image and video models from OpenAI, Google, ByteDance, Midjourney, xAI, Black Forest Labs, Alibaba, and Agnes — no GPU required. Call list_models for the current lineup, or see the model comparison for capabilities and pricing. Create a key using a desktop browser at API Keys. Use the same account to choose Top Up on Profile, or purchase on mobile.
API keys can only use purchased credits, not daily free credits. Ensure your account has purchased credits before generating via the plugin.

Bring Your Own API (OpenAI-Compatible)

Connect any image generation API that follows the OpenAI format — Together AI, Fireworks AI, DeepInfra, SiliconFlow, OpenAI, or your own endpoint. Set OPENAI_BASE_URL to point to your provider’s endpoint. If omitted, defaults to OpenAI’s API.

ComfyUI (Local)

Run image generation on your own GPU with full control over models, samplers, and workflows. Free to use — no API key needed. Requirements:
  1. ComfyUI must be running and accessible at the configured URL
  2. You need at least one imported workflow template — see the ComfyUI Guide
ComfyUI runs serially: one image at a time.

Output Directories

General image/video generation and the standalone CLI can save files locally. Dedicated Skills return image URLs/resource links; download them explicitly when you need local files. Set these the same way as your provider variables — in the env block of your MCP config, or exported in your shell for CLI use.

Verify Installation

After setup, ask your AI assistant:
“List MeiGen’s available Skills and current prices”
Confirm a real list_skills call succeeds without generation or charges. Use list_models separately to inspect general-generation backends. A saved configuration is not proof of connection.

Usage

Once installed, ask your AI assistant in plain language — for example, “Generate a watercolor landscape, 16:9 aspect ratio”. See the overview for the full list of tools.

Upgrade from an earlier version

Your existing MeiGen key, MEIGEN_API_TOKEN and private ~/.config/meigen/config.json can be reused. Change a fixed older npm version to meigen@2.0.0, then restart. Entries tracking the latest release also need a restart and a version/tool check. Local npm exposes 17 tools; the existing nine remain and the new dedicated flows change how the agent routes Skill requests. Claude/OpenClaw instructions and manifests update through their own distribution; upgrading npm alone does not replace them. Remote users do not upgrade npm: wait for backend deployment, then refresh/reconnect. No mandatory switch from local to remote is required. See source and release notes. For Skill image limits, interrupted requests, resizing confirmation and price changes, follow the Skills API guide. A Skill upload failure must not trigger paid submission or status polling.

Troubleshooting

No provider is set up. On Claude Code, run /meigen:setup (interactive wizard). On other hosts (Cursor, Codex, Windsurf, Hermes Agent, etc.), add the env var to your MCP config file directly:
  • MeiGen: MEIGEN_API_TOKEN
  • OpenAI-compatible: OPENAI_API_KEY
  • ComfyUI: COMFYUI_URL (and import a workflow)
Then restart the host.
API keys can only use purchased credits, not daily free credits. Use the same key-owner account and choose Top Up on Profile; mobile checkout.
  1. Make sure ComfyUI is running (python main.py in the ComfyUI directory)
  2. Check that COMFYUI_URL matches the address shown when ComfyUI starts (default: http://127.0.0.1:8188)
  3. If running on a different machine, ensure the port is accessible
  1. Open the ComfyUI web UI and check for error messages
  2. Use comfyui_workflow view to inspect the workflow nodes
  3. Ensure the checkpoint model referenced in the workflow is actually downloaded
  4. Try running the workflow manually in ComfyUI first
  1. Make sure Node.js 22+ is installed
  2. Try running npx -y meigen@2.0.0 directly to check for errors
  3. Restart your editor
  4. Check that the MCP configuration JSON is valid
Generation times vary by model — MeiGen Cloud image models typically finish in well under a minute; video generation takes longer, especially with reference-video continuation. Polling isn’t capped by a fixed 5- or 8-minute client timeout — it follows the server’s own progress signal, with only a 45-minute safety valve against a fully hung connection.If your session disconnects or polling is interrupted, recover with check_generation using the original generationId or persisted UUID requestId. Preserve exact inputs and IDs; do not allocate a new ID on transient failure. See workflow recovery.ComfyUI generation is still capped at 5 minutes (depends on your local GPU).
After modifying ~/.config/meigen/config.json or environment variables, you must restart your editor (or start a new Claude Code session) for changes to take effect.