> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meigen.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server Overview

> Generate AI images and videos in Claude Code, Cursor, Codex, Windsurf, Hermes Agent, and OpenClaw — MeiGen's open-source MCP server. Supports GPT Image 2, Nano Banana 2, Midjourney V8.1, Seedream, Grok Imagine, Flux 2, Seedance, Veo 3.1, Agnes, and local ComfyUI.

**MeiGen** is an open-source MCP (Model Context Protocol) server that gives AI coding assistants the ability to generate **images and videos**. It supports multiple generation backends — use MeiGen's cloud models, your local ComfyUI server, or any OpenAI-compatible API.

<Card title="GitHub Repository" icon="github" href="https://github.com/jau123/MeiGen-AI-Design-MCP">
  View source code, report issues, and contribute.
</Card>

## What is MCP?

Model Context Protocol (MCP) is an open standard that allows AI assistants to use external tools. When you install MeiGen as an MCP server, your AI assistant gains the ability to generate images and videos, run semantic search across the MeiGen community prompt gallery, and enhance prompts — all through natural language. Search, inspiration, and prompt enhancement need no API key, and a prompt library bundled with the plugin keeps search useful even when you're offline.

***

## Providers

MeiGen supports three image generation backends — configure one or more.

<CardGroup cols={3}>
  <Card title="MeiGen Cloud" icon="cloud">
    **Hosted multi-model API**. Image and video models from OpenAI, Google, ByteDance, Midjourney, xAI, Black Forest Labs, Alibaba, and Agnes. No GPU required — just an API key. Run `list_models` for the current lineup.
  </Card>

  <Card title="ComfyUI" icon="server">
    **Local GPU generation**. Run any Stable Diffusion, SDXL, or Flux model on your own hardware. Full control over workflows and parameters.
  </Card>

  <Card title="Bring Your Own API" icon="plug">
    **Any OpenAI-compatible API**. Connect Together AI, Fireworks AI, DeepInfra, SiliconFlow, OpenAI, or your own endpoint.
  </Card>
</CardGroup>

| Provider           | Type              | Cost                                     | Best For                                |
| ------------------ | ----------------- | ---------------------------------------- | --------------------------------------- |
| MeiGen Cloud       | Hosted API        | Credits ([pricing](/en/features/models)) | Multi-model access, zero setup          |
| ComfyUI            | Local GPU         | Free (your hardware)                     | Full control, custom workflows, privacy |
| Bring Your Own API | OpenAI-compatible | Varies by service                        | Existing API keys, any provider         |

**Provider priority**: When multiple providers are configured, MeiGen selects in this order: MeiGen Cloud → ComfyUI → OpenAI-compatible. You can override this per-request.

***

## Tools

Most MCP tools work without configuring any provider:

| Tool                    | Description                                                                                                                                                         | Requires Provider? |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| **generate\_image**     | Generate images using any configured provider                                                                                                                       | Yes                |
| **generate\_video**     | Generate videos via the MeiGen platform — text-to-video, first/last-frame image-to-video, and reference-video continuation                                          | Yes (MeiGen)       |
| **enhance\_prompt**     | Transform a brief idea into a detailed, professional prompt                                                                                                         | No                 |
| **search\_gallery**     | Semantic search across the MeiGen community prompt gallery, with image previews — falls back to a bundled offline prompt library when the search API is unreachable | No                 |
| **get\_inspiration**    | Get the full prompt and images for any gallery entry                                                                                                                | No                 |
| **list\_models**        | List available models across all configured providers                                                                                                               | No                 |
| **manage\_preferences** | Save defaults — style, aspect ratio, model, provider, and free-text style notes — plus favorite prompts                                                             | No                 |
| **comfyui\_workflow**   | Import, view, modify, and delete ComfyUI workflow templates                                                                                                         | No                 |

<Note>
  Video capabilities differ by model — quality tiers, available durations and resolutions, audio, reference-video continuation, and whether a first frame is required. Some models are image-to-video only. Call `list_models` for the current lineup, or see the [model comparison](/en/features/models).
</Note>

***

## Supported Platforms

<CardGroup cols={3}>
  <Card title="Claude Code" icon="terminal">
    Install as a plugin from the marketplace — includes slash commands, smart agents, and automation hooks.
  </Card>

  <Card title="Cursor / VS Code / Windsurf / Roo Code" icon="window">
    One-command setup via `npx meigen init <host>` — writes the right MCP config file for each editor.
  </Card>

  <Card title="OpenAI Codex CLI" icon="terminal">
    Add the MCP server to `~/.codex/config.toml`. Standard stdio MCP, no extra plumbing.
  </Card>

  <Card title="Hermes Agent" icon="robot">
    First-class MCP support — add to `~/.hermes/config.yaml` with `timeout: 600` for video generation.
  </Card>

  <Card title="OpenClaw" icon="puzzle-piece">
    Install as a [plugin](https://clawhub.ai/plugins/meigen-ai-design) from ClawHub — includes skills, commands, and MCP server.
  </Card>

  <Card title="Any MCP host" icon="plug">
    Standard stdio MCP — point any MCP-compatible host at `npx -y meigen@latest`.
  </Card>
</CardGroup>

***

## Standalone CLI Mode

No MCP host? MeiGen also ships as a CLI for shell scripts and CI pipelines:

```bash theme={null}
export MEIGEN_API_TOKEN=meigen_sk_...
npx meigen gen --prompt "a calico cat in a sunlit kitchen"
npx meigen gen -p "logo design" -m midjourney-v8.1 -r 1:1 --json
```

Use `--json` for machine-readable output, `--no-wait` to submit without polling, and `--reference <path|url>` to pass a reference image. Run `npx meigen gen --help` for the full flag list.

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Setup Guide" icon="wrench" href="/en/mcp/setup">
    Install the plugin and configure your preferred provider.
  </Card>

  <Card title="ComfyUI Guide" icon="server" href="/en/mcp/comfyui">
    Set up local ComfyUI generation with custom workflows.
  </Card>

  <Card title="REST API" icon="code" href="/en/api-reference/introduction">
    Prefer HTTP? Integrate via REST without MCP setup.
  </Card>
</CardGroup>
