Configure MeiGen plugin provider and API keys. Use this when the user runs /meigen:setup, asks to "configure meigen", "set up image generation", "add API key", or needs help configuring the plugin.
Configures image generation providers and API keys for the MeiGen plugin when users need setup help.
npx claudepluginhub jau123/meigen-ai-design-mcpThis skill inherits all available tools. When active, it can use any tool Claude has access to.
You are guiding the user through configuring the MeiGen plugin for image generation. Follow this flow step by step.
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.
Present these options to the user:
/v1/images/generations endpoint/meigen:setup anytime later to enable image generationIf user chooses Skip, say goodbye and exit. Otherwise continue to the appropriate Step 3.
Ask the user:
Do you already have a MeiGen API token, or do you need to create one?
Provide these instructions:
meigen_sk_)Then ask them to paste the token.
Ask them to paste their meigen_sk_... token.
meigen_sk_If valid, proceed to Step 4 with this config:
{
"meigenApiToken": "<the token>"
}
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
Cannot connect to ComfyUI at
<URL>. Please make sure:
- ComfyUI is running (start it with
python main.pyor your launcher)- The URL and port are correct
- No firewall is blocking the connection
Explain the workflow export process to the user:
To use ComfyUI with this plugin, you need to export a workflow in API format:
- Open ComfyUI in your browser (usually
http://localhost:8188)- Load or create your preferred workflow
- Click ⚙️ Settings → enable "Enable Dev mode options"
- Click the "Save (API Format)" button that appears
- Save the downloaded
.jsonfile 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:
comfyui_workflow import with filePath and nameIf the import succeeds, ask if they want to import additional workflows. If yes, repeat this step.
Build the config JSON:
{
"comfyuiUrl": "<the URL, omit if http://localhost:8188>",
"comfyuiDefaultWorkflow": "<the first imported workflow name>"
}
Proceed to Step 4 to save. The workflow files are already saved by the import step.
Collect the following information. Present common presets first for convenience:
| Service | Base URL | Default Model |
|---|---|---|
| OpenAI | https://api.openai.com (default) | gpt-image-1.5 |
| Together AI | https://api.together.xyz/v1 | (check their docs) |
| Fireworks AI | https://api.fireworks.ai/inference/v1 | (check their docs) |
Ask the user to either pick a preset or provide custom values.
API Key (required): Their API key for the service
sk-... for OpenAIBase URL (optional): API endpoint URL
https://api.openai.comModel Name (optional): Which model to use
gpt-image-1.5After collecting the info, suggest testing with curl:
curl -s <BASE_URL>/v1/models \
-H "Authorization: Bearer <API_KEY>" | head -c 500
This helps catch invalid keys or wrong URLs before saving.
Proceed to Step 4 with config from the collected fields (see bottom of this section for format).
Only include fields that differ from defaults. Omit openaiBaseUrl if it's https://api.openai.com, omit openaiModel if it's gpt-image-1.5.
Ask the user to paste their curl command. Common formats they might paste:
Format 1: Image generation endpoint
curl https://api.openai.com/v1/images/generations \
-H "Authorization: Bearer sk-xxx" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-1.5", "prompt": "a cat", "n": 1, "size": "1024x1024"}'
Format 2: Simple model list test
curl https://api.together.xyz/v1/models \
-H "Authorization: Bearer xxx"
Format 3: With -u flag or other auth styles
curl -u :sk-xxx https://api.fireworks.ai/inference/v1/images/generations \
-d '{"model": "accounts/fireworks/models/flux", "prompt": "a cat"}'
Base URL: The URL hostname + base path (strip /v1/images/generations, /v1/models, etc.)
https://api.openai.com/v1/images/generations → https://api.openai.comhttps://api.together.xyz/v1/models → https://api.together.xyz/v1/v1/..., keep the /v1 part only if it's NOT api.openai.comAPI Key: From Authorization: Bearer <key> header, or -u :<key> flag, or --header variants
Model: From the JSON request body "model": "<value>" if present
I extracted the following from your curl command:
- API Key:
sk-xxx...(first 10 chars)- Base URL:
https://api.together.xyz/v1- Model:
black-forest-labs/FLUX.1-schnellDoes this look correct?
If user confirms, proceed to Step 4. If not, let them correct individual fields.
Build the config JSON based on the chosen provider:
For MeiGen:
{
"meigenApiToken": "<the token>"
}
For ComfyUI:
{
"comfyuiUrl": "<url, omit if default>",
"comfyuiDefaultWorkflow": "<workflow name>"
}
For OpenAI-compatible (manual or curl import):
{
"openaiApiKey": "<the key>",
"openaiBaseUrl": "<base url, omit if default>",
"openaiModel": "<model, omit if default>"
}
Create the config directory and write the file:
mkdir -p ~/.config/meigen
Then use the Write tool to write the JSON config to ~/.config/meigen/config.json.
Important: If the user already has a config file with other providers configured, merge the new config into the existing one rather than overwriting. For example, a user might have both MeiGen and ComfyUI configured.
After writing, set permissions:
chmod 600 ~/.config/meigen/config.json
Tell the user:
Configuration saved! To activate the new settings, please start a new Claude Code session (close and reopen, or open a new terminal tab).
After restarting, you can:
- Use
generate_imageto create AI images- Run
list_modelsto see available models and workflows- Try: "Generate a beautiful sunset over mountains"
You can run
/meigen:setupagain anytime to change your configuration.
For ComfyUI users, additionally mention:
ComfyUI tips:
- Use
comfyui_workflow listto see your saved workflows- Use
comfyui_workflow viewto see adjustable parameters (steps, CFG, sampler, etc.)- Ask me to change any workflow parameter — e.g., "increase steps to 30" or "switch sampler to dpmpp_2m"
- You can import more workflows anytime with
comfyui_workflow import
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.