Prerequisites
- Node.js 18+ installed
- At least one image generation provider:
- 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.)
Installation
Claude Code Plugin (Recommended)
Install the plugin
Alternative: manual MCP setup
Alternative: manual MCP setup
If you prefer not to use the plugin system, add the MCP server directly:
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.Alternatively, set environment variables directly (see Provider Configuration below).OpenClaw
Install the full plugin from ClawHub (includes commands, skills, and MCP server):OpenClaw uses the Agent Skills open standard. No MCP configuration needed — the skill handles everything.
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. Access multiple AI models (Nanobanana, Seedream, Midjourney V7/Niji 7, Seedance, and more) through MeiGen’s hosted API.| Variable | Value |
|---|---|
MEIGEN_API_TOKEN | Your API key starting with meigen_sk_ |
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.| Variable | Value |
|---|---|
OPENAI_API_KEY | Your API key from the provider |
OPENAI_BASE_URL | API endpoint (e.g., https://api.together.xyz/v1) |
OPENAI_MODEL | (Optional) Model name at your provider |
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.| Variable | Value |
|---|---|
COMFYUI_URL | ComfyUI server address (default: http://127.0.0.1:8188) |
- ComfyUI must be running and accessible at the configured URL
- You need at least one imported workflow template — see the ComfyUI Guide
ComfyUI runs serially: one image at a time.
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 Examples
Generate an image
“Generate a watercolor landscape, 16:9 aspect ratio”
Use a reference image
“Generate a product photo similar to this image: [drag a file or paste a URL]“
Search for inspiration
“Search the gallery for food photography”
Enhance a prompt
“Enhance this prompt: a sunset over mountains”
Manage your defaults
“Set my default style to minimalist photography”
Troubleshooting
'No image generation providers configured'
'No image generation providers configured'
No provider is set up. Run
/meigen:setup in Claude Code, or add the appropriate environment variable to your MCP configuration:- MeiGen:
MEIGEN_API_TOKEN - OpenAI-compatible:
OPENAI_API_KEY - ComfyUI:
COMFYUI_URL(and import a workflow)
'Insufficient credits' (MeiGen)
'Insufficient credits' (MeiGen)
API keys can only use purchased credits, not daily free credits. Purchase credits at meigen.ai.
ComfyUI connection refused
ComfyUI connection refused
- Make sure ComfyUI is running (
python main.pyin the ComfyUI directory) - Check that
COMFYUI_URLmatches the address shown when ComfyUI starts (default:http://127.0.0.1:8188) - If running on a different machine, ensure the port is accessible
ComfyUI generation fails
ComfyUI generation fails
- Open the ComfyUI web UI and check for error messages
- Use
comfyui_workflow viewto inspect the workflow nodes - Ensure the checkpoint model referenced in the workflow is actually downloaded
- Try running the workflow manually in ComfyUI first
Plugin not showing in tool list
Plugin not showing in tool list
- Make sure Node.js 18+ is installed
- Try running
npx -y meigendirectly to check for errors - Restart your editor
- Check that the MCP configuration JSON is valid
Generation timeout
Generation timeout
Generation times vary by model and provider. MeiGen Cloud models range from 5–60 seconds. ComfyUI depends on your GPU. The plugin waits up to 5 minutes before timing out.
Changes to config not taking effect
Changes to config not taking effect
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.