kling-mcp

v0.5.0
io.github.runapi-builder/kling-mcp Checked 2 days ago Published 3 days ago

RunAPI 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.

ParameterTypeDescription
forcebooleanRe-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.

ParameterTypeDescription
prompt *stringDescription of the avatar. Declared type: string.
source_audio_url *stringAudio URL for lip sync. Declared type: string.
source_image_url *stringFace image URL. Declared type: string.
callback_urlstringWebhook URL for async notifications. Declared type: string.
modelstringRunAPI model slug for this model line.
poll_interval_msinteger
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
prompt *stringVideo description. Declared type: string.
aspect_ratiostringOutput aspect ratio; source-only requests require auto. Declared type: string. Known values: "auto", "16:9", "9:16", "1:1".
callback_urlstringWebhook URL for async notifications. Declared type: string.
duration_secondsintegerOutput duration in seconds. Declared type: integer. Known values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.
enable_soundbooleanEnable synchronized sound generation. Declared type: boolean.
modelstringRunAPI model slug for this model line.
output_resolutionstringOutput resolution. Declared type: string. Known values: "720p", "1080p", "4k".
poll_interval_msinteger
reference_image_urlsarrayOrdered reference image URLs. Declared type: array.
source_task_idstringCompleted compatible task ID; cannot be combined with source_video_url. Declared type: string.
source_video_urlstringPublic source video URL; cannot be combined with source_task_id. Declared type: string.
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
source_task_id *stringCompleted Kling v2.5 Turbo source task ID. Declared type: string.
callback_urlstringWebhook URL for async notifications. Declared type: string.
modestringExtension quality mode. Declared type: string. Known values: "std", "pro".
modelstringRunAPI model slug for this model line.
poll_interval_msinteger
promptstringOptional description for the continuation. Declared type: string.
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
first_frame_image_url *stringPublic HTTP(S) JPG, JPEG, or PNG first-frame image URL. Declared type: string.
aspect_ratiostringOutput aspect ratio. Declared type: string.
callback_urlstringWebhook URL for async notifications. Declared type: string.
cfg_scalenumberGuidance scale (0-1). Declared type: number.
duration_secondsintegerDuration in seconds. Declared type: integer. Known values: 5, 10, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 15.
enable_soundbooleanSound generation must remain disabled. Declared type: boolean.
last_frame_image_urlstringPublic HTTP(S) JPG, JPEG, or PNG final-frame image URL; cannot be combined with reference_image_urls or reference_video_url. Declared type: string.
modestringGeneration mode. Declared type: string. Known values: "std", "pro".
modelstringRunAPI model slug for this model line.
multi_promptarrayCustom 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_shotsbooleanEnable multi-shot generation. Declared type: boolean.
negative_promptstringNegative prompt. Declared type: string.
output_resolutionstringOutput resolution. Declared type: string. Known values: "720p", "1080p", "4k".
poll_interval_msinteger
preserve_reference_video_audiobooleanPreserve the reference video's original audio. Declared type: boolean.
promptstringVideo description; reference media with matching numbered markers. Declared type: string.
reference_image_urlsarrayOrdered public HTTP(S) JPG, JPEG, or PNG reference image URLs; cannot be combined with last_frame_image_url. Declared type: array.
reference_video_typestringUse the video as a base edit or feature reference. Declared type: string. Known values: "base", "feature".
reference_video_urlstringPublic HTTP(S) MP4 or MOV reference video URL; cannot be combined with last_frame_image_url. Declared type: string.
shot_typestringMulti-shot storyboard method; defaults to custom when multi_shots is true. Declared type: string. Known values: "custom", "automatic".
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
prompt *stringVideo description with frame references. Declared type: string.
aspect_ratiostringOutput aspect ratio when no frame is supplied. Declared type: string. Known values: "16:9", "9:16", "1:1", "21:9", "auto".
callback_urlstringWebhook URL for async notifications. Declared type: string.
duration_secondsintegerOutput duration in seconds. Declared type: integer.
first_frame_image_urlstringFirst keyframe image URL. Declared type: string.
keyframe_urlsarrayMiddle keyframe image URLs in chronological order. Declared type: array.
last_frame_image_urlstringLast keyframe image URL. Declared type: string.
modelstringRunAPI model slug for this model line.
output_resolutionstringOutput resolution. Flash is fixed at 720p. Declared type: string. Known values: "720p", "1080p".
poll_interval_msinteger
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
output_resolution *stringOutput resolution. Declared type: string. Known values: "720p", "1080p".
reference_video_url *stringReference motion video URL. Declared type: string.
source_image_url *stringSubject image URL. Declared type: string.
callback_urlstringWebhook URL for async notifications. Declared type: string.
character_orientationstringCharacter orientation. Declared type: string. Known values: "video", "image".
modelstringRunAPI model slug for this model line.
poll_interval_msinteger
promptstringDescription prompt. Declared type: string.
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
prompt *stringVideo description with material references. Declared type: string.
aspect_ratiostringOutput aspect ratio. Declared type: string. Known values: "16:9", "9:16", "1:1", "21:9", "auto".
callback_urlstringWebhook URL for async notifications. Declared type: string.
duration_secondsintegerOutput duration in seconds. Declared type: integer.
elementsarrayDeclared type: array.
keep_original_soundbooleanKeep audio from reference videos. Declared type: boolean.
modelstringRunAPI model slug for this model line.
output_resolutionstringOutput resolution. Flash is fixed at 720p. Declared type: string. Known values: "720p", "1080p".
poll_interval_msinteger
reference_image_urlsarrayDeclared type: array.
reference_video_urlsarrayDeclared type: array.
timeout_msinteger
voicesarrayDeclared type: array.
waitbooleanPoll 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.

