@felores/kie-ai-mcp-server 3.2.0 → 3.2.1

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
@@ -6,7 +6,7 @@ Kie.ai offers **30-50% lower cost** than competitors with 99.9% uptime and 24/7
6
6
 
7
7
  ## 📚 Documentation
8
8
 
9
- - **[Complete Tool Reference](docs/TOOLS.md)** - Detailed documentation for all 21 AI tools
9
+ - **[Complete Tool Reference](docs/TOOLS.md)** - Detailed documentation for all 24 AI tools
10
10
  - **[Database & Task Management](docs/DATABASE.md)** - SQLite database and task lifecycle
11
11
  - **[Administrator Configuration](docs/ADMIN.md)** - Deployment guides and environment setup
12
12
  - **[Intelligent Features](docs/INTELLIGENCE.md)** - Smart mode detection and cost optimization
@@ -33,10 +33,9 @@ The easiest way to use this server is to add it to your MCP client configuration
33
33
 
34
34
  **That's it!** No callback URL setup required - the server handles it automatically.
35
35
 
36
- <details>
37
- <summary><strong>🎛️ Filter Tools (optional - click to expand)</strong></summary>
36
+ ### 🎛️ Enable Only the Tools You Need
38
37
 
39
- Reduce cognitive load by enabling only the tools you need:
38
+ 25 tools is a lot. Reduce cognitive load by enabling only what you use. Add the env var to the config above:
40
39
 
41
40
  **Whitelist (enable specific tools only):**
42
41
  ```json
@@ -47,48 +46,26 @@ Reduce cognitive load by enabling only the tools you need:
47
46
  "args": ["-y", "@felores/kie-ai-mcp-server"],
48
47
  "env": {
49
48
  "KIE_AI_API_KEY": "your-api-key-here",
50
- "KIE_AI_ENABLED_TOOLS": "nano_banana_image,veo3_generate_video,suno_generate_music"
49
+ "KIE_AI_ENABLED_TOOLS": "gpt_image_2,wan_video,suno_generate_music"
51
50
  }
52
51
  }
53
52
  }
54
53
  }
55
54
  ```
56
55
 
57
- **Category filter (enable by type):**
56
+ **Category filter (enable all image + video tools):**
58
57
  ```json
59
- {
60
- "mcpServers": {
61
- "kie-ai": {
62
- "command": "npx",
63
- "args": ["-y", "@felores/kie-ai-mcp-server"],
64
- "env": {
65
- "KIE_AI_API_KEY": "your-api-key-here",
66
- "KIE_AI_TOOL_CATEGORIES": "image,video"
67
- }
68
- }
69
- }
70
- }
58
+ "KIE_AI_TOOL_CATEGORIES": "image,video"
71
59
  ```
72
60
 
73
61
  **Blacklist (disable specific tools):**
74
62
  ```json
75
- {
76
- "mcpServers": {
77
- "kie-ai": {
78
- "command": "npx",
79
- "args": ["-y", "@felores/kie-ai-mcp-server"],
80
- "env": {
81
- "KIE_AI_API_KEY": "your-api-key-here",
82
- "KIE_AI_DISABLED_TOOLS": "midjourney_generate,runway_aleph_video"
83
- }
84
- }
85
- }
86
- }
63
+ "KIE_AI_DISABLED_TOOLS": "midjourney_generate,runway_aleph_video"
87
64
  ```
88
65
 
89
- **Categories:** `image` | `video` | `audio` Utility tools (list_tasks, get_task_status) are always enabled.
66
+ **Categories:** `image` (9) | `video` (11) | `audio` (3) -- Utility tools (`list_tasks`, `get_task_status`) are always enabled.
90
67
 
91
- </details>
68
+ **Priority:** `ENABLED_TOOLS` > `TOOL_CATEGORIES` > `DISABLED_TOOLS` > all tools (default)
92
69
 
93
70
  **For Claude Desktop:** Add this to `~/Library/Application Support/Claude/claude_desktop_config.json` (Mac) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows)
94
71
 
@@ -106,7 +83,6 @@ Reduce cognitive load by enabling only the tools you need:
106
83
  ### 🚀 All AI Models in One API
107
84
 
108
85
  - **Google Veo 3**: Cinematic video generation with synchronized audio and 1080p output
109
- - **OpenAI Sora 2**: Advanced video generation with text/image/storyboard modes (unified)
110
86
  - **Runway Aleph**: Advanced video editing with object removal and style transfer
111
87
  - **Suno V5**: Professional music generation with realistic vocals up to 8 minutes
112
88
  - **Nano Banana 2**: Lightning-fast image generation and editing with Google Search grounding (unified tool)
@@ -114,9 +90,10 @@ Reduce cognitive load by enabling only the tools you need:
114
90
  - **ByteDance Seedance**: High-quality video with text-to-video and image-to-video (unified)
115
91
  - **ByteDance Seedream V5 Lite**: Advanced image generation and editing with unified interface
116
92
  - **Qwen**: Powerful image generation and editing with acceleration options (unified)
117
- - **OpenAI 4o Image**: Advanced image generation, editing, and variant creation with GPT-4o (unified)
93
+ - **GPT Image 2**: Advanced image generation and editing with up to 16 reference images (unified)
118
94
  - **Flux Kontext**: Professional image generation and editing with advanced features (unified)
119
- - **Alibaba Wan 2.5**: High-quality video generation with text-to-video and image-to-video (unified)
95
+ - **Alibaba Wan 2.7**: Multi-mode video generation with T2V, I2V, R2V, and video-edit (unified)
96
+ - **HappyHorse 1.0**: Multi-mode video generation with T2V, I2V, R2V (9 refs), and video-edit with audio
120
97
  - **Hailuo 02**: Professional video generation with text-to-video and image-to-video modes (unified, standard/pro quality)
121
98
  - **Kling 3.0**: Advanced video generation with 3-15s duration, multi-shot storytelling, and native audio
122
99
  - **Midjourney AI**: Industry-leading image and video generation with multiple modes (unified)
@@ -164,16 +141,16 @@ Your AI assistant can research and learn about available models before using the
164
141
  - `kie://guides/video-models-comparison` - Feature matrix for all video models
165
142
  - `kie://guides/quality-optimization` - Cost/quality strategies
166
143
 
167
- ### 🛠️ 21 Unified AI Tools
144
+ ### 🛠️ 24 Unified AI Tools
168
145
 
169
146
  All tools feature **smart mode detection** - one tool does multiple things:
170
147
 
171
148
  | Category | Tools |
172
149
  |----------|-------|
173
- | **Image (7)** | `bytedance_seedream_image`, `qwen_image`, `nano_banana_image`, `flux_kontext_image`, `openai_4o_image`, `recraft_remove_background`, `ideogram_reframe` |
174
- | **Video (8)** | `veo3_generate_video`, `sora_video`, `bytedance_seedance_video`, `wan_video`, `hailuo_video`, `kling_video`, `runway_aleph_video`, `midjourney_generate` |
150
+ | **Image (9)** | `nano_banana_image`, `bytedance_seedream_image`, `qwen_image`, `gpt_image_2`, `flux_kontext_image`, `flux2_image`, `topaz_upscale_image`, `recraft_remove_background`, `ideogram_reframe` |
151
+ | **Video (10)** | `veo3_generate_video`, `bytedance_seedance_video`, `wan_video`, `happyhorse_video`, `hailuo_video`, `kling_video`, `runway_aleph_video`, `wan_animate`, `midjourney_generate` |
175
152
  | **Audio (3)** | `suno_generate_music`, `elevenlabs_tts`, `elevenlabs_ttsfx` |
176
- | **Utility (3)** | `list_tasks`, `get_task_status`, `veo3_get_1080p_video` |
153
+ | **Utility (2)** | `list_tasks`, `get_task_status` |
177
154
 
178
155
  **→ [See complete tool documentation](docs/TOOLS.md)**
179
156
 
@@ -280,8 +257,8 @@ export KIE_AI_DISABLED_TOOLS="midjourney_generate,runway_aleph_video"
280
257
  **Priority Logic**: `ENABLED_TOOLS` > `TOOL_CATEGORIES` > `DISABLED_TOOLS` > All tools (default)
281
258
 
282
259
  **Tool Categories**:
283
- - **image** (8): nano_banana, seedream, qwen, openai_4o, flux, recraft, ideogram, midjourney*
284
- - **video** (9): veo3, veo3_1080p, sora, seedance, wan, hailuo, kling, runway, midjourney*
260
+ - **image** (9): nano_banana, seedream, qwen, gpt_image_2, flux_kontext, flux2, topaz, recraft, ideogram, midjourney*
261
+ - **video** (10): veo3, seedance, wan_video, happyhorse_video, hailuo, kling, runway, wan_animate, midjourney*
285
262
  - **audio** (3): suno, elevenlabs_tts, elevenlabs_ttsfx
286
263
  - **utility** (2): list_tasks, get_task_status ⭐ **Always enabled**
287
264
 
@@ -341,12 +318,11 @@ Or if installed globally with npx:
341
318
  ### Generate Video
342
319
  ```json
343
320
  {
344
- "tool": "sora_video",
321
+ "tool": "wan_video",
345
322
  "arguments": {
346
323
  "prompt": "A peaceful garden with blooming flowers and butterflies",
347
- "model": "sora-2",
348
324
  "resolution": "1080p",
349
- "duration": "10"
325
+ "duration": 5
350
326
  }
351
327
  }
352
328
  ```
@@ -422,7 +398,7 @@ The server includes a built-in SQLite database for persistent task tracking:
422
398
 
423
399
  ```bash
424
400
  # Generate social media video content
425
- sora_video: "A trendy coffee shop with latte art, cinematic lighting"
401
+ wan_video: "A trendy coffee shop with latte art, cinematic lighting"
426
402
 
427
403
  # Create product photography
428
404
  nano_banana_image: "Luxury watch on marble surface, professional product shot"
@@ -470,7 +446,7 @@ elevenlabs_tts: "Tap here to get started with your new profile"
470
446
  veo3_generate_video: "Professional office environment, employee training scenario"
471
447
 
472
448
  # Create corporate presentations
473
- openai_4o_image: "Add company logo to presentation slide, maintain professional style"
449
+ gpt_image_2: "Add company logo to presentation slide, maintain professional style"
474
450
 
475
451
  # Produce marketing content
476
452
  suno_generate_music: "Corporate background music for promotional video"
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, ListResources
5
5
  import { KieAiClient } from "./kie-ai-client.js";
6
6
  import { TaskDatabase } from "./database.js";
7
7
  import { z } from "zod";
8
- import { NanoBananaImageSchema, Veo3GenerateSchema, SunoGenerateSchema, ElevenLabsTTSSchema, ElevenLabsSoundEffectsSchema, ByteDanceSeedanceVideoSchema, ByteDanceSeedreamImageSchema, QwenImageSchema, RunwayAlephVideoSchema, Wan27VideoSchema, MidjourneyGenerateSchema, GptImage2Schema, FluxKontextImageSchema, RecraftRemoveBackgroundSchema, IdeogramReframeSchema, KlingVideoSchema, HailuoVideoSchema, SoraVideoSchema, Flux2ImageSchema, WanAnimateSchema, ZImageSchema, GrokImagineSchema, InfiniTalkSchema, KlingAvatarSchema, TopazUpscaleImageSchema, HappyHorseVideoSchema, } from "./types.js";
8
+ import { NanoBananaImageSchema, Veo3GenerateSchema, SunoGenerateSchema, ElevenLabsTTSSchema, ElevenLabsSoundEffectsSchema, ByteDanceSeedanceVideoSchema, ByteDanceSeedreamImageSchema, QwenImageSchema, RunwayAlephVideoSchema, Wan27VideoSchema, MidjourneyGenerateSchema, GptImage2Schema, FluxKontextImageSchema, RecraftRemoveBackgroundSchema, IdeogramReframeSchema, KlingVideoSchema, HailuoVideoSchema, Flux2ImageSchema, WanAnimateSchema, ZImageSchema, GrokImagineSchema, InfiniTalkSchema, KlingAvatarSchema, TopazUpscaleImageSchema, HappyHorseVideoSchema, } from "./types.js";
9
9
  class KieAiMcpServer {
10
10
  server;
11
11
  client;
@@ -29,7 +29,6 @@ class KieAiMcpServer {
29
29
  video: [
30
30
  "veo3_generate_video",
31
31
  "veo3_get_1080p_video",
32
- "sora_video",
33
32
  "bytedance_seedance_video",
34
33
  "wan_video",
35
34
  "wan_animate",
@@ -54,7 +53,7 @@ class KieAiMcpServer {
54
53
  constructor() {
55
54
  this.server = new Server({
56
55
  name: "kie-ai-mcp-server",
57
- version: "3.2.0",
56
+ version: "3.2.1",
58
57
  });
59
58
  // Initialize client with config from environment
60
59
  this.config = {
@@ -1921,56 +1920,6 @@ class KieAiMcpServer {
1921
1920
  required: ["prompt"],
1922
1921
  },
1923
1922
  },
1924
- {
1925
- name: "sora_video",
1926
- description: "Generate videos using OpenAI's Sora 2 models (unified tool for text-to-video, image-to-video, and storyboard generation with standard/high quality)",
1927
- inputSchema: {
1928
- type: "object",
1929
- properties: {
1930
- prompt: {
1931
- type: "string",
1932
- description: "Text prompt describing the desired video content (max 5000 characters). Required for text-to-video and image-to-video modes, optional for storyboard mode.",
1933
- maxLength: 5000,
1934
- },
1935
- image_urls: {
1936
- type: "array",
1937
- description: "Array of image URLs for image-to-video or storyboard modes (1-10 URLs). For storyboard mode: provide images without prompt. For image-to-video: provide with prompt.",
1938
- items: { type: "string", format: "uri" },
1939
- minItems: 1,
1940
- maxItems: 10,
1941
- },
1942
- aspect_ratio: {
1943
- type: "string",
1944
- description: "Aspect ratio of the generated video",
1945
- enum: ["portrait", "landscape"],
1946
- default: "landscape",
1947
- },
1948
- n_frames: {
1949
- type: "string",
1950
- description: "Number of frames/duration: 10s (5fps), 15s (5fps), or 25s (5fps). Storyboard mode supports 15s and 25s only.",
1951
- enum: ["10", "15", "25"],
1952
- default: "10",
1953
- },
1954
- size: {
1955
- type: "string",
1956
- description: "Quality tier: standard (480p) or high (1080p). High quality uses pro endpoints.",
1957
- enum: ["standard", "high"],
1958
- default: "standard",
1959
- },
1960
- remove_watermark: {
1961
- type: "boolean",
1962
- description: "Whether to remove the Sora watermark from the generated video",
1963
- default: true,
1964
- },
1965
- callBackUrl: {
1966
- type: "string",
1967
- description: "Optional: URL for task completion notifications (uses KIE_AI_CALLBACK_URL env var if not provided)",
1968
- format: "uri",
1969
- },
1970
- },
1971
- required: [],
1972
- },
1973
- },
1974
1923
  ];
1975
1924
  const filteredTools = allTools.filter((tool) => this.enabledTools.has(tool.name));
1976
1925
  return { tools: filteredTools };
@@ -2035,8 +1984,6 @@ class KieAiMcpServer {
2035
1984
  return await this.handleKlingVideo(args);
2036
1985
  case "hailuo_video":
2037
1986
  return await this.handleHailuoVideo(args);
2038
- case "sora_video":
2039
- return await this.handleSoraVideo(args);
2040
1987
  case "flux2_image":
2041
1988
  return await this.handleFlux2Image(args);
2042
1989
  case "wan_animate":
@@ -2189,26 +2136,6 @@ class KieAiMcpServer {
2189
2136
  priority: 0.6,
2190
2137
  },
2191
2138
  },
2192
- {
2193
- uri: "kie://models/sora-2",
2194
- name: "Sora 2 Standard",
2195
- description: "OpenAI Sora 2 text/image/storyboard video (480p, secondary option)",
2196
- mimeType: "text/markdown",
2197
- annotations: {
2198
- audience: ["assistant"],
2199
- priority: 0.7,
2200
- },
2201
- },
2202
- {
2203
- uri: "kie://models/sora-2-pro",
2204
- name: "Sora 2 Pro",
2205
- description: "OpenAI Sora 2 premium quality video (1080p, secondary option)",
2206
- mimeType: "text/markdown",
2207
- annotations: {
2208
- audience: ["assistant"],
2209
- priority: 0.7,
2210
- },
2211
- },
2212
2139
  {
2213
2140
  uri: "kie://models/midjourney",
2214
2141
  name: "Midjourney",
@@ -2758,9 +2685,6 @@ class KieAiMcpServer {
2758
2685
  "veo3",
2759
2686
  "veo3-fast",
2760
2687
  "veo3-1080p",
2761
- "sora-video",
2762
- "sora-2",
2763
- "sora-2-pro",
2764
2688
  "kling-3.0-video",
2765
2689
  "bytedance-seedance-video",
2766
2690
  "wan-video",
@@ -4498,82 +4422,6 @@ class KieAiMcpServer {
4498
4422
  });
4499
4423
  }
4500
4424
  }
4501
- async handleSoraVideo(args) {
4502
- try {
4503
- const request = SoraVideoSchema.parse(args);
4504
- request.callBackUrl = this.getCallbackUrl(request.callBackUrl);
4505
- const response = await this.client.generateSoraVideo(request);
4506
- let modeDescription;
4507
- if (!request.prompt && request.image_urls?.length) {
4508
- modeDescription = `storyboard (${request.size || "standard"} quality)`;
4509
- }
4510
- else if (request.prompt && !request.image_urls?.length) {
4511
- modeDescription = `text-to-video (${request.size || "standard"} quality)`;
4512
- }
4513
- else if (request.prompt && request.image_urls?.length) {
4514
- modeDescription = `image-to-video (${request.size || "standard"} quality)`;
4515
- }
4516
- else {
4517
- modeDescription = `unknown mode`;
4518
- }
4519
- if (response.data?.taskId) {
4520
- await this.db.createTask({
4521
- task_id: response.data.taskId,
4522
- api_type: "sora-video",
4523
- status: "pending",
4524
- });
4525
- }
4526
- return {
4527
- content: [
4528
- {
4529
- type: "text",
4530
- text: JSON.stringify({
4531
- success: true,
4532
- task_id: response.data?.taskId,
4533
- mode: modeDescription,
4534
- message: `Sora video generation task created successfully (${modeDescription})`,
4535
- parameters: {
4536
- prompt: request.prompt,
4537
- image_urls: request.image_urls,
4538
- aspect_ratio: request.aspect_ratio || "landscape",
4539
- n_frames: request.n_frames || "10",
4540
- size: request.size || "standard",
4541
- remove_watermark: request.remove_watermark !== false,
4542
- callBackUrl: request.callBackUrl,
4543
- },
4544
- next_steps: [
4545
- "Use get_task_status to check generation progress",
4546
- "Task completion will be sent to the provided callback URL",
4547
- "Video generation typically takes 2-5 minutes for standard, 5-10 minutes for high quality",
4548
- ],
4549
- }, null, 2),
4550
- },
4551
- ],
4552
- };
4553
- }
4554
- catch (error) {
4555
- if (error instanceof z.ZodError) {
4556
- return this.formatError("sora_video", error, {
4557
- prompt: "Optional: text description for video generation (max 5000 chars). Required for text-to-video and image-to-video modes.",
4558
- image_urls: "Optional: array of image URLs for image-to-video or storyboard modes (1-10 URLs)",
4559
- aspect_ratio: 'Optional: aspect ratio "portrait" or "landscape" (default: landscape)',
4560
- n_frames: 'Optional: number of frames "10" (default), "15", or "25". Storyboard mode supports 15s and 25s only.',
4561
- size: 'Optional: quality tier "standard" (default) or "high"',
4562
- remove_watermark: "Optional: remove Sora watermark (default: true)",
4563
- callBackUrl: "Optional: callback URL for notifications (uses KIE_AI_CALLBACK_URL env var if not provided)",
4564
- });
4565
- }
4566
- return this.formatError("sora_video", error, {
4567
- prompt: "Optional: text description for video generation",
4568
- image_urls: "Optional: array of image URLs for image-to-video or storyboard modes",
4569
- aspect_ratio: "Optional: aspect ratio (portrait or landscape)",
4570
- n_frames: "Optional: video duration in frames (10, 15, or 25)",
4571
- size: "Optional: quality tier (standard or high)",
4572
- remove_watermark: "Optional: remove Sora watermark",
4573
- callBackUrl: "Optional: URL for task completion notifications",
4574
- });
4575
- }
4576
- }
4577
4425
  async handleFlux2Image(args) {
4578
4426
  try {
4579
4427
  const request = Flux2ImageSchema.parse(args);
@@ -5356,8 +5204,6 @@ These guidelines ensure optimal balance between quality requirements and cost ma
5356
5204
  "kling-v2-5": "kling_v2-5-turbo-text-to-video-pro.md",
5357
5205
  midjourney: "midjourney_generate.md",
5358
5206
  hailuo: "hailuo_02-text-to-video-pro.md",
5359
- "sora-2": "sora-2-text-to-video.md",
5360
- "sora-2-pro": "sora-2-pro-text-to-video.md",
5361
5207
  };
5362
5208
  const fileName = modelFiles[modelKey];
5363
5209
  if (!fileName) {
@@ -1,4 +1,4 @@
1
- import { KieAiConfig, KieAiResponse, NanoBananaImageRequest, Veo3GenerateRequest, SunoGenerateRequest, ElevenLabsTTSRequest, ElevenLabsSoundEffectsRequest, ByteDanceSeedanceVideoRequest, RunwayAlephVideoRequest, WanVideoRequest, ByteDanceSeedreamImageRequest, QwenImageRequest, MidjourneyGenerateRequest, GptImage2Request, FluxKontextImageRequest, RecraftRemoveBackgroundRequest, IdeogramReframeRequest, KlingVideoRequest, HailuoVideoRequest, SoraVideoRequest, Flux2ImageRequest, WanAnimateRequest, ZImageRequest, GrokImagineRequest, InfiniTalkRequest, KlingAvatarRequest, TopazUpscaleImageRequest, HappyHorseVideoRequest, ImageResponse, TaskResponse } from "./types.js";
1
+ import { KieAiConfig, KieAiResponse, NanoBananaImageRequest, Veo3GenerateRequest, SunoGenerateRequest, ElevenLabsTTSRequest, ElevenLabsSoundEffectsRequest, ByteDanceSeedanceVideoRequest, RunwayAlephVideoRequest, WanVideoRequest, ByteDanceSeedreamImageRequest, QwenImageRequest, MidjourneyGenerateRequest, GptImage2Request, FluxKontextImageRequest, RecraftRemoveBackgroundRequest, IdeogramReframeRequest, KlingVideoRequest, HailuoVideoRequest, Flux2ImageRequest, WanAnimateRequest, ZImageRequest, GrokImagineRequest, InfiniTalkRequest, KlingAvatarRequest, TopazUpscaleImageRequest, HappyHorseVideoRequest, ImageResponse, TaskResponse } from "./types.js";
2
2
  export declare class KieAiClient {
3
3
  private config;
4
4
  constructor(config: KieAiConfig);
@@ -23,7 +23,6 @@ export declare class KieAiClient {
23
23
  getVeo1080pVideo(taskId: string, index?: number): Promise<KieAiResponse<any>>;
24
24
  generateKlingVideo(request: KlingVideoRequest): Promise<KieAiResponse<TaskResponse>>;
25
25
  generateHailuoVideo(request: HailuoVideoRequest): Promise<KieAiResponse<TaskResponse>>;
26
- generateSoraVideo(request: SoraVideoRequest): Promise<KieAiResponse<TaskResponse>>;
27
26
  generateFlux2Image(request: Flux2ImageRequest): Promise<KieAiResponse<TaskResponse>>;
28
27
  generateWanAnimate(request: WanAnimateRequest): Promise<KieAiResponse<TaskResponse>>;
29
28
  generateZImage(request: ZImageRequest): Promise<KieAiResponse<TaskResponse>>;
@@ -82,7 +82,6 @@ export class KieAiClient {
82
82
  apiType === "ideogram-reframe" ||
83
83
  apiType === "kling-3.0-video" ||
84
84
  apiType === "hailuo" ||
85
- apiType === "sora-video" ||
86
85
  apiType === "flux2-image" ||
87
86
  apiType === "wan-animate" ||
88
87
  apiType === "topaz-upscale" ||
@@ -636,62 +635,6 @@ export class KieAiClient {
636
635
  };
637
636
  return this.makeRequest("/jobs/createTask", "POST", jobRequest);
638
637
  }
639
- async generateSoraVideo(request) {
640
- // Smart mode detection based on parameters
641
- const hasPrompt = !!request.prompt;
642
- const hasImages = !!request.image_urls?.length;
643
- let model;
644
- let input;
645
- if (!hasPrompt && hasImages) {
646
- // Storyboard mode: images only, no prompt
647
- model = "openai/sora-2-storyboard";
648
- input = {
649
- image_urls: request.image_urls,
650
- aspect_ratio: request.aspect_ratio || "landscape",
651
- n_frames: request.n_frames || "15", // Storyboard defaults to 15s
652
- size: request.size || "standard",
653
- remove_watermark: request.remove_watermark !== false,
654
- };
655
- }
656
- else if (hasPrompt && !hasImages) {
657
- // Text-to-video mode
658
- const isHighQuality = request.size === "high";
659
- model = isHighQuality
660
- ? "openai/sora-2-pro-text-to-video"
661
- : "openai/sora-2-text-to-video";
662
- input = {
663
- prompt: request.prompt,
664
- aspect_ratio: request.aspect_ratio || "landscape",
665
- n_frames: request.n_frames || "10",
666
- size: request.size || "standard",
667
- remove_watermark: request.remove_watermark !== false,
668
- };
669
- }
670
- else if (hasPrompt && hasImages) {
671
- // Image-to-video mode
672
- const isHighQuality = request.size === "high";
673
- model = isHighQuality
674
- ? "openai/sora-2-pro-image-to-video"
675
- : "openai/sora-2-image-to-video";
676
- input = {
677
- prompt: request.prompt,
678
- image_urls: request.image_urls,
679
- aspect_ratio: request.aspect_ratio || "landscape",
680
- n_frames: request.n_frames || "10",
681
- size: request.size || "standard",
682
- remove_watermark: request.remove_watermark !== false,
683
- };
684
- }
685
- else {
686
- throw new Error("Invalid parameters: must provide either prompt (for text-to-video) or image_urls (for storyboard), or both (for image-to-video)");
687
- }
688
- const jobRequest = {
689
- model,
690
- input,
691
- callBackUrl: request.callBackUrl || process.env.KIE_AI_CALLBACK_URL,
692
- };
693
- return this.makeRequest("/jobs/createTask", "POST", jobRequest);
694
- }
695
638
  async generateFlux2Image(request) {
696
639
  // Smart mode detection based on parameters
697
640
  const hasInputUrls = !!request.input_urls && request.input_urls.length > 0;
package/dist/types.d.ts CHANGED
@@ -1167,48 +1167,6 @@ export declare const HailuoVideoSchema: z.ZodEffects<z.ZodObject<{
1167
1167
  promptOptimizer?: boolean | undefined;
1168
1168
  }>;
1169
1169
  export type HailuoVideoRequest = z.infer<typeof HailuoVideoSchema>;
1170
- export declare const SoraVideoSchema: z.ZodEffects<z.ZodObject<{
1171
- prompt: z.ZodOptional<z.ZodString>;
1172
- image_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1173
- aspect_ratio: z.ZodOptional<z.ZodDefault<z.ZodEnum<["portrait", "landscape"]>>>;
1174
- n_frames: z.ZodOptional<z.ZodDefault<z.ZodEnum<["10", "15", "25"]>>>;
1175
- size: z.ZodOptional<z.ZodDefault<z.ZodEnum<["standard", "high"]>>>;
1176
- remove_watermark: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1177
- callBackUrl: z.ZodOptional<z.ZodString>;
1178
- }, "strip", z.ZodTypeAny, {
1179
- prompt?: string | undefined;
1180
- aspect_ratio?: "portrait" | "landscape" | undefined;
1181
- callBackUrl?: string | undefined;
1182
- image_urls?: string[] | undefined;
1183
- n_frames?: "10" | "15" | "25" | undefined;
1184
- size?: "standard" | "high" | undefined;
1185
- remove_watermark?: boolean | undefined;
1186
- }, {
1187
- prompt?: string | undefined;
1188
- aspect_ratio?: "portrait" | "landscape" | undefined;
1189
- callBackUrl?: string | undefined;
1190
- image_urls?: string[] | undefined;
1191
- n_frames?: "10" | "15" | "25" | undefined;
1192
- size?: "standard" | "high" | undefined;
1193
- remove_watermark?: boolean | undefined;
1194
- }>, {
1195
- prompt?: string | undefined;
1196
- aspect_ratio?: "portrait" | "landscape" | undefined;
1197
- callBackUrl?: string | undefined;
1198
- image_urls?: string[] | undefined;
1199
- n_frames?: "10" | "15" | "25" | undefined;
1200
- size?: "standard" | "high" | undefined;
1201
- remove_watermark?: boolean | undefined;
1202
- }, {
1203
- prompt?: string | undefined;
1204
- aspect_ratio?: "portrait" | "landscape" | undefined;
1205
- callBackUrl?: string | undefined;
1206
- image_urls?: string[] | undefined;
1207
- n_frames?: "10" | "15" | "25" | undefined;
1208
- size?: "standard" | "high" | undefined;
1209
- remove_watermark?: boolean | undefined;
1210
- }>;
1211
- export type SoraVideoRequest = z.infer<typeof SoraVideoSchema>;
1212
1170
  export declare const Flux2ImageSchema: z.ZodEffects<z.ZodObject<{
1213
1171
  prompt: z.ZodString;
1214
1172
  input_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -1281,7 +1239,7 @@ export interface TaskResponse {
1281
1239
  export interface TaskRecord {
1282
1240
  id?: number;
1283
1241
  task_id: string;
1284
- api_type: "nano-banana" | "nano-banana-edit" | "nano-banana-image" | "veo3" | "suno" | "elevenlabs-tts" | "elevenlabs-sound-effects" | "bytedance-seedance-video" | "runway-aleph-video" | "wan-video" | "bytedance-seedream-image" | "qwen-image" | "midjourney" | "gpt-image-2" | "flux-kontext-image" | "recraft-remove-background" | "ideogram-reframe" | "kling-3.0-video" | "hailuo" | "sora-video" | "flux2-image" | "wan-animate" | "z-image" | "grok-imagine" | "infinitalk" | "kling-avatar" | "topaz-upscale" | "happyhorse-video";
1242
+ api_type: "nano-banana" | "nano-banana-edit" | "nano-banana-image" | "veo3" | "suno" | "elevenlabs-tts" | "elevenlabs-sound-effects" | "bytedance-seedance-video" | "runway-aleph-video" | "wan-video" | "bytedance-seedream-image" | "qwen-image" | "midjourney" | "gpt-image-2" | "flux-kontext-image" | "recraft-remove-background" | "ideogram-reframe" | "kling-3.0-video" | "hailuo" | "flux2-image" | "wan-animate" | "z-image" | "grok-imagine" | "infinitalk" | "kling-avatar" | "topaz-upscale" | "happyhorse-video";
1285
1243
  status: "pending" | "processing" | "completed" | "failed";
1286
1244
  created_at: string;
1287
1245
  updated_at: string;
package/dist/types.js CHANGED
@@ -770,45 +770,6 @@ export const HailuoVideoSchema = z
770
770
  message: "Invalid parameter combination. Choose mode: 1) prompt only (text-to-video), or 2) prompt + imageUrl (image-to-video). endImageUrl is only valid with imageUrl. For 2.3: 10s+1080P not supported, 512P not available. For 02: 1080P not available.",
771
771
  path: [],
772
772
  });
773
- // Sora Video - Unified tool for all 5 Sora 2 endpoints
774
- export const SoraVideoSchema = z
775
- .object({
776
- prompt: z.string().min(1).max(5000).optional(),
777
- image_urls: z.array(z.string().url()).min(1).max(10).optional(),
778
- aspect_ratio: z
779
- .enum(["portrait", "landscape"])
780
- .default("landscape")
781
- .optional(),
782
- n_frames: z.enum(["10", "15", "25"]).default("10").optional(),
783
- size: z.enum(["standard", "high"]).default("standard").optional(),
784
- remove_watermark: z.boolean().default(true).optional(),
785
- callBackUrl: z.string().url().optional(),
786
- })
787
- .refine((data) => {
788
- // Smart mode validation based on input parameters
789
- const hasPrompt = !!data.prompt;
790
- const hasImages = !!data.image_urls?.length;
791
- // Storyboard mode: no prompt required, but images required
792
- if (!hasPrompt && !hasImages) {
793
- return false; // Need either prompt or images
794
- }
795
- // Storyboard mode: images only, no prompt
796
- if (!hasPrompt && hasImages) {
797
- return data.n_frames !== "10"; // Storyboard supports 15s, 25s (not 10s)
798
- }
799
- // Text-to-video mode: prompt only, no images
800
- if (hasPrompt && !hasImages) {
801
- return true; // All parameters valid
802
- }
803
- // Image-to-video mode: prompt + images
804
- if (hasPrompt && hasImages) {
805
- return true; // All parameters valid
806
- }
807
- return true;
808
- }, {
809
- message: "Invalid parameter combination. For storyboard mode: provide image_urls without prompt. For text-to-video: provide prompt only. For image-to-video: provide both prompt and image_urls.",
810
- path: [],
811
- });
812
773
  // Flux-2 Image - Unified text-to-image and image-to-image (Pro/Flex)
813
774
  export const Flux2ImageSchema = z
814
775
  .object({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@felores/kie-ai-mcp-server",
3
- "version": "3.2.0",
4
- "description": "MCP server for Kie.ai APIs (25 AI tools: Nano Banana image generation/editing/upscaling, Veo3 video generation, Suno music generation, ElevenLabs TTS/sound effects, ByteDance Seedance/Seedream video/image, Qwen image generation/editing, Runway Aleph video transformation, Midjourney AI generation, Wan 2.7 video generation, Hailuo video generation, Kling video generation, GPT Image 2 generation/editing, Flux Kontext image generation/editing, Recraft background removal, Ideogram image reframing, Sora 2 video generation, Topaz image upscaling, HappyHorse 1.0 video generation)",
3
+ "version": "3.2.1",
4
+ "description": "MCP server for Kie.ai APIs (24 AI tools: Nano Banana image generation/editing/upscaling, Veo3 video generation, Suno music generation, ElevenLabs TTS/sound effects, ByteDance Seedance/Seedream video/image, Qwen image generation/editing, Runway Aleph video transformation, Midjourney AI generation, Wan 2.7 video generation, Hailuo video generation, Kling video generation, GPT Image 2 generation/editing, Flux Kontext image generation/editing, Recraft background removal, Ideogram image reframing, Topaz image upscaling, HappyHorse 1.0 video generation)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "kie-ai-mcp-server": "dist/index.js"