dingding-local-api-mcp 1.4.1 → 1.5.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/server.cjs +26 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dingding-local-api-mcp",
3
- "version": "1.4.1",
3
+ "version": "1.5.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.4.1"
16
+ "dingding-local-api-core": "1.5.0"
17
17
  },
18
18
  "engines": {
19
19
  "node": ">=18"
package/src/server.cjs CHANGED
@@ -16,6 +16,12 @@ const TOOL_DEFINITIONS = [
16
16
  tool('get_runtime_session', 'Open and wait for a debuggable runtime session.', { ...selectorProps(), timeoutMs: intProp('Wait timeout in milliseconds') }),
17
17
  tool('get_runtime_status', 'Get runtime status by selector without launching.', selectorProps()),
18
18
  tool('close_browser', 'Stop a browser profile by selector.', selectorProps()),
19
+ tool('browser_navigate', 'Open a URL in a DingDing Browser profile through CDP.', { ...runtimeActionProps(), url: stringProp('URL to open') }, ['url']),
20
+ tool('browser_click', 'Click an element in a DingDing Browser profile through CDP.', { ...runtimeActionProps(), element: stringProp('CSS selector for the element') }, ['element']),
21
+ tool('browser_fill', 'Fill an input or textarea in a DingDing Browser profile through CDP.', { ...runtimeActionProps(), element: stringProp('CSS selector for the field'), text: stringProp('Text to fill'), value: stringProp('Alias for text') }, ['element']),
22
+ tool('browser_extract_text', 'Extract visible text from a page or element in a DingDing Browser profile.', { ...runtimeActionProps(), element: stringProp('Optional CSS selector. Defaults to body.') }),
23
+ tool('browser_evaluate', 'Evaluate JavaScript in a DingDing Browser profile. Use for page inspection, not bypassing site protections.', { ...runtimeActionProps(), expression: stringProp('JavaScript expression to evaluate') }, ['expression']),
24
+ tool('browser_screenshot', 'Capture a screenshot from a DingDing Browser profile. Returns a base64 image payload.', { ...runtimeActionProps(), fullPage: boolProp('Capture full page'), format: stringProp('png or jpeg') }),
19
25
  tool('list_launch_logs', 'List recent Launch API call logs.', { limit: intProp('Max records') }),
20
26
  tool('list_automation_scripts', 'List automation scripts.', {}),
21
27
  tool('get_automation_script', 'Get automation script metadata by scriptId.', { scriptId: stringProp('Script ID') }, ['scriptId']),
@@ -67,6 +73,18 @@ async function callTool(name, args = {}, client = createClient()) {
67
73
  return client.runtimeStatus(args)
68
74
  case 'close_browser':
69
75
  return client.runtimeStop(args)
76
+ case 'browser_navigate':
77
+ return client.runtimeAction({ ...args, action: 'navigate' })
78
+ case 'browser_click':
79
+ return client.runtimeAction({ ...args, action: 'click' })
80
+ case 'browser_fill':
81
+ return client.runtimeAction({ ...args, action: 'fill' })
82
+ case 'browser_extract_text':
83
+ return client.runtimeAction({ ...args, action: 'extract_text' })
84
+ case 'browser_evaluate':
85
+ return client.runtimeAction({ ...args, action: 'evaluate' })
86
+ case 'browser_screenshot':
87
+ return client.runtimeAction({ ...args, action: 'screenshot' })
70
88
  case 'list_launch_logs':
71
89
  return client.launchLogs(args.limit)
72
90
  case 'list_automation_scripts':
@@ -253,6 +271,14 @@ function selectorProps() {
253
271
  }
254
272
  }
255
273
 
274
+ function runtimeActionProps() {
275
+ return {
276
+ ...selectorProps(),
277
+ timeoutMs: intProp('Wait timeout in milliseconds'),
278
+ waitMs: intProp('Optional wait time after the action'),
279
+ }
280
+ }
281
+
256
282
  function stringProp(description) {
257
283
  return { type: 'string', description }
258
284
  }