mcp-ai-music 1.0.12 → 1.0.19
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/index.js +8 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
|
9
9
|
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
10
10
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
11
11
|
// API 基础配置
|
|
12
|
-
const API_BASE_URL = "https://api.
|
|
12
|
+
const API_BASE_URL = "https://api.kie.ai/api/v1";
|
|
13
13
|
// 获取API密钥的函数
|
|
14
14
|
function getApiKey() {
|
|
15
15
|
const apiKey = process.env.SUNO_API_KEY;
|
|
@@ -85,7 +85,7 @@ const PROGRESS_QUERY_OUTPUT_SCHEMA = {
|
|
|
85
85
|
// 工具定义
|
|
86
86
|
const GENERATE_MUSIC_TOOL = {
|
|
87
87
|
name: "generate_music",
|
|
88
|
-
description: "
|
|
88
|
+
description: "生成音乐,根据提示词和风格生成原创音乐,支持自定义模式和纯音乐模式。任务会在后台异步执行,完成后会在右上角弹出通知。\n\n注意:\n- 平台仅保存音频与封面文件 15 天,请及时下载保存。\n\n参数行为说明:\n- customMode: 是否启用自定义模式(默认 true)。\n- instrumental: 是否为纯音乐。\n- 当 customMode=true 且 instrumental=false 时,可以同时提供 prompt(音乐描述)和 lyrics(精确歌词);\n 当 customMode=false 且 instrumental=false 时,只需 prompt,将自动生成歌词;\n 当 instrumental=true 时,始终为纯音乐(不含歌词),只需提供 prompt。\n\n返回字段说明:\n- taskId: 任务ID,用于备查\n- status: 任务状态 (pending)\n- message: 状态描述",
|
|
89
89
|
inputSchema: {
|
|
90
90
|
type: "object",
|
|
91
91
|
properties: {
|
|
@@ -136,7 +136,7 @@ const GENERATE_MUSIC_TOOL = {
|
|
|
136
136
|
};
|
|
137
137
|
const COVER_MUSIC_TOOL = {
|
|
138
138
|
name: "cover_music",
|
|
139
|
-
description: "
|
|
139
|
+
description: "AI翻唱工具,上传音频文件并转换为新的风格,保留核心旋律。任务会在后台异步执行,完成后会在右上角弹出通知。\n\n注意:\n- 平台仅保存音频与封面文件 15 天,请及时下载保存。\n- 当 instrumental=false 时,可以同时提供 prompt(风格描述)和 lyrics(精确歌词)。\n\n返回字段说明:\n- taskId: 任务ID,用于备查\n- status: 任务状态 (pending)\n- message: 状态描述",
|
|
140
140
|
inputSchema: {
|
|
141
141
|
type: "object",
|
|
142
142
|
properties: {
|
|
@@ -186,7 +186,7 @@ const COVER_MUSIC_TOOL = {
|
|
|
186
186
|
};
|
|
187
187
|
const EXTEND_MUSIC_TOOL = {
|
|
188
188
|
name: "extend_music",
|
|
189
|
-
description: "
|
|
189
|
+
description: "AI音乐扩展工具,在保留原始音频风格的同时扩展音轨长度。任务会在后台异步执行,完成后会在右上角弹出通知。\n\n注意:\n- 平台仅保存音频与封面文件 15 天,请及时下载保存。\n- 当 instrumental=false 时,可以同时提供 prompt(扩展描述)和 lyrics(精确歌词)。\n\n返回字段说明:\n- taskId: 任务ID,用于备查\n- status: 任务状态 (pending)\n- message: 状态描述",
|
|
190
190
|
inputSchema: {
|
|
191
191
|
type: "object",
|
|
192
192
|
properties: {
|
|
@@ -485,7 +485,7 @@ async function handleGenerateMusic(input, chatSessionId) {
|
|
|
485
485
|
result.task_id ||
|
|
486
486
|
"unknown",
|
|
487
487
|
status: "pending",
|
|
488
|
-
message: "
|
|
488
|
+
message: "音乐生成任务已提交后台运行,任务会在后台异步执行,完成后会在右上角弹出通知。",
|
|
489
489
|
};
|
|
490
490
|
return {
|
|
491
491
|
content: [
|
|
@@ -580,7 +580,7 @@ async function handleCoverMusic(input, chatSessionId) {
|
|
|
580
580
|
result.task_id ||
|
|
581
581
|
"unknown",
|
|
582
582
|
status: "pending",
|
|
583
|
-
message: "
|
|
583
|
+
message: "音乐翻唱任务已提交,任务会在后台异步执行,完成后会在右上角弹出通知。",
|
|
584
584
|
};
|
|
585
585
|
return {
|
|
586
586
|
content: [
|
|
@@ -683,7 +683,7 @@ async function handleExtendMusic(input, chatSessionId) {
|
|
|
683
683
|
result.task_id ||
|
|
684
684
|
"unknown",
|
|
685
685
|
status: "pending",
|
|
686
|
-
message: "
|
|
686
|
+
message: "音乐扩展任务已提交,任务会在后台异步执行,完成后会在右上角弹出通知。",
|
|
687
687
|
};
|
|
688
688
|
return {
|
|
689
689
|
content: [
|
|
@@ -967,8 +967,7 @@ async function handleQueryProgress(input) {
|
|
|
967
967
|
// MCP 服务器配置与启动
|
|
968
968
|
const server = new index_js_1.Server({
|
|
969
969
|
name: "mcp-ai-music",
|
|
970
|
-
version: "1.0.0"
|
|
971
|
-
description: "AI作曲MCP服务 - 基于Suno4.5 API的音乐生成、翻唱、扩展和进度查询工具",
|
|
970
|
+
version: "1.0.0"
|
|
972
971
|
}, {
|
|
973
972
|
capabilities: {
|
|
974
973
|
tools: TOOLS.reduce((acc, tool) => {
|