From 2566f79d5ccae5aa6a083f82ba9d89b424404a8d Mon Sep 17 00:00:00 2001 From: jau123 <741267111@qq.com> Date: Sun, 8 Mar 2026 01:49:29 +0800 Subject: [PATCH] Address review feedback: restructure plugin for marketplace conventions - Remove .mcp.json (not used in marketplace, add README instead) - Add marketplace.json entry for plugin discovery - Add README.md with MCP server setup guide, provider config, and troubleshooting - Add tools: declaration to image-generator agent (functional fix) - Move blocks from YAML frontmatter to markdown body - Remove unused tools: Read, Grep, Glob from prompt-crafter agent - Remove redundant name: field from command frontmatter - Use full MCP tool prefix (mcp__meigen__*) in commands - Rewrite plugin.json description to factual style - Pin npm version to meigen@1.2.5 Co-Authored-By: Claude Opus 4.6 --- .claude-plugin/marketplace.json | 13 ++ .../.claude-plugin/plugin.json | 4 +- plugins/meigen-ai-design/.mcp.json | 6 - plugins/meigen-ai-design/README.md | 112 ++++++++++++++++++ .../agents/image-generator.md | 63 +++++----- .../meigen-ai-design/agents/prompt-crafter.md | 2 - plugins/meigen-ai-design/commands/find.md | 7 +- plugins/meigen-ai-design/commands/gen.md | 7 +- 8 files changed, 165 insertions(+), 49 deletions(-) delete mode 100644 plugins/meigen-ai-design/.mcp.json create mode 100644 plugins/meigen-ai-design/README.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 4421d8a..11bfb13 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -945,6 +945,19 @@ "homepage": "https://github.com/wshobson/agents", "license": "MIT", "category": "languages" + }, + { + "name": "meigen-ai-design", + "source": "./plugins/meigen-ai-design", + "description": "AI image generation with creative workflow orchestration, prompt engineering, and curated inspiration library via MCP server", + "version": "1.0.0", + "author": { + "name": "MeiGen", + "url": "https://github.com/jau123" + }, + "homepage": "https://github.com/jau123/MeiGen-AI-Design-MCP", + "license": "MIT", + "category": "creative" } ] } diff --git a/plugins/meigen-ai-design/.claude-plugin/plugin.json b/plugins/meigen-ai-design/.claude-plugin/plugin.json index efa9a5e..03f5fee 100644 --- a/plugins/meigen-ai-design/.claude-plugin/plugin.json +++ b/plugins/meigen-ai-design/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "meigen-ai-design", - "version": "1.2.3", - "description": "Turn Claude Code into a visual creative assistant rivaling Lovart — AI image generation with creative workflow orchestration, parallel multi-direction output, prompt engineering skills, and a 1,300+ curated inspiration library. Supports local ComfyUI, MeiGen Cloud, and OpenAI APIs.", + "version": "1.0.0", + "description": "AI image generation with creative workflow orchestration, parallel multi-direction output, prompt engineering, and a 1,300+ curated inspiration library. Requires MeiGen MCP server (supports MeiGen Cloud, local ComfyUI, and OpenAI-compatible APIs).", "author": { "name": "MeiGen", "url": "https://www.meigen.ai" diff --git a/plugins/meigen-ai-design/.mcp.json b/plugins/meigen-ai-design/.mcp.json deleted file mode 100644 index fe6ac5c..0000000 --- a/plugins/meigen-ai-design/.mcp.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "meigen": { - "command": "npx", - "args": ["-y", "meigen@latest"] - } -} diff --git a/plugins/meigen-ai-design/README.md b/plugins/meigen-ai-design/README.md new file mode 100644 index 0000000..d5ee557 --- /dev/null +++ b/plugins/meigen-ai-design/README.md @@ -0,0 +1,112 @@ +# MeiGen AI Design + +AI image generation plugin with creative workflow orchestration, parallel multi-direction output, prompt engineering, and a 1,300+ curated inspiration library. + +## Prerequisites + +This plugin requires the **meigen** MCP server. Install it by adding to your project's `.mcp.json`: + +```json +{ + "mcpServers": { + "meigen": { + "command": "npx", + "args": ["-y", "meigen@1.2.5"] + } + } +} +``` + +**Restart Claude Code** after adding the configuration. + +Requires Node.js 18+. + +## Provider Setup + +Configure at least one provider to enable image generation. **Free features** (gallery search, prompt enhancement, model listing, preference management) work without any provider configured. + +### Option A: MeiGen Cloud (Recommended) + +1. Sign up at [meigen.ai](https://www.meigen.ai) +2. Click avatar → Settings → API Keys → create a new key (starts with `meigen_sk_`) +3. Set environment variable: + +```bash +export MEIGEN_API_TOKEN=meigen_sk_your_token_here +``` + +### Option B: Local ComfyUI (Free, Private) + +1. Install and run [ComfyUI](https://github.com/comfyanonymous/ComfyUI) +2. Set environment variable: + +```bash +export COMFYUI_URL=http://localhost:8188 +``` + +3. Export workflows from ComfyUI (API format JSON) and import via the plugin + +### Option C: OpenAI-compatible API (Bring Your Own Key) + +Works with any OpenAI-compatible image generation API (OpenAI, Together AI, Fireworks AI, etc.): + +```bash +export OPENAI_API_KEY=your_key_here +export OPENAI_BASE_URL=https://api.openai.com/v1 +export OPENAI_MODEL=gpt-image-1 +``` + +Alternatively, store configuration in `~/.config/meigen/config.json`. + +## Agents + +| Agent | Model | Purpose | +|-------|-------|---------| +| `gallery-researcher` | haiku | Search 1,300+ curated gallery, find references, build mood boards | +| `prompt-crafter` | haiku | Write multiple distinct prompts for parallel image generation | +| `image-generator` | inherit | Execute `generate_image` calls and relay results | + +## Commands + +| Command | Description | +|---------|-------------| +| `/meigen-ai-design:gen ` | Quick image generation — skips intent assessment | +| `/meigen-ai-design:find ` | Quick gallery search — browse inspiration | + +## Free Features (No API Key) + +These tools work immediately without any provider setup: +- **search_gallery** — Search 1,300+ curated AI image prompts +- **enhance_prompt** — Expand brief descriptions into detailed generation prompts +- **list_models** — List available models across all configured providers +- **manage_preferences** — Save default style, aspect ratio, and favorite prompts + +## Verification + +After setup, test with a free feature: +> "Search the gallery for product photography inspiration" + +Then test generation: +> "Generate a product photo for a glass perfume bottle on marble" + +## Troubleshooting + +| Problem | Solution | +|---------|----------| +| MCP tools not available | Restart Claude Code after adding `.mcp.json` configuration | +| "No image generation providers configured" | Configure at least one provider (see Provider Setup above) | +| API key / authentication errors | Verify env vars or check `~/.config/meigen/config.json` | +| ComfyUI connection refused | Ensure ComfyUI is running at the configured URL | +| Generation timeout | Server may be under high load — try again in a moment | +| Empty gallery search results | Try different keywords or broader terms | + +## Links + +- [npm package](https://www.npmjs.com/package/meigen) +- [GitHub](https://github.com/jau123/MeiGen-AI-Design-MCP) +- [Homepage](https://www.meigen.ai) +- [Demo Video](https://youtu.be/JQ3DZ1DXqvs) + +## License + +MIT diff --git a/plugins/meigen-ai-design/agents/image-generator.md b/plugins/meigen-ai-design/agents/image-generator.md index 70504ba..321bf1f 100644 --- a/plugins/meigen-ai-design/agents/image-generator.md +++ b/plugins/meigen-ai-design/agents/image-generator.md @@ -1,43 +1,44 @@ --- -name: image-generator description: >- Image generation executor agent. Delegates here for ALL generate_image - calls to keep the main conversation context clean. Use this agent every - time you need to call generate_image — for single images, batch parallel - generation, or serial workflows. - - - Context: User wants to generate 4 logo concepts in parallel - user: "Generate all 4 directions" - assistant: "I'll spawn 4 image-generator agents in parallel, one for each direction." - - Multiple images needed — spawn one image-generator agent per image in a single response for true parallel execution. - - - - - Context: User wants a single product photo - user: "Generate a product photo for this perfume" - assistant: "I'll use the image-generator agent to create the product photo." - - Single image generation — delegate to image-generator to keep base64/response data out of main context. - - - - - Context: User approved a logo and wants mockup extensions - user: "Use this logo for a mug and t-shirt mockup" - assistant: "I'll spawn 2 image-generator agents in parallel for the mockups." - - Multiple derivative images — spawn parallel agents, each with referenceImages pointing to the approved logo URL. - - + calls to keep the main conversation context clean. Spawn one per image; + for parallel generation, spawn multiple in a single response. model: inherit color: magenta +tools: mcp__meigen__generate_image --- You are an image generation executor. Your ONLY job is to call `generate_image` and return the result. +## When to Delegate + + +Context: User wants to generate 4 logo concepts in parallel +user: "Generate all 4 directions" +assistant: "I'll spawn 4 image-generator agents in parallel, one for each direction." + +Multiple images needed — spawn one image-generator agent per image in a single response for true parallel execution. + + + + +Context: User wants a single product photo +user: "Generate a product photo for this perfume" +assistant: "I'll use the image-generator agent to create the product photo." + +Single image generation — delegate to image-generator to keep base64/response data out of main context. + + + + +Context: User approved a logo and wants mockup extensions +user: "Use this logo for a mug and t-shirt mockup" +assistant: "I'll spawn 2 image-generator agents in parallel for the mockups." + +Multiple derivative images — spawn parallel agents, each with referenceImages pointing to the approved logo URL. + + + ## Process 1. You will receive a prompt and optional parameters (aspectRatio, referenceImages) diff --git a/plugins/meigen-ai-design/agents/prompt-crafter.md b/plugins/meigen-ai-design/agents/prompt-crafter.md index c53540b..3bf52c2 100644 --- a/plugins/meigen-ai-design/agents/prompt-crafter.md +++ b/plugins/meigen-ai-design/agents/prompt-crafter.md @@ -1,5 +1,4 @@ --- -name: prompt-crafter description: >- Batch prompt writing agent. Delegates here when you need to write multiple distinct prompts at once — for parallel image generation @@ -7,7 +6,6 @@ description: >- logo then apply to mug/t-shirt/poster), or any task requiring 2+ prompts crafted simultaneously. model: haiku -tools: Read, Grep, Glob --- You are an expert AI image generation prompt writer. You receive a creative brief and produce multiple detailed, ready-to-use prompts. diff --git a/plugins/meigen-ai-design/commands/find.md b/plugins/meigen-ai-design/commands/find.md index a9f2ca3..a330109 100644 --- a/plugins/meigen-ai-design/commands/find.md +++ b/plugins/meigen-ai-design/commands/find.md @@ -1,7 +1,6 @@ --- -name: find description: >- - Quick gallery search. Use when user runs /meigen:find with keywords + Quick gallery search. Use when user runs /meigen-ai-design:find with keywords to browse inspiration. argument-hint: --- @@ -12,13 +11,13 @@ Search the curated gallery for inspiration. Show visual results immediately. ## Instructions -1. Call `search_gallery` with query: `$ARGUMENTS` +1. Call `mcp__meigen__search_gallery` with query: `$ARGUMENTS` - If no arguments provided, call with no query to get trending picks - Use limit: 6 for a good visual spread 2. Display results as a compact list: - Number, preview image (markdown), one-line prompt excerpt, category 3. End with: "Say a number to see the full prompt, or describe what you want to generate." -If the user picks a number, call `get_inspiration` with that entry's ID to show the full prompt and images. +If the user picks a number, call `mcp__meigen__get_inspiration` with that entry's ID to show the full prompt and images. Keep output visual and scannable. No long explanations. diff --git a/plugins/meigen-ai-design/commands/gen.md b/plugins/meigen-ai-design/commands/gen.md index 97d941c..a3c6e8f 100644 --- a/plugins/meigen-ai-design/commands/gen.md +++ b/plugins/meigen-ai-design/commands/gen.md @@ -1,7 +1,6 @@ --- -name: gen description: >- - Quick image generation. Use when user runs /meigen:gen with a prompt. + Quick image generation. Use when user runs /meigen-ai-design:gen with a prompt. Skips intent assessment, generates directly. argument-hint: --- @@ -13,7 +12,7 @@ Generate an image immediately from the user's description. This is the fast path ## Instructions 1. Look at the user's prompt: `$ARGUMENTS` -2. If the prompt is very short (under 10 words), call `enhance_prompt` first to enrich it, then use the enhanced result +2. If the prompt is very short (under 10 words), call `mcp__meigen__enhance_prompt` first to enrich it, then use the enhanced result 3. If the prompt is already detailed (10+ words), use it directly 4. Delegate to the **image-generator** agent with the prompt (keeps base64 data out of main context) 5. When the agent returns, show a brief one-line creative comment about the generation @@ -21,7 +20,7 @@ Generate an image immediately from the user's description. This is the fast path Do NOT: - Ask for confirmation before generating - Suggest alternatives or options -- Run search_gallery for references +- Run mcp__meigen__search_gallery for references - Give lengthy explanations or describe the image - Call generate_image directly — always delegate to image-generator agent