dingtalk-mcp 1.0.13 → 1.0.15
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/dingtalk_department_mcp_server.yaml +2 -2
- package/dist/DingTalkMCPServer.js +12 -12
- package/dist/cli.js +4 -3
- package/package.json +1 -1
|
@@ -32,12 +32,12 @@ tools:
|
|
|
32
32
|
description: 部门名称或者部门名称拼音
|
|
33
33
|
- name: offset
|
|
34
34
|
type: number
|
|
35
|
-
required:
|
|
35
|
+
required: true
|
|
36
36
|
position: body
|
|
37
37
|
description: 分页页码,默认0
|
|
38
38
|
- name: size
|
|
39
39
|
type: number
|
|
40
|
-
required:
|
|
40
|
+
required: true
|
|
41
41
|
position: body
|
|
42
42
|
description: 分页大小,默认10,最大100
|
|
43
43
|
|
|
@@ -386,7 +386,7 @@ export class DingTalkMCPServer {
|
|
|
386
386
|
'Content-Type': 'application/json'
|
|
387
387
|
};
|
|
388
388
|
// 只有对新版API (api.dingtalk.com) 才添加token到header
|
|
389
|
-
if (tool.requestTemplate.url && !tool.requestTemplate.url.includes('oapi.dingtalk.com') &&
|
|
389
|
+
if (tool.requestTemplate.url && !tool.requestTemplate.url.includes('oapi.dingtalk.com') && this.accessToken) {
|
|
390
390
|
headers['x-acs-dingtalk-access-token'] = this.accessToken;
|
|
391
391
|
}
|
|
392
392
|
if (tool.requestTemplate.headers) {
|
|
@@ -458,18 +458,18 @@ export class DingTalkMCPServer {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
});
|
|
461
|
-
// 为searchUser添加默认的分页参数
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
// 设置默认的size为20
|
|
468
|
-
if (body.size === undefined) {
|
|
469
|
-
body.size = 20;
|
|
470
|
-
}
|
|
471
|
-
console.error(`SearchUser API with params: offset=${body.offset}, size=${body.size}`);
|
|
461
|
+
// 为searchUser/searchDepartment添加默认的分页参数
|
|
462
|
+
|
|
463
|
+
// 设置默认的offset为0
|
|
464
|
+
if (body.offset === undefined) {
|
|
465
|
+
body.offset = 0;
|
|
472
466
|
}
|
|
467
|
+
// 设置默认的size为20
|
|
468
|
+
if (body.size === undefined) {
|
|
469
|
+
body.size = 20;
|
|
470
|
+
}
|
|
471
|
+
console.error(`SearchUser API with params: offset=${body.offset}, size=${body.size}`);
|
|
472
|
+
|
|
473
473
|
return Object.keys(body).length > 0 ? body : undefined;
|
|
474
474
|
}
|
|
475
475
|
async run() {
|
package/dist/cli.js
CHANGED
|
@@ -5,9 +5,10 @@ async function main() {
|
|
|
5
5
|
const appId = process.env.DINGTALK_Client_ID;
|
|
6
6
|
const appSecret = process.env.DINGTALK_Client_Secret;
|
|
7
7
|
const accessToken = process.env.DINGTALK_ACCESS_TOKEN;
|
|
8
|
+
process.env.ACTIVE_PROFILES = 'dingtalk-contacts,dingtalk-department'
|
|
8
9
|
// 如果既没有AppKey/Secret也没有AccessToken,显示帮助信息
|
|
9
10
|
if (!accessToken && (!appId || !appSecret)) {
|
|
10
|
-
console.error('🔧 DingTalk
|
|
11
|
+
console.error('🔧 DingTalk MCP Server 配置指南');
|
|
11
12
|
console.error('');
|
|
12
13
|
console.error('📋 需要设置以下环境变量之一:');
|
|
13
14
|
console.error('');
|
|
@@ -27,7 +28,7 @@ async function main() {
|
|
|
27
28
|
console.error(' DINGTALK_Client_Secret=XXXXXXXXXXXXX');
|
|
28
29
|
console.error('');
|
|
29
30
|
console.error('🚀 启动命令:');
|
|
30
|
-
console.error(' npx dingtalk-
|
|
31
|
+
console.error(' npx dingtalk-mcp');
|
|
31
32
|
console.error('');
|
|
32
33
|
process.exit(1);
|
|
33
34
|
}
|
|
@@ -36,7 +37,7 @@ async function main() {
|
|
|
36
37
|
console.error('🎯 DingTalk MCP Server 启动中...');
|
|
37
38
|
console.error('🔗 连接方式:stdio transport');
|
|
38
39
|
await server.run();
|
|
39
|
-
console.error('🎯 DingTalk
|
|
40
|
+
console.error('🎯 DingTalk MCP Server 启动成功.');
|
|
40
41
|
}
|
|
41
42
|
catch (error) {
|
|
42
43
|
console.error('❌ 服务器启动失败:', error);
|