@runapi.ai/wan-mcp 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <h1 align="center">RunAPI Wan MCP Server</h1>
2
2
 
3
3
  <p align="center">
4
- <strong>Wan API access for AI agents: create image and video generation tasks, poll results, and check pricing through one focused MCP server.</strong>
4
+ <strong>Wan API access for AI agents: run image and video generation operations, poll asynchronous results, and check pricing through one focused MCP server.</strong>
5
5
  </p>
6
6
 
7
7
  <p align="center">
@@ -23,39 +23,64 @@
23
23
  "wan/animate": {
24
24
  "model": "Wan",
25
25
  "endpoint": "animate",
26
+ "task_type": "asynchronous",
26
27
  "models": [
27
28
  "wan-2.2-animate-move",
28
29
  "wan-2.2-animate-replace"
29
30
  ],
30
31
  "fields_by_model": {
31
32
  "wan-2.2-animate-move": {
33
+ "model": {
34
+ "type": "string"
35
+ },
32
36
  "source_image_url": {
37
+ "type": "string",
38
+ "required": true
39
+ },
40
+ "reference_video_url": {
41
+ "type": "string",
33
42
  "required": true
34
43
  },
44
+ "callback_url": {
45
+ "type": "string"
46
+ },
35
47
  "output_resolution": {
48
+ "type": "string",
36
49
  "enum": [
37
50
  "480p",
38
51
  "580p",
39
52
  "720p"
40
53
  ]
41
54
  },
42
- "reference_video_url": {
43
- "required": true
55
+ "enable_safety_checker": {
56
+ "type": "boolean"
44
57
  }
45
58
  },
46
59
  "wan-2.2-animate-replace": {
60
+ "model": {
61
+ "type": "string"
62
+ },
47
63
  "source_image_url": {
64
+ "type": "string",
65
+ "required": true
66
+ },
67
+ "reference_video_url": {
68
+ "type": "string",
48
69
  "required": true
49
70
  },
71
+ "callback_url": {
72
+ "type": "string"
73
+ },
50
74
  "output_resolution": {
75
+ "type": "string",
51
76
  "enum": [
52
77
  "480p",
53
78
  "580p",
54
79
  "720p"
55
80
  ]
56
81
  },
57
- "reference_video_url": {
58
- "required": true
82
+ "enable_safety_checker": {
83
+ "type": "boolean"
59
84
  }
60
85
  }
61
86
  }
@@ -63,6 +88,7 @@
63
88
  "wan/edit-video": {
64
89
  "model": "Wan",
65
90
  "endpoint": "edit_video",
91
+ "task_type": "asynchronous",
66
92
  "models": [
67
93
  "wan-2.6-edit-video",
68
94
  "wan-2.6-flash-edit-video",
@@ -70,29 +96,151 @@
70
96
  ],
71
97
  "fields_by_model": {
72
98
  "wan-2.6-edit-video": {
99
+ "model": {
100
+ "type": "string"
101
+ },
102
+ "source_video_url": {
103
+ "type": "string"
104
+ },
105
+ "source_video_urls": {
106
+ "type": "array",
107
+ "required": true
108
+ },
73
109
  "prompt": {
110
+ "type": "string",
74
111
  "required": true
75
112
  },
113
+ "callback_url": {
114
+ "type": "string"
115
+ },
116
+ "negative_prompt": {
117
+ "type": "string"
118
+ },
119
+ "reference_image_url": {
120
+ "type": "string"
121
+ },
76
122
  "output_resolution": {
123
+ "type": "string",
77
124
  "enum": [
78
125
  "720p",
79
126
  "1080p"
80
127
  ]
81
128
  },
82
- "source_video_urls": {
83
- "required": true
129
+ "aspect_ratio": {
130
+ "type": "string"
131
+ },
132
+ "duration_seconds": {
133
+ "type": "integer"
134
+ },
135
+ "audio_setting": {
136
+ "type": "string"
137
+ },
138
+ "enable_prompt_expansion": {
139
+ "type": "boolean"
140
+ },
141
+ "watermark": {
142
+ "type": "boolean"
143
+ },
144
+ "seed": {
145
+ "type": "integer"
146
+ },
147
+ "enable_safety_checker": {
148
+ "type": "boolean"
149
+ },
150
+ "audio": {
151
+ "type": "boolean"
152
+ },
153
+ "multi_shots": {
154
+ "type": "boolean"
84
155
  }
85
156
  },
86
157
  "wan-2.6-flash-edit-video": {
87
- "prompt": {
88
- "required": true
158
+ "model": {
159
+ "type": "string"
160
+ },
161
+ "source_video_url": {
162
+ "type": "string"
89
163
  },
90
164
  "source_video_urls": {
165
+ "type": "array",
166
+ "required": true
167
+ },
168
+ "prompt": {
169
+ "type": "string",
91
170
  "required": true
171
+ },
172
+ "callback_url": {
173
+ "type": "string"
174
+ },
175
+ "negative_prompt": {
176
+ "type": "string"
177
+ },
178
+ "reference_image_url": {
179
+ "type": "string"
180
+ },
181
+ "output_resolution": {
182
+ "type": "string"
183
+ },
184
+ "aspect_ratio": {
185
+ "type": "string"
186
+ },
187
+ "duration_seconds": {
188
+ "type": "integer"
189
+ },
190
+ "audio_setting": {
191
+ "type": "string"
192
+ },
193
+ "enable_prompt_expansion": {
194
+ "type": "boolean"
195
+ },
196
+ "watermark": {
197
+ "type": "boolean"
198
+ },
199
+ "seed": {
200
+ "type": "integer"
201
+ },
202
+ "enable_safety_checker": {
203
+ "type": "boolean"
204
+ },
205
+ "audio": {
206
+ "type": "boolean"
207
+ },
208
+ "multi_shots": {
209
+ "type": "boolean"
92
210
  }
93
211
  },
94
212
  "wan-2.7-edit-video": {
213
+ "model": {
214
+ "type": "string"
215
+ },
216
+ "source_video_url": {
217
+ "type": "string",
218
+ "required": true
219
+ },
220
+ "source_video_urls": {
221
+ "type": "array"
222
+ },
223
+ "prompt": {
224
+ "type": "string"
225
+ },
226
+ "callback_url": {
227
+ "type": "string"
228
+ },
229
+ "negative_prompt": {
230
+ "type": "string"
231
+ },
232
+ "reference_image_url": {
233
+ "type": "string"
234
+ },
235
+ "output_resolution": {
236
+ "type": "string",
237
+ "enum": [
238
+ "720p",
239
+ "1080p"
240
+ ]
241
+ },
95
242
  "aspect_ratio": {
243
+ "type": "string",
96
244
  "enum": [
97
245
  "16:9",
98
246
  "9:16",
@@ -101,14 +249,29 @@
101
249
  "3:4"
102
250
  ]
103
251
  },
104
- "source_video_url": {
105
- "required": true
252
+ "duration_seconds": {
253
+ "type": "integer"
106
254
  },
107
- "output_resolution": {
108
- "enum": [
109
- "720p",
110
- "1080p"
111
- ]
255
+ "audio_setting": {
256
+ "type": "string"
257
+ },
258
+ "enable_prompt_expansion": {
259
+ "type": "boolean"
260
+ },
261
+ "watermark": {
262
+ "type": "boolean"
263
+ },
264
+ "seed": {
265
+ "type": "integer"
266
+ },
267
+ "enable_safety_checker": {
268
+ "type": "boolean"
269
+ },
270
+ "audio": {
271
+ "type": "boolean"
272
+ },
273
+ "multi_shots": {
274
+ "type": "boolean"
112
275
  }
113
276
  }
114
277
  }
@@ -116,6 +279,7 @@
116
279
  "wan/image-to-video": {
117
280
  "model": "Wan",
118
281
  "endpoint": "image_to_video",
282
+ "task_type": "asynchronous",
119
283
  "models": [
120
284
  "wan-2.2-a14b-image-to-video-turbo",
121
285
  "wan-2.5-image-to-video",
@@ -123,72 +287,356 @@
123
287
  "wan-2.6-image-to-video",
124
288
  "wan-2.7-image-to-video"
125
289
  ],
290
+ "rules": [
291
+ {
292
+ "when": {
293
+ "model": "wan-2.6-flash-image-to-video"
294
+ },
295
+ "forbidden": [
296
+ "seed"
297
+ ]
298
+ },
299
+ {
300
+ "when": {
301
+ "model": "wan-2.6-image-to-video"
302
+ },
303
+ "forbidden": [
304
+ "seed"
305
+ ]
306
+ }
307
+ ],
126
308
  "fields_by_model": {
127
309
  "wan-2.2-a14b-image-to-video-turbo": {
310
+ "model": {
311
+ "type": "string"
312
+ },
313
+ "prompt": {
314
+ "type": "string"
315
+ },
316
+ "callback_url": {
317
+ "type": "string"
318
+ },
319
+ "first_frame_image_url": {
320
+ "type": "string",
321
+ "required": true
322
+ },
323
+ "last_frame_image_url": {
324
+ "type": "string"
325
+ },
326
+ "source_video_url": {
327
+ "type": "string"
328
+ },
329
+ "duration_seconds": {
330
+ "type": "integer"
331
+ },
128
332
  "output_resolution": {
333
+ "type": "string",
129
334
  "enum": [
130
335
  "480p",
131
336
  "720p"
132
337
  ]
133
338
  },
134
- "first_frame_image_url": {
135
- "required": true
339
+ "aspect_ratio": {
340
+ "type": "string"
341
+ },
342
+ "negative_prompt": {
343
+ "type": "string"
344
+ },
345
+ "enable_prompt_expansion": {
346
+ "type": "boolean"
347
+ },
348
+ "seed": {
349
+ "type": "integer"
350
+ },
351
+ "acceleration": {
352
+ "type": "string"
353
+ },
354
+ "enable_safety_checker": {
355
+ "type": "boolean"
356
+ },
357
+ "watermark": {
358
+ "type": "boolean"
359
+ },
360
+ "audio": {
361
+ "type": "boolean"
362
+ },
363
+ "multi_shots": {
364
+ "type": "boolean"
365
+ },
366
+ "driving_audio_url": {
367
+ "type": "string"
368
+ },
369
+ "background_audio_url": {
370
+ "type": "string"
371
+ },
372
+ "ratio": {
373
+ "type": "string"
136
374
  }
137
375
  },
138
376
  "wan-2.5-image-to-video": {
377
+ "model": {
378
+ "type": "string"
379
+ },
380
+ "prompt": {
381
+ "type": "string"
382
+ },
383
+ "callback_url": {
384
+ "type": "string"
385
+ },
386
+ "first_frame_image_url": {
387
+ "type": "string",
388
+ "required": true
389
+ },
390
+ "last_frame_image_url": {
391
+ "type": "string"
392
+ },
393
+ "source_video_url": {
394
+ "type": "string"
395
+ },
139
396
  "duration_seconds": {
397
+ "type": "integer",
140
398
  "required": true
141
399
  },
142
400
  "output_resolution": {
401
+ "type": "string",
143
402
  "enum": [
144
403
  "720p",
145
404
  "1080p"
146
405
  ]
147
406
  },
148
- "first_frame_image_url": {
149
- "required": true
407
+ "aspect_ratio": {
408
+ "type": "string"
409
+ },
410
+ "negative_prompt": {
411
+ "type": "string"
412
+ },
413
+ "enable_prompt_expansion": {
414
+ "type": "boolean"
415
+ },
416
+ "seed": {
417
+ "type": "integer"
418
+ },
419
+ "acceleration": {
420
+ "type": "string"
421
+ },
422
+ "enable_safety_checker": {
423
+ "type": "boolean"
424
+ },
425
+ "watermark": {
426
+ "type": "boolean"
427
+ },
428
+ "audio": {
429
+ "type": "boolean"
430
+ },
431
+ "multi_shots": {
432
+ "type": "boolean"
433
+ },
434
+ "driving_audio_url": {
435
+ "type": "string"
436
+ },
437
+ "background_audio_url": {
438
+ "type": "string"
439
+ },
440
+ "ratio": {
441
+ "type": "string"
150
442
  }
151
443
  },
152
444
  "wan-2.6-flash-image-to-video": {
153
- "audio": {
154
- "required": true
445
+ "model": {
446
+ "type": "string"
155
447
  },
156
448
  "prompt": {
449
+ "type": "string",
450
+ "required": true
451
+ },
452
+ "callback_url": {
453
+ "type": "string"
454
+ },
455
+ "first_frame_image_url": {
456
+ "type": "string",
157
457
  "required": true
158
458
  },
459
+ "last_frame_image_url": {
460
+ "type": "string"
461
+ },
462
+ "source_video_url": {
463
+ "type": "string"
464
+ },
465
+ "duration_seconds": {
466
+ "type": "integer"
467
+ },
159
468
  "output_resolution": {
469
+ "type": "string",
160
470
  "enum": [
161
471
  "720p",
162
472
  "1080p"
163
473
  ]
164
474
  },
165
- "first_frame_image_url": {
475
+ "aspect_ratio": {
476
+ "type": "string"
477
+ },
478
+ "negative_prompt": {
479
+ "type": "string"
480
+ },
481
+ "enable_prompt_expansion": {
482
+ "type": "boolean"
483
+ },
484
+ "acceleration": {
485
+ "type": "string"
486
+ },
487
+ "enable_safety_checker": {
488
+ "type": "boolean"
489
+ },
490
+ "watermark": {
491
+ "type": "boolean"
492
+ },
493
+ "audio": {
494
+ "type": "boolean",
166
495
  "required": true
496
+ },
497
+ "multi_shots": {
498
+ "type": "boolean"
499
+ },
500
+ "driving_audio_url": {
501
+ "type": "string"
502
+ },
503
+ "background_audio_url": {
504
+ "type": "string"
505
+ },
506
+ "ratio": {
507
+ "type": "string"
167
508
  }
168
509
  },
169
510
  "wan-2.6-image-to-video": {
511
+ "model": {
512
+ "type": "string"
513
+ },
170
514
  "prompt": {
515
+ "type": "string",
516
+ "required": true
517
+ },
518
+ "callback_url": {
519
+ "type": "string"
520
+ },
521
+ "first_frame_image_url": {
522
+ "type": "string",
171
523
  "required": true
172
524
  },
525
+ "last_frame_image_url": {
526
+ "type": "string"
527
+ },
528
+ "source_video_url": {
529
+ "type": "string"
530
+ },
531
+ "duration_seconds": {
532
+ "type": "integer"
533
+ },
173
534
  "output_resolution": {
535
+ "type": "string",
174
536
  "enum": [
175
537
  "720p",
176
538
  "1080p"
177
539
  ]
178
540
  },
179
- "first_frame_image_url": {
180
- "required": true
541
+ "aspect_ratio": {
542
+ "type": "string"
543
+ },
544
+ "negative_prompt": {
545
+ "type": "string"
546
+ },
547
+ "enable_prompt_expansion": {
548
+ "type": "boolean"
549
+ },
550
+ "acceleration": {
551
+ "type": "string"
552
+ },
553
+ "enable_safety_checker": {
554
+ "type": "boolean"
555
+ },
556
+ "watermark": {
557
+ "type": "boolean"
558
+ },
559
+ "audio": {
560
+ "type": "boolean"
561
+ },
562
+ "multi_shots": {
563
+ "type": "boolean"
564
+ },
565
+ "driving_audio_url": {
566
+ "type": "string"
567
+ },
568
+ "background_audio_url": {
569
+ "type": "string"
570
+ },
571
+ "ratio": {
572
+ "type": "string"
181
573
  }
182
574
  },
183
575
  "wan-2.7-image-to-video": {
576
+ "model": {
577
+ "type": "string"
578
+ },
184
579
  "prompt": {
580
+ "type": "string",
185
581
  "required": true
186
582
  },
583
+ "callback_url": {
584
+ "type": "string"
585
+ },
586
+ "first_frame_image_url": {
587
+ "type": "string"
588
+ },
589
+ "last_frame_image_url": {
590
+ "type": "string"
591
+ },
592
+ "source_video_url": {
593
+ "type": "string"
594
+ },
595
+ "duration_seconds": {
596
+ "type": "integer"
597
+ },
187
598
  "output_resolution": {
599
+ "type": "string",
188
600
  "enum": [
189
601
  "720p",
190
602
  "1080p"
191
603
  ]
604
+ },
605
+ "aspect_ratio": {
606
+ "type": "string"
607
+ },
608
+ "negative_prompt": {
609
+ "type": "string"
610
+ },
611
+ "enable_prompt_expansion": {
612
+ "type": "boolean"
613
+ },
614
+ "seed": {
615
+ "type": "integer"
616
+ },
617
+ "acceleration": {
618
+ "type": "string"
619
+ },
620
+ "enable_safety_checker": {
621
+ "type": "boolean"
622
+ },
623
+ "watermark": {
624
+ "type": "boolean"
625
+ },
626
+ "audio": {
627
+ "type": "boolean"
628
+ },
629
+ "multi_shots": {
630
+ "type": "boolean"
631
+ },
632
+ "driving_audio_url": {
633
+ "type": "string"
634
+ },
635
+ "background_audio_url": {
636
+ "type": "string"
637
+ },
638
+ "ratio": {
639
+ "type": "string"
192
640
  }
193
641
  }
194
642
  }
@@ -196,26 +644,61 @@
196
644
  "wan/speech-to-video": {
197
645
  "model": "Wan",
198
646
  "endpoint": "speech_to_video",
647
+ "task_type": "asynchronous",
199
648
  "models": [
200
649
  "wan-2.2-a14b-speech-to-video-turbo"
201
650
  ],
202
651
  "fields_by_model": {
203
652
  "wan-2.2-a14b-speech-to-video-turbo": {
204
- "prompt": {
653
+ "model": {
654
+ "type": "string"
655
+ },
656
+ "source_image_url": {
657
+ "type": "string",
205
658
  "required": true
206
659
  },
207
660
  "source_audio_url": {
661
+ "type": "string",
208
662
  "required": true
209
663
  },
210
- "source_image_url": {
664
+ "prompt": {
665
+ "type": "string",
211
666
  "required": true
212
667
  },
668
+ "callback_url": {
669
+ "type": "string"
670
+ },
671
+ "num_frames": {
672
+ "type": "integer"
673
+ },
674
+ "frames_per_second": {
675
+ "type": "integer"
676
+ },
213
677
  "output_resolution": {
678
+ "type": "string",
214
679
  "enum": [
215
680
  "480p",
216
681
  "580p",
217
682
  "720p"
218
683
  ]
684
+ },
685
+ "negative_prompt": {
686
+ "type": "string"
687
+ },
688
+ "seed": {
689
+ "type": "integer"
690
+ },
691
+ "num_inference_steps": {
692
+ "type": "integer"
693
+ },
694
+ "guidance_scale": {
695
+ "type": "number"
696
+ },
697
+ "shift": {
698
+ "type": "number"
699
+ },
700
+ "enable_safety_checker": {
701
+ "type": "boolean"
219
702
  }
220
703
  }
221
704
  }
@@ -223,13 +706,24 @@
223
706
  "wan/text-to-image": {
224
707
  "model": "Wan",
225
708
  "endpoint": "text_to_image",
709
+ "task_type": "asynchronous",
226
710
  "models": [
227
711
  "wan-2.7-image",
228
712
  "wan-2.7-image-pro"
229
713
  ],
230
714
  "fields_by_model": {
231
715
  "wan-2.7-image": {
716
+ "model": {
717
+ "type": "string"
718
+ },
719
+ "prompt": {
720
+ "type": "string"
721
+ },
722
+ "callback_url": {
723
+ "type": "string"
724
+ },
232
725
  "aspect_ratio": {
726
+ "type": "string",
233
727
  "enum": [
234
728
  "1:1",
235
729
  "16:9",
@@ -242,15 +736,53 @@
242
736
  ]
243
737
  },
244
738
  "output_resolution": {
739
+ "type": "string",
245
740
  "enum": [
246
741
  "1k",
247
742
  "2k",
248
743
  "4k"
249
744
  ]
745
+ },
746
+ "output_count": {
747
+ "type": "integer"
748
+ },
749
+ "enable_sequential": {
750
+ "type": "boolean"
751
+ },
752
+ "thinking_mode": {
753
+ "type": "boolean"
754
+ },
755
+ "watermark": {
756
+ "type": "boolean"
757
+ },
758
+ "seed": {
759
+ "type": "integer"
760
+ },
761
+ "enable_safety_checker": {
762
+ "type": "boolean"
763
+ },
764
+ "source_image_urls": {
765
+ "type": "array"
766
+ },
767
+ "color_palette": {
768
+ "type": "array"
769
+ },
770
+ "bbox_list": {
771
+ "type": "array"
250
772
  }
251
773
  },
252
774
  "wan-2.7-image-pro": {
775
+ "model": {
776
+ "type": "string"
777
+ },
778
+ "prompt": {
779
+ "type": "string"
780
+ },
781
+ "callback_url": {
782
+ "type": "string"
783
+ },
253
784
  "aspect_ratio": {
785
+ "type": "string",
254
786
  "enum": [
255
787
  "1:1",
256
788
  "16:9",
@@ -263,11 +795,39 @@
263
795
  ]
264
796
  },
265
797
  "output_resolution": {
798
+ "type": "string",
266
799
  "enum": [
267
800
  "1k",
268
801
  "2k",
269
802
  "4k"
270
803
  ]
804
+ },
805
+ "output_count": {
806
+ "type": "integer"
807
+ },
808
+ "enable_sequential": {
809
+ "type": "boolean"
810
+ },
811
+ "thinking_mode": {
812
+ "type": "boolean"
813
+ },
814
+ "watermark": {
815
+ "type": "boolean"
816
+ },
817
+ "seed": {
818
+ "type": "integer"
819
+ },
820
+ "enable_safety_checker": {
821
+ "type": "boolean"
822
+ },
823
+ "source_image_urls": {
824
+ "type": "array"
825
+ },
826
+ "color_palette": {
827
+ "type": "array"
828
+ },
829
+ "bbox_list": {
830
+ "type": "array"
271
831
  }
272
832
  }
273
833
  }
@@ -275,6 +835,7 @@
275
835
  "wan/text-to-video": {
276
836
  "model": "Wan",
277
837
  "endpoint": "text_to_video",
838
+ "task_type": "asynchronous",
278
839
  "models": [
279
840
  "wan-2.2-a14b-text-to-video-turbo",
280
841
  "wan-2.5-text-to-video",
@@ -282,59 +843,322 @@
282
843
  "wan-2.7-r2v",
283
844
  "wan-2.7-text-to-video"
284
845
  ],
846
+ "rules": [
847
+ {
848
+ "when": {
849
+ "model": "wan-2.6-text-to-video"
850
+ },
851
+ "forbidden": [
852
+ "seed"
853
+ ]
854
+ }
855
+ ],
285
856
  "fields_by_model": {
286
857
  "wan-2.2-a14b-text-to-video-turbo": {
858
+ "model": {
859
+ "type": "string"
860
+ },
861
+ "prompt": {
862
+ "type": "string"
863
+ },
864
+ "callback_url": {
865
+ "type": "string"
866
+ },
867
+ "duration_seconds": {
868
+ "type": "integer"
869
+ },
287
870
  "output_resolution": {
871
+ "type": "string",
288
872
  "enum": [
289
873
  "480p",
290
874
  "580p",
291
875
  "720p"
292
876
  ]
877
+ },
878
+ "aspect_ratio": {
879
+ "type": "string"
880
+ },
881
+ "ratio": {
882
+ "type": "string"
883
+ },
884
+ "negative_prompt": {
885
+ "type": "string"
886
+ },
887
+ "reference_image_urls": {
888
+ "type": "array"
889
+ },
890
+ "reference_video_urls": {
891
+ "type": "array"
892
+ },
893
+ "first_frame_image_url": {
894
+ "type": "string"
895
+ },
896
+ "reference_audio_url": {
897
+ "type": "string"
898
+ },
899
+ "enable_prompt_expansion": {
900
+ "type": "boolean"
901
+ },
902
+ "seed": {
903
+ "type": "integer"
904
+ },
905
+ "acceleration": {
906
+ "type": "string"
907
+ },
908
+ "enable_safety_checker": {
909
+ "type": "boolean"
910
+ },
911
+ "watermark": {
912
+ "type": "boolean"
913
+ },
914
+ "background_audio_url": {
915
+ "type": "string"
293
916
  }
294
917
  },
295
918
  "wan-2.5-text-to-video": {
919
+ "model": {
920
+ "type": "string"
921
+ },
922
+ "prompt": {
923
+ "type": "string"
924
+ },
925
+ "callback_url": {
926
+ "type": "string"
927
+ },
928
+ "duration_seconds": {
929
+ "type": "integer"
930
+ },
296
931
  "output_resolution": {
932
+ "type": "string",
297
933
  "enum": [
298
934
  "720p",
299
935
  "1080p"
300
936
  ]
937
+ },
938
+ "aspect_ratio": {
939
+ "type": "string"
940
+ },
941
+ "ratio": {
942
+ "type": "string"
943
+ },
944
+ "negative_prompt": {
945
+ "type": "string"
946
+ },
947
+ "reference_image_urls": {
948
+ "type": "array"
949
+ },
950
+ "reference_video_urls": {
951
+ "type": "array"
952
+ },
953
+ "first_frame_image_url": {
954
+ "type": "string"
955
+ },
956
+ "reference_audio_url": {
957
+ "type": "string"
958
+ },
959
+ "enable_prompt_expansion": {
960
+ "type": "boolean"
961
+ },
962
+ "seed": {
963
+ "type": "integer"
964
+ },
965
+ "acceleration": {
966
+ "type": "string"
967
+ },
968
+ "enable_safety_checker": {
969
+ "type": "boolean"
970
+ },
971
+ "watermark": {
972
+ "type": "boolean"
973
+ },
974
+ "background_audio_url": {
975
+ "type": "string"
301
976
  }
302
977
  },
303
978
  "wan-2.6-text-to-video": {
979
+ "model": {
980
+ "type": "string"
981
+ },
982
+ "prompt": {
983
+ "type": "string"
984
+ },
985
+ "callback_url": {
986
+ "type": "string"
987
+ },
988
+ "duration_seconds": {
989
+ "type": "integer"
990
+ },
304
991
  "output_resolution": {
992
+ "type": "string",
305
993
  "enum": [
306
994
  "720p",
307
995
  "1080p"
308
996
  ]
997
+ },
998
+ "aspect_ratio": {
999
+ "type": "string"
1000
+ },
1001
+ "ratio": {
1002
+ "type": "string"
1003
+ },
1004
+ "negative_prompt": {
1005
+ "type": "string"
1006
+ },
1007
+ "reference_image_urls": {
1008
+ "type": "array"
1009
+ },
1010
+ "reference_video_urls": {
1011
+ "type": "array"
1012
+ },
1013
+ "first_frame_image_url": {
1014
+ "type": "string"
1015
+ },
1016
+ "reference_audio_url": {
1017
+ "type": "string"
1018
+ },
1019
+ "enable_prompt_expansion": {
1020
+ "type": "boolean"
1021
+ },
1022
+ "acceleration": {
1023
+ "type": "string"
1024
+ },
1025
+ "enable_safety_checker": {
1026
+ "type": "boolean"
1027
+ },
1028
+ "watermark": {
1029
+ "type": "boolean"
1030
+ },
1031
+ "background_audio_url": {
1032
+ "type": "string"
309
1033
  }
310
1034
  },
311
1035
  "wan-2.7-r2v": {
312
- "aspect_ratio": {
313
- "enum": [
314
- "16:9",
315
- "9:16",
316
- "1:1",
317
- "4:3",
318
- "3:4"
319
- ]
1036
+ "model": {
1037
+ "type": "string"
1038
+ },
1039
+ "prompt": {
1040
+ "type": "string"
1041
+ },
1042
+ "callback_url": {
1043
+ "type": "string"
320
1044
  },
321
1045
  "duration_seconds": {
1046
+ "type": "integer",
322
1047
  "max": 10,
323
1048
  "min": 2
324
1049
  },
325
1050
  "output_resolution": {
1051
+ "type": "string",
326
1052
  "enum": [
327
1053
  "720p",
328
1054
  "1080p"
329
1055
  ]
1056
+ },
1057
+ "aspect_ratio": {
1058
+ "type": "string",
1059
+ "enum": [
1060
+ "16:9",
1061
+ "9:16",
1062
+ "1:1",
1063
+ "4:3",
1064
+ "3:4"
1065
+ ]
1066
+ },
1067
+ "ratio": {
1068
+ "type": "string"
1069
+ },
1070
+ "negative_prompt": {
1071
+ "type": "string"
1072
+ },
1073
+ "reference_image_urls": {
1074
+ "type": "array"
1075
+ },
1076
+ "reference_video_urls": {
1077
+ "type": "array"
1078
+ },
1079
+ "first_frame_image_url": {
1080
+ "type": "string"
1081
+ },
1082
+ "reference_audio_url": {
1083
+ "type": "string"
1084
+ },
1085
+ "enable_prompt_expansion": {
1086
+ "type": "boolean"
1087
+ },
1088
+ "seed": {
1089
+ "type": "integer"
1090
+ },
1091
+ "acceleration": {
1092
+ "type": "string"
1093
+ },
1094
+ "enable_safety_checker": {
1095
+ "type": "boolean"
1096
+ },
1097
+ "watermark": {
1098
+ "type": "boolean"
1099
+ },
1100
+ "background_audio_url": {
1101
+ "type": "string"
330
1102
  }
331
1103
  },
332
1104
  "wan-2.7-text-to-video": {
1105
+ "model": {
1106
+ "type": "string"
1107
+ },
1108
+ "prompt": {
1109
+ "type": "string"
1110
+ },
1111
+ "callback_url": {
1112
+ "type": "string"
1113
+ },
1114
+ "duration_seconds": {
1115
+ "type": "integer"
1116
+ },
333
1117
  "output_resolution": {
1118
+ "type": "string",
334
1119
  "enum": [
335
1120
  "720p",
336
1121
  "1080p"
337
1122
  ]
1123
+ },
1124
+ "aspect_ratio": {
1125
+ "type": "string"
1126
+ },
1127
+ "ratio": {
1128
+ "type": "string"
1129
+ },
1130
+ "negative_prompt": {
1131
+ "type": "string"
1132
+ },
1133
+ "reference_image_urls": {
1134
+ "type": "array"
1135
+ },
1136
+ "reference_video_urls": {
1137
+ "type": "array"
1138
+ },
1139
+ "first_frame_image_url": {
1140
+ "type": "string"
1141
+ },
1142
+ "reference_audio_url": {
1143
+ "type": "string"
1144
+ },
1145
+ "enable_prompt_expansion": {
1146
+ "type": "boolean"
1147
+ },
1148
+ "seed": {
1149
+ "type": "integer"
1150
+ },
1151
+ "acceleration": {
1152
+ "type": "string"
1153
+ },
1154
+ "enable_safety_checker": {
1155
+ "type": "boolean"
1156
+ },
1157
+ "watermark": {
1158
+ "type": "boolean"
1159
+ },
1160
+ "background_audio_url": {
1161
+ "type": "string"
338
1162
  }
339
1163
  }
340
1164
  }
@@ -1,5 +1,5 @@
1
1
  export declare const META: {
2
2
  readonly name: "@runapi.ai/wan-mcp";
3
- readonly version: "0.1.4";
3
+ readonly version: "0.1.7";
4
4
  readonly lineSlug: "wan";
5
5
  };
package/dist/src/meta.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const META = {
2
2
  name: "@runapi.ai/wan-mcp",
3
- version: "0.1.4",
3
+ version: "0.1.7",
4
4
  lineSlug: "wan"
5
5
  };
6
6
  //# sourceMappingURL=meta.js.map
@@ -1,13 +1,19 @@
1
1
  import { z } from "zod";
2
- import { createModelServer, findModelForAction, findModels, friendlyError, jsonText, priceForModel, RunApiClient, taskStatus } from "@runapi.ai/mcp-core";
2
+ import { createModelServer, declaredFieldsForAction, findModelForAction, findModels, friendlyError, jsonText, priceForModel, RunApiClient, taskStatus, validateInputRules, validateParams, zodShapeForFields } from "@runapi.ai/mcp-core";
3
3
  import { readContract, readPricing } from "./data.js";
4
4
  import { META } from "./meta.js";
5
+ function taskType(action) {
6
+ return action.task_type ?? "asynchronous";
7
+ }
5
8
  function lineService(contract) {
6
9
  return Object.keys(contract.actions)[0]?.split("/")[0] ?? META.lineSlug;
7
10
  }
8
- function lineEndpoints(contract) {
11
+ function lineEndpoints(contract, filter) {
9
12
  const seen = new Set();
10
13
  for (const action of Object.values(contract.actions)) {
14
+ if (filter && taskType(action) !== filter) {
15
+ continue;
16
+ }
11
17
  seen.add(action.endpoint);
12
18
  }
13
19
  return [...seen];
@@ -28,6 +34,9 @@ function buildTools(contract) {
28
34
  const tools = [];
29
35
  const inputRules = {};
30
36
  for (const [key, action] of Object.entries(contract.actions)) {
37
+ if (taskType(action) === "synchronous") {
38
+ continue;
39
+ }
31
40
  const service = key.split("/")[0];
32
41
  const endpoint = action.endpoint;
33
42
  tools.push({
@@ -41,29 +50,74 @@ function buildTools(contract) {
41
50
  }
42
51
  return { tools, inputRules };
43
52
  }
53
+ function registerSynchronousTools(server, contract, pricing, client) {
54
+ for (const [key, action] of Object.entries(contract.actions)) {
55
+ if (taskType(action) !== "synchronous") {
56
+ continue;
57
+ }
58
+ const service = key.split("/")[0];
59
+ const endpoint = action.endpoint;
60
+ const shape = zodShapeForFields(declaredFieldsForAction(action));
61
+ if (action.models.length > 0) {
62
+ shape.model = z.enum(action.models).optional().describe("RunAPI model slug for this model line.");
63
+ }
64
+ server.tool(endpoint, `Run a synchronous ${action.model} operation on RunAPI (${endpoint.replace(/_/g, " ")}). Returns the operation result and pricing snapshot.`, shape, async (args) => {
65
+ const { model, ...params } = args;
66
+ try {
67
+ const info = findModelForAction(service, endpoint, model, contract);
68
+ if (!info) {
69
+ return jsonText({
70
+ error: "Unsupported RunAPI service/action/model combination.",
71
+ hint: "This model server was generated for a specific model line; verify the requested model."
72
+ });
73
+ }
74
+ const body = validateParams(info.fields, {
75
+ ...params,
76
+ ...(info.model ? { model: info.model } : {})
77
+ });
78
+ const ruleError = validateInputRules(action.rules ?? [], body);
79
+ if (ruleError) {
80
+ return jsonText({
81
+ error: `Invalid RunAPI parameters: ${ruleError}`,
82
+ hint: "Adjust the parameters to satisfy the endpoint input rules before retrying."
83
+ });
84
+ }
85
+ const result = await client.createTask(service, endpoint, body);
86
+ return jsonText({ result, price: priceForModel(info, pricing) });
87
+ }
88
+ catch (error) {
89
+ return jsonText({ error: friendlyError(error) });
90
+ }
91
+ });
92
+ }
93
+ }
44
94
  function registerLineTools(server, contract, pricing, client) {
45
95
  const service = lineService(contract);
46
96
  const endpoints = lineEndpoints(contract);
97
+ const asynchronousEndpoints = lineEndpoints(contract, "asynchronous");
47
98
  const models = lineModels(contract);
48
99
  const endpointEnum = endpoints.length > 0 ? z.enum(endpoints) : z.string();
49
100
  const modelEnum = models.length > 0 ? z.enum(models) : z.string();
50
- // With one endpoint, action defaults safely. With several, a wrong default
51
- // would query the wrong task route, so the caller must name the endpoint.
52
- const getTaskAction = endpoints.length > 1
53
- ? endpointEnum.describe("Endpoint the task was created on.")
54
- : endpointEnum.optional().describe("Endpoint the task was created on. Defaults to the line's only endpoint.");
55
- server.tool("get_task", `Fetch the current status and latest result payload for a ${META.lineSlug} task.`, {
56
- task_id: z.string().describe("Task id returned when the task was created."),
57
- action: getTaskAction
58
- }, async ({ task_id, action }) => {
59
- try {
60
- const task = await client.getTask(service, task_id, action ?? endpoints[0]);
61
- return jsonText({ task_id, status: taskStatus(task), task });
62
- }
63
- catch (error) {
64
- return jsonText({ error: friendlyError(error) });
65
- }
66
- });
101
+ if (asynchronousEndpoints.length > 0) {
102
+ const asynchronousEndpointEnum = z.enum(asynchronousEndpoints);
103
+ // With one endpoint, action defaults safely. With several, a wrong default
104
+ // would query the wrong task route, so the caller must name the endpoint.
105
+ const getTaskAction = asynchronousEndpoints.length > 1
106
+ ? asynchronousEndpointEnum.describe("Asynchronous endpoint the task was created on.")
107
+ : asynchronousEndpointEnum.optional().describe("Asynchronous endpoint the task was created on. Defaults to the line's only asynchronous endpoint.");
108
+ server.tool("get_task", `Fetch the current status and latest result payload for a ${META.lineSlug} task.`, {
109
+ task_id: z.string().describe("Task id returned when the task was created."),
110
+ action: getTaskAction
111
+ }, async ({ task_id, action }) => {
112
+ try {
113
+ const task = await client.getTask(service, task_id, action ?? asynchronousEndpoints[0]);
114
+ return jsonText({ task_id, status: taskStatus(task), task });
115
+ }
116
+ catch (error) {
117
+ return jsonText({ error: friendlyError(error) });
118
+ }
119
+ });
120
+ }
67
121
  server.tool("check_pricing", `Look up RunAPI pricing for the ${META.lineSlug} model line.`, {
68
122
  model: modelEnum.optional().describe("Model slug. Defaults to the line's primary model."),
69
123
  action: endpointEnum.optional().describe("Endpoint name. Defaults to the endpoint that offers the model.")
@@ -117,6 +171,7 @@ export function createServer() {
117
171
  tools,
118
172
  client
119
173
  });
174
+ registerSynchronousTools(server, contract, pricing, client);
120
175
  registerLineTools(server, contract, pricing, client);
121
176
  return server;
122
177
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,UAAU,EAMX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,SAAS,WAAW,CAAC,QAAkB;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI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BAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runapi.ai/wan-mcp",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "RunAPI Wan MCP server for image and video generation: create tasks, poll results, and check pricing across 18 model variants from Claude Code, Codex, Cursor, and VS Code.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@modelcontextprotocol/sdk": "^1.29.0",
63
- "@runapi.ai/mcp-core": "0.1.5",
63
+ "@runapi.ai/mcp-core": "0.1.7",
64
64
  "zod": "^3.25.76"
65
65
  },
66
66
  "devDependencies": {
package/server.json CHANGED
@@ -6,12 +6,12 @@
6
6
  "url": "https://github.com/runapi-ai/wan-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.1.5",
9
+ "version": "0.1.7",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "@runapi.ai/wan-mcp",
14
- "version": "0.1.5",
14
+ "version": "0.1.7",
15
15
  "transport": {
16
16
  "type": "stdio"
17
17
  },