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
A Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
5
+
A Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, generate test code, web scraps the page and execute JavaScript in a real browser environment.
Copy file name to clipboardExpand all lines: docs/docs/playwright-web/Supported-Tools.mdx
+129Lines changed: 129 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ import YouTubeVideoEmbed from '@site/src/components/HomepageFeatures/YouTubeVide
9
9
10
10
Playwright MCP for Browser automation has following key features
11
11
- Console log monitoring
12
+
- Code Generation
13
+
- Web Scraping
12
14
- Screenshot capabilities
13
15
- JavaScript execution
14
16
- Basic web interaction (navigation, clicking, form filling, drop down select and hover)
@@ -23,6 +25,65 @@ Playwright MCP for Browser automation has following key features
23
25
Playwright UI automation is supported for very limited feature sets, more features will be added in upcoming days. Please feel free to fork the repo and add the feature and raise PR, will can build the library together!
24
26
:::
25
27
28
+
## Code Generation Tools
29
+
30
+
These tools allow you to record and generate reusable Playwright test scripts.
31
+
32
+
### start_codegen_session
33
+
Start a new code generation session to record Playwright actions.
34
+
35
+
-**Inputs:**
36
+
-**`options`***(object, required)*:
37
+
Code generation options:
38
+
-**`outputPath`***(string, required)*:
39
+
Directory path where generated tests will be saved (use absolute path).
40
+
-**`testNamePrefix`***(string, optional)*:
41
+
Prefix to use for generated test names (default: 'GeneratedTest').
42
+
-**`includeComments`***(boolean, optional)*:
43
+
Whether to include descriptive comments in generated tests.
44
+
45
+
-**Response:**
46
+
- Session ID for the newly created code generation session.
47
+
48
+
---
49
+
50
+
### end_codegen_session
51
+
End a code generation session and generate the test file.
52
+
53
+
-**Inputs:**
54
+
-**`sessionId`***(string, required)*:
55
+
ID of the session to end.
56
+
57
+
-**Response:**
58
+
- Information about the generated test file.
59
+
60
+
---
61
+
62
+
### get_codegen_session
63
+
Get information about a code generation session.
64
+
65
+
-**Inputs:**
66
+
-**`sessionId`***(string, required)*:
67
+
ID of the session to retrieve.
68
+
69
+
-**Response:**
70
+
- Session information including recorded actions and status.
71
+
72
+
---
73
+
74
+
### clear_codegen_session
75
+
Clear a code generation session without generating a test.
76
+
77
+
-**Inputs:**
78
+
-**`sessionId`***(string, required)*:
79
+
ID of the session to clear.
80
+
81
+
-**Response:**
82
+
- Confirmation that the session was cleared.
83
+
84
+
---
85
+
86
+
## Browser Automation Tools
26
87
27
88
### Playwright_navigate
28
89
@@ -214,3 +275,71 @@ Get the HTML content of the current page.
214
275
-**Response:**
215
276
-**`content`***(string)*:
216
277
The complete HTML content of the current page.
278
+
279
+
---
280
+
281
+
### playwright_go_back
282
+
Navigate back in browser history.
283
+
284
+
-**Response:**
285
+
- Confirmation message that the browser has navigated back in its history.
286
+
287
+
---
288
+
289
+
### playwright_go_forward
290
+
Navigate forward in browser history.
291
+
292
+
-**Response:**
293
+
- Confirmation message that the browser has navigated forward in its history.
294
+
295
+
---
296
+
297
+
### playwright_drag
298
+
Drag an element to a target location.
299
+
300
+
-**Inputs:**
301
+
-**`sourceSelector`***(string)*:
302
+
CSS selector for the element to drag.
303
+
-**`targetSelector`***(string)*:
304
+
CSS selector for the target location.
305
+
306
+
-**Response:**
307
+
- Confirmation message that the drag operation has been performed.
308
+
309
+
---
310
+
311
+
### playwright_press_key
312
+
Press a keyboard key.
313
+
314
+
-**Inputs:**
315
+
-**`key`***(string)*:
316
+
Key to press (e.g. 'Enter', 'ArrowDown', 'a').
317
+
-**`selector`***(string, optional)*:
318
+
CSS selector for an element to focus before pressing the key.
319
+
320
+
-**Response:**
321
+
- Confirmation message indicating which key was pressed.
0 commit comments