dingding-local-api-mcp 1.3.8 → 1.4.0
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 +19 -0
- package/package.json +2 -2
- package/src/server.cjs +35 -1
package/README.md
CHANGED
|
@@ -30,7 +30,26 @@ Tools include:
|
|
|
30
30
|
- `get_runtime_session`
|
|
31
31
|
- `list_automation_scripts`
|
|
32
32
|
- `run_automation_script`
|
|
33
|
+
- `list_rpa_tasks`
|
|
34
|
+
- `get_rpa_task`
|
|
35
|
+
- `run_rpa_task`
|
|
36
|
+
- `list_rpa_runs`
|
|
33
37
|
- `list_groups`
|
|
34
38
|
- `list_proxies`
|
|
35
39
|
- `list_tags`
|
|
36
40
|
- `list_cores`
|
|
41
|
+
|
|
42
|
+
## RPA task example
|
|
43
|
+
|
|
44
|
+
Ask Codex or Claude to call `run_rpa_task`:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"taskId": "news-query-txt",
|
|
49
|
+
"selector": { "code": "BUYER_001" },
|
|
50
|
+
"params": { "keyword": "OpenAI" },
|
|
51
|
+
"timeoutMs": 120000
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`taskId` is the same value as the existing automation `scriptId`, so old `run_automation_script` integrations keep working.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dingding-local-api-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "MCP stdio server for DingDing Browser Local API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/server.cjs",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"README.md"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"dingding-local-api-core": "1.
|
|
16
|
+
"dingding-local-api-core": "1.4.0"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=18"
|
package/src/server.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { createClient } = loadCore()
|
|
4
4
|
|
|
5
|
-
const VERSION = '
|
|
5
|
+
const VERSION = require('../package.json').version
|
|
6
6
|
|
|
7
7
|
const TOOL_DEFINITIONS = [
|
|
8
8
|
tool('check_status', 'Check DingDing Browser Local API availability.', {}),
|
|
@@ -21,6 +21,10 @@ const TOOL_DEFINITIONS = [
|
|
|
21
21
|
tool('get_automation_script', 'Get automation script metadata by scriptId.', { scriptId: stringProp('Script ID') }, ['scriptId']),
|
|
22
22
|
tool('run_automation_script', 'Run an automation script.', { scriptId: stringProp('Script ID'), selector: objectProp('Target selector'), params: objectProp('Script params'), useScriptSelector: boolProp('Use default selector'), useScriptParams: boolProp('Use default params'), timeoutMs: intProp('Timeout in milliseconds') }, ['scriptId']),
|
|
23
23
|
tool('list_automation_runs', 'List recent automation script runs.', { limit: intProp('Max records') }),
|
|
24
|
+
tool('list_rpa_tasks', 'List RPA tasks. Alias of list_automation_scripts for Codex, Claude, and other agents.', {}),
|
|
25
|
+
tool('get_rpa_task', 'Get one RPA task by taskId. Alias of get_automation_script.', { taskId: stringProp('RPA task ID'), scriptId: stringProp('Automation script ID') }),
|
|
26
|
+
tool('run_rpa_task', 'Run an RPA task by taskId with optional target selector and params.', { taskId: stringProp('RPA task ID'), scriptId: stringProp('Automation script ID'), selector: objectProp('Target selector'), params: objectProp('Task params'), useTaskSelector: boolProp('Use default task selector'), useTaskParams: boolProp('Use default task params'), useScriptSelector: boolProp('Use default script selector'), useScriptParams: boolProp('Use default script params'), timeoutMs: intProp('Timeout in milliseconds') }),
|
|
27
|
+
tool('list_rpa_runs', 'List recent RPA task runs. Alias of list_automation_runs.', { limit: intProp('Max records') }),
|
|
24
28
|
tool('list_groups', 'List profile groups.', {}),
|
|
25
29
|
tool('create_group', 'Create a profile group.', { groupName: stringProp('Group name'), parentId: stringProp('Parent group ID'), sortOrder: intProp('Sort order') }, ['groupName']),
|
|
26
30
|
tool('update_group', 'Update a profile group.', { groupId: stringProp('Group ID'), groupName: stringProp('Group name'), parentId: stringProp('Parent group ID'), sortOrder: intProp('Sort order') }, ['groupId']),
|
|
@@ -73,6 +77,14 @@ async function callTool(name, args = {}, client = createClient()) {
|
|
|
73
77
|
return client.runAutomationScript(pick(args, ['scriptId', 'selector', 'params', 'useScriptSelector', 'useScriptParams', 'timeoutMs']))
|
|
74
78
|
case 'list_automation_runs':
|
|
75
79
|
return client.listAutomationRuns(args.limit)
|
|
80
|
+
case 'list_rpa_tasks':
|
|
81
|
+
return client.listAutomationScripts()
|
|
82
|
+
case 'get_rpa_task':
|
|
83
|
+
return client.getAutomationScript(requiredTaskId(args))
|
|
84
|
+
case 'run_rpa_task':
|
|
85
|
+
return client.runAutomationScript(normalizeRPATaskRunArgs(args))
|
|
86
|
+
case 'list_rpa_runs':
|
|
87
|
+
return client.listAutomationRuns(args.limit)
|
|
76
88
|
case 'list_groups':
|
|
77
89
|
return client.listGroups()
|
|
78
90
|
case 'create_group':
|
|
@@ -269,6 +281,28 @@ function pick(source, keys) {
|
|
|
269
281
|
return out
|
|
270
282
|
}
|
|
271
283
|
|
|
284
|
+
function requiredTaskId(args) {
|
|
285
|
+
const taskId = String(args.taskId || args.scriptId || '').trim()
|
|
286
|
+
if (!taskId) throw new Error('taskId is required')
|
|
287
|
+
return taskId
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function normalizeRPATaskRunArgs(args) {
|
|
291
|
+
const out = pick(args, ['selector', 'params', 'timeoutMs'])
|
|
292
|
+
out.scriptId = requiredTaskId(args)
|
|
293
|
+
if (args.useTaskSelector !== undefined) {
|
|
294
|
+
out.useScriptSelector = args.useTaskSelector
|
|
295
|
+
} else if (args.useScriptSelector !== undefined) {
|
|
296
|
+
out.useScriptSelector = args.useScriptSelector
|
|
297
|
+
}
|
|
298
|
+
if (args.useTaskParams !== undefined) {
|
|
299
|
+
out.useScriptParams = args.useTaskParams
|
|
300
|
+
} else if (args.useScriptParams !== undefined) {
|
|
301
|
+
out.useScriptParams = args.useScriptParams
|
|
302
|
+
}
|
|
303
|
+
return out
|
|
304
|
+
}
|
|
305
|
+
|
|
272
306
|
function loadCore() {
|
|
273
307
|
try {
|
|
274
308
|
return require('dingding-local-api-core')
|