pagerunner 0.1.1

Browser automation MCP server for AI agents — drives real Chrome with your profiles
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Pagerunner MCP Tools Schema",
  "description": "Complete JSON Schema definitions for all 27 Pagerunner MCP tools",
  "type": "object",
  "tools": [
    {
      "name": "list_profiles",
      "description": "List all available Chrome profiles on this system",
      "inputSchema": {
        "type": "object",
        "properties": {}
      },
      "outputSchema": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Profile identifier (pass to open_session as 'profile')"
            },
            "display_name": {
              "type": "string",
              "description": "Human-readable profile label (e.g., 'Stas (user@example.com)')"
            }
          },
          "required": ["name", "display_name"]
        }
      }
    },
    {
      "name": "open_session",
      "description": "Open a new browser session with a Chrome profile",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "description": "Profile name from list_profiles"
          },
          "stealth": {
            "type": "boolean",
            "description": "Enable stealth mode (masks navigator.webdriver, adds human-like delays)"
          },
          "anonymize": {
            "type": "boolean",
            "description": "Enable PII anonymization (strips PII from get_content and evaluate results)"
          },
          "anonymization_profile": {
            "type": "string",
            "description": "Named anonymization profile from config.toml (mutually exclusive with anonymization_entities)"
          },
          "anonymization_entities": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["EMAIL", "PHONE", "CREDIT_CARD", "IBAN", "SSN", "IP", "PERSON", "ORG"]
            },
            "description": "Entities to anonymize (for inline config)"
          },
          "anonymization_mode": {
            "type": "string",
            "enum": ["tokenize", "redact"],
            "description": "Anonymization mode: tokenize (reversible) or redact (one-way)"
          },
          "allowed_domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Whitelist of allowed domains (e.g., ['example.com', '*.sub.example.com'])"
          },
          "max_navigations": {
            "type": "integer",
            "description": "Maximum number of page loads allowed in this session"
          }
        },
        "required": ["profile"]
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session identifier (pass to all subsequent tools)"
          },
          "profile": {
            "type": "string",
            "description": "Profile name"
          },
          "stealth": {
            "type": "boolean"
          },
          "anonymize": {
            "type": "boolean"
          }
        },
        "required": ["session_id", "profile"]
      }
    },
    {
      "name": "close_session",
      "description": "Close a browser session and release all resources",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID from open_session"
          }
        },
        "required": ["session_id"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "list_sessions",
      "description": "List all active browser sessions",
      "inputSchema": {
        "type": "object",
        "properties": {}
      },
      "outputSchema": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Session ID"
            },
            "profile": {
              "type": "string",
              "description": "Chrome profile name"
            },
            "stealth": {
              "type": "boolean",
              "description": "Is stealth mode enabled"
            },
            "anonymize": {
              "type": "boolean",
              "description": "Is anonymization enabled"
            },
            "opened_at": {
              "type": "string",
              "format": "date-time",
              "description": "Session creation timestamp"
            }
          },
          "required": ["id", "profile"]
        }
      }
    },
    {
      "name": "list_tabs",
      "description": "List all open tabs in a session",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID from open_session"
          }
        },
        "required": ["session_id"]
      },
      "outputSchema": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "target_id": {
              "type": "string",
              "description": "CDP target identifier (pass to navigate, get_content, evaluate, etc.)"
            },
            "url": {
              "type": "string",
              "description": "Current page URL"
            },
            "title": {
              "type": "string",
              "description": "Page title (may be sanitized)"
            }
          },
          "required": ["target_id", "url"]
        }
      }
    },
    {
      "name": "new_tab",
      "description": "Open a new tab in a session",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID from open_session"
          },
          "url": {
            "type": "string",
            "description": "URL to navigate to (optional)"
          }
        },
        "required": ["session_id"]
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "target_id": {
            "type": "string",
            "description": "New tab's CDP target ID"
          },
          "url": {
            "type": "string",
            "description": "Tab URL (about:blank if no URL provided)"
          }
        },
        "required": ["target_id"]
      }
    },
    {
      "name": "navigate",
      "description": "Navigate to a URL in a tab",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID from list_tabs"
          },
          "url": {
            "type": "string",
            "description": "URL to navigate to (must start with http://, https://, file://, or about:)"
          }
        },
        "required": ["session_id", "target_id", "url"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message with target_id and URL"
      }
    },
    {
      "name": "wait_for",
      "description": "Wait for a condition: CSS selector, URL pattern, or fixed delay",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "selector": {
            "type": "string",
            "description": "CSS selector to wait for (mutually exclusive with url and ms)"
          },
          "url": {
            "type": "string",
            "description": "URL pattern to wait for (glob-style: **/path/**) (mutually exclusive with selector and ms)"
          },
          "ms": {
            "type": "integer",
            "description": "Fixed delay in milliseconds (mutually exclusive with selector and url)"
          }
        },
        "required": ["session_id", "target_id"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Success message indicating condition met or delay completed"
      }
    },
    {
      "name": "get_content",
      "description": "Extract sanitized page text content",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          }
        },
        "required": ["session_id", "target_id"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Sanitized page text content (marked with <<<UNTRUSTED_WEB_CONTENT>>> if anonymization is disabled; anonymized if enabled)"
      }
    },
    {
      "name": "screenshot",
      "description": "Capture a screenshot of the current viewport or full page",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "base64": {
            "type": "boolean",
            "description": "Return base64-encoded PNG instead of file path (default: false)"
          }
        },
        "required": ["session_id", "target_id"]
      },
      "outputSchema": {
        "oneOf": [
          {
            "type": "string",
            "description": "File path to PNG image (when base64=false)"
          },
          {
            "type": "object",
            "properties": {
              "base64": {
                "type": "string",
                "description": "Base64-encoded PNG data (when base64=true)"
              }
            },
            "required": ["base64"]
          }
        ]
      }
    },
    {
      "name": "evaluate",
      "description": "Execute JavaScript and return the result",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "expression": {
            "type": "string",
            "description": "JavaScript expression to evaluate (return a value, not just execute)"
          }
        },
        "required": ["session_id", "target_id", "expression"]
      },
      "outputSchema": {
        "type": "string",
        "description": "JSON-serialized result of the JavaScript expression. WARNING: Always return labeled objects {key: value}, not unlabeled arrays, to prevent hallucination."
      }
    },
    {
      "name": "click",
      "description": "Click an element by CSS selector",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "selector": {
            "type": "string",
            "description": "CSS selector of element to click"
          }
        },
        "required": ["session_id", "target_id", "selector"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "type_text",
      "description": "Type text into an element by CSS selector",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "text": {
            "type": "string",
            "description": "Text to type (supports anonymization tokens like [EMAIL:a3f9b2])"
          },
          "selector": {
            "type": "string",
            "description": "CSS selector of input element (optional; uses focus() if not provided)"
          }
        },
        "required": ["session_id", "target_id", "text"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "fill",
      "description": "Clear and fill an input or textarea element",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "selector": {
            "type": "string",
            "description": "CSS selector of input/textarea element"
          },
          "value": {
            "type": "string",
            "description": "Value to fill (supports anonymization tokens like [EMAIL:a3f9b2] which will be de-tokenized before writing)"
          }
        },
        "required": ["session_id", "target_id", "selector", "value"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message (includes synthetic event support for React/Vue/Angular)"
      }
    },
    {
      "name": "select",
      "description": "Select an option in a dropdown element",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "selector": {
            "type": "string",
            "description": "CSS selector of select element"
          },
          "value": {
            "type": "string",
            "description": "Option value to select"
          }
        },
        "required": ["session_id", "target_id", "selector", "value"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "scroll",
      "description": "Scroll a page or element",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID"
          },
          "selector": {
            "type": "string",
            "description": "CSS selector of element to scroll (optional; scrolls page if not provided)"
          },
          "x": {
            "type": "integer",
            "description": "Horizontal scroll distance in pixels (default: 0)"
          },
          "y": {
            "type": "integer",
            "description": "Vertical scroll distance in pixels (default: 300)"
          }
        },
        "required": ["session_id", "target_id"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "save_snapshot",
      "description": "Save cookies and localStorage for a URL origin",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID (used to determine origin)"
          },
          "origin": {
            "type": "string",
            "description": "Optional explicit origin (e.g., 'https://example.com'). If not provided, uses current page origin."
          }
        },
        "required": ["session_id", "target_id"]
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "origin": {
            "type": "string",
            "description": "Origin URL"
          },
          "saved_at": {
            "type": "string",
            "format": "date-time",
            "description": "Snapshot creation timestamp"
          }
        },
        "required": ["origin"]
      }
    },
    {
      "name": "restore_snapshot",
      "description": "Restore cookies and localStorage from a snapshot",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          },
          "target_id": {
            "type": "string",
            "description": "Tab target ID (must be at the target origin)"
          },
          "origin": {
            "type": "string",
            "description": "Origin URL to restore for"
          },
          "from_profile": {
            "type": "string",
            "description": "Optional: restore from a different profile (must be same origin)"
          }
        },
        "required": ["session_id", "target_id", "origin"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "list_snapshots",
      "description": "List all saved snapshots",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "description": "Filter by profile name (optional)"
          },
          "all": {
            "type": "boolean",
            "description": "List snapshots from all profiles (default: current session profile)"
          }
        }
      },
      "outputSchema": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "origin": {
              "type": "string",
              "description": "URL origin"
            },
            "profile": {
              "type": "string",
              "description": "Profile name"
            },
            "saved_at": {
              "type": "string",
              "format": "date-time",
              "description": "Snapshot creation timestamp"
            }
          },
          "required": ["origin", "saved_at"]
        }
      }
    },
    {
      "name": "delete_snapshot",
      "description": "Delete a saved snapshot",
      "inputSchema": {
        "type": "object",
        "properties": {
          "profile": {
            "type": "string",
            "description": "Profile name"
          },
          "origin": {
            "type": "string",
            "description": "Origin URL"
          },
          "saved_at": {
            "type": "string",
            "format": "date-time",
            "description": "Snapshot creation timestamp (from list_snapshots)"
          }
        },
        "required": ["profile", "origin"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "save_tab_state",
      "description": "Save all open tab URLs and state for restoration",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          }
        },
        "required": ["session_id"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message with number of tabs saved"
      }
    },
    {
      "name": "restore_tab_state",
      "description": "Restore previously saved tab URLs and state",
      "inputSchema": {
        "type": "object",
        "properties": {
          "session_id": {
            "type": "string",
            "description": "Session ID"
          }
        },
        "required": ["session_id"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message with number of tabs restored"
      }
    },
    {
      "name": "kv_set",
      "description": "Set a key-value pair in the persistent store",
      "inputSchema": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "description": "Namespace (e.g., 'session-state', 'user-data')"
          },
          "key": {
            "type": "string",
            "description": "Key name"
          },
          "value": {
            "type": "string",
            "description": "Value (string or JSON)"
          }
        },
        "required": ["namespace", "key", "value"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "kv_get",
      "description": "Get a value from the persistent store",
      "inputSchema": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "description": "Namespace"
          },
          "key": {
            "type": "string",
            "description": "Key name"
          }
        },
        "required": ["namespace", "key"]
      },
      "outputSchema": {
        "oneOf": [
          {
            "type": "string",
            "description": "Value if found"
          },
          {
            "type": "null",
            "description": "null if key not found"
          }
        ]
      }
    },
    {
      "name": "kv_delete",
      "description": "Delete a key from the persistent store",
      "inputSchema": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "description": "Namespace"
          },
          "key": {
            "type": "string",
            "description": "Key name"
          }
        },
        "required": ["namespace", "key"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message"
      }
    },
    {
      "name": "kv_list",
      "description": "List all keys in a namespace, optionally filtered by prefix",
      "inputSchema": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "description": "Namespace"
          },
          "prefix": {
            "type": "string",
            "description": "Filter keys by prefix (optional)"
          },
          "keys_only": {
            "type": "boolean",
            "description": "Return only key names, not values (default: false)"
          }
        },
        "required": ["namespace"]
      },
      "outputSchema": {
        "oneOf": [
          {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of keys (when keys_only=true)"
          },
          {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": ["key", "value"]
            },
            "description": "List of {key, value} objects (when keys_only=false)"
          }
        ]
      }
    },
    {
      "name": "kv_clear",
      "description": "Delete all keys in a namespace",
      "inputSchema": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "description": "Namespace to clear"
          }
        },
        "required": ["namespace"]
      },
      "outputSchema": {
        "type": "string",
        "description": "Confirmation message with number of keys deleted"
      }
    }
  ]
}