@mearl/mcp-server 2.0.0 → 2.0.2
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 +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +120 -36
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## 功能
|
|
6
6
|
|
|
7
7
|
- 📊 **browser_get_requests**: 获取历史请求记录
|
|
8
|
-
- 📊 **browser_get_events**:
|
|
8
|
+
- 📊 **browser_get_events**: 获取指定标签页的 RUM/aplus/ARMS 埋点事件,无需打开 DevTools panel
|
|
9
9
|
- 📝 **browser_get_logs**: 获取控制台日志
|
|
10
10
|
- 🎭 **browser_set_mock**: 动态设置 Mock 数据
|
|
11
11
|
- 🌐 **browser_list**: 统一列出普通浏览器和托管浏览器,返回默认目标、类型及连接状态
|
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
|
|
16
16
|
## 浏览器交互工作流
|
|
17
17
|
|
|
18
|
-
首次进入页面时调用 `browser_page_snapshot` 建立结构基线。后续点击、输入、悬停、滚动、按键和上传直接调用 `browser_page_click/type/hover/scroll/press/upload`,它们默认内置观察,动作与异步同步在一次调用内完成;同页结果读取 `effects.notifications`、`effects.interactives` 和 `effects.focus
|
|
18
|
+
首次进入页面时调用 `browser_page_snapshot` 建立结构基线。后续点击、输入、悬停、滚动、按键和上传直接调用 `browser_page_click/type/hover/scroll/press/upload`,它们默认内置观察,动作与异步同步在一次调用内完成;同页结果读取 `effects.notifications`、`effects.interactives` 和 `effects.focus`。新增或变化的可交互节点会尽量携带可直接用于后续动作的 `node.ref`,解析不到 ref 时回退使用 `node.selector`。导航结果读取新 URL 和就绪状态。通常仅在导航后、`fullSnapshotRecommended: true` 或需要视觉判断时重新 snapshot 或截图;滚动后若下一步需要读取新视口内容,可按需获取 viewport 快照。`browser_page_eval` 默认裸执行,仅在表达式会修改页面且需要变化信号时显式传 `observe` 对象。
|
|
19
19
|
|
|
20
|
-
长列表重新感知时优先使用 `browser_page_snapshot(mode: "viewport")
|
|
20
|
+
长列表重新感知时优先使用 `browser_page_snapshot(mode: "viewport")`;已知 CSS 区域时使用 `rootSelector`,已有 ref 时使用 `rootRef`,只查找特定文案或角色时使用 `query`;仅需要当前视口内的控件时使用 `mode: "interactive"`,避免整页 AX Tree 占用上下文。视口内缺少 AX 控件语义时,`interactive` 会自动回退到 viewport,并返回 `fallbackMode: "viewport"`。重复文本点击可用 `scope` 限定子树,滚动子节点所在容器可用 `containerPolicy: "nearest"`。
|
|
21
21
|
|
|
22
22
|
页面动作传 `observe: false` 可关闭内置观察仅执行裸动作;不需要在每次动作后固定追加 wait、snapshot 或 screenshot。
|
|
23
23
|
|
|
24
|
+
`browser_page_click.clickMode` 默认 `auto`:可见桌面页使用可信 mouse,移动模拟页使用可信 touch;目标页隐藏时不会切换标签或还原窗口,而是使用 DOM fallback,并返回 `dispatchMode: "dom"`、`fallbackReason: "page-hidden"`。可用 `dom` / `mouse` / `touch` 覆盖自动策略;可信输入返回实际 `pointerType`。
|
|
25
|
+
|
|
24
26
|
## 安装
|
|
25
27
|
|
|
26
28
|
**方式一:使用 npx(推荐,保持最新)**
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 提供 MCP 工具让 AI 能够与浏览器交互:
|
|
6
6
|
* - browser_get_requests: 获取历史请求
|
|
7
|
-
* - browser_get_events: 获取 RUM/aplus 埋点事件
|
|
7
|
+
* - browser_get_events: 获取 RUM/aplus/ARMS 埋点事件
|
|
8
8
|
* - browser_get_logs: 获取控制台日志
|
|
9
9
|
* - browser_set_mock: 设置 Mock 数据
|
|
10
10
|
*
|
|
@@ -322,7 +322,7 @@ async function main() {
|
|
|
322
322
|
capabilities: {
|
|
323
323
|
tools: {},
|
|
324
324
|
},
|
|
325
|
-
instructions: '浏览器交互默认工作流:首次进入页面时使用 browser_page_snapshot 建立页面基线;后续点击、输入、悬停、滚动、按键和上传直接使用 browser_page_click/type/hover/scroll/press/upload,它们默认内置观察,动作与异步稳定判断在一次调用内完成,返回 { action, observation };传 observe:false 可关闭观察仅执行裸动作。观察结果不替代完整页面理解:observation.mode 为 delta 时确认 scope="main-document",再读取 effects.notifications、effects.interactives 和 effects.focus;notifications 中 change=transient 表示已经消失的 Toast、状态或错误提示。为 navigation 时先检查 ready,ready=true 表示文档、相关业务请求和可见骨架状态已经稳定,可在新页面重建 snapshot
|
|
325
|
+
instructions: '浏览器交互默认工作流:首次进入页面时使用 browser_page_snapshot 建立页面基线;后续点击、输入、悬停、滚动、按键和上传直接使用 browser_page_click/type/hover/scroll/press/upload,它们默认内置观察,动作与异步稳定判断在一次调用内完成,返回 { action, observation };传 observe:false 可关闭观察仅执行裸动作。观察结果不替代完整页面理解:observation.mode 为 delta 时确认 scope="main-document",再读取 effects.notifications、effects.interactives 和 effects.focus;interactives/focus 节点有 ref 时优先直接用于后续动作,没有 ref 时使用 selector;notifications 中 change=transient 表示已经消失的 Toast、状态或错误提示。为 navigation 时先检查 ready,ready=true 表示文档、相关业务请求和可见骨架状态已经稳定,可在新页面重建 snapshot。其他情况下通常仅当 fullSnapshotRecommended 为 true 时根据 snapshotReasons 回退,并选择最小范围:已有区域 ref 用 rootRef,已有 CSS 根节点用 rootSelector,只需查找特定目标时加 query,长列表用 mode="viewport",只需当前视口内的控件用 mode="interactive";滚动动作的 moved 只证明位置变化,下一步需要读取新视口内容时可按需获取 viewport 快照。视口内缺少 AX 控件语义时 interactive 会在同一次调用中回退到 viewport,并返回 fallbackMode。重复文本点击用 scope 限定区域,ref 指向滚动容器子节点时用 containerPolicy="nearest"。page_eval 默认裸执行且应作为结构化能力无法表达时的补充,仅在表达式修改页面并需要变化信号时显式传 observe 对象。视觉任务再使用 screenshot。不要在每次动作后固定调用 browser_page_wait、snapshot 或 screenshot。',
|
|
326
326
|
});
|
|
327
327
|
// 页面交互工具共享的 observe 参数 schema:默认开启内置观察,传 false 关闭
|
|
328
328
|
const OBSERVE_INPUT_SCHEMA = {
|
|
@@ -367,6 +367,10 @@ async function main() {
|
|
|
367
367
|
inputSchema: {
|
|
368
368
|
type: 'object',
|
|
369
369
|
properties: {
|
|
370
|
+
tabId: {
|
|
371
|
+
type: 'number',
|
|
372
|
+
description: '目标标签页 ID,从 browser_tab_list 获取。不传则使用当前激活标签页',
|
|
373
|
+
},
|
|
370
374
|
count: {
|
|
371
375
|
type: 'number',
|
|
372
376
|
description: '获取的请求数量,默认 10 个。最多可获取最近 1000 个请求',
|
|
@@ -410,26 +414,30 @@ async function main() {
|
|
|
410
414
|
source: {
|
|
411
415
|
type: 'string',
|
|
412
416
|
enum: ['mtop', 'requests'],
|
|
413
|
-
description: '数据源。mtop: mtop 接口(默认); requests: 普通 XHR/Fetch
|
|
417
|
+
description: '数据源。mtop: mtop 接口(默认); requests: 普通 XHR/Fetch 请求',
|
|
414
418
|
},
|
|
415
419
|
},
|
|
416
420
|
},
|
|
417
421
|
},
|
|
418
422
|
{
|
|
419
423
|
name: 'browser_get_events',
|
|
420
|
-
description: '
|
|
424
|
+
description: '获取目标标签页后台采集的 RUM/aplus/ARMS 埋点事件,无需打开 DevTools panel。包含页面资源性能指标、用户行为埋点、SPM 点击事件等。',
|
|
421
425
|
inputSchema: {
|
|
422
426
|
type: 'object',
|
|
423
427
|
properties: {
|
|
428
|
+
tabId: {
|
|
429
|
+
type: 'number',
|
|
430
|
+
description: '目标标签页 ID,从 browser_tab_list 获取。不传则使用当前激活标签页',
|
|
431
|
+
},
|
|
424
432
|
source: {
|
|
425
433
|
type: 'string',
|
|
426
|
-
enum: ['rum', 'aplus', 'all'],
|
|
427
|
-
description: '事件来源。rum: RUM 性能监控事件; aplus: aplus 埋点事件; all: 全部(默认)',
|
|
434
|
+
enum: ['rum', 'aplus', 'arms', 'all'],
|
|
435
|
+
description: '事件来源。rum: RUM 性能监控事件; aplus: aplus 埋点事件; arms: ARMS 前端监控事件; all: 全部(默认)',
|
|
428
436
|
default: 'all',
|
|
429
437
|
},
|
|
430
438
|
event_type: {
|
|
431
439
|
type: 'string',
|
|
432
|
-
description: '事件类型正则过滤。例如: "
|
|
440
|
+
description: '事件类型正则过滤。例如: "view" 匹配页面 view 事件, "CLK" 匹配点击埋点',
|
|
433
441
|
},
|
|
434
442
|
filter: {
|
|
435
443
|
type: 'string',
|
|
@@ -444,6 +452,11 @@ async function main() {
|
|
|
444
452
|
description: '返回条数上限,默认 20',
|
|
445
453
|
default: 20,
|
|
446
454
|
},
|
|
455
|
+
includeRaw: {
|
|
456
|
+
type: 'boolean',
|
|
457
|
+
description: '是否返回完整 tracking URL、_raw 原始载荷和 _context 上下文;默认 false,仅返回解析后的精简字段',
|
|
458
|
+
default: false,
|
|
459
|
+
},
|
|
447
460
|
},
|
|
448
461
|
},
|
|
449
462
|
},
|
|
@@ -1068,7 +1081,7 @@ async function main() {
|
|
|
1068
1081
|
},
|
|
1069
1082
|
{
|
|
1070
1083
|
name: 'browser_page_click',
|
|
1071
|
-
description: '点击页面元素,默认内置观察:同一次调用内等待相关 DOM、XHR/Fetch/MTop 请求或导航稳定,返回 { action, observation };传 observe:false 仅执行裸点击。定位方式三选一:selector(CSS 或 @eN snapshot ref)、text(按可见文本匹配 accessibility name
|
|
1084
|
+
description: '点击页面元素,默认内置观察:同一次调用内等待相关 DOM、XHR/Fetch/MTop 请求或导航稳定,返回 { action, observation };传 observe:false 仅执行裸点击。定位方式三选一:selector(CSS 或 @eN snapshot ref)、text(按可见文本匹配 accessibility name,可用 scope 限定子树)、point(视口坐标)。clickMode 默认 auto:可见页按设备模拟状态使用可信 mouse/touch,隐藏页不切换标签或还原窗口并自动使用 DOM fallback;checkbox/radio 使用带状态校验的 DOM 路径。可用 dom/mouse/touch 强制派发方式。响应返回实际 dispatchMode,可信输入还返回 pointerType。',
|
|
1072
1085
|
inputSchema: {
|
|
1073
1086
|
type: 'object',
|
|
1074
1087
|
properties: {
|
|
@@ -1078,7 +1091,7 @@ async function main() {
|
|
|
1078
1091
|
},
|
|
1079
1092
|
selector: {
|
|
1080
1093
|
type: 'string',
|
|
1081
|
-
description: '原生 CSS 选择器(如 "[aria-label=\'提交\']"、"#login-btn")或
|
|
1094
|
+
description: '原生 CSS 选择器(如 "[aria-label=\'提交\']"、"#login-btn")或 page_snapshot / 页面动作 observation 返回的 ref(如 "@e3",必须带 "@" 前缀)。注意字段名是 "selector" 而非 "ref"。不支持 :has-text/:visible 等 Playwright 扩展语法。与 text/point 互斥。',
|
|
1082
1095
|
},
|
|
1083
1096
|
text: {
|
|
1084
1097
|
type: 'string',
|
|
@@ -1102,11 +1115,15 @@ async function main() {
|
|
|
1102
1115
|
description: '配合 text 使用,默认 true 精确匹配;false 时按子串匹配',
|
|
1103
1116
|
default: true,
|
|
1104
1117
|
},
|
|
1105
|
-
|
|
1118
|
+
scope: {
|
|
1106
1119
|
type: 'string',
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1120
|
+
description: '配合 text 使用,把 AX 文本匹配限制在指定 CSS 元素或 snapshot ref(如 "@e12")子树内',
|
|
1121
|
+
},
|
|
1122
|
+
clickMode: {
|
|
1123
|
+
type: 'string',
|
|
1124
|
+
enum: ['auto', 'dom', 'mouse', 'touch'],
|
|
1125
|
+
description: '点击模式。auto 在可见页按设备模拟状态选择可信 mouse/touch,在隐藏页使用 DOM fallback,checkbox/radio 使用带状态校验的 DOM 路径;dom/mouse/touch 强制指定派发方式',
|
|
1126
|
+
default: 'auto',
|
|
1110
1127
|
},
|
|
1111
1128
|
observe: OBSERVE_INPUT_SCHEMA,
|
|
1112
1129
|
},
|
|
@@ -1125,7 +1142,7 @@ async function main() {
|
|
|
1125
1142
|
},
|
|
1126
1143
|
selector: {
|
|
1127
1144
|
type: 'string',
|
|
1128
|
-
description: '原生 CSS
|
|
1145
|
+
description: '原生 CSS 选择器,或 page_snapshot / 页面动作 observation 返回的 ref(如 "@e6",必须带 "@" 前缀)。字段名是 "selector"。不支持 :has-text/:visible 等 Playwright 扩展。',
|
|
1129
1146
|
},
|
|
1130
1147
|
text: {
|
|
1131
1148
|
type: 'string',
|
|
@@ -1143,7 +1160,7 @@ async function main() {
|
|
|
1143
1160
|
},
|
|
1144
1161
|
{
|
|
1145
1162
|
name: 'browser_page_scroll',
|
|
1146
|
-
description: '
|
|
1163
|
+
description: '滚动页面或指定滚动容器,默认内置观察(懒加载内容等变化),返回 { action, observation };传 observe:false 仅执行裸滚动。支持 up、down、top、bottom 四个方向;containerPolicy="nearest" 可从目标子节点解析最近可滚动祖先。动作结果包含前后位置、是否移动和边界状态。',
|
|
1147
1164
|
inputSchema: {
|
|
1148
1165
|
type: 'object',
|
|
1149
1166
|
properties: {
|
|
@@ -1161,6 +1178,15 @@ async function main() {
|
|
|
1161
1178
|
description: '滚动距离(像素),仅 up/down 方向有效。默认 600',
|
|
1162
1179
|
default: 600,
|
|
1163
1180
|
},
|
|
1181
|
+
selector: {
|
|
1182
|
+
type: 'string',
|
|
1183
|
+
description: '目标滚动容器的原生 CSS 选择器,或 page_snapshot / 页面动作 observation 返回的 ref(如 "@e6",必须带 "@" 前缀);不传时滚动页面。',
|
|
1184
|
+
},
|
|
1185
|
+
containerPolicy: {
|
|
1186
|
+
type: 'string',
|
|
1187
|
+
enum: ['self', 'nearest'],
|
|
1188
|
+
description: '默认 self,要求 selector 本身可滚动;nearest 会在其不可滚动时使用最近的可滚动祖先',
|
|
1189
|
+
},
|
|
1164
1190
|
observe: OBSERVE_INPUT_SCHEMA,
|
|
1165
1191
|
},
|
|
1166
1192
|
required: ['tabId', 'direction'],
|
|
@@ -1178,7 +1204,7 @@ async function main() {
|
|
|
1178
1204
|
},
|
|
1179
1205
|
selector: {
|
|
1180
1206
|
type: 'string',
|
|
1181
|
-
description: '原生 CSS
|
|
1207
|
+
description: '原生 CSS 选择器,或 page_snapshot / 页面动作 observation 返回的 ref(如 "@e1",必须带 "@" 前缀)。字段名是 "selector"。不支持 :has-text/:visible 等 Playwright 扩展。',
|
|
1182
1208
|
},
|
|
1183
1209
|
observe: OBSERVE_INPUT_SCHEMA,
|
|
1184
1210
|
},
|
|
@@ -1187,7 +1213,7 @@ async function main() {
|
|
|
1187
1213
|
},
|
|
1188
1214
|
{
|
|
1189
1215
|
name: 'browser_page_eval',
|
|
1190
|
-
description: '
|
|
1216
|
+
description: '在页面上下文中执行 JavaScript 表达式并返回结果,作为结构化页面能力无法表达时的补充。默认裸执行;仅在表达式会修改页面且需要变化信号时显式传 observe 对象。',
|
|
1191
1217
|
inputSchema: {
|
|
1192
1218
|
type: 'object',
|
|
1193
1219
|
properties: {
|
|
@@ -1208,13 +1234,18 @@ async function main() {
|
|
|
1208
1234
|
description: '是否等待表达式返回的 Promise,默认 true',
|
|
1209
1235
|
default: true,
|
|
1210
1236
|
},
|
|
1237
|
+
observe: {
|
|
1238
|
+
...OBSERVE_INPUT_SCHEMA,
|
|
1239
|
+
type: 'object',
|
|
1240
|
+
description: '仅在表达式会修改页面且需要观察结果时显式传入;不传时轻量执行并直接返回结果',
|
|
1241
|
+
},
|
|
1211
1242
|
},
|
|
1212
1243
|
required: ['tabId', 'expression'],
|
|
1213
1244
|
},
|
|
1214
1245
|
},
|
|
1215
1246
|
{
|
|
1216
1247
|
name: 'browser_page_snapshot',
|
|
1217
|
-
description: '获取页面无障碍树,返回角色、名称、值、状态和 @ref。默认 mode="full" 建立完整基线;长列表可用 mode="viewport"
|
|
1248
|
+
description: '获取页面无障碍树,返回角色、名称、值、状态和 @ref。默认 mode="full" 建立完整基线;长列表可用 mode="viewport",只看当前视口内的表单控件可用 mode="interactive",已知 CSS 区域可用 rootSelector,已有 ref 可用 rootRef + ancestorDepth 获取局部上下文,只查找特定文本/角色时用 query 服务端裁剪。视口内缺少 AX 控件语义时 interactive 会自动回退到 viewport,并返回 fallbackMode="viewport"。后续交互依赖页面交互工具内置的观察结果,仅在建议回退、导航或 ref 失效时再次调用。',
|
|
1218
1249
|
inputSchema: {
|
|
1219
1250
|
type: 'object',
|
|
1220
1251
|
properties: {
|
|
@@ -1230,11 +1261,39 @@ async function main() {
|
|
|
1230
1261
|
mode: {
|
|
1231
1262
|
type: 'string',
|
|
1232
1263
|
enum: ['full', 'interactive', 'viewport'],
|
|
1233
|
-
description: '输出范围:full 为完整树;interactive
|
|
1264
|
+
description: '输出范围:full 为完整树;interactive 只保留当前视口内的语义控件,视口内无 AX 控件语义时自动回退到 viewport;viewport 只保留当前可视区域。默认 full',
|
|
1234
1265
|
},
|
|
1235
1266
|
rootSelector: {
|
|
1236
1267
|
type: 'string',
|
|
1237
|
-
description: '只获取指定 CSS 元素的 AX 子树,可与 mode
|
|
1268
|
+
description: '只获取指定 CSS 元素的 AX 子树,可与 mode 组合;与 rootRef 互斥',
|
|
1269
|
+
},
|
|
1270
|
+
rootRef: {
|
|
1271
|
+
type: 'string',
|
|
1272
|
+
description: '以已有 snapshot ref(如 "@e8")为根获取局部 AX 子树',
|
|
1273
|
+
},
|
|
1274
|
+
ancestorDepth: {
|
|
1275
|
+
type: 'number',
|
|
1276
|
+
description: 'rootRef 向上扩展的 DOM 祖先层数,默认 0,最大 20',
|
|
1277
|
+
minimum: 0,
|
|
1278
|
+
maximum: 20,
|
|
1279
|
+
},
|
|
1280
|
+
query: {
|
|
1281
|
+
type: 'object',
|
|
1282
|
+
description: '服务端过滤 AX 树,只保留按 accessibility name / role 命中的节点及祖先路径',
|
|
1283
|
+
properties: {
|
|
1284
|
+
text: {
|
|
1285
|
+
type: 'string',
|
|
1286
|
+
description: '要匹配的 accessibility name',
|
|
1287
|
+
},
|
|
1288
|
+
role: {
|
|
1289
|
+
type: 'string',
|
|
1290
|
+
description: '要匹配的 AX role',
|
|
1291
|
+
},
|
|
1292
|
+
exact: {
|
|
1293
|
+
type: 'boolean',
|
|
1294
|
+
description: 'text 默认精确匹配;false 时按子串匹配',
|
|
1295
|
+
},
|
|
1296
|
+
},
|
|
1238
1297
|
},
|
|
1239
1298
|
maxNodes: {
|
|
1240
1299
|
type: 'number',
|
|
@@ -1310,7 +1369,7 @@ async function main() {
|
|
|
1310
1369
|
},
|
|
1311
1370
|
{
|
|
1312
1371
|
name: 'browser_page_navigate',
|
|
1313
|
-
description: '
|
|
1372
|
+
description: '在指定标签页中导航到 URL、设置 refresh:true 重新加载,或用 history:"back"|"forward" 沿浏览历史移动。三种模式互斥,返回最终 URL 和标题。',
|
|
1314
1373
|
inputSchema: {
|
|
1315
1374
|
type: 'object',
|
|
1316
1375
|
properties: {
|
|
@@ -1320,13 +1379,18 @@ async function main() {
|
|
|
1320
1379
|
},
|
|
1321
1380
|
url: {
|
|
1322
1381
|
type: 'string',
|
|
1323
|
-
description: '要导航到的 URL
|
|
1382
|
+
description: '要导航到的 URL;与 refresh/history 互斥',
|
|
1324
1383
|
},
|
|
1325
1384
|
refresh: {
|
|
1326
1385
|
type: 'boolean',
|
|
1327
|
-
description: '为 true
|
|
1386
|
+
description: '为 true 时直接重新加载当前页面;与 url/history 互斥',
|
|
1328
1387
|
default: false,
|
|
1329
1388
|
},
|
|
1389
|
+
history: {
|
|
1390
|
+
type: 'string',
|
|
1391
|
+
enum: ['back', 'forward'],
|
|
1392
|
+
description: '沿当前标签页浏览历史后退或前进;与 url/refresh 互斥',
|
|
1393
|
+
},
|
|
1330
1394
|
},
|
|
1331
1395
|
required: ['tabId'],
|
|
1332
1396
|
},
|
|
@@ -1343,7 +1407,7 @@ async function main() {
|
|
|
1343
1407
|
},
|
|
1344
1408
|
selector: {
|
|
1345
1409
|
type: 'string',
|
|
1346
|
-
description: '原生 CSS
|
|
1410
|
+
description: '原生 CSS 选择器,或 page_snapshot / 页面动作 observation 返回的 ref(如 "@e5",必须带 "@" 前缀),用于定位 <input type="file"> 元素。字段名是 "selector"。',
|
|
1347
1411
|
},
|
|
1348
1412
|
filePaths: {
|
|
1349
1413
|
type: 'array',
|
|
@@ -1497,8 +1561,9 @@ async function main() {
|
|
|
1497
1561
|
let result;
|
|
1498
1562
|
switch (name) {
|
|
1499
1563
|
case 'browser_get_requests': {
|
|
1500
|
-
const { count = 10, filter, since, includeBody = true, includeHeaders = false, maxBodySize = 50000, fields, keysOnly = false, source, } = args;
|
|
1564
|
+
const { tabId, count = 10, filter, since, includeBody = true, includeHeaders = false, maxBodySize = 50000, fields, keysOnly = false, source, } = args;
|
|
1501
1565
|
result = await client.getRequests({
|
|
1566
|
+
tabId,
|
|
1502
1567
|
count,
|
|
1503
1568
|
filter,
|
|
1504
1569
|
since,
|
|
@@ -1512,8 +1577,16 @@ async function main() {
|
|
|
1512
1577
|
break;
|
|
1513
1578
|
}
|
|
1514
1579
|
case 'browser_get_events': {
|
|
1515
|
-
const { source = 'all', event_type, filter, since, limit = 20 } = args;
|
|
1516
|
-
result = await client.getEvents({
|
|
1580
|
+
const { tabId, source = 'all', event_type, filter, since, limit = 20, includeRaw = false, } = args;
|
|
1581
|
+
result = await client.getEvents({
|
|
1582
|
+
tabId,
|
|
1583
|
+
source,
|
|
1584
|
+
event_type,
|
|
1585
|
+
filter,
|
|
1586
|
+
since,
|
|
1587
|
+
limit,
|
|
1588
|
+
includeRaw,
|
|
1589
|
+
});
|
|
1517
1590
|
break;
|
|
1518
1591
|
}
|
|
1519
1592
|
case 'browser_get_logs': {
|
|
@@ -1674,7 +1747,7 @@ async function main() {
|
|
|
1674
1747
|
break;
|
|
1675
1748
|
}
|
|
1676
1749
|
case 'browser_page_click': {
|
|
1677
|
-
const { tabId, selector, text, point, role, exact,
|
|
1750
|
+
const { tabId, selector, text, point, role, exact, scope, clickMode, observe } = args;
|
|
1678
1751
|
result = await client.pageClick({
|
|
1679
1752
|
tabId,
|
|
1680
1753
|
selector,
|
|
@@ -1682,7 +1755,8 @@ async function main() {
|
|
|
1682
1755
|
point,
|
|
1683
1756
|
role,
|
|
1684
1757
|
exact,
|
|
1685
|
-
|
|
1758
|
+
scope,
|
|
1759
|
+
clickMode,
|
|
1686
1760
|
observe,
|
|
1687
1761
|
});
|
|
1688
1762
|
break;
|
|
@@ -1693,8 +1767,15 @@ async function main() {
|
|
|
1693
1767
|
break;
|
|
1694
1768
|
}
|
|
1695
1769
|
case 'browser_page_scroll': {
|
|
1696
|
-
const { tabId, direction, distance = 600, observe } = args;
|
|
1697
|
-
result = await client.pageScroll({
|
|
1770
|
+
const { tabId, direction, distance = 600, selector, containerPolicy, observe, } = args;
|
|
1771
|
+
result = await client.pageScroll({
|
|
1772
|
+
tabId,
|
|
1773
|
+
direction,
|
|
1774
|
+
distance,
|
|
1775
|
+
selector,
|
|
1776
|
+
containerPolicy,
|
|
1777
|
+
observe,
|
|
1778
|
+
});
|
|
1698
1779
|
break;
|
|
1699
1780
|
}
|
|
1700
1781
|
case 'browser_page_hover': {
|
|
@@ -1703,17 +1784,20 @@ async function main() {
|
|
|
1703
1784
|
break;
|
|
1704
1785
|
}
|
|
1705
1786
|
case 'browser_page_eval': {
|
|
1706
|
-
const { tabId, expression, frameId, awaitPromise = true } = args;
|
|
1707
|
-
result = await client.pageEval({ tabId, expression, frameId, awaitPromise });
|
|
1787
|
+
const { tabId, expression, frameId, awaitPromise = true, observe } = args;
|
|
1788
|
+
result = await client.pageEval({ tabId, expression, frameId, awaitPromise, observe });
|
|
1708
1789
|
break;
|
|
1709
1790
|
}
|
|
1710
1791
|
case 'browser_page_snapshot': {
|
|
1711
|
-
const { tabId, depth = 15, mode, rootSelector, maxNodes, maxChars } = args;
|
|
1792
|
+
const { tabId, depth = 15, mode, rootSelector, rootRef, ancestorDepth, query, maxNodes, maxChars, } = args;
|
|
1712
1793
|
result = await client.pageSnapshot({
|
|
1713
1794
|
tabId,
|
|
1714
1795
|
depth,
|
|
1715
1796
|
mode,
|
|
1716
1797
|
rootSelector,
|
|
1798
|
+
rootRef,
|
|
1799
|
+
ancestorDepth,
|
|
1800
|
+
query,
|
|
1717
1801
|
maxNodes,
|
|
1718
1802
|
maxChars,
|
|
1719
1803
|
});
|
|
@@ -1737,8 +1821,8 @@ async function main() {
|
|
|
1737
1821
|
break;
|
|
1738
1822
|
}
|
|
1739
1823
|
case 'browser_page_navigate': {
|
|
1740
|
-
const { tabId, url, refresh } = args;
|
|
1741
|
-
result = await client.pageNavigate({ tabId, url, refresh });
|
|
1824
|
+
const { tabId, url, refresh, history } = args;
|
|
1825
|
+
result = await client.pageNavigate({ tabId, url, refresh, history });
|
|
1742
1826
|
break;
|
|
1743
1827
|
}
|
|
1744
1828
|
case 'browser_page_upload': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "MCP Server for Mearl - enables AI to interact with Chrome browser requests and logs",
|
|
5
5
|
"mcpName": "io.github.F-loat/mearl",
|
|
6
6
|
"type": "module",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
32
32
|
"prompts": "^2.4.2",
|
|
33
|
-
"@mearl/
|
|
34
|
-
"@mearl/
|
|
33
|
+
"@mearl/native-host": "2.0.2",
|
|
34
|
+
"@mearl/client": "2.0.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^24.9.1",
|