Skip to main content

Prerequisites

  • Node.js 18+ installed
  • At least one generation provider (for generate_image / generate_video):
    • MeiGen Cloud — an API key from meigen.ai (Settings → API Keys)
    • 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.

Installation

Prefer zero installation? The remote MCP endpoint needs no Node.js, no npx, and no local config file — just point any MCP host at https://www.meigen.ai/api/mcp over HTTP.
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. The setup wizard will guide you through provider selection and API key configuration on macOS, Linux, and Windows.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. That listing doesn’t bundle MCP server config — after installing, add the JSON block from Other MCP-Compatible Hosts to .mcp.json yourself.

Cursor / VS Code / Windsurf / Roo Code

One command writes the right MCP config file for each editor:
After the config is written, set MEIGEN_API_TOKEN in your shell and restart the host. On hosts that don’t support the /meigen:setup slash command, add the token to the env block of the meigen server entry directly.

OpenAI Codex CLI

Codex uses TOML. Add to ~/.codex/config.toml:

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 does disconnect mid-generation, don’t resubmit — call check_generation with the generationId from your original request to resume tracking it. Resubmitting starts a new generation and deducts credits again.

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

Install the full plugin from ClawHub (includes commands, skills, and MCP server):
Or install only the skill (no commands/agents):
OpenClaw uses the Agent Skills open standard. No MCP configuration needed — the skill handles everything.

Other MCP-Compatible Hosts

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

Provider Configuration

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. Get your API key: sign in at meigen.ai → click your avatar → SettingsAPI Keys → create a new key.
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

Generated files are written to disk by both the MCP tools and the standalone CLI. 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 the available models”
If configured correctly, it will call the list_models tool and show models from all your configured providers.

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.

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. Purchase credits at meigen.ai.
  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 18+ is installed
  2. Try running npx -y meigen 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 gets interrupted, don’t resubmit the same request — call check_generation with the generationId from your original request to resume tracking it. Resubmitting starts a new generation and deducts credits again.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.