EggAPI/docs / mcp
sign in

Connect AI Agents (MCP)

Let Claude Code, Codex, Cursor, and other MCP clients generate images and videos through EggAPI

EggAPI runs a remote Model Context Protocol server. Any MCP client that supports Streamable HTTP can list models, start image and video tasks, and read their results with your API key. Usage is billed to the key's account exactly like POST /v1/generate.

SettingValue
Endpointhttps://api.eggapi.ai/mcp
TransportStreamable HTTP
Auth headerAuthorization: Bearer YOUR_API_KEY

Create a key in the dashboard and export it first:

bash
export EGGAPI_API_KEY="egg_..."

Client Setup

Claude Code

bash
claude mcp add --transport http eggapi https://api.eggapi.ai/mcp \
  --header "Authorization: Bearer $EGGAPI_API_KEY"

Codex

Add to ~/.codex/config.toml:

toml
[mcp_servers.eggapi]
url = "https://api.eggapi.ai/mcp"
bearer_token_env_var = "EGGAPI_API_KEY"

Cursor and other clients

Add to your client's mcp.json:

json
{
  "mcpServers": {
    "eggapi": {
      "url": "https://api.eggapi.ai/mcp",
      "headers": { "Authorization": "Bearer <EGGAPI_API_KEY>" }
    }
  }
}

Step-by-step setup with a key generator is also on eggapi.ai/connect.

Tools

ToolArgumentsReturns
list_modelskind? (image or video)Model IDs with kind, generation_type, unit_price_usd, unit_price_by_resolution, and the tool that runs each one.
generate_imagemodel, prompt, images?, negative_prompt?, aspect_ratio?, resolution?, num_outputs?, parameters?, nsfw_filter?A task_id. images holds the source image URLs for edit models.
generate_videomodel, prompt, duration, image?, negative_prompt?, aspect_ratio?, resolution?, parameters?, nsfw_filter?A task_id. image is the first frame URL for image-to-video models; duration is required.
get_tasktask_idstatus (pending, processing, completed, failed), done, output urls, cost, and error.

The agent's workflow is:

  1. Call list_models to pick a valid model ID.
  2. Call generate_image or generate_video. It returns a task_id immediately; the output is not ready yet.
  3. Poll get_task every 5 to 15 seconds until done is true. Images usually finish within a minute; videos usually take one to three minutes.

Tasks created over MCP also appear in GET /v1/tasks and in your usage records.

Dynamic UI tools

The same server also provides get_ui_catalog, render_ui, update_ui, get_ui_state, set_ui_values, and run_ui_action: the agent composes a form page from a short JSON description, the user fills it in inside the conversation (clients that support MCP Apps) or in a browser, and the agent reads the result to continue. See Dynamic UI.

Workflow Skills

For complete workflows on top of these tools, such as e-commerce image sets, ad creatives, and short films, install the ready-made workflow skills.

connected
mcp https://api.eggapi.ai/mcp
models ...
Claude Code · Codex · MCP
█