jtcrpa-mcp 0.6.2 → 0.7.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 CHANGED
@@ -23,7 +23,7 @@
23
23
  此 Codex CLI 流程需要支持浏览器实例绑定的扩展和 0.5.1 或更高版本的桥接器。开发测试可在本仓库运行 `npm run build` 后使用 `npm pack` 生成的本地安装包。
24
24
 
25
25
  3. **连接你要用的浏览器。** 在该浏览器的 **MCP 连接** 页面打开 **开启 MCP 连接** 开关,按提示允许本机通信,然后选择 **Codex** 查看首次接入命令。
26
- 4. **登记 MCP 服务。** 将页面给出的整条命令粘贴到终端运行。命令核对目标浏览器后,显示浏览器名称和 MCP 服务名,然后退出。Codex 加载这项配置后,你可以在自己的对话里提出任务。首次访问后,扩展会显示访问时间。要使用另一份浏览器配置,从那份配置的扩展页接入。[安装 Codex CLI](https://developers.openai.com/codex/cli/) · [使用 Claude Code 或 DeepSeek Harness](docs/usage.md#客户端配置)
26
+ 4. **登记 MCP 服务。** 将页面给出的整条命令粘贴到终端运行。命令核对目标浏览器后,显示浏览器名称和 MCP 服务名,然后退出。Codex 加载这项配置后,你可以在自己的对话里提出任务。首次访问后,扩展会显示访问时间。要使用另一份浏览器配置,从那份配置的扩展页接入。[安装 Codex CLI](https://developers.openai.com/codex/cli/) · [使用 Claude Code、DeepSeek Harness 或 WorkBuddy](docs/usage.md#客户端配置)
27
27
 
28
28
  ### 第一次用 MCP 采集书名和价格
29
29
 
@@ -77,7 +77,7 @@
77
77
  This Codex CLI flow requires an extension that supports browser instance binding and bridge version 0.5.1 or later. To test a development checkout, run `npm run build` and install the local package produced by `npm pack`.
78
78
 
79
79
  3. **Connect the browser you want to use.** In that profile, open **MCP connection**, turn on the connection switch and allow native messaging when prompted. Select **Codex** to see the first-time setup command.
80
- 4. **Register the MCP server.** Run the setup command in your terminal. It verifies the target browser, prints its display name and MCP server name, then exits. Once Codex has loaded the configuration, enter your task in your own conversation. The extension shows the time of the first access. To use another profile, start from its extension page. [Install the Codex CLI](https://developers.openai.com/codex/cli/) · [Use Claude Code or DeepSeek Harness](docs/usage.md#client-configuration)
80
+ 4. **Register the MCP server.** Run the setup command in your terminal. It verifies the target browser, prints its display name and MCP server name, then exits. Once Codex has loaded the configuration, enter your task in your own conversation. The extension shows the time of the first access. To use another profile, start from its extension page. [Install the Codex CLI](https://developers.openai.com/codex/cli/) · [Use Claude Code, DeepSeek Harness or WorkBuddy](docs/usage.md#client-configuration)
81
81
 
82
82
  ### Collect your first four books
83
83
 
package/dist/methods.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** Native host 白名单与 MCP 工具面同步;不接受任意扩展 RPC。 */
2
- export const METHODS = ['connection_status', 'connection_ping', 'browser_context', 'page_open', 'page_close', 'workflow_contract', 'page_probe', 'workflow_list', 'workflow_get', 'workflow_save', 'workflow_run', 'run_get', 'run_control', 'dataset_list', 'dataset_read'];
2
+ export const METHODS = ['connection_status', 'connection_ping', 'browser_context', 'page_open', 'page_close', 'workflow_contract', 'capability_probe', 'page_probe', 'workflow_list', 'workflow_get', 'workflow_save', 'workflow_run', 'run_get', 'run_control', 'dataset_list', 'dataset_read'];
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod/v4';
2
2
  import { pageTargetFields } from "./definition.js";
3
- const probeNames = [
3
+ const pageProbeNames = [
4
4
  'snapshot',
5
5
  'queryFrames',
6
6
  'probeElement',
@@ -8,6 +8,7 @@ const probeNames = [
8
8
  'probeClick',
9
9
  'probeScroll',
10
10
  ];
11
+ const capabilityProbeNames = ['probeUserScript', 'probeFileAccess', 'probeFeishu'];
11
12
  export const authoringTools = [
12
13
  {
13
14
  name: 'browser_context',
@@ -39,18 +40,25 @@ export const authoringTools = [
39
40
  schema: z.object({
40
41
  includeGuide: z.boolean().optional(),
41
42
  nodeTools: z.array(z.string()).max(6).optional(),
42
- probeTools: z.array(z.enum(probeNames)).max(6).optional(),
43
+ probeTools: z.array(z.enum([...pageProbeNames, ...capabilityProbeNames])).max(6).optional(),
43
44
  }),
44
45
  readOnly: true,
45
46
  openWorld: false,
46
47
  },
48
+ {
49
+ name: 'capability_probe',
50
+ description: '检查绑定实例的用户脚本权限、本地文件读取能力或飞书凭据配置。仅查指定项,无需标签页。READY 只确认对应的本机条件;BLOCKED 按原因处理。检查失败时权限未知。设置改变后重新检查。',
51
+ schema: z.object({ tool: z.enum(capabilityProbeNames) }).strict(),
52
+ readOnly: true,
53
+ openWorld: false,
54
+ },
47
55
  {
48
56
  name: 'page_probe',
49
57
  description: '在明确的标签页及 Frame 中调用白名单编译期探针。先通过 workflow_contract 获取其 params Schema。' +
50
58
  '点击和滚动会真实操作页面,必须提供 requestId,且探测范围须在用户授权之内。' +
51
59
  'clean 通过现有沙箱执行。不提供任意 RPC 或 JavaScript 求值接口。',
52
60
  schema: z.object({
53
- tool: z.enum(probeNames),
61
+ tool: z.enum(pageProbeNames),
54
62
  ...pageTargetFields,
55
63
  frameId: z.number().int().nonnegative().optional(),
56
64
  params: z.record(z.string(), z.unknown()).optional(),
@@ -35,6 +35,9 @@ async function forwardToolCall(target, definition, params) {
35
35
  else if (failure.error === 'CONNECTION_INSTANCE_MISMATCH' || failure.error === 'CONNECTION_REMOVED') {
36
36
  failure.message = '原浏览器绑定已变更,请从目标浏览器重新接入。';
37
37
  }
38
+ else if (failure.error === 'UNKNOWN_METHOD' && definition.name === 'capability_probe') {
39
+ failure.message = '当前连接缺少能力检查工具,权限状态未知。请配套更新九头虫扩展和本机桥接器。';
40
+ }
38
41
  else if (failure.error === 'UNKNOWN_METHOD' && (definition.name === 'page_open' || definition.name === 'page_close')) {
39
42
  failure.message = '当前连接尚未提供此页面工具。请配套更新目标浏览器中的九头虫扩展和本机桥接器。';
40
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jtcrpa-mcp",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "description": "在 macOS 和 Windows 上用 Codex 等 AI 客户端连接九头虫 Agent,创建和运行网页采集工作流、读取数据集。Connect AI clients to Jiutouchong Agent on macOS and Windows via MCP to create and run web scraping workflows and read datasets.",
6
6
  "homepage": "https://jtcrpa.com/",