ParameterTypeDescription
aspect_ratiostringOutput aspect ratio. Declared type: string. Known values: "16:9", "9:16", "1:1".
callback_urlstringWebhook URL for async notifications. Declared type: string.
cfg_scalenumberGuidance scale (0-1). Declared type: number.
duration_secondsintegerDuration in seconds. Declared type: integer. Known values: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15.
enable_soundbooleanEnable sound generation. Declared type: boolean.
first_frame_image_urlstringFirst frame image URL. Declared type: string.
kling_elementsarrayElement references with image, video, or audio materials. Declared type: array.
last_frame_image_urlstringLast frame image URL for single-shot mode. Declared type: string.
modestringGeneration mode. Declared type: string. Known values: "std", "pro".
modelstringRunAPI model slug for this model line.
multi_promptarrayRequired 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_shotsbooleanEnable multi-shot generation. Declared type: boolean.
negative_promptstringNegative prompt. Declared type: string.
output_resolutionstringOutput resolution. Declared type: string. Known values: "720p", "1080p", "4k".
poll_interval_msinteger
preserve_reference_video_audiobooleanPreserve the reference video's original audio. Declared type: boolean.
promptstringVideo description. Required for single-shot and automatic storyboarding. Declared type: string.
reference_image_urlsarrayOrdered public HTTP(S) JPG, JPEG, or PNG reference image URLs. Declared type: array.
reference_video_typestringUse the video as a base edit or feature reference. Declared type: string. Known values: "base", "feature".
reference_video_urlstringPublic HTTP(S) MP4 or MOV reference video URL. Declared type: string.
shot_typestringMulti-shot storyboard method: custom or automatic; defaults to custom only when multi_shots is true. Declared type: string. Known values: "custom", "automatic".
timeout_msinteger
waitbooleanPoll 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.

ParameterTypeDescription
prompt *stringImage description; reference supplied images with @image_N or elements with @name. Declared type: string.
aspect_ratiostringOutput 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_urlstringWebhook URL for async notifications. Declared type: string.
elementsarrayNamed references, each counted as one input material. Names are case-insensitively unique; image_N and object_N are reserved. Declared type: array.
lengthstringEcommerce image length. Declared type: string. Known values: "short", "medium", "long".
modestringSingle/default generation or a related image series. Declared type: string. Known values: "default", "series".
modelstringRunAPI model slug for this model line.
output_countinteger1–9 in default mode; required 2–10 in series mode. Declared type: integer.
output_resolutionstringOutput resolution. Declared type: string. Known values: "2k", "4k", "8k", "1k".
poll_interval_msinteger
skillstringLong-image skill; case insensitive. Declared type: string. Known values: "ecommerce", "webpage".
source_image_urlsarrayPublic HTTP/HTTPS JPG or PNG images, at most 20 MB each. Images and elements total at most 10. Declared type: array.
style_image_urlstringOptional webpage style reference: public HTTP/HTTPS JPG or PNG, at most 20 MB. Declared type: string.
subject_image_urlstringOptional webpage subject reference: public HTTP/HTTPS JPG or PNG, at most 20 MB. Declared type: string.
timeout_msinteger
waitbooleanPoll until the task reaches a terminal status.

get_task

Fetch the current status and latest result payload for a kling task.

ParameterTypeDescription
action *stringAsynchronous endpoint the task was created on.
task_id *stringTask id returned when the task was created.

check_pricing

Look up RunAPI pricing for the kling model line.

ParameterTypeDescription
actionstringEndpoint name. Defaults to the endpoint that offers the model.
modelstringModel slug. Defaults to the line's primary model.