mcp-ai-music 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -85,13 +85,13 @@ const PROGRESS_QUERY_OUTPUT_SCHEMA = {
85
85
  // 工具定义
86
86
  const GENERATE_MUSIC_TOOL = {
87
87
  name: "generate_music",
88
- description: "生成音乐。根据提示词和风格生成原创音乐,支持自定义模式和纯音乐模式。\n\n注意:生成需要时间,请每10-30秒轮询调用query_progress工具,直到状态为'complete'或'failed'。\n\n返回字段说明:\n- taskId: 任务ID,用于查询进度\n- status: 任务状态 (pending)\n- message: 状态描述",
88
+ description: "生成音乐。根据提示词和风格生成原创音乐,支持自定义模式和纯音乐模式。\n\n注意:生成需要时间,请每10-30秒轮询调用query_progress查询进度工具,直到状态为'complete'或'failed'。\n\n参数行为说明:\n- customMode: 是否启用自定义模式(默认 true)。\n- instrumental: 是否为纯音乐。\n- 当 customMode=true 且 instrumental=false 时,prompt 将作为精确歌词使用;\n 当 customMode=false 且 instrumental=false 时,将自动生成歌词;\n 当 instrumental=true 时,始终为纯音乐(不含歌词)。\n\n返回字段说明:\n- taskId: 任务ID,用于查询进度\n- status: 任务状态 (pending)\n- message: 状态描述",
89
89
  inputSchema: {
90
90
  type: "object",
91
91
  properties: {
92
92
  prompt: {
93
93
  type: "string",
94
- description: "音乐描述提示词,详细描述想要的音乐风格、情感、乐器等。长度限制:V3_5和V4模型3000字符,V4_5模型5000字符。",
94
+ description: "音乐描述提示词,详细描述想要的音乐风格、情感、乐器等。长度限制:V3_5和V4模型3000字符,V4_5模型5000字符。注意:当 customMode=true 且 instrumental=false 时,prompt 将作为精确歌词使用。",
95
95
  },
96
96
  style: {
97
97
  type: "string",
@@ -103,9 +103,14 @@ const GENERATE_MUSIC_TOOL = {
103
103
  description: "音乐标题,最多80字符。",
104
104
  default: "",
105
105
  },
106
+ customMode: {
107
+ type: "boolean",
108
+ description: "是否启用自定义模式。为 true 时:如果 instrumental=true,仅需提供 style 和 title;如果 instrumental=false,需要提供 style、title 和 prompt(prompt 作为精确歌词)。为 false 时:只需 prompt,若 instrumental=false 将自动生成歌词。",
109
+ default: true,
110
+ },
106
111
  instrumental: {
107
112
  type: "boolean",
108
- description: "是否生成纯音乐(无歌词)。",
113
+ description: "是否生成纯音乐(无歌词)。当 customMode=true 且该值=false 时,需要提供精确歌词(使用 prompt 作为歌词);当 customMode=false 且该值=false,将自动生成歌词。",
109
114
  default: false,
110
115
  },
111
116
  model: {
@@ -340,7 +345,7 @@ async function handleGenerateMusic(input) {
340
345
  errorMessage: "输入参数格式错误,预期为包含prompt字段的对象。",
341
346
  };
342
347
  }
343
- const { prompt, style = "", title = "", instrumental = false, model = "V4_5", negativeTags = "" } = input;
348
+ const { prompt, style = "", title = "", customMode = true, instrumental = false, model = "V4_5", negativeTags = "" } = input;
344
349
  if (!prompt || typeof prompt !== 'string') {
345
350
  return {
346
351
  content: [],
@@ -380,7 +385,7 @@ async function handleGenerateMusic(input) {
380
385
  prompt,
381
386
  style,
382
387
  title,
383
- customMode: true,
388
+ customMode,
384
389
  instrumental,
385
390
  model,
386
391
  negativeTags,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-ai-music",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "AI作曲MCP服务 - 基于Suno4.5 API的音乐生成、翻唱、扩展和进度查询工具",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {