KIE.AI MCP GitHub

Images, video and voice from your coding agent

An open-source MCP server for KIE.ai. Connect Claude Code, Codex, Cursor or VS Code, and generate with your own KIE credits.

Unofficial project, maintained independently of KIE.ai. For account or billing questions, contact KIE.

Set it up

  1. 1Get a KIE API key

    Create or copy one at kie.ai/api-key. The hosted server receives it with each request and forwards it to KIE, so keep it in your app's private settings, out of chats and Git.

  2. 2Give your agent this prompt

    Paste it into Claude Code, Codex, Cursor or VS Code. The agent adds the server and tells you where your key goes.

    Setup prompt
    Add the KIE.AI MCP server to the app you are running in.
    
    Name: kie-ai
    Transport: Streamable HTTP
    URL: https://kie-mcp.alfredomanresa.com/mcp
    Header: Authorization: Bearer YOUR_KIE_API_KEY
    
    Add it for my user, not only this project, and keep any servers already configured.
    Do not ask me to paste my key here. Use the app's secret input or an environment variable if it has one; otherwise leave YOUR_KIE_API_KEY as a placeholder and tell me exactly where to replace it.
    App-specific steps: https://github.com/alfman99/kie-ai-mcp/blob/main/docs/INSTALL_OTHER_APPS.md#remote-setup
    Then tell me whether to restart the app.
    Or set it up yourself

    Load your key without saving it in shell history. Paste the key when the terminal waits; it will not show.

    Terminal
    read -s KIE_API_KEY && export KIE_API_KEY

    Then add the server for all your projects:

    Terminal
    claude mcp add --scope user --transport http kie-ai \
      https://kie-mcp.alfredomanresa.com/mcp \
      --header "Authorization: Bearer $KIE_API_KEY"

    Check it with /mcp inside Claude Code.

    Load your key without saving it in shell history. Paste the key when the terminal waits; it will not show.

    Terminal
    read -s KIE_API_KEY && export KIE_API_KEY

    Then add the server:

    Terminal
    codex mcp add kie-ai \
      --url https://kie-mcp.alfredomanresa.com/mcp \
      --bearer-token-env-var KIE_API_KEY

    Codex saves the variable name, not the key, so KIE_API_KEY must be set wherever Codex runs. An app opened from the Dock may not see your terminal's variables. Check it with codex mcp get kie-ai.

    Add this to ~/.cursor/mcp.json, keeping any servers already there, and replace YOUR_KIE_API_KEY with your key.

    ~/.cursor/mcp.json
    {
      "mcpServers": {
        "kie-ai": {
          "url": "https://kie-mcp.alfredomanresa.com/mcp",
          "headers": { "Authorization": "Bearer YOUR_KIE_API_KEY" }
        }
      }
    }

    Restart Cursor and enable kie-ai in its MCP settings. Cursor Agent uses the same file.

    Run MCP: Open User Configuration from the Command Palette and add this, keeping existing servers and inputs.

    mcp.json
    {
      "inputs": [
        { "type": "promptString", "id": "kie-api-key", "description": "KIE API key", "password": true }
      ],
      "servers": {
        "kie-ai": {
          "type": "http",
          "url": "https://kie-mcp.alfredomanresa.com/mcp",
          "headers": { "Authorization": "Bearer ${input:kie-api-key}" }
        }
      }
    }

    Start the server, enter your key when VS Code asks, then enable its tools in Copilot Chat.

    Any app that supports remote MCP servers with a custom header:

    Name
    kie-ai
    Transport
    Streamable HTTP
    URL
    https://kie-mcp.alfredomanresa.com/mcp
    Header
    Authorization: Bearer YOUR_KIE_API_KEY

    For apps that read an mcpServers JSON file:

    JSON
    {
      "mcpServers": {
        "kie-ai": {
          "type": "http",
          "url": "https://kie-mcp.alfredomanresa.com/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_KIE_API_KEY"
          }
        }
      }
    }

    ChatGPT's website cannot send a custom header, so it cannot connect. See client compatibility.

    Step-by-step setup for each app, including Windows: setup guide.

  3. 3Check the connection

    Start a new chat and ask for your KIE credit balance. If a number comes back, the server and your key both work.

Ask for what you want

Describe the result in plain words. Each generation uses your KIE credits.

  • “Use Seedream 5.0 Pro to create a square photo of a red ceramic mug on a wooden table in morning light.”
  • “Use Seedance 2.5 to make a five-second video of waves reaching a sandy beach, at 720p in 16:9.”
  • “Read this in a calm voice: Your order is ready for collection.”
kie_create_image
Create or edit images
kie_create_video
Create video clips
kie_create_speech
Create voiceover and narration
kie_get_creation
Collect finished media
kie_upload_media
Upload reference media
kie_get_credits
Check your KIE balance

Videos take minutes, so they return a task ID right away; ask for the result and the agent collects it. Images and speech usually come back in the same call.

Using your own files

A hosted server cannot reach your disk, so a reference image or audio clip has to be sent to KIE first. Your API key already works with KIE's own upload API, so one request does it:

Terminal
curl -X POST "https://kieai.redpandaai.co/api/file-stream-upload" \
  -H "Authorization: Bearer YOUR_KIE_API_KEY" \
  -F file=@/path/to/reference.png \
  -F uploadPath=agent-uploads

Pass downloadUrl from the response to any create tool. Your agent gets this command when it connects. The upload goes directly to KIE under your own account. KIE upload URLs are temporary; download files you want to keep.

Run it yourself

The server also runs locally over stdio, and the whole thing is open source. Setup for every supported app, the environment variables and the full tool reference are in the repository.

Install the Claude Desktop extension or build the local server from source.