a-calc 3.0.0-beta.20250123.10 → 3.0.0-beta.20250123.11
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/mcp-server/src/index.js +43 -0
- package/package.json +1 -1
package/mcp-server/src/index.js
CHANGED
|
@@ -379,6 +379,24 @@ const itemTotal = calc("price * quantity | =2", item)
|
|
|
379
379
|
required: ["topic"],
|
|
380
380
|
},
|
|
381
381
|
},
|
|
382
|
+
{
|
|
383
|
+
name: "debug_info",
|
|
384
|
+
description: `🔍 调试工具 - 获取 MCP 服务器的运行环境信息
|
|
385
|
+
|
|
386
|
+
返回信息:
|
|
387
|
+
- cwd: 当前工作目录 (process.cwd())
|
|
388
|
+
- __dirname: 脚本所在目录
|
|
389
|
+
- __filename: 脚本文件路径
|
|
390
|
+
- node_version: Node.js 版本
|
|
391
|
+
- platform: 操作系统平台
|
|
392
|
+
- env: 相关环境变量
|
|
393
|
+
|
|
394
|
+
用途:调试 MCP 服务器配置问题`,
|
|
395
|
+
inputSchema: {
|
|
396
|
+
type: "object",
|
|
397
|
+
properties: {},
|
|
398
|
+
},
|
|
399
|
+
},
|
|
382
400
|
];
|
|
383
401
|
|
|
384
402
|
// ==================== Resources 定义 ====================
|
|
@@ -1229,6 +1247,31 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1229
1247
|
};
|
|
1230
1248
|
}
|
|
1231
1249
|
|
|
1250
|
+
case "debug_info": {
|
|
1251
|
+
const debugInfo = {
|
|
1252
|
+
cwd: process.cwd(),
|
|
1253
|
+
__dirname: import.meta.url,
|
|
1254
|
+
node_version: process.version,
|
|
1255
|
+
platform: process.platform,
|
|
1256
|
+
arch: process.arch,
|
|
1257
|
+
env: {
|
|
1258
|
+
HOME: process.env.HOME,
|
|
1259
|
+
USERPROFILE: process.env.USERPROFILE,
|
|
1260
|
+
PATH: process.env.PATH?.split(process.platform === 'win32' ? ';' : ':').slice(0, 5).join('\n '),
|
|
1261
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
1262
|
+
},
|
|
1263
|
+
};
|
|
1264
|
+
|
|
1265
|
+
return {
|
|
1266
|
+
content: [
|
|
1267
|
+
{
|
|
1268
|
+
type: "text",
|
|
1269
|
+
text: JSON.stringify(debugInfo, null, 2),
|
|
1270
|
+
},
|
|
1271
|
+
],
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1232
1275
|
default:
|
|
1233
1276
|
throw new Error(`Unknown tool: ${name}`);
|
|
1234
1277
|
}
|
package/package.json
CHANGED