@felores/kie-ai-mcp-server 1.7.1 → 1.7.2

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
@@ -22,6 +22,7 @@ Access the world's best AI models through a single, developer-friendly API. Gene
22
22
  - **Nano Banana**: Lightning-fast image generation and editing
23
23
  - **ElevenLabs**: Studio-quality text-to-speech and sound effects
24
24
  - **ByteDance Seedance**: High-quality video with text-to-video and image-to-video
25
+ - **ByteDance Seedream V4**: Advanced image generation and editing with unified interface
25
26
 
26
27
  ### 💰 **Affordable Pricing**
27
28
  Pay-as-you-go credit system means you only pay for what you use. Good for startups and enterprises looking to reduce AI costs.
@@ -515,7 +516,71 @@ Video with specific ending frame:
515
516
 
516
517
  **Note**: The `callBackUrl` is optional and will use the `KIE_AI_CALLBACK_URL` environment variable if not provided. Video generation typically takes 2-5 minutes depending on quality and complexity.
517
518
 
518
- ### 13. `runway_aleph_video`
519
+ ### 13. `bytedance_seedream_image`
520
+ Generate and edit images using ByteDance Seedream V4 models (unified tool for both text-to-image and image editing).
521
+
522
+ **Parameters:**
523
+ - `prompt` (string, required): Text prompt for image generation or editing (max 10000 chars)
524
+ - `image_urls` (array, optional): Array of image URLs for editing mode (1-10 images, if not provided, uses text-to-image)
525
+ - `image_size` (string, optional): Image aspect ratio (default: "1:1")
526
+ - Options: `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `21:9`, `9:21`, `3:2`, `2:3`
527
+ - `image_resolution` (string, optional): Image resolution (default: "1K")
528
+ - `1K`: Standard resolution (1024px on shortest side)
529
+ - `2K`: High resolution (2048px on shortest side)
530
+ - `4K`: Ultra high resolution (4096px on shortest side)
531
+ - `max_images` (integer, optional): Number of images to generate (1-6, default: 1)
532
+ - `seed` (integer, optional): Random seed for reproducible results (default: -1 for random)
533
+ - `callBackUrl` (string, optional): URL for task completion notifications
534
+
535
+ **Examples:**
536
+
537
+ Text-to-image generation:
538
+ ```json
539
+ {
540
+ "prompt": "A majestic dragon perched atop a crystal mountain at sunset, digital art style",
541
+ "image_size": "16:9",
542
+ "image_resolution": "2K",
543
+ "max_images": 2,
544
+ "seed": 42
545
+ }
546
+ ```
547
+
548
+ Image editing:
549
+ ```json
550
+ {
551
+ "prompt": "Transform the day scene into a magical night with glowing stars and moonlight",
552
+ "image_urls": ["https://example.com/day-landscape.jpg"],
553
+ "image_size": "16:9",
554
+ "image_resolution": "2K",
555
+ "max_images": 1
556
+ }
557
+ ```
558
+
559
+ Multiple image editing:
560
+ ```json
561
+ {
562
+ "prompt": "Apply a consistent cyberpunk aesthetic to all images with neon lights and futuristic elements",
563
+ "image_urls": [
564
+ "https://example.com/character1.jpg",
565
+ "https://example.com/character2.jpg",
566
+ "https://example.com/background.jpg"
567
+ ],
568
+ "image_resolution": "4K",
569
+ "max_images": 3
570
+ }
571
+ ```
572
+
573
+ **Key Features:**
574
+ - **Unified Interface**: Single tool for both text-to-image and image editing
575
+ - **Smart Mode Detection**: Automatically detects mode based on presence of `image_urls`
576
+ - **High Resolution**: Support for 1K, 2K, and 4K output
577
+ - **Multiple Images**: Generate up to 6 images in a single request
578
+ - **Batch Editing**: Edit up to 10 images simultaneously with consistent style
579
+ - **Reproducible Results**: Seed control for consistent output
580
+
581
+ **Note**: The `callBackUrl` is optional and will use the `KIE_AI_CALLBACK_URL` environment variable if not provided. Image generation typically takes 30-120 seconds depending on resolution and complexity.
582
+
583
+ ### 14. `runway_aleph_video`
519
584
  Transform videos using Runway Aleph video-to-video generation with AI-powered editing.
520
585
 
521
586
  **Parameters:**
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } f
5
5
  import { KieAiClient } from './kie-ai-client.js';
6
6
  import { TaskDatabase } from './database.js';
7
7
  import { z } from 'zod';
8
- import { NanoBananaGenerateSchema, NanoBananaEditSchema, NanoBananaUpscaleSchema, Veo3GenerateSchema, SunoGenerateSchema, ElevenLabsTTSSchema, ElevenLabsSoundEffectsSchema, ByteDanceSeedanceVideoSchema, RunwayAlephVideoSchema, WanVideoSchema } from './types.js';
8
+ import { NanoBananaGenerateSchema, NanoBananaEditSchema, NanoBananaUpscaleSchema, Veo3GenerateSchema, SunoGenerateSchema, ElevenLabsTTSSchema, ElevenLabsSoundEffectsSchema, ByteDanceSeedanceVideoSchema, ByteDanceSeedreamImageSchema, RunwayAlephVideoSchema, WanVideoSchema } from './types.js';
9
9
  class KieAiMcpServer {
10
10
  server;
11
11
  client;
@@ -13,7 +13,7 @@ class KieAiMcpServer {
13
13
  constructor() {
14
14
  this.server = new Server({
15
15
  name: 'kie-ai-mcp-server',
16
- version: '1.7.1',
16
+ version: '1.7.2',
17
17
  });
18
18
  // Initialize client with config from environment
19
19
  const config = {
@@ -551,6 +551,61 @@ class KieAiMcpServer {
551
551
  required: ['prompt']
552
552
  }
553
553
  },
554
+ {
555
+ name: 'bytedance_seedream_image',
556
+ description: 'Generate and edit images using ByteDance Seedream V4 models (unified tool for both text-to-image and image editing)',
557
+ inputSchema: {
558
+ type: 'object',
559
+ properties: {
560
+ prompt: {
561
+ type: 'string',
562
+ description: 'Text prompt for image generation or editing (max 10000 characters)',
563
+ minLength: 1,
564
+ maxLength: 10000
565
+ },
566
+ image_urls: {
567
+ type: 'array',
568
+ description: 'Array of image URLs for editing mode (optional - if not provided, uses text-to-image)',
569
+ items: {
570
+ type: 'string',
571
+ format: 'uri'
572
+ },
573
+ minItems: 1,
574
+ maxItems: 10
575
+ },
576
+ image_size: {
577
+ type: 'string',
578
+ description: 'Image aspect ratio',
579
+ enum: ['1:1', '4:3', '3:4', '16:9', '9:16', '21:9', '9:21', '3:2', '2:3'],
580
+ default: '1:1'
581
+ },
582
+ image_resolution: {
583
+ type: 'string',
584
+ description: 'Image resolution',
585
+ enum: ['1K', '2K', '4K'],
586
+ default: '1K'
587
+ },
588
+ max_images: {
589
+ type: 'integer',
590
+ description: 'Number of images to generate',
591
+ minimum: 1,
592
+ maximum: 6,
593
+ default: 1
594
+ },
595
+ seed: {
596
+ type: 'integer',
597
+ description: 'Random seed for reproducible results (use -1 for random)',
598
+ default: -1
599
+ },
600
+ callBackUrl: {
601
+ type: 'string',
602
+ description: 'Optional: URL for task completion notifications (uses KIE_AI_CALLBACK_URL env var if not provided)',
603
+ format: 'uri'
604
+ }
605
+ },
606
+ required: ['prompt']
607
+ }
608
+ },
554
609
  {
555
610
  name: 'runway_aleph_video',
556
611
  description: 'Transform videos using Runway Aleph video-to-video generation with AI-powered editing',
@@ -693,6 +748,8 @@ class KieAiMcpServer {
693
748
  return await this.handleElevenLabsSoundEffects(args);
694
749
  case 'bytedance_seedance_video':
695
750
  return await this.handleByteDanceSeedanceVideo(args);
751
+ case 'bytedance_seedream_image':
752
+ return await this.handleByteDanceSeedreamImage(args);
696
753
  case 'runway_aleph_video':
697
754
  return await this.handleRunwayAlephVideo(args);
698
755
  case 'wan_video':
@@ -1383,6 +1440,81 @@ class KieAiMcpServer {
1383
1440
  });
1384
1441
  }
1385
1442
  }
1443
+ async handleByteDanceSeedreamImage(args) {
1444
+ try {
1445
+ const request = ByteDanceSeedreamImageSchema.parse(args);
1446
+ // Use environment variable as fallback if callBackUrl not provided
1447
+ if (!request.callBackUrl && process.env.KIE_AI_CALLBACK_URL) {
1448
+ request.callBackUrl = process.env.KIE_AI_CALLBACK_URL;
1449
+ }
1450
+ const response = await this.client.generateByteDanceSeedreamImage(request);
1451
+ if (response.code === 200 && response.data?.taskId) {
1452
+ // Determine mode for user feedback
1453
+ const isEdit = !!request.image_urls && request.image_urls.length > 0;
1454
+ const mode = isEdit ? 'Image Editing' : 'Text-to-Image';
1455
+ // Store task in database
1456
+ await this.db.createTask({
1457
+ task_id: response.data.taskId,
1458
+ api_type: 'bytedance-seedream-image',
1459
+ status: 'pending'
1460
+ });
1461
+ return {
1462
+ content: [
1463
+ {
1464
+ type: 'text',
1465
+ text: JSON.stringify({
1466
+ success: true,
1467
+ task_id: response.data.taskId,
1468
+ message: `ByteDance Seedream V4 ${mode} task created successfully`,
1469
+ parameters: {
1470
+ mode: mode,
1471
+ prompt: request.prompt.substring(0, 100) + (request.prompt.length > 100 ? '...' : ''),
1472
+ image_size: request.image_size || '1:1',
1473
+ image_resolution: request.image_resolution || '1K',
1474
+ max_images: request.max_images || 1,
1475
+ seed: request.seed !== undefined ? request.seed : -1,
1476
+ ...(isEdit && { image_urls_count: request.image_urls?.length || 0 })
1477
+ },
1478
+ next_steps: [
1479
+ `Use get_task_status with task_id: ${response.data.taskId} to check progress`,
1480
+ 'Generated images will be available when status is "completed"'
1481
+ ],
1482
+ usage_examples: [
1483
+ `get_task_status: {"task_id": "${response.data.taskId}"}`,
1484
+ `list_tasks: {"limit": 10}`
1485
+ ]
1486
+ }, null, 2)
1487
+ }
1488
+ ]
1489
+ };
1490
+ }
1491
+ else {
1492
+ throw new Error(response.msg || 'Failed to create ByteDance Seedream V4 image task');
1493
+ }
1494
+ }
1495
+ catch (error) {
1496
+ if (error instanceof z.ZodError) {
1497
+ return this.formatError('bytedance_seedream_image', error, {
1498
+ prompt: 'Required: Text prompt for image generation or editing (max 10000 characters)',
1499
+ image_urls: 'Optional: Array of image URLs for editing mode (1-10 images)',
1500
+ image_size: 'Optional: Image aspect ratio (default: 1:1)',
1501
+ image_resolution: 'Optional: Image resolution - 1K/2K/4K (default: 1K)',
1502
+ max_images: 'Optional: Number of images to generate (1-6, default: 1)',
1503
+ seed: 'Optional: Random seed for reproducible results (default: -1 for random)',
1504
+ callBackUrl: 'Optional: URL for task completion notifications (uses KIE_AI_CALLBACK_URL env var if not provided)'
1505
+ });
1506
+ }
1507
+ return this.formatError('bytedance_seedream_image', error, {
1508
+ prompt: 'Required: Text prompt for image generation or editing (max 10000 characters)',
1509
+ image_urls: 'Optional: Array of image URLs for editing mode (1-10 images)',
1510
+ image_size: 'Optional: Image aspect ratio (default: 1:1)',
1511
+ image_resolution: 'Optional: Image resolution - 1K/2K/4K (default: 1K)',
1512
+ max_images: 'Optional: Number of images to generate (1-6, default: 1)',
1513
+ seed: 'Optional: Random seed for reproducible results (default: -1 for random)',
1514
+ callBackUrl: 'Optional: URL for task completion notifications (uses KIE_AI_CALLBACK_URL env var if not provided)'
1515
+ });
1516
+ }
1517
+ }
1386
1518
  async handleRunwayAlephVideo(args) {
1387
1519
  try {
1388
1520
  const request = RunwayAlephVideoSchema.parse(args);
@@ -1,4 +1,4 @@
1
- import { KieAiConfig, KieAiResponse, NanoBananaGenerateRequest, NanaBananaEditRequest, NanoBananaUpscaleRequest, Veo3GenerateRequest, SunoGenerateRequest, ElevenLabsTTSRequest, ElevenLabsSoundEffectsRequest, ByteDanceSeedanceVideoRequest, RunwayAlephVideoRequest, WanVideoRequest, ImageResponse, TaskResponse } from './types.js';
1
+ import { KieAiConfig, KieAiResponse, NanoBananaGenerateRequest, NanaBananaEditRequest, NanoBananaUpscaleRequest, Veo3GenerateRequest, SunoGenerateRequest, ElevenLabsTTSRequest, ElevenLabsSoundEffectsRequest, ByteDanceSeedanceVideoRequest, RunwayAlephVideoRequest, WanVideoRequest, ByteDanceSeedreamImageRequest, ImageResponse, TaskResponse } from './types.js';
2
2
  export declare class KieAiClient {
3
3
  private config;
4
4
  constructor(config: KieAiConfig);
@@ -14,5 +14,6 @@ export declare class KieAiClient {
14
14
  generateByteDanceSeedanceVideo(request: ByteDanceSeedanceVideoRequest): Promise<KieAiResponse<TaskResponse>>;
15
15
  generateRunwayAlephVideo(request: RunwayAlephVideoRequest): Promise<KieAiResponse<TaskResponse>>;
16
16
  generateWanVideo(request: WanVideoRequest): Promise<KieAiResponse<TaskResponse>>;
17
+ generateByteDanceSeedreamImage(request: ByteDanceSeedreamImageRequest): Promise<KieAiResponse<TaskResponse>>;
17
18
  getVeo1080pVideo(taskId: string, index?: number): Promise<KieAiResponse<any>>;
18
19
  }
@@ -80,7 +80,7 @@ export class KieAiClient {
80
80
  else if (apiType === 'suno') {
81
81
  return this.makeRequest(`/generate/record-info?taskId=${taskId}`, 'GET');
82
82
  }
83
- else if (apiType === 'elevenlabs-tts' || apiType === 'elevenlabs-sound-effects' || apiType === 'bytedance-seedance-video' || apiType === 'wan-video') {
83
+ else if (apiType === 'elevenlabs-tts' || apiType === 'elevenlabs-sound-effects' || apiType === 'bytedance-seedance-video' || apiType === 'bytedance-seedream-image' || apiType === 'wan-video') {
84
84
  return this.makeRequest(`/jobs/recordInfo?taskId=${taskId}`, 'GET');
85
85
  }
86
86
  else if (apiType === 'runway-aleph-video') {
@@ -232,6 +232,28 @@ export class KieAiClient {
232
232
  };
233
233
  return this.makeRequest('/jobs/createTask', 'POST', jobRequest);
234
234
  }
235
+ async generateByteDanceSeedreamImage(request) {
236
+ // Determine mode based on presence of image_urls
237
+ const isEdit = !!request.image_urls && request.image_urls.length > 0;
238
+ const model = isEdit ? 'bytedance/seedream-v4-edit' : 'bytedance/seedream-v4-text-to-image';
239
+ const input = {
240
+ prompt: request.prompt,
241
+ image_size: request.image_size || '1:1',
242
+ image_resolution: request.image_resolution || '1K',
243
+ max_images: request.max_images || 1,
244
+ seed: request.seed !== undefined ? request.seed : -1
245
+ };
246
+ // Add edit-specific parameters
247
+ if (isEdit) {
248
+ input.image_urls = request.image_urls;
249
+ }
250
+ const jobRequest = {
251
+ model,
252
+ input,
253
+ callBackUrl: request.callBackUrl || process.env.KIE_AI_CALLBACK_URL
254
+ };
255
+ return this.makeRequest('/jobs/createTask', 'POST', jobRequest);
256
+ }
235
257
  async getVeo1080pVideo(taskId, index) {
236
258
  const params = new URLSearchParams({ taskId });
237
259
  if (index !== undefined) {
package/dist/types.d.ts CHANGED
@@ -402,6 +402,47 @@ export declare const WanVideoSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
402
402
  negative_prompt?: string | undefined;
403
403
  enable_prompt_expansion?: boolean | undefined;
404
404
  }>;
405
+ export declare const ByteDanceSeedreamImageSchema: z.ZodEffects<z.ZodObject<{
406
+ prompt: z.ZodString;
407
+ image_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
408
+ image_size: z.ZodOptional<z.ZodDefault<z.ZodEnum<["square", "square_hd", "portrait_4_3", "portrait_3_2", "portrait_16_9", "landscape_4_3", "landscape_3_2", "landscape_16_9", "landscape_21_9"]>>>;
409
+ image_resolution: z.ZodOptional<z.ZodDefault<z.ZodEnum<["1K", "2K", "4K"]>>>;
410
+ max_images: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
411
+ seed: z.ZodOptional<z.ZodNumber>;
412
+ callBackUrl: z.ZodOptional<z.ZodString>;
413
+ }, "strip", z.ZodTypeAny, {
414
+ prompt: string;
415
+ image_size?: "square" | "square_hd" | "portrait_4_3" | "portrait_3_2" | "portrait_16_9" | "landscape_4_3" | "landscape_3_2" | "landscape_16_9" | "landscape_21_9" | undefined;
416
+ image_urls?: string[] | undefined;
417
+ callBackUrl?: string | undefined;
418
+ seed?: number | undefined;
419
+ image_resolution?: "1K" | "2K" | "4K" | undefined;
420
+ max_images?: number | undefined;
421
+ }, {
422
+ prompt: string;
423
+ image_size?: "square" | "square_hd" | "portrait_4_3" | "portrait_3_2" | "portrait_16_9" | "landscape_4_3" | "landscape_3_2" | "landscape_16_9" | "landscape_21_9" | undefined;
424
+ image_urls?: string[] | undefined;
425
+ callBackUrl?: string | undefined;
426
+ seed?: number | undefined;
427
+ image_resolution?: "1K" | "2K" | "4K" | undefined;
428
+ max_images?: number | undefined;
429
+ }>, {
430
+ prompt: string;
431
+ image_size?: "square" | "square_hd" | "portrait_4_3" | "portrait_3_2" | "portrait_16_9" | "landscape_4_3" | "landscape_3_2" | "landscape_16_9" | "landscape_21_9" | undefined;
432
+ image_urls?: string[] | undefined;
433
+ callBackUrl?: string | undefined;
434
+ seed?: number | undefined;
435
+ image_resolution?: "1K" | "2K" | "4K" | undefined;
436
+ max_images?: number | undefined;
437
+ }, {
438
+ prompt: string;
439
+ image_size?: "square" | "square_hd" | "portrait_4_3" | "portrait_3_2" | "portrait_16_9" | "landscape_4_3" | "landscape_3_2" | "landscape_16_9" | "landscape_21_9" | undefined;
440
+ image_urls?: string[] | undefined;
441
+ callBackUrl?: string | undefined;
442
+ seed?: number | undefined;
443
+ image_resolution?: "1K" | "2K" | "4K" | undefined;
444
+ max_images?: number | undefined;
445
+ }>;
405
446
  export type NanoBananaGenerateRequest = z.infer<typeof NanoBananaGenerateSchema>;
406
447
  export type NanaBananaEditRequest = z.infer<typeof NanoBananaEditSchema>;
407
448
  export type NanoBananaUpscaleRequest = z.infer<typeof NanoBananaUpscaleSchema>;
@@ -412,6 +453,7 @@ export type ElevenLabsSoundEffectsRequest = z.infer<typeof ElevenLabsSoundEffect
412
453
  export type ByteDanceSeedanceVideoRequest = z.infer<typeof ByteDanceSeedanceVideoSchema>;
413
454
  export type RunwayAlephVideoRequest = z.infer<typeof RunwayAlephVideoSchema>;
414
455
  export type WanVideoRequest = z.infer<typeof WanVideoSchema>;
456
+ export type ByteDanceSeedreamImageRequest = z.infer<typeof ByteDanceSeedreamImageSchema>;
415
457
  export interface KieAiResponse<T = any> {
416
458
  code: number;
417
459
  msg: string;
@@ -427,7 +469,7 @@ export interface TaskResponse {
427
469
  export interface TaskRecord {
428
470
  id?: number;
429
471
  task_id: string;
430
- api_type: 'nano-banana' | 'nano-banana-edit' | 'nano-banana-upscale' | 'veo3' | 'suno' | 'elevenlabs-tts' | 'elevenlabs-sound-effects' | 'bytedance-seedance-video' | 'runway-aleph-video' | 'wan-video';
472
+ api_type: 'nano-banana' | 'nano-banana-edit' | 'nano-banana-upscale' | 'veo3' | 'suno' | 'elevenlabs-tts' | 'elevenlabs-sound-effects' | 'bytedance-seedance-video' | 'runway-aleph-video' | 'wan-video' | 'bytedance-seedream-image';
431
473
  status: 'pending' | 'processing' | 'completed' | 'failed';
432
474
  created_at: string;
433
475
  updated_at: string;
package/dist/types.js CHANGED
@@ -180,3 +180,25 @@ export const WanVideoSchema = z.object({
180
180
  message: "Invalid aspect_ratio for image-to-video mode. Valid options: 16:9, 9:16, 1:1",
181
181
  path: ["aspect_ratio"]
182
182
  });
183
+ export const ByteDanceSeedreamImageSchema = z.object({
184
+ prompt: z.string().min(1).max(5000),
185
+ image_urls: z.array(z.string().url()).min(1).max(10).optional(),
186
+ image_size: z.enum([
187
+ 'square', 'square_hd', 'portrait_4_3', 'portrait_3_2', 'portrait_16_9',
188
+ 'landscape_4_3', 'landscape_3_2', 'landscape_16_9', 'landscape_21_9'
189
+ ]).default('square_hd').optional(),
190
+ image_resolution: z.enum(['1K', '2K', '4K']).default('1K').optional(),
191
+ max_images: z.number().int().min(1).max(6).default(1).optional(),
192
+ seed: z.number().optional(),
193
+ callBackUrl: z.string().url().optional()
194
+ }).refine((data) => {
195
+ // Check if callBackUrl is provided directly or via environment variable
196
+ const hasCallBackUrl = data.callBackUrl || process.env.KIE_AI_CALLBACK_URL;
197
+ if (!hasCallBackUrl) {
198
+ return false;
199
+ }
200
+ return true;
201
+ }, {
202
+ message: "callBackUrl is required (either directly or via KIE_AI_CALLBACK_URL environment variable)",
203
+ path: ["callBackUrl"]
204
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@felores/kie-ai-mcp-server",
3
- "version": "1.7.1",
4
- "description": "MCP server for Kie.ai APIs (Nano Banana image generation/editing, Veo3 video generation, Suno music generation, and ElevenLabs text-to-speech)",
3
+ "version": "1.7.2",
4
+ "description": "MCP server for Kie.ai APIs (Nano Banana image generation/editing, ByteDance Seedream V4 image generation/editing, Veo3 video generation, Suno music generation, and ElevenLabs text-to-speech)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "kie-ai-mcp-server": "dist/index.js"