multi-modal-mcp 0.0.3 → 0.0.5

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/dist/config.js CHANGED
@@ -20,5 +20,5 @@ export const config = {
20
20
  /** MCP 服务器名称 */
21
21
  serverName: 'multi-modal-mcp',
22
22
  /** MCP 服务器版本 */
23
- serverVersion: '0.0.3',
23
+ serverVersion: '0.0.5',
24
24
  };
@@ -54,9 +54,9 @@ class VideoGenerationTool extends MCPTool {
54
54
  .default('1024x1024')
55
55
  .describe('视频分辨率,默认1024x1024'),
56
56
  fps: z
57
- .union([z.literal(30), z.literal(60)])
57
+ .enum(['30', '60'])
58
58
  .optional()
59
- .default(30)
59
+ .default('30')
60
60
  .describe('视频帧率(FPS),可选值为 30 或 60,默认30'),
61
61
  });
62
62
  /**
@@ -67,19 +67,18 @@ class VideoGenerationTool extends MCPTool {
67
67
  const requestData = {
68
68
  model: config.videoModel,
69
69
  prompt: input.prompt,
70
- quality: input.quality || 'speed',
71
- with_audio: input.withAudio ?? false,
72
- watermark_enabled: input.watermarkEnabled ?? true,
73
- image_url: input.imageUrl,
70
+ quality: input.quality,
71
+ with_audio: input.withAudio,
72
+ watermark_enabled: input.watermarkEnabled,
73
+ // image_url: input.imageUrl,
74
74
  size: input.size,
75
- fps: input.fps || 30,
75
+ fps: parseInt(String(input.fps)),
76
76
  };
77
77
  const apiResponse = (await http.post('/videos/generations', requestData));
78
78
  const taskId = apiResponse.id;
79
79
  if (!taskId)
80
- throw new Error('视频生成任务创建失败,未返回任务ID');
81
- const videoUrl = await this.pollTaskStatus(taskId);
82
- return videoUrl;
80
+ return `视频生成失败,${JSON.stringify(apiResponse)}`;
81
+ return await this.pollTaskStatus(taskId);
83
82
  }
84
83
  catch (error) {
85
84
  return `视频生成时发生错误: ${error}`;
@@ -90,12 +89,11 @@ class VideoGenerationTool extends MCPTool {
90
89
  */
91
90
  async pollTaskStatus(taskId) {
92
91
  const startTime = Date.now();
93
- const timeout = 60000;
92
+ const timeout = 60000 * 3;
94
93
  while (true) {
95
94
  const elapsedTime = Date.now() - startTime;
96
- if (elapsedTime >= timeout) {
97
- throw new Error('视频生成超时,超过60秒未完成');
98
- }
95
+ if (elapsedTime >= timeout)
96
+ return `任务超时,请检查任务状态`;
99
97
  const apiResponse = (await http.get(`/async-result/${taskId}`));
100
98
  const taskData = apiResponse;
101
99
  if (taskData.task_status === 'SUCCESS' &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multi-modal-mcp",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "multi-modal MCP server",
5
5
  "type": "module",
6
6
  "bin": {