mcp-page-bridge 0.1.5 → 0.1.7

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/dist/bridge.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createBridge
4
- } from "./chunk-EQUJLLID.js";
4
+ } from "./chunk-VB4V3KDR.js";
5
5
  export {
6
6
  createBridge
7
7
  };
@@ -21,7 +21,7 @@ import {
21
21
  } from "@modelcontextprotocol/sdk/types.js";
22
22
 
23
23
  // ../protocol/src/index.ts
24
- var MCP_PAGE_BRIDGE_VERSION = "0.1.5";
24
+ var MCP_PAGE_BRIDGE_VERSION = "0.1.7";
25
25
  var WS_SUBPROTOCOL = "mcp";
26
26
  var DEFAULT_PORT = 8787;
27
27
  var NAMESPACE_SEP = "__";
@@ -78,7 +78,64 @@ var BUILTIN_TOOL_NAMES = [
78
78
  // Service-worker delegated
79
79
  "screenshot",
80
80
  "navigate",
81
- "reload"
81
+ "reload",
82
+ // Automation (opt-in)
83
+ "find_by_text",
84
+ "find_by_role",
85
+ "find_by_label",
86
+ "find_by_test_id",
87
+ "locator_snapshot",
88
+ "locator_count",
89
+ "smart_click",
90
+ "hover",
91
+ "double_click",
92
+ "type_text",
93
+ "press_key",
94
+ "clear_value",
95
+ "select_option",
96
+ "check",
97
+ "uncheck",
98
+ "upload_file",
99
+ "drag_and_drop",
100
+ "start_network_capture",
101
+ "stop_network_capture",
102
+ "list_network_requests",
103
+ "wait_for_response",
104
+ "get_response_body",
105
+ "clear_network_capture",
106
+ "get_storage_state",
107
+ "set_local_storage",
108
+ "set_session_storage",
109
+ "clear_storage",
110
+ "list_cookies",
111
+ "set_cookie",
112
+ "delete_cookie",
113
+ "set_dialog_behavior",
114
+ "list_dialogs",
115
+ "clear_dialogs",
116
+ "list_frames",
117
+ "frame_dom_query",
118
+ "frame_click",
119
+ "frame_set_value",
120
+ "resize_window",
121
+ // Advanced CDP (opt-in, requires optional debugger permission)
122
+ "cdp_status",
123
+ "cdp_attach",
124
+ "cdp_detach",
125
+ "cdp_send_command",
126
+ "cdp_list_events",
127
+ "cdp_clear_events",
128
+ "cdp_get_response_body",
129
+ "cdp_emulate_viewport",
130
+ "cdp_clear_emulation",
131
+ "cdp_dispatch_mouse",
132
+ "cdp_dispatch_key",
133
+ "cdp_evaluate",
134
+ "cdp_capture_screenshot",
135
+ "cdp_get_performance_metrics",
136
+ "cdp_set_network_conditions",
137
+ "cdp_set_user_agent",
138
+ "cdp_set_geolocation"
82
139
  ];
83
140
  var BROWSER_TOOL_NAMES = ["list_tabs", "open_tab", "activate_tab", "navigate_tab", "close_tab"];
84
141
 
package/dist/cli.d.ts CHANGED
@@ -14,5 +14,6 @@ declare function parsePort(argv: string[]): number;
14
14
  * token before we attach. Throws a clear, actionable error on mismatch.
15
15
  */
16
16
  declare function assertCompatibleToken(port: number, token: string | undefined, probe: BridgeProbe): Promise<void>;
17
+ declare function isDirectInvocation(entry?: string | undefined, moduleUrl?: string): boolean;
17
18
 
18
- export { assertCompatibleToken, parsePort, probeBridge };
19
+ export { assertCompatibleToken, isDirectInvocation, parsePort, probeBridge };
package/dist/cli.js CHANGED
@@ -7,12 +7,13 @@ import {
7
7
  SERVICE_ID,
8
8
  TOKEN_HEADER,
9
9
  createBridge
10
- } from "./chunk-EQUJLLID.js";
10
+ } from "./chunk-VB4V3KDR.js";
11
11
 
12
12
  // src/cli.ts
13
13
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
14
14
  import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/websocket.js";
15
15
  import { spawn } from "child_process";
16
+ import { realpathSync } from "fs";
16
17
  import { readFile, rm, writeFile } from "fs/promises";
17
18
  import { tmpdir } from "os";
18
19
  import { join } from "path";
@@ -291,8 +292,15 @@ async function main() {
291
292
  await ensureDaemon(port, token, parseIdleTimeoutMs(argv));
292
293
  await connectProxy(port, token);
293
294
  }
294
- var invokedDirectly = !!process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
295
- if (invokedDirectly) {
295
+ function isDirectInvocation(entry = process.argv[1], moduleUrl = import.meta.url) {
296
+ if (!entry) return false;
297
+ try {
298
+ return realpathSync(entry) === realpathSync(fileURLToPath(moduleUrl));
299
+ } catch {
300
+ return moduleUrl === pathToFileURL(entry).href;
301
+ }
302
+ }
303
+ if (isDirectInvocation()) {
296
304
  main().catch((error) => {
297
305
  console.error("[mcp-page-bridge] fatal:", error);
298
306
  process.exit(1);
@@ -300,6 +308,7 @@ if (invokedDirectly) {
300
308
  }
301
309
  export {
302
310
  assertCompatibleToken,
311
+ isDirectInvocation,
303
312
  parsePort,
304
313
  probeBridge
305
314
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-page-bridge",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "MCP bridge that aggregates live browser-page MCP servers and exposes them to a coding agent over stdio",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "typescript": "^5.7.3",
48
48
  "vitest": "^2.1.8",
49
49
  "zod": "^3.25.0",
50
- "mcp-page-bridge-protocol": "0.1.5"
50
+ "mcp-page-bridge-protocol": "0.1.7"
51
51
  },
52
52
  "scripts": {
53
53
  "start": "tsx src/cli.ts",