kling-mcp
v0.5.0RunAPI MCP server for Kling: create tasks, poll status, check pricing.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
login
Authenticate RunAPI by opening a browser PKCE login flow and saving the API key to ~/.config/runapi/config.json.
| Parameter | Type | Description |
|---|---|---|
force | boolean | Re-run browser login when the current credential comes from the local config file. |
ai_avatar
Create a Kling task on RunAPI (ai avatar). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Description of the avatar. Declared type: string. |
source_audio_url * | string | Audio URL for lip sync. Declared type: string. |
source_image_url * | string | Face image URL. Declared type: string. |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
model | string | RunAPI model slug for this model line. |
poll_interval_ms | integer | |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
edit_video
Create a Kling task on RunAPI (edit video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Video description. Declared type: string. |
aspect_ratio | string | Output aspect ratio; source-only requests require auto. Declared type: string. Known values: "auto", "16:9", "9:16", "1:1". |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
duration_seconds | integer | Output duration in seconds. Declared type: integer. Known values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. |
enable_sound | boolean | Enable synchronized sound generation. Declared type: boolean. |
model | string | RunAPI model slug for this model line. |
output_resolution | string | Output resolution. Declared type: string. Known values: "720p", "1080p", "4k". |
poll_interval_ms | integer | |
reference_image_urls | array | Ordered reference image URLs. Declared type: array. |
source_task_id | string | Completed compatible task ID; cannot be combined with source_video_url. Declared type: string. |
source_video_url | string | Public source video URL; cannot be combined with source_task_id. Declared type: string. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
extend_video
Create a Kling task on RunAPI (extend video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
source_task_id * | string | Completed Kling v2.5 Turbo source task ID. Declared type: string. |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
mode | string | Extension quality mode. Declared type: string. Known values: "std", "pro". |
model | string | RunAPI model slug for this model line. |
poll_interval_ms | integer | |
prompt | string | Optional description for the continuation. Declared type: string. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
image_to_video
Create a Kling task on RunAPI (image to video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
first_frame_image_url * | string | Public HTTP(S) JPG, JPEG, or PNG first-frame image URL. Declared type: string. |
aspect_ratio | string | Output aspect ratio. Declared type: string. |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
cfg_scale | number | Guidance scale (0-1). Declared type: number. |
duration_seconds | integer | Duration in seconds. Declared type: integer. Known values: 5, 10, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 15. |
enable_sound | boolean | Sound generation must remain disabled. Declared type: boolean. |
last_frame_image_url | string | Public HTTP(S) JPG, JPEG, or PNG final-frame image URL; cannot be combined with reference_image_urls or reference_video_url. Declared type: string. |
mode | string | Generation mode. Declared type: string. Known values: "std", "pro". |
model | string | RunAPI model slug for this model line. |
multi_prompt | array | Custom multi-shot list: 1–6 shots with nonempty prompts up to 500 characters, each duration_seconds 1–12, summing to duration_seconds. Declared type: array. |
multi_shots | boolean | Enable multi-shot generation. Declared type: boolean. |
negative_prompt | string | Negative prompt. Declared type: string. |
output_resolution | string | Output resolution. Declared type: string. Known values: "720p", "1080p", "4k". |
poll_interval_ms | integer | |
preserve_reference_video_audio | boolean | Preserve the reference video's original audio. Declared type: boolean. |
prompt | string | Video description; reference media with matching numbered markers. Declared type: string. |
reference_image_urls | array | Ordered public HTTP(S) JPG, JPEG, or PNG reference image URLs; cannot be combined with last_frame_image_url. Declared type: array. |
reference_video_type | string | Use the video as a base edit or feature reference. Declared type: string. Known values: "base", "feature". |
reference_video_url | string | Public HTTP(S) MP4 or MOV reference video URL; cannot be combined with last_frame_image_url. Declared type: string. |
shot_type | string | Multi-shot storyboard method; defaults to custom when multi_shots is true. Declared type: string. Known values: "custom", "automatic". |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
keyframe_to_video
Create a Kling task on RunAPI (keyframe to video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Video description with frame references. Declared type: string. |
aspect_ratio | string | Output aspect ratio when no frame is supplied. Declared type: string. Known values: "16:9", "9:16", "1:1", "21:9", "auto". |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
duration_seconds | integer | Output duration in seconds. Declared type: integer. |
first_frame_image_url | string | First keyframe image URL. Declared type: string. |
keyframe_urls | array | Middle keyframe image URLs in chronological order. Declared type: array. |
last_frame_image_url | string | Last keyframe image URL. Declared type: string. |
model | string | RunAPI model slug for this model line. |
output_resolution | string | Output resolution. Flash is fixed at 720p. Declared type: string. Known values: "720p", "1080p". |
poll_interval_ms | integer | |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
motion_control
Create a Kling task on RunAPI (motion control). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
output_resolution * | string | Output resolution. Declared type: string. Known values: "720p", "1080p". |
reference_video_url * | string | Reference motion video URL. Declared type: string. |
source_image_url * | string | Subject image URL. Declared type: string. |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
character_orientation | string | Character orientation. Declared type: string. Known values: "video", "image". |
model | string | RunAPI model slug for this model line. |
poll_interval_ms | integer | |
prompt | string | Description prompt. Declared type: string. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
reference_to_video
Create a Kling task on RunAPI (reference to video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Video description with material references. Declared type: string. |
aspect_ratio | string | Output aspect ratio. Declared type: string. Known values: "16:9", "9:16", "1:1", "21:9", "auto". |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
duration_seconds | integer | Output duration in seconds. Declared type: integer. |
elements | array | Declared type: array. |
keep_original_sound | boolean | Keep audio from reference videos. Declared type: boolean. |
model | string | RunAPI model slug for this model line. |
output_resolution | string | Output resolution. Flash is fixed at 720p. Declared type: string. Known values: "720p", "1080p". |
poll_interval_ms | integer | |
reference_image_urls | array | Declared type: array. |
reference_video_urls | array | Declared type: array. |
timeout_ms | integer | |
voices | array | Declared type: array. |
wait | boolean | Poll until the task reaches a terminal status. |
text_to_video
Create a Kling task on RunAPI (text to video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
aspect_ratio | string | Output aspect ratio. Declared type: string. Known values: "16:9", "9:16", "1:1". |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
cfg_scale | number | Guidance scale (0-1). Declared type: number. |
duration_seconds | integer | Duration in seconds. Declared type: integer. Known values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. |
enable_sound | boolean | Enable sound generation. Declared type: boolean. |
first_frame_image_url | string | First frame image URL. Declared type: string. |
kling_elements | array | Element references with image, video, or audio materials. Declared type: array. |
last_frame_image_url | string | Last frame image URL for single-shot mode. Declared type: string. |
mode | string | Generation mode. Declared type: string. Known values: "std", "pro". |
model | string | RunAPI model slug for this model line. |
multi_prompt | array | Required for custom multi-shot mode: 1–6 shots with nonempty prompts up to 500 characters (each @element reference counts as 37), each duration_seconds 1–12, summing to duration_seconds. Declared… |
multi_shots | boolean | Enable multi-shot generation. Declared type: boolean. |
negative_prompt | string | Negative prompt. Declared type: string. |
output_resolution | string | Output resolution. Declared type: string. Known values: "720p", "1080p", "4k". |
poll_interval_ms | integer | |
preserve_reference_video_audio | boolean | Preserve the reference video's original audio. Declared type: boolean. |
prompt | string | Video description. Required for single-shot and automatic storyboarding. Declared type: string. |
reference_image_urls | array | Ordered public HTTP(S) JPG, JPEG, or PNG reference image URLs. Declared type: array. |
reference_video_type | string | Use the video as a base edit or feature reference. Declared type: string. Known values: "base", "feature". |
reference_video_url | string | Public HTTP(S) MP4 or MOV reference video URL. Declared type: string. |
shot_type | string | Multi-shot storyboard method: custom or automatic; defaults to custom only when multi_shots is true. Declared type: string. Known values: "custom", "automatic". |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
text_to_image
Create a Kling task on RunAPI (text to image). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Image description; reference supplied images with @image_N or elements with @name. Declared type: string. |
aspect_ratio | string | Output aspect ratio. Declared type: string. Known values: "auto", "9:16", "2:3", "3:4", "1:1", "4:3", "3:2", "16:9", "21:9". |
callback_url | string | Webhook URL for async notifications. Declared type: string. |
elements | array | Named references, each counted as one input material. Names are case-insensitively unique; image_N and object_N are reserved. Declared type: array. |
length | string | Ecommerce image length. Declared type: string. Known values: "short", "medium", "long". |
mode | string | Single/default generation or a related image series. Declared type: string. Known values: "default", "series". |
model | string | RunAPI model slug for this model line. |
output_count | integer | 1–9 in default mode; required 2–10 in series mode. Declared type: integer. |
output_resolution | string | Output resolution. Declared type: string. Known values: "2k", "4k", "8k", "1k". |
poll_interval_ms | integer | |
skill | string | Long-image skill; case insensitive. Declared type: string. Known values: "ecommerce", "webpage". |
source_image_urls | array | Public HTTP/HTTPS JPG or PNG images, at most 20 MB each. Images and elements total at most 10. Declared type: array. |
style_image_url | string | Optional webpage style reference: public HTTP/HTTPS JPG or PNG, at most 20 MB. Declared type: string. |
subject_image_url | string | Optional webpage subject reference: public HTTP/HTTPS JPG or PNG, at most 20 MB. Declared type: string. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
get_task
Fetch the current status and latest result payload for a kling task.
| Parameter | Type | Description |
|---|---|---|
action * | string | Asynchronous endpoint the task was created on. |
task_id * | string | Task id returned when the task was created. |
check_pricing
Look up RunAPI pricing for the kling model line.
| Parameter | Type | Description |
|---|---|---|
action | string | Endpoint name. Defaults to the endpoint that offers the model. |
model | string | Model slug. Defaults to the line's primary model. |