dingtalk-mcp 1.0.12 → 1.0.13
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/README.md +36 -12
- package/dingtalk_appmanage_mcp_server.yaml +304 -0
- package/dingtalk_calendar_mcp_server.yaml +714 -0
- package/dingtalk_checkin_mcp_server.yaml +76 -0
- package/dingtalk_contacts_mcp_server.yaml +18 -1
- package/dingtalk_department_mcp_server.yaml +95 -0
- package/dingtalk_honor_mcp_server.yaml +174 -0
- package/dingtalk_notice_mcp_server.yaml +85 -0
- package/dingtalk_servicewindow_mcp_server.yaml +109 -0
- package/dist/cli.js +51 -5
- package/dist/utils/apiClient.d.ts +49 -0
- package/dist/utils/apiClient.d.ts.map +1 -0
- package/dist/utils/apiClient.js +85 -0
- package/dist/utils/apiClient.js.map +1 -0
- package/dist/utils/errorFormatter.d.ts +44 -0
- package/dist/utils/errorFormatter.d.ts.map +1 -0
- package/dist/utils/errorFormatter.js +164 -0
- package/dist/utils/errorFormatter.js.map +1 -0
- package/dist/utils/messageBuilder.d.ts +57 -0
- package/dist/utils/messageBuilder.d.ts.map +1 -0
- package/dist/utils/messageBuilder.js +200 -0
- package/dist/utils/messageBuilder.js.map +1 -0
- package/dist/utils/messageProcessor.d.ts +36 -0
- package/dist/utils/messageProcessor.d.ts.map +1 -0
- package/dist/utils/messageProcessor.js +145 -0
- package/dist/utils/messageProcessor.js.map +1 -0
- package/dist/utils/validator.d.ts +64 -0
- package/dist/utils/validator.d.ts.map +1 -0
- package/dist/utils/validator.js +181 -0
- package/dist/utils/validator.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 钉钉MCP Server
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
## 🚀 功能特性
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
5
|
+
- 钉钉通讯录
|
|
6
|
+
- 钉钉部门管理
|
|
7
|
+
- 钉钉机器人发消息/DING
|
|
8
|
+
- 钉钉企业文化荣誉
|
|
9
|
+
- 钉钉待办
|
|
10
|
+
- 钉钉日程
|
|
11
|
+
- 钉钉签到
|
|
12
|
+
- 钉钉服务窗
|
|
13
|
+
- 钉钉工作通知
|
|
14
|
+
- 钉钉应用管理
|
|
11
15
|
|
|
12
16
|
## 如何使用
|
|
13
17
|
```json
|
|
14
18
|
{
|
|
15
19
|
"mcpServers": {
|
|
16
|
-
"dingtalk-
|
|
20
|
+
"dingtalk-mcp": {
|
|
17
21
|
"command": "npx",
|
|
18
22
|
"args": [
|
|
19
23
|
"-y",
|
|
20
|
-
"dingtalk-
|
|
24
|
+
"dingtalk-mcp@latest"
|
|
21
25
|
],
|
|
22
26
|
"env": {
|
|
23
27
|
"DINGTALK_Client_ID": "your dingtalk client id",
|
|
@@ -27,13 +31,33 @@
|
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
```
|
|
34
|
+
### env环境变量说明
|
|
35
|
+
1. DINGTALK_Client_ID
|
|
36
|
+
2. DINGTALK_Client_Secret
|
|
37
|
+
3. ACTIVE_PROFILES,激活哪些钉钉MCP服务,逗号风格,如果是ALL则激活全部。可选集合
|
|
38
|
+
|
|
39
|
+
| ProfileId | Description | Permission |
|
|
40
|
+
|-----------------------------|---------------|---------------------------------|
|
|
41
|
+
| dingtalk-contacts | 钉钉通讯录 |
|
|
42
|
+
| dingtalk-department | 钉钉部门管理 |
|
|
43
|
+
| dingtalk-robot-send-message | 钉钉机器人发消息/DING |
|
|
44
|
+
| dingtalk-honor | 钉钉企业文化荣誉 |
|
|
45
|
+
| dingtalk-tasks | 钉钉待办 | Todo.Todo.Write Todo.Todo.Read |
|
|
46
|
+
| dingtalk-calendar | 钉钉日程 |
|
|
47
|
+
| dingtalk-checkin | 钉钉签到 |
|
|
48
|
+
| dingtalk-servicewindow | 钉钉服务窗 |
|
|
49
|
+
| dingtalk-notice | 钉钉工作通知 |
|
|
50
|
+
| dingtalk-app-manage | 钉钉应用管理 |
|
|
51
|
+
4. ROBOT_CODE,用于发消息/DING的机器人Code
|
|
52
|
+
5. ROBOT_ACCESS_TOKEN,群自定义机器人ACCESS_TOEKN,用于自定义机器人发消息
|
|
53
|
+
|
|
30
54
|
### 如何获取钉钉Client ID和Client Secret
|
|
31
55
|
1. [成为钉钉开发者](https://open.dingtalk.com/document/orgapp/obtain-developer-permissions)
|
|
32
56
|
2. [创建应用](https://open.dingtalk.com/document/orgapp/create-an-application)
|
|
33
57
|
3. 进入应用详情页-凭证与基础信息,获取Client ID和Client Secret
|
|
34
|
-
4. [添加权限](https://open.dingtalk.com/document/orgapp/add-api-permission)
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
4. [添加权限](https://open.dingtalk.com/document/orgapp/add-api-permission),根据启用的MCP服务添加相关权限点
|
|
59
|
+
### 如何获取ROBOT_CODE
|
|
60
|
+
1. 参考[如何创建机器人](https://open.dingtalk.com/document/orgapp/the-creation-and-installation-of-the-application-robot-in-the)
|
|
37
61
|
|
|
38
62
|
|
|
39
63
|
## 📞 支持
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
server:
|
|
2
|
+
name: dingtalk-app-manage
|
|
3
|
+
description: 钉钉应用管理
|
|
4
|
+
tools:
|
|
5
|
+
# 应用管理类工具
|
|
6
|
+
- name: createInnerApp
|
|
7
|
+
description: 创建企业内部应用,支持H5微应用和小程序两种类型
|
|
8
|
+
requestTemplate:
|
|
9
|
+
method: POST
|
|
10
|
+
url: https://api.dingtalk.com/v1.0/microApp/apps
|
|
11
|
+
args:
|
|
12
|
+
- name: opUnionId
|
|
13
|
+
description: 操作人的unionId,该用户必须是拥有应用管理权限的管理员
|
|
14
|
+
type: string
|
|
15
|
+
required: true
|
|
16
|
+
position: body
|
|
17
|
+
- name: name
|
|
18
|
+
description: 应用名称,长度范围要求2-20个字符
|
|
19
|
+
type: string
|
|
20
|
+
required: true
|
|
21
|
+
position: body
|
|
22
|
+
- name: desc
|
|
23
|
+
description: 应用描述,最大长度200个字符
|
|
24
|
+
type: string
|
|
25
|
+
required: true
|
|
26
|
+
position: body
|
|
27
|
+
- name: icon
|
|
28
|
+
description: 应用图标media_id
|
|
29
|
+
type: string
|
|
30
|
+
required: false
|
|
31
|
+
position: body
|
|
32
|
+
- name: homepageLink
|
|
33
|
+
description: 应用首页地址,H5微应用时必传
|
|
34
|
+
type: string
|
|
35
|
+
required: false
|
|
36
|
+
position: body
|
|
37
|
+
- name: pcHomepageLink
|
|
38
|
+
description: 应用PC端地址
|
|
39
|
+
type: string
|
|
40
|
+
required: false
|
|
41
|
+
position: body
|
|
42
|
+
- name: ompLink
|
|
43
|
+
description: 应用管理后台地址
|
|
44
|
+
type: string
|
|
45
|
+
required: false
|
|
46
|
+
position: body
|
|
47
|
+
- name: ipWhiteList
|
|
48
|
+
description: 服务器出口IP白名单列表,最大值50
|
|
49
|
+
type: array
|
|
50
|
+
required: false
|
|
51
|
+
position: body
|
|
52
|
+
items:
|
|
53
|
+
type: string
|
|
54
|
+
- name: scopeType
|
|
55
|
+
description: 权限类型,目前只支持BASE
|
|
56
|
+
type: string
|
|
57
|
+
required: false
|
|
58
|
+
position: body
|
|
59
|
+
- name: developType
|
|
60
|
+
description: 创建的内部应用类型,0为H5微应用,1为小程序,默认为0
|
|
61
|
+
type: number
|
|
62
|
+
required: false
|
|
63
|
+
position: body
|
|
64
|
+
|
|
65
|
+
- name: updateInnerApp
|
|
66
|
+
description: 更新企业内部应用信息,包括应用名称、描述、图标、链接等
|
|
67
|
+
requestTemplate:
|
|
68
|
+
method: PUT
|
|
69
|
+
url: https://api.dingtalk.com/v1.0/microApp/apps/{agentId}
|
|
70
|
+
args:
|
|
71
|
+
- name: agentId
|
|
72
|
+
description: 应用的agentId
|
|
73
|
+
type: number
|
|
74
|
+
required: true
|
|
75
|
+
position: path
|
|
76
|
+
- name: opUnionId
|
|
77
|
+
description: 操作更新的员工unionId,必须有该应用的管理权限
|
|
78
|
+
type: string
|
|
79
|
+
required: true
|
|
80
|
+
position: body
|
|
81
|
+
- name: name
|
|
82
|
+
description: 应用名称,长度范围要求2-20个字符
|
|
83
|
+
type: string
|
|
84
|
+
required: false
|
|
85
|
+
position: body
|
|
86
|
+
- name: desc
|
|
87
|
+
description: 应用描述,最大长度200个字符
|
|
88
|
+
type: string
|
|
89
|
+
required: false
|
|
90
|
+
position: body
|
|
91
|
+
- name: icon
|
|
92
|
+
description: 应用图标media_id
|
|
93
|
+
type: string
|
|
94
|
+
required: false
|
|
95
|
+
position: body
|
|
96
|
+
- name: homepageLink
|
|
97
|
+
description: 应用首页地址
|
|
98
|
+
type: string
|
|
99
|
+
required: false
|
|
100
|
+
position: body
|
|
101
|
+
- name: pcHomepageLink
|
|
102
|
+
description: 应用PC端地址
|
|
103
|
+
type: string
|
|
104
|
+
required: false
|
|
105
|
+
position: body
|
|
106
|
+
- name: ompLink
|
|
107
|
+
description: 应用管理后台地址
|
|
108
|
+
type: string
|
|
109
|
+
required: false
|
|
110
|
+
position: body
|
|
111
|
+
- name: ipWhiteList
|
|
112
|
+
description: 服务器出口ip白名单
|
|
113
|
+
type: array
|
|
114
|
+
required: false
|
|
115
|
+
position: body
|
|
116
|
+
items:
|
|
117
|
+
type: string
|
|
118
|
+
|
|
119
|
+
- name: listAllApp
|
|
120
|
+
description: 获取企业所有应用列表,包括基础应用、自建应用和第三方应用
|
|
121
|
+
requestTemplate:
|
|
122
|
+
method: GET
|
|
123
|
+
url: https://api.dingtalk.com/v1.0/microApp/allApps
|
|
124
|
+
args: []
|
|
125
|
+
|
|
126
|
+
- name: listAllInnerApps
|
|
127
|
+
description: 获取企业内部所有应用列表,仅限内部开发的应用
|
|
128
|
+
requestTemplate:
|
|
129
|
+
method: GET
|
|
130
|
+
url: https://api.dingtalk.com/v1.0/microApp/allInnerApps
|
|
131
|
+
args: []
|
|
132
|
+
|
|
133
|
+
- name: listUserVilebleApp
|
|
134
|
+
description: 获取指定用户可使用的企业应用列表及应用信息
|
|
135
|
+
requestTemplate:
|
|
136
|
+
method: GET
|
|
137
|
+
url: https://api.dingtalk.com/v1.0/microApp/users/{userId}/apps
|
|
138
|
+
args:
|
|
139
|
+
- name: userId
|
|
140
|
+
description: 用户的userId值
|
|
141
|
+
type: string
|
|
142
|
+
required: true
|
|
143
|
+
position: path
|
|
144
|
+
|
|
145
|
+
# 权限范围管理类工具
|
|
146
|
+
- name: getMicroAppScope
|
|
147
|
+
description: 获取企业内部应用的可使用范围信息(用户、部门、角色)
|
|
148
|
+
requestTemplate:
|
|
149
|
+
method: GET
|
|
150
|
+
url: https://api.dingtalk.com/v1.0/microApp/apps/{agentId}/scopes
|
|
151
|
+
args:
|
|
152
|
+
- name: agentId
|
|
153
|
+
description: 应用agentId
|
|
154
|
+
type: number
|
|
155
|
+
required: true
|
|
156
|
+
position: path
|
|
157
|
+
|
|
158
|
+
- name: setMicroAppScope
|
|
159
|
+
description: 更新企业内部应用的可使用范围,支持增删用户、部门、角色
|
|
160
|
+
requestTemplate:
|
|
161
|
+
method: POST
|
|
162
|
+
url: https://api.dingtalk.com/v1.0/microApp/apps/{agentId}/scopes
|
|
163
|
+
args:
|
|
164
|
+
- name: agentId
|
|
165
|
+
description: 应用agentId
|
|
166
|
+
type: number
|
|
167
|
+
required: true
|
|
168
|
+
position: path
|
|
169
|
+
- name: addUserIds
|
|
170
|
+
description: 增加的可使用用户userId列表,最大长度100
|
|
171
|
+
type: array
|
|
172
|
+
required: false
|
|
173
|
+
position: body
|
|
174
|
+
items:
|
|
175
|
+
type: string
|
|
176
|
+
- name: delUserIds
|
|
177
|
+
description: 删除的可使用用户userId列表,最大长度100
|
|
178
|
+
type: array
|
|
179
|
+
required: false
|
|
180
|
+
position: body
|
|
181
|
+
items:
|
|
182
|
+
type: string
|
|
183
|
+
- name: addDeptIds
|
|
184
|
+
description: 增加的可使用部门ID列表,最大长度100
|
|
185
|
+
type: array
|
|
186
|
+
required: false
|
|
187
|
+
position: body
|
|
188
|
+
items:
|
|
189
|
+
type: number
|
|
190
|
+
- name: delDeptIds
|
|
191
|
+
description: 删除的可使用部门ID列表,最大长度100
|
|
192
|
+
type: array
|
|
193
|
+
required: false
|
|
194
|
+
position: body
|
|
195
|
+
items:
|
|
196
|
+
type: number
|
|
197
|
+
- name: addRoleIds
|
|
198
|
+
description: 增加的可使用角色列表,最大长度100
|
|
199
|
+
type: array
|
|
200
|
+
required: false
|
|
201
|
+
position: body
|
|
202
|
+
items:
|
|
203
|
+
type: number
|
|
204
|
+
- name: delRoleIds
|
|
205
|
+
description: 删除的可使用角色列表,最大长度100
|
|
206
|
+
type: array
|
|
207
|
+
required: false
|
|
208
|
+
position: body
|
|
209
|
+
items:
|
|
210
|
+
type: number
|
|
211
|
+
- name: onlyAdminVisible
|
|
212
|
+
description: 是否仅管理员可使用,true为是,false为否
|
|
213
|
+
type: boolean
|
|
214
|
+
required: false
|
|
215
|
+
position: body
|
|
216
|
+
|
|
217
|
+
# 小程序版本管理类工具
|
|
218
|
+
- name: publishInnerAppVersion
|
|
219
|
+
description: 发布企业内部小程序版本,支持线上版本和体验版本
|
|
220
|
+
requestTemplate:
|
|
221
|
+
method: POST
|
|
222
|
+
url: https://api.dingtalk.com/v1.0/microApp/innerMiniApps/{agentId}/versions/publish
|
|
223
|
+
args:
|
|
224
|
+
- name: agentId
|
|
225
|
+
description: 应用AgentId
|
|
226
|
+
type: number
|
|
227
|
+
required: true
|
|
228
|
+
position: path
|
|
229
|
+
- name: appVersionId
|
|
230
|
+
description: 小程序版本id,用于唯一标识小程序版本信息
|
|
231
|
+
type: number
|
|
232
|
+
required: true
|
|
233
|
+
position: body
|
|
234
|
+
- name: opUnionId
|
|
235
|
+
description: 操作人的unionId,该用户必须是拥有应用管理权限的管理员
|
|
236
|
+
type: string
|
|
237
|
+
required: true
|
|
238
|
+
position: body
|
|
239
|
+
- name: publishType
|
|
240
|
+
description: 小程序发布类型,online为发布线上版本,experience为发布体验版本
|
|
241
|
+
type: string
|
|
242
|
+
required: false
|
|
243
|
+
position: body
|
|
244
|
+
- name: miniAppOnPc
|
|
245
|
+
description: 是否支持PC端打开小程序,false为只发布移动端,true为既发布移动端又发布PC端
|
|
246
|
+
type: boolean
|
|
247
|
+
required: false
|
|
248
|
+
position: body
|
|
249
|
+
|
|
250
|
+
- name: rollbackInnerAppVersion
|
|
251
|
+
description: 回滚企业内部小程序到历史版本
|
|
252
|
+
requestTemplate:
|
|
253
|
+
method: POST
|
|
254
|
+
url: https://api.dingtalk.com/v1.0/microApp/innerMiniApps/{agentId}/versions/rollback
|
|
255
|
+
args:
|
|
256
|
+
- name: agentId
|
|
257
|
+
description: 应用AgentId
|
|
258
|
+
type: number
|
|
259
|
+
required: true
|
|
260
|
+
position: path
|
|
261
|
+
- name: versionId
|
|
262
|
+
description: 小程序版本id
|
|
263
|
+
type: number
|
|
264
|
+
required: true
|
|
265
|
+
position: body
|
|
266
|
+
- name: opUnionId
|
|
267
|
+
description: 操作人的unionId,该用户必须是拥有应用管理权限的管理员
|
|
268
|
+
type: string
|
|
269
|
+
required: true
|
|
270
|
+
position: body
|
|
271
|
+
|
|
272
|
+
- name: listInnerAppVersion
|
|
273
|
+
description: 获取企业内部小程序的所有版本信息
|
|
274
|
+
requestTemplate:
|
|
275
|
+
method: GET
|
|
276
|
+
url: https://api.dingtalk.com/v1.0/microApp/innerMiniApps/{agentId}/versions
|
|
277
|
+
args:
|
|
278
|
+
- name: agentId
|
|
279
|
+
description: 应用AgentId
|
|
280
|
+
type: number
|
|
281
|
+
required: true
|
|
282
|
+
position: path
|
|
283
|
+
|
|
284
|
+
- name: pageInnerAppHistoryVersion
|
|
285
|
+
description: 分页获取企业内部小程序历史版本列表
|
|
286
|
+
requestTemplate:
|
|
287
|
+
method: GET
|
|
288
|
+
url: https://api.dingtalk.com/v1.0/microApp/innerMiniApps/{agentId}/historyVersions
|
|
289
|
+
args:
|
|
290
|
+
- name: agentId
|
|
291
|
+
description: 应用AgentId
|
|
292
|
+
type: number
|
|
293
|
+
required: true
|
|
294
|
+
position: path
|
|
295
|
+
- name: pageNumber
|
|
296
|
+
description: 当前页
|
|
297
|
+
type: number
|
|
298
|
+
required: true
|
|
299
|
+
position: query
|
|
300
|
+
- name: pageSize
|
|
301
|
+
description: 本次读取的最大数据记录数量
|
|
302
|
+
type: number
|
|
303
|
+
required: true
|
|
304
|
+
position: query
|