@eldment/meting-mcp 1.6.3 → 1.6.4
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/package.json +1 -1
- package/src/mcp-server.js +22 -5
package/package.json
CHANGED
package/src/mcp-server.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
1
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
3
|
import * as z from "zod/v4";
|
|
3
4
|
import Meting from "./meting.js";
|
|
4
5
|
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const { name: packageName, version } = require("../package.json");
|
|
8
|
+
|
|
9
|
+
const packageUrl = `https://www.npmjs.com/package/${packageName}`;
|
|
10
|
+
|
|
5
11
|
export const serviceMetadata = Object.freeze({
|
|
6
12
|
name: "meting-mcp",
|
|
7
|
-
version
|
|
13
|
+
version,
|
|
14
|
+
title: "Meting MCP",
|
|
15
|
+
description:
|
|
16
|
+
"Search music and fetch song, album, artist, playlist, lyrics, cover, and play URL data across NetEase, Tencent, KuGou, Baidu, and Kuwo.",
|
|
17
|
+
websiteUrl: packageUrl,
|
|
8
18
|
});
|
|
9
19
|
|
|
10
20
|
const platformCatalog = Object.freeze([
|
|
@@ -104,11 +114,11 @@ function WithCommonInput(extraSchema) {
|
|
|
104
114
|
};
|
|
105
115
|
}
|
|
106
116
|
|
|
107
|
-
function RegisterTool(server, toolName, description, inputSchema, handler) {
|
|
117
|
+
function RegisterTool(server, toolName, title, description, inputSchema, handler) {
|
|
108
118
|
server.registerTool(
|
|
109
119
|
toolName,
|
|
110
120
|
{
|
|
111
|
-
title
|
|
121
|
+
title,
|
|
112
122
|
description,
|
|
113
123
|
inputSchema,
|
|
114
124
|
},
|
|
@@ -129,7 +139,7 @@ export function CreateMcpServer() {
|
|
|
129
139
|
server.registerTool(
|
|
130
140
|
"platforms",
|
|
131
141
|
{
|
|
132
|
-
title: "
|
|
142
|
+
title: "List Supported Platforms",
|
|
133
143
|
description: "List supported music platforms.",
|
|
134
144
|
},
|
|
135
145
|
async () => {
|
|
@@ -143,6 +153,7 @@ export function CreateMcpServer() {
|
|
|
143
153
|
RegisterTool(
|
|
144
154
|
server,
|
|
145
155
|
"search",
|
|
156
|
+
"Search Music",
|
|
146
157
|
"Search songs, albums or artists on a specific platform.",
|
|
147
158
|
WithCommonInput({
|
|
148
159
|
keyword: z.string().min(1).describe("Search keyword."),
|
|
@@ -178,6 +189,7 @@ export function CreateMcpServer() {
|
|
|
178
189
|
RegisterTool(
|
|
179
190
|
server,
|
|
180
191
|
"song",
|
|
192
|
+
"Get Song Details",
|
|
181
193
|
"Get song detail by id.",
|
|
182
194
|
WithCommonInput({
|
|
183
195
|
id: z.string().min(1).describe("Song id."),
|
|
@@ -191,6 +203,7 @@ export function CreateMcpServer() {
|
|
|
191
203
|
RegisterTool(
|
|
192
204
|
server,
|
|
193
205
|
"album",
|
|
206
|
+
"Get Album Details",
|
|
194
207
|
"Get album detail by id.",
|
|
195
208
|
WithCommonInput({
|
|
196
209
|
id: z.string().min(1).describe("Album id."),
|
|
@@ -204,6 +217,7 @@ export function CreateMcpServer() {
|
|
|
204
217
|
RegisterTool(
|
|
205
218
|
server,
|
|
206
219
|
"artist",
|
|
220
|
+
"Get Artist Works",
|
|
207
221
|
"Get artist songs by id.",
|
|
208
222
|
WithCommonInput({
|
|
209
223
|
id: z.string().min(1).describe("Artist id."),
|
|
@@ -218,6 +232,7 @@ export function CreateMcpServer() {
|
|
|
218
232
|
RegisterTool(
|
|
219
233
|
server,
|
|
220
234
|
"playlist",
|
|
235
|
+
"Get Playlist Details",
|
|
221
236
|
"Get playlist detail by id.",
|
|
222
237
|
WithCommonInput({
|
|
223
238
|
id: z.string().min(1).describe("Playlist id."),
|
|
@@ -231,6 +246,7 @@ export function CreateMcpServer() {
|
|
|
231
246
|
RegisterTool(
|
|
232
247
|
server,
|
|
233
248
|
"url",
|
|
249
|
+
"Get Play URL",
|
|
234
250
|
"Get playable song url by id.",
|
|
235
251
|
WithCommonInput({
|
|
236
252
|
id: z.string().min(1).describe("Song id."),
|
|
@@ -238,7 +254,6 @@ export function CreateMcpServer() {
|
|
|
238
254
|
}),
|
|
239
255
|
async (input) => {
|
|
240
256
|
const meting = CreateClient(input.platform, input.cookie);
|
|
241
|
-
WithCommonInput;
|
|
242
257
|
return ParseResult(await meting.url(input.id, input.br));
|
|
243
258
|
}
|
|
244
259
|
);
|
|
@@ -246,6 +261,7 @@ export function CreateMcpServer() {
|
|
|
246
261
|
RegisterTool(
|
|
247
262
|
server,
|
|
248
263
|
"lyric",
|
|
264
|
+
"Get Lyrics",
|
|
249
265
|
"Get song lyric by id.",
|
|
250
266
|
WithCommonInput({
|
|
251
267
|
id: z.string().min(1).describe("Song id."),
|
|
@@ -259,6 +275,7 @@ export function CreateMcpServer() {
|
|
|
259
275
|
RegisterTool(
|
|
260
276
|
server,
|
|
261
277
|
"pic",
|
|
278
|
+
"Get Cover Image",
|
|
262
279
|
"Get cover or picture url by id.",
|
|
263
280
|
WithCommonInput({
|
|
264
281
|
id: z.string().min(1).describe("Picture id."),
|