You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Text: fmt.Sprintf("Result too large for inline display (%d bytes). Saved to %s — use the Read tool to view it.", len(data), f.Name()),
415
462
}},
416
463
}, nil
417
464
}
418
465
419
466
funcregisterTools(server*mcp.Server) {
467
+
// --- iwdp status ---
468
+
mcp.AddTool(server, &mcp.Tool{
469
+
Name: "iwdp_status", Description: "Check if ios-webkit-debug-proxy is running and optionally start it. Call this first before any other tool to ensure iwdp is available.",
returnnil, map[string]any{"running": true, "message": "ios-webkit-debug-proxy is running on port 9221"}, nil
474
+
}
475
+
// Default auto_start to true when not explicitly set
476
+
autoStart:=input.AutoStart==nil||*input.AutoStart
477
+
if!autoStart {
478
+
returnnil, map[string]any{"running": false, "message": "ios-webkit-debug-proxy is not running. Start it with: ios_webkit_debug_proxy --no-frontend"}, nil
returnnil, map[string]any{"running": true, "started": true, "message": "ios-webkit-debug-proxy was not running — started it automatically"}, nil
484
+
})
485
+
420
486
// --- Device/Page management ---
421
487
mcp.AddTool(server, &mcp.Tool{
422
488
Name: "list_devices", Description: "List connected iOS devices (from iwdp listing port 9221). Each device's URL shows which port to use for list_pages.",
Copy file name to clipboardExpand all lines: skills/ios-safari-debug/SKILL.md
+12-21Lines changed: 12 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,9 @@ Use this skill to inspect and debug Safari tabs on a connected iOS device throug
9
9
10
10
## Prerequisites
11
11
12
-
1.**Check if iwdp is running** (check the listing port 9221, NOT a device port):
13
-
```bash
14
-
curl -s http://localhost:9221/json
15
-
```
16
-
A JSON array of connected devices means it is running.
17
-
18
-
2.**If not running, start it:**
19
-
```bash
20
-
ios_webkit_debug_proxy --no-frontend &
21
-
```
22
-
Wait 1 second, then verify:
23
-
```bash
24
-
sleep 1 && curl -s http://localhost:9221/json
25
-
```
26
-
27
-
3.**An iOS device must be connected** via USB with Safari open and Web Inspector enabled (Settings > Safari > Advanced > Web Inspector).
12
+
1.**Check iwdp status** — call `iwdp_status` first. It checks if ios-webkit-debug-proxy is running and auto-starts it if needed (no manual shell commands required).
13
+
14
+
2.**An iOS device must be connected** via USB with Safari open and Web Inspector enabled (Settings > Safari > Advanced > Web Inspector).
28
15
29
16
## Port Layout
30
17
@@ -36,16 +23,18 @@ Each device entry from port 9221 includes a URL field (e.g., `localhost:9222`) i
36
23
37
24
## Workflow
38
25
39
-
1.**List devices** — use `list_devices` to see connected iOS devices and their port assignments.
26
+
1.**Ensure iwdp is running** — call `iwdp_status` to verify (it auto-starts if needed).
27
+
28
+
2.**List devices** — use `list_devices` to see connected iOS devices and their port assignments.
40
29
41
-
2.**List pages** — use `list_pages` (optionally with `port` for a specific device) to discover open Safari tabs. Each entry includes a title, URL, and `webSocketDebuggerUrl`.
30
+
3.**List pages** — use `list_pages` (optionally with `port` for a specific device) to discover open Safari tabs. Each entry includes a title, URL, and `webSocketDebuggerUrl`.
42
31
43
-
3.**Select a page** — use `select_page` with the WebSocket URL from the listing to connect to the target tab.
32
+
4.**Select a page** — use `select_page` with the WebSocket URL from the listing to connect to the target tab.
44
33
45
-
4.**Use debugging tools** for the task at hand. Available tools include:
34
+
5.**Use debugging tools** for the task at hand. Available tools include:
46
35
-`navigate` — go to a URL
47
36
-`evaluate_script` — run JavaScript in the page
48
-
-`take_screenshot` — capture the page as a base64 PNG
37
+
-`take_screenshot` — capture the page as a PNG file (returns path — use Read to view)
49
38
-`get_document` / `query_selector` / `get_outer_html` — inspect the DOM
50
39
-`click` / `fill` / `type_text` — interact with page elements
51
40
-`get_cookies` / `set_cookie` / `delete_cookie` — manage cookies (incl. httpOnly)
@@ -102,3 +91,5 @@ View all cookies including httpOnly ones that JavaScript cannot access:
102
91
-`get_cookies` returns httpOnly and secure cookies that `document.cookie` cannot access.
103
92
- Network/console monitoring only captures events while active — enable before triggering traffic.
104
93
-`evaluate_script` runs arbitrary JS in the page context — use it for anything the specialized tools don't cover.
94
+
- Screenshots are saved as PNG files — use the Read tool to view the returned file path.
95
+
- Large results (DOM trees, network logs, JS output) are automatically saved to temp files when they exceed the inline size limit.
0 commit comments