@xiedada/nodemw-mcp-server 0.0.11 → 0.0.12
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 +7 -48
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
37
37
|
// package.json
|
|
38
38
|
var package_default = {
|
|
39
39
|
name: "@xiedada/nodemw-mcp-server",
|
|
40
|
-
version: "0.0.
|
|
40
|
+
version: "0.0.12",
|
|
41
41
|
description: "MCP server for nodemw - MediaWiki API client",
|
|
42
42
|
type: "module",
|
|
43
43
|
main: "dist/index.js",
|
|
@@ -301,7 +301,7 @@ async function handleGetArticleTool(title, followRedirect, redirectInfo, revisio
|
|
|
301
301
|
});
|
|
302
302
|
const pages = info.pages;
|
|
303
303
|
const page = getFirstItem(pages);
|
|
304
|
-
if (!page || page.missing) {
|
|
304
|
+
if (!page || page.missing !== void 0) {
|
|
305
305
|
return {
|
|
306
306
|
content: [{ type: "text", text: `Page "${title}" not found.` }],
|
|
307
307
|
isError: true
|
|
@@ -923,17 +923,7 @@ function whoamiTool(server) {
|
|
|
923
923
|
},
|
|
924
924
|
async () => handleWhoamiTool()
|
|
925
925
|
);
|
|
926
|
-
tool.update({ outputSchema: { user: z15.
|
|
927
|
-
name: z15.string(),
|
|
928
|
-
id: z15.number(),
|
|
929
|
-
groups: z15.array(z15.string()),
|
|
930
|
-
rights: z15.array(z15.string()),
|
|
931
|
-
ratelimits: z15.union([z15.record(z15.unknown()), z15.array(z15.unknown())]),
|
|
932
|
-
editcount: z15.number(),
|
|
933
|
-
realname: z15.string().optional(),
|
|
934
|
-
email: z15.string().optional(),
|
|
935
|
-
emailauthenticated: z15.string().optional()
|
|
936
|
-
}) } });
|
|
926
|
+
tool.update({ outputSchema: { user: z15.record(z15.unknown()) } });
|
|
937
927
|
return tool;
|
|
938
928
|
}
|
|
939
929
|
async function handleWhoamiTool() {
|
|
@@ -965,18 +955,7 @@ function whoisTool(server) {
|
|
|
965
955
|
},
|
|
966
956
|
async ({ username }) => handleWhoisTool(username)
|
|
967
957
|
);
|
|
968
|
-
tool.update({ outputSchema: { user: z16.
|
|
969
|
-
userid: z16.number(),
|
|
970
|
-
name: z16.string(),
|
|
971
|
-
groups: z16.array(z16.string()),
|
|
972
|
-
implicitgroups: z16.array(z16.string()).optional(),
|
|
973
|
-
rights: z16.array(z16.string()),
|
|
974
|
-
editcount: z16.number(),
|
|
975
|
-
registration: z16.string().optional(),
|
|
976
|
-
emailable: z16.string().optional(),
|
|
977
|
-
gender: z16.string().optional(),
|
|
978
|
-
blockinfo: z16.record(z16.unknown()).optional()
|
|
979
|
-
}) } });
|
|
958
|
+
tool.update({ outputSchema: { user: z16.record(z16.unknown()) } });
|
|
980
959
|
return tool;
|
|
981
960
|
}
|
|
982
961
|
async function handleWhoisTool(username) {
|
|
@@ -987,7 +966,7 @@ async function handleWhoisTool(username) {
|
|
|
987
966
|
"whois",
|
|
988
967
|
username
|
|
989
968
|
);
|
|
990
|
-
if (userInfo.missing) {
|
|
969
|
+
if (userInfo.missing !== void 0) {
|
|
991
970
|
return errorResult(`User "${username}" not found.`);
|
|
992
971
|
}
|
|
993
972
|
return jsonResult({ user: userInfo });
|
|
@@ -1012,18 +991,7 @@ function whoareTool(server) {
|
|
|
1012
991
|
},
|
|
1013
992
|
async (params) => handleWhoareTool(params)
|
|
1014
993
|
);
|
|
1015
|
-
tool.update({ outputSchema: { users: z17.array(z17.
|
|
1016
|
-
userid: z17.number(),
|
|
1017
|
-
name: z17.string(),
|
|
1018
|
-
groups: z17.array(z17.string()),
|
|
1019
|
-
implicitgroups: z17.array(z17.string()).optional(),
|
|
1020
|
-
rights: z17.array(z17.string()),
|
|
1021
|
-
editcount: z17.number(),
|
|
1022
|
-
registration: z17.string().optional(),
|
|
1023
|
-
emailable: z17.string().optional(),
|
|
1024
|
-
gender: z17.string().optional(),
|
|
1025
|
-
blockinfo: z17.record(z17.unknown()).optional()
|
|
1026
|
-
})), count: z17.number() } });
|
|
994
|
+
tool.update({ outputSchema: { users: z17.array(z17.record(z17.unknown())), count: z17.number() } });
|
|
1027
995
|
return tool;
|
|
1028
996
|
}
|
|
1029
997
|
async function handleWhoareTool(params) {
|
|
@@ -1429,16 +1397,7 @@ function getSiteStatsTool(server) {
|
|
|
1429
1397
|
},
|
|
1430
1398
|
async () => handleGetSiteStatsTool()
|
|
1431
1399
|
);
|
|
1432
|
-
tool.update({ outputSchema: { statistics: z27.
|
|
1433
|
-
pages: z27.number(),
|
|
1434
|
-
articles: z27.number(),
|
|
1435
|
-
edits: z27.number(),
|
|
1436
|
-
images: z27.number(),
|
|
1437
|
-
users: z27.number(),
|
|
1438
|
-
activeusers: z27.number().optional(),
|
|
1439
|
-
admins: z27.number().optional(),
|
|
1440
|
-
jobs: z27.number().optional()
|
|
1441
|
-
}) } });
|
|
1400
|
+
tool.update({ outputSchema: { statistics: z27.record(z27.unknown()) } });
|
|
1442
1401
|
return tool;
|
|
1443
1402
|
}
|
|
1444
1403
|
async function handleGetSiteStatsTool() {
|