mcp

v0.2.0
@wanapis/mcp Checked 2 days ago Published 2 days ago

MCP server for WanAPIs image and video generation.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

wanapis_generate_image

Generate an image with WanAPIs. Returns image URLs directly if it finishes quickly, otherwise a job_id to poll with wanapis_check_task (generation can take 1-5 minutes). Use wanapis_list_models for current image model IDs, options and defaults.

ParameterTypeDescription
prompt *stringWhat to generate.
aspectstringAspect ratio supported by the selected model.
countintegerNumber of images where supported.
modelstring
qualitystringQuality tier accepted by the selected model.
reference_imagesarrayImage URLs for image-to-image.
resolutionstringResolution from the model capabilities.
sizestringImage size where supported.

wanapis_generate_video

Start a video generation. Returns a task_id immediately — video takes ~100s, so poll wanapis_check_task until status is completed. Use wanapis_list_models for current video model IDs, options and reference-media limits.

ParameterTypeDescription
prompt *string
aspectstringOutput aspect ratio.
context_ir_enabledbooleanH3 IR, default true; adds a per-request fee.
fast_modebooleanH3 priority mode, default false; doubles the video fee.
first_framestringH3/Seedance explicit first-frame image (URL/data/local path).
generate_audiobooleanSeedance audio toggle. Muse always includes sound, so omit or pass true.
image_urlstringLegacy single opening-frame/reference image URL. Use reference_images for multiple inputs.
last_framestringH3/Seedance explicit last-frame image (URL/data/local path).
modelstring
qualitystringQuality tier where supported.
ratiostringAlias for aspect when supported by the model.
reference_audioarrayH3/Seedance reference audio (URL/local path; H3 also accepts data/asset_id). Up to 3.
reference_imagesarrayMuse: up to 9 image URLs, image data URIs or base64 images (11 MiB total, URLs must be publicly accessible). H3 and Seedance also accept local paths. H3 accepts asset_id.
reference_videosarrayH3/Seedance reference videos (URL/local path; H3 also accepts data/asset_id). Up to 3.
resolutionstringResolution from the model capabilities.
return_last_framebooleanSeedance: include the last frame URL in the result.
secondsnumberRequested video duration. Use the bounds and default from wanapis_list_models.
seedintegerSeedance: randomness seed.

wanapis_upload_media

Upload one local image, video or audio file for H3 or Seedance. H3 returns an opaque asset_id that can be reused; Seedance returns a temporary signed public URL (valid for a few hours). Uploading is free and does not create a generation task.

ParameterTypeDescription
media_type *string
path *stringLocal file path.
binding_asset_idstringH3 only: optional existing asset_id whose channel/credential this upload should reuse.
modelstringTarget model; default minimax-h3. Use a seedance-* model to get a temporary public URL instead of asset_id.

wanapis_regenerate_video

Create a 2K regeneration from one of your successful 768P MiniMax H3 source tasks. mode=source uses the source task directly when the account/channel enables it. mode=content requires the original final prompt and every original reference material, exactly as submitted; local paths are uploaded automatically. Regeneration is a new paid task; the original generation remains billed.

ParameterTypeDescription
source_task_id *stringYour public WanAPIs task ID of a successful 768P minimax-h3 original.
first_framestring
last_framestring
modestring
promptstringcontent mode only: the original final prompt.
reference_audioarray
reference_imagesarraycontent mode: the original reference images.
reference_videosarray

wanapis_optimize_prompt

Create a standalone H3 prompt-optimization task. The result is text, not a video; poll wanapis_check_task with kind="prompt". It is a separate paid request. When using the returned prompt for a video, set context_ir_enabled=false to avoid a second IR charge.

ParameterTypeDescription
prompt *string
ratiostringPlanned video ratio, default 9:16.
secondsnumberPlanned video duration 4–15, default 4.

wanapis_check_task

Check an async generation task. Returns status, progress, billing (reserved/charged/refunded CNY), the real cost once settled, and media URLs or prompt text when done. IMPORTANT: gateway video proxy URLs (/v1/videos/.../content) require your WanAPIs key — opening one in a browser returns 401 — whereas async image tasks return public upstream CDN URLs directly. Pass save_dir to download files locally before upstream links expire (~24h). H3 billing may remain pending_usage after the result succeeds; the reserved amount is not the final charge.

ParameterTypeDescription
task_id *string
kindstring
save_dirstringDirectory to download finished media into. Use this to give the user a real file — the URLs alone are not shareable.

wanapis_estimate_cost

Estimate a generation budget using public live pricing and an assumed group multiplier. This does not determine your key's billing route or final charge. Image 2.5 estimates are tier precharges. H3 with reference media returns a reservation upper bound (reference-video seconds are reserved before verified usage).

ParameterTypeDescription
model *string
aspectstring
context_ir_enabledbooleanH3 only, default true.
countintegerNumber of images where supported.
fast_modebooleanH3 only, default false.
first_framestring
generate_audiobooleanGenerate audio where supported.
group_rationumberBudget assumption only; default 1. Does not change the generation group or billing.
image_urlstringLegacy single image; H3 sends one input_reference object.
last_framestring
qualitystringQuality tier where supported.
ratiostring
reference_audioarrayH3 reference audio; no material fee.
reference_imagesarrayMuse reference images, up to 9. H3 images/frames for the reservation estimate. Image 2.5 references can increase actual usage.
reference_videosarrayH3 reference videos; the estimate reserves the protocol input upper bound.
resolutionstringResolution from the model capabilities.
secondsnumberRequested video duration in seconds.
sizestring

wanapis_list_models

List gateway-published media models, execution support, parameters and live prices.

ParameterTypeDescription
kindstring