/setup
Interactive provider configuration wizard. Use when the user runs /meigen:setup, says "configure meigen", "set up image generation", "add API key", or otherwise needs help wiring up an image generation provider (MeiGen platform, ComfyUI, or any OpenAI-compatible API).
> /plugin marketplace add jau123/MeiGen-AI-Design-MCP > /plugin install meigen@meigen-marketplace
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/setup
Context preview
What this command does when you run it.
Interactive provider configuration wizard. Use when the user runs /meigen:setup, says "configure meigen", "set up image generation", "add API key", or otherwise needs help wiring up an image generation provider (MeiGen platform, ComfyUI, or any OpenAI-compatible API).
Command definition
setup.mddescription: >-
Interactive provider configuration wizard. Use when the user runs
/meigen:setup, says "configure meigen", "set up image generation",
"add API key", or otherwise needs help wiring up an image generation
provider (MeiGen platform, ComfyUI, or any OpenAI-compatible API).
MeiGen Plugin Setup
You are guiding the user through configuring the MeiGen plugin for image generation. Follow this flow step by step.
Step 0: Detect Platform
Before running any shell commands, detect whether you're on Windows. Many of the commands below assume a Unix shell (macOS / Linux / Git Bash). Quick check:
node -e "console.log(process.platform)"
- `darwin` / `linux` → Unix shell, use the commands as written
- `win32` → Windows. **Adjustments**:
- **For `2>/dev/null` in Step 1** (e.g. `cat ... 2>/dev/null`, `ls ... 2>/dev/null`): replace with `2>NUL` in cmd or `2>$null` in PowerShell. Or simpler: use a Node check instead, e.g. `node -e "try{console.log(require('fs').readFileSync(require('os').homedir()+'/.config/meigen/config.json','utf8'))}catch{}"`
- **For `mkdir -p ~/.config/meigen`**: in PowerShell use `New-Item -ItemType Directory -Force ~/.config/meigen`. Or skip mkdir entirely — when you later call the Write tool with `file_path: ~/.config/meigen/config.json`, Claude Code's harness creates the parent directory automatically (Write creates the **file**, the parent dir is a side-effect).
- **Skip `chmod 600`** — NTFS has no chmod, and Windows file permissions are inherited from the parent directory.
- **For curl health checks** (Step 3B-1, 3C): Windows 10+ has curl but lacks `head -c`; truncate with `Select-Object -First 5` (PowerShell) or omit the truncation.
- The config file lives at `%USERPROFILE%\.config\meigen\config.json` — Node's `os.homedir()` resolves `~` correctly when reading at runtime, so the config path in code works fine.
Step 1: Welcome
First, check if a config file already exists:
cat ~/.config/meigen/config.json 2>/dev/null
Also check for existing ComfyUI workflows:
ls ~/.config/meigen/workflows/*.json 2>/dev/null
If config exists, show the current configuration (mask API keys: show first 10 chars + "...") and any saved workflows. Ask if they want to reconfigure.
If no config exists, present this introduction:
> **MeiGen Plugin Configuration** > > This is optional. Without configuration, you can still use free features: > - Search gallery for inspiration and prompts > - Enhance simple ideas into professional prompts > - Browse available AI models > > Configuring a provider unlocks **image generation**.
Then proceed to Step 2.
Step 2: Choose Provider
Present these options to the user:
Option A: MeiGen Platform (Recommended)
- Supports **GPT Image 2.0**, **Nanobanana 2**, **Seedream 5.0** and more
- Reference image support for style transfer
- No additional accounts needed — just get a token from meigen.ai
Option B: ComfyUI (Local)
- Use your **local ComfyUI** installation for image generation
- Full control over models, samplers, and workflow settings
- No cloud API needed — runs entirely on your machine
- Import your own workflow from ComfyUI
Option C: Custom OpenAI-Compatible API
- Use your own **OpenAI**, **Together AI**, **Fireworks AI**, or any OpenAI-compatible service
- Bring your own API key and billing
- Supports any model that uses the OpenAI `/v1/images/generations` endpoint
Option D: Import from curl Example
- Already have a working curl command from your API provider's docs? Paste it directly!
- We'll automatically extract the API key, base URL, and model name
Option E: Skip image generation for now
- Free features still available (inspiration search, prompt enhancement, model listing)
- You can run `/meigen:setup` anytime later to enable image generation
If user chooses **Skip**, say goodbye and exit. Otherwise continue to the appropriate Step 3.
Step 3A: MeiGen Platform Setup
Ask the user:
> Do you already have a MeiGen API token, or do you need to create one?
If they need to create one:
Provide these instructions:
1. Go to **https://www.meigen.ai** 2. Sign in or create an account 3. Navigate to **Settings** (click your avatar) → **API Keys** 4. Click **Create API Key**, give it a name 5. Copy the token (starts with `meigen_sk_`)
Then ask them to paste the token.
If they already have one:
Ask them to paste their `meigen_sk_...` token.
Validate the token:
- Must start with `meigen_sk_`
- Must be at least 30 characters long
If valid, proceed to **Step 4** with this config:
{
"meigenApiToken": "<the token>"
}Step 3B: ComfyUI (Local) Setup
3B-1: Check Connection
Ask the user for their ComfyUI server URL:
> What is your ComfyUI server URL? (default: `http://localhost:8188`)
Test the connection:
curl -s <URL>/system_stats | head -c 200
- **Success**: Show confirmation and continue to 3B-2
- **Failure**: Tell the user:
> Cannot connect to ComfyUI at `<URL>`. Please make sure: > 1. ComfyUI is running (start it with `python main.py` or your launcher) > 2. The URL and port are correct > 3. No firewall is blocking the connection
3B-2: Import Workflow
Explain the workflow export process to the user:
> To use ComfyUI with this plugin, you need to export a workflow in **API format**: > > 1. Open ComfyUI in your browser (usually `http://localhost:8188`) > 2. Load or create your preferred workflow > 3. Click **⚙️ Settings** → enable **"Enable Dev mode options"** > 4. Click the **"Save (API Format)"** button that appears > 5. Save the downloaded `.json` file somewhere convenient
Then ask them to provide the file path:
> Please provide the path to your exported workflow JSON file: > Example: `~/Downloads/workflow_api.json`
Use the `comfyui_workflow` tool with action `import` to import the workflow:
- Ask for a short name for the workflow (e.g., "txt2img", "anime", "realistic"
Read more
description: >- Interactive provider configuration wizard. Use when the user runs /meigen:setup, says "configure meigen", "set up image generation", "add API key", or otherwise needs help wiring up an image generation provider (MeiGen platform, ComfyUI, or any OpenAI-compatible API).
MeiGen Plugin Setup
You are guiding the user through configuring the MeiGen plugin for image generation. Follow this flow step by step.
Step 0: Detect Platform
Before running any shell commands, detect whether you're on Windows. Many of the commands below assume a Unix shell (macOS / Linux / Git Bash). Quick check:
node -e "console.log(process.platform)"
- `darwin` / `linux` → Unix shell, use the commands as written
- `win32` → Windows. **Adjustments**:
- **For `2>/dev/null` in Step 1** (e.g. `cat ... 2>/dev/null`, `ls ... 2>/dev/null`): replace with `2>NUL` in cmd or `2>$null` in PowerShell. Or simpler: use a Node check instead, e.g. `node -e "try{console.log(require('fs').readFileSync(require('os').homedir()+'/.config/meigen/config.json','utf8'))}catch{}"`
- **For `mkdir -p ~/.config/meigen`**: in PowerShell use `New-Item -ItemType Directory -Force ~/.config/meigen`. Or skip mkdir entirely — when you later call the Write tool with `file_path: ~/.config/meigen/config.json`, Claude Code's harness creates the parent directory automatically (Write creates the **file**, the parent dir is a side-effect).
- **Skip `chmod 600`** — NTFS has no chmod, and Windows file permissions are inherited from the parent directory.
- **For curl health checks** (Step 3B-1, 3C): Windows 10+ has curl but lacks `head -c`; truncate with `Select-Object -First 5` (PowerShell) or omit the truncation.
- The config file lives at `%USERPROFILE%\.config\meigen\config.json` — Node's `os.homedir()` resolves `~` correctly when reading at runtime, so the config path in code works fine.
Step 1: Welcome
First, check if a config file already exists:
cat ~/.config/meigen/config.json 2>/dev/null
Also check for existing ComfyUI workflows:
ls ~/.config/meigen/workflows/*.json 2>/dev/null
If config exists, show the current configuration (mask API keys: show first 10 chars + "...") and any saved workflows. Ask if they want to reconfigure.
If no config exists, present this introduction:
> **MeiGen Plugin Configuration** > > This is optional. Without configuration, you can still use free features: > - Search gallery for inspiration and prompts > - Enhance simple ideas into professional prompts > - Browse available AI models > > Configuring a provider unlocks **image generation**.
Then proceed to Step 2.
Step 2: Choose Provider
Present these options to the user:
Option A: MeiGen Platform (Recommended)
- Supports **GPT Image 2.0**, **Nanobanana 2**, **Seedream 5.0** and more
- Reference image support for style transfer
- No additional accounts needed — just get a token from meigen.ai
Option B: ComfyUI (Local)
- Use your **local ComfyUI** installation for image generation
- Full control over models, samplers, and workflow settings
- No cloud API needed — runs entirely on your machine
- Import your own workflow from ComfyUI
Option C: Custom OpenAI-Compatible API
- Use your own **OpenAI**, **Together AI**, **Fireworks AI**, or any OpenAI-compatible service
- Bring your own API key and billing
- Supports any model that uses the OpenAI `/v1/images/generations` endpoint
Option D: Import from curl Example
- Already have a working curl command from your API provider's docs? Paste it directly!
- We'll automatically extract the API key, base URL, and model name
Option E: Skip image generation for now
- Free features still available (inspiration search, prompt enhancement, model listing)
- You can run `/meigen:setup` anytime later to enable image generation
If user chooses **Skip**, say goodbye and exit. Otherwise continue to the appropriate Step 3.
Step 3A: MeiGen Platform Setup
Ask the user:
> Do you already have a MeiGen API token, or do you need to create one?
If they need to create one:
Provide these instructions:
1. Go to **https://www.meigen.ai** 2. Sign in or create an account 3. Navigate to **Settings** (click your avatar) → **API Keys** 4. Click **Create API Key**, give it a name 5. Copy the token (starts with `meigen_sk_`)
Then ask them to paste the token.
If they already have one:
Ask them to paste their `meigen_sk_...` token.
Validate the token:
- Must start with `meigen_sk_`
- Must be at least 30 characters long
If valid, proceed to **Step 4** with this config:
{
"meigenApiToken": "<the token>"
}Step 3B: ComfyUI (Local) Setup
3B-1: Check Connection
Ask the user for their ComfyUI server URL:
> What is your ComfyUI server URL? (default: `http://localhost:8188`)
Test the connection:
curl -s <URL>/system_stats | head -c 200
- **Success**: Show confirmation and continue to 3B-2
- **Failure**: Tell the user:
> Cannot connect to ComfyUI at `<URL>`. Please make sure: > 1. ComfyUI is running (start it with `python main.py` or your launcher) > 2. The URL and port are correct > 3. No firewall is blocking the connection
3B-2: Import Workflow
Explain the workflow export process to the user:
> To use ComfyUI with this plugin, you need to export a workflow in **API format**: > > 1. Open ComfyUI in your browser (usually `http://localhost:8188`) > 2. Load or create your preferred workflow > 3. Click **⚙️ Settings** → enable **"Enable Dev mode options"** > 4. Click the **"Save (API Format)"** button that appears > 5. Save the downloaded `.json` file somewhere convenient
Then ask them to provide the file path:
> Please provide the path to your exported workflow JSON file: > Example: `~/Downloads/workflow_api.json`
Use the `comfyui_workflow` tool with action `import` to import the workflow:
- Ask for a short name for the workflow (e.g., "txt2img", "anime", "realistic"
Supports GPT Image 2, Seedance & ComfyUI, with a 1,400+ prompt library, carefully crafted hooks and a multi-task orchestration system
Repo: jau123/MeiGen-AI-Design-MCP
Other commands on meigen-ai-design-mcp.
- /find
Quick gallery search. Use when user runs /meigen:find with keywords to browse inspiration.
Open command - /gen
Quick image generation. Use when user runs /meigen:gen with a prompt. Skips intent assessment, generates directly.
Open command - /models
List available AI models and switch the default model for this session. Use when user runs /meigen:models to see or change models.
Open command

