@mearl/mcp-server 2.0.0 → 2.0.1
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -9
- 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**: 统一列出普通浏览器和托管浏览器,返回默认目标、类型及连接状态
|
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
|
*
|
|
@@ -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',
|
|
@@ -1497,8 +1505,9 @@ async function main() {
|
|
|
1497
1505
|
let result;
|
|
1498
1506
|
switch (name) {
|
|
1499
1507
|
case 'browser_get_requests': {
|
|
1500
|
-
const { count = 10, filter, since, includeBody = true, includeHeaders = false, maxBodySize = 50000, fields, keysOnly = false, source, } = args;
|
|
1508
|
+
const { tabId, count = 10, filter, since, includeBody = true, includeHeaders = false, maxBodySize = 50000, fields, keysOnly = false, source, } = args;
|
|
1501
1509
|
result = await client.getRequests({
|
|
1510
|
+
tabId,
|
|
1502
1511
|
count,
|
|
1503
1512
|
filter,
|
|
1504
1513
|
since,
|
|
@@ -1512,8 +1521,8 @@ async function main() {
|
|
|
1512
1521
|
break;
|
|
1513
1522
|
}
|
|
1514
1523
|
case 'browser_get_events': {
|
|
1515
|
-
const { source = 'all', event_type, filter, since, limit = 20 } = args;
|
|
1516
|
-
result = await client.getEvents({ source, event_type, filter, since, limit });
|
|
1524
|
+
const { tabId, source = 'all', event_type, filter, since, limit = 20 } = args;
|
|
1525
|
+
result = await client.getEvents({ tabId, source, event_type, filter, since, limit });
|
|
1517
1526
|
break;
|
|
1518
1527
|
}
|
|
1519
1528
|
case 'browser_get_logs': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mearl/mcp-server",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
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/client": "2.0.
|
|
34
|
-
"@mearl/native-host": "2.0.
|
|
33
|
+
"@mearl/client": "2.0.1",
|
|
34
|
+
"@mearl/native-host": "2.0.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^24.9.1",
|