A Model Context Protocol (MCP) server for kie.ai — one API for the best AI models. Plug in your kie.ai API key and give Claude (or any MCP client) the ability to generate images, video, music, and text across 100+ models: Veo, Runway, Kling, Seedance, Flux, Nano Banana, Seedream, Ideogram, Qwen, Hailuo, Wan, Suno, GPT, Gemini, Claude, and more.
Built on kie.ai's unified jobs API plus its dedicated Veo / Runway / Suno / Flux Kontext / GPT‑4o endpoints, with a bundled catalog of every market model (exact model IDs + input schemas) so the assistant can discover and run anything.
kie_generate— run any of 100+ image/video/music models end‑to‑end (submit + wait for the result URL).- Model discovery —
kie_list_modelsandkie_get_model_schemalet the assistant find the right model and learn its exact inputs (no guesswork). - Dedicated helpers for the big APIs with extra features: Veo (1080p/4K, extend), Runway (+ Aleph video‑to‑video), Suno (music, extend, lyrics), Flux Kontext, GPT‑4o images.
kie_chat— chat with GPT, Gemini, and Claude text models.- Utilities — credit balance, download links, and file upload (turn a local/base64 image into a hosted URL for image‑to‑video etc.).
- Robust polling, timeouts, and clean error messages. Your API key stays in your environment.
The bundled catalog currently covers 112 market models (41 image, 67 video, 4 music) — see src/catalog-data.ts.
- Node.js 18+
- A kie.ai API key — create one at https://kie.ai/api-key (sign in at https://kie.ai, open the API Keys section).
npx github:neomorrison/kie-mcp(The first run builds automatically.)
git clone https://github.com/neomorrison/kie-mcp.git
cd kie-mcp
npm install # builds automatically via the prepare scriptThe server entry point is dist/index.js.
The server reads your key from the KIE_API_KEY environment variable.
Edit your claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Or, without cloning:
{
"mcpServers": {
"kie": {
"command": "npx",
"args": ["-y", "github:neomorrison/kie-mcp"],
"env": { "KIE_API_KEY": "your_kie_api_key_here" }
}
}
}Restart Claude Desktop afterward.
# from a cloned + built checkout
claude mcp add kie --env KIE_API_KEY=your_kie_api_key_here -- node /absolute/path/to/kie-mcp/dist/index.js
# or via npx
claude mcp add kie --env KIE_API_KEY=your_kie_api_key_here -- npx -y github:neomorrison/kie-mcpRun node dist/index.js (or npx -y github:neomorrison/kie-mcp) over stdio with KIE_API_KEY set in the environment.
kie.ai has hundreds of models. The assistant doesn't need to memorize them — it discovers them:
- Find a model →
kie_list_models(filter bycategoryandsearch). - Learn its inputs →
kie_get_model_schema(exact field names, types, defaults, allowed values). - Run it →
kie_generatewith themodelIdand aninputobject. It submits the job and polls until the output URL(s) are ready.
Example (what the assistant does under the hood):
// 1) discover
kie_list_models { "category": "image", "search": "nano banana" }
// 2) schema
kie_get_model_schema { "model": "google/nano-banana" }
// 3) generate
kie_generate {
"model": "google/nano-banana",
"input": { "prompt": "a corgi astronaut on the moon, studio lighting", "output_format": "png" }
}Most image jobs finish in seconds; video/music can take a few minutes. If a job exceeds the wait budget, the tool returns a taskId you can poll with kie_get_task (or the matching *_get tool).
| Tool | Description |
|---|---|
kie_list_models |
Search the catalog of image/video/music models. |
kie_get_model_schema |
Get a model's input fields + example (bundled, or fresh from live docs). |
kie_generate |
Submit a job to any model and wait for the output URL(s). Primary tool. |
kie_create_task |
Submit a job and return the taskId immediately (no waiting). |
kie_get_task |
Poll a job's status/result. |
| Tool | Description |
|---|---|
kie_chat |
Chat with GPT / Gemini / Claude text models. |
| Tool | Description |
|---|---|
kie_get_credits |
Remaining credit balance. |
kie_get_download_url |
Convert a kie.ai file URL into a direct download link. |
kie_upload_file |
Host a remote URL or base64 file and get a public URL (for image/video inputs). |
| Tool | Description |
|---|---|
kie_veo_generate / kie_veo_get / kie_veo_extend |
Google Veo 3.1 video (text/image‑to‑video, extend). |
kie_veo_get_1080p / kie_veo_get_4k |
Fetch higher‑resolution Veo renders. |
kie_runway_generate / kie_runway_get / kie_runway_extend |
Runway video generation & extension. |
kie_runway_aleph_generate / kie_runway_aleph_get |
Runway Aleph video‑to‑video. |
kie_suno_generate / kie_suno_get / kie_suno_extend |
Suno music generation & extension. |
kie_suno_lyrics / kie_suno_lyrics_get |
Suno lyric generation. |
kie_flux_kontext_generate / kie_flux_kontext_get |
Flux Kontext image generation & editing. |
kie_4o_image_generate / kie_4o_image_get / kie_4o_image_download_url |
GPT‑4o image generation & editing. |
| Variable | Default | Purpose |
|---|---|---|
KIE_API_KEY |
(required) | Your kie.ai API key. |
KIE_BASE_URL |
https://api.kie.ai |
API base URL. |
KIE_UPLOAD_BASE |
https://kieai.redpandaai.co |
File‑upload host. |
KIE_TIMEOUT_MS |
60000 |
Per‑request timeout. |
KIE_POLL_TIMEOUT_MS |
300000 |
Max time a *_generate tool waits for a job (5 min). |
KIE_POLL_INTERVAL_MS |
5000 |
Delay between polls. |
See .env.example.
- Async by design. Generation is a job: create → poll → result. The
*_generate/kie_generatetools do this for you; raisewaitSecondsfor long video/music renders, or setwait: falseto return immediately and poll later. - Credits. Each generation consumes kie.ai credits; check
kie_get_credits. - File lifetimes. Generated URLs typically expire after ~24 hours (some sooner). Download what you need, or use
kie_get_download_url. - Keep your key secret. It lives in your MCP client's environment, never in this repo.
.envis git‑ignored.
npm install # install deps (also builds via prepare)
npm run build # compile TypeScript -> dist/
npm run typecheck # type-check only
npm run watch # rebuild on changeSource layout:
src/
index.ts server bootstrap (stdio)
config.ts env config
client.ts HTTP client (auth, timeouts, {code,msg,data} envelope)
poll.ts generic async-job poller
catalog.ts catalog types + search/lookup helpers
catalog-data.ts generated catalog of market models (ids + input schemas)
util.ts result/error helpers
tools/ one module per tool group (market, chat, veo, runway, suno, flux, image4o, account)
src/catalog-data.ts is generated from the kie.ai docs index (https://docs.kie.ai/llms.txt) and each model's doc page. Re‑extract it when kie.ai adds models.
This is an unofficial, community-built integration and is not affiliated with or endorsed by kie.ai. Model availability, parameters, and pricing are controlled by kie.ai and may change; see the official docs.
MIT © neomorrison
{ "mcpServers": { "kie": { "command": "node", "args": ["/absolute/path/to/kie-mcp/dist/index.js"], "env": { "KIE_API_KEY": "your_kie_api_key_here" } } } }