Skip to content

Commit 93381f9

Browse files
Merge pull request #127 from executeautomation/Added-support-for-MCP-with-updated-documentation
Added support for mcp with updated documentation
2 parents 6d57cb0 + 8218bba commit 93381f9

File tree

10 files changed

+450
-397
lines changed

10 files changed

+450
-397
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const urlForWebsites = `vscode:mcp/install?${encodeURIComponent(config)}`;
5757
const urlForGithub = `https://insiders.vscode.dev/redirect?url=${encodeURIComponent(urlForWebsites)}`;
5858
-->
5959

60+
[<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540executeautomation%252Fplaywright-mcp-server%2522%255D%257D)
6061
[<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540executeautomation%252Fplaywright-mcp-server%2522%255D%257D)
6162

6263
Alternatively, you can install the Playwright MCP server using the VS Code CLI:
@@ -87,6 +88,36 @@ Here's the Claude Desktop configuration to use the Playwright server:
8788
}
8889
```
8990

91+
## SSE (Server-Sent Events) Support
92+
93+
Playwright MCP Server now supports real-time event streaming via Server-Sent Events (SSE).
94+
95+
### How to Use
96+
97+
- The server exposes an SSE endpoint at `http://localhost:3001/events`.
98+
- You can connect to this endpoint using any SSE-compatible client (such as EventSource in the browser or curl).
99+
- Events are sent in real-time as they occur (e.g., new console logs, screenshots, etc.).
100+
101+
### Example (JavaScript)
102+
```js
103+
const evtSource = new EventSource('http://localhost:3001/events');
104+
evtSource.addEventListener('console_log_entry', (event) => {
105+
const data = JSON.parse(event.data);
106+
console.log('Console log:', data.log);
107+
});
108+
evtSource.addEventListener('screenshot', (event) => {
109+
const data = JSON.parse(event.data);
110+
console.log('Screenshot event:', data);
111+
});
112+
```
113+
114+
### Available Events
115+
- `console_log_entry`: Fired when a new console log is captured.
116+
- `console_logs`: Fired when all logs are requested.
117+
- `screenshot`: Fired when a screenshot is taken or requested.
118+
119+
This allows you to build real-time dashboards, monitoring tools, or simply observe browser activity as it happens.
120+
90121
## Testing
91122

92123
This project uses Jest for testing. The tests are located in the `src/__tests__` directory.

docs/docs/intro.mdx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,31 @@ Modify your `claude-desktop-config.json` file as shown below
7070
This video should give you an high level overview of what Claude's MCP is and how helpful it will soon become for AI agents
7171

7272
<YouTubeVideoEmbed videoId="hGJQMbpsTi4" />
73+
74+
## 🟢 Real-Time Event Streaming (SSE)
75+
76+
Playwright MCP Server now supports real-time event streaming via Server-Sent Events (SSE).
77+
78+
- The server exposes an SSE endpoint at `http://localhost:3001/events`.
79+
- You can connect to this endpoint using any SSE-compatible client (such as EventSource in the browser or curl).
80+
- Events are sent in real-time as they occur (e.g., new console logs, screenshots, etc.).
81+
82+
**Example (JavaScript):**
83+
```js
84+
const evtSource = new EventSource('http://localhost:3001/events');
85+
evtSource.addEventListener('console_log_entry', (event) => {
86+
const data = JSON.parse(event.data);
87+
console.log('Console log:', data.log);
88+
});
89+
evtSource.addEventListener('screenshot', (event) => {
90+
const data = JSON.parse(event.data);
91+
console.log('Screenshot event:', data);
92+
});
93+
```
94+
95+
**Available Events:**
96+
- `console_log_entry`: Fired when a new console log is captured.
97+
- `console_logs`: Fired when all logs are requested.
98+
- `screenshot`: Fired when a screenshot is taken or requested.
99+
100+
This allows you to build real-time dashboards, monitoring tools, or simply observe browser activity as it happens.

docs/docs/playwright-web/Supported-Tools.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ sidebar_position: 1
44

55
import YouTubeVideoEmbed from '@site/src/components/HomepageFeatures/YouTubeVideoEmbed';
66

7-
87
# 🛠️ Supported Tools
98

9+
> **🟢 Real-Time Event Streaming (SSE) is now supported!**
10+
>
11+
> - Connect to `http://localhost:3001/events` for real-time updates (console logs, screenshots, etc.).
12+
> - Use any SSE-compatible client (e.g., EventSource in the browser).
13+
> - Events: `console_log_entry`, `console_logs`, `screenshot`.
14+
1015
Playwright MCP for Browser automation has following key features
1116
- Console log monitoring
1217
- Code Generation

docs/docs/release.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ import YouTubeVideoEmbed from '@site/src/components/HomepageFeatures/YouTubeVide
55

66
# Release Notes
77

8+
## Version 1.0.4
9+
- **SSE (Server-Sent Events) Support**: Added real-time event streaming via SSE
10+
- New SSE server runs on `http://localhost:3001/events`
11+
- Real-time streaming of browser console logs and screenshots to any SSE-compatible client
12+
- Example usage and event types (`console_log_entry`, `console_logs`, `screenshot`) documented in README and docs
13+
- Enables building real-time dashboards, monitoring tools, or observing browser activity as it happens
14+
15+
- **New Tool: `playwright_iframe_fill`**
16+
- Fill input fields inside iframes using CSS selectors
17+
18+
- **New Tool: `playwright_click_and_switch_tab`**
19+
- Click a link and automatically switch to the newly opened browser tab
20+
21+
- **Improved Error Logging**
22+
- Captures uncaught exceptions and unhandled Promise rejections in browser logs for better debugging
23+
24+
- **Documentation Updates**
25+
- Added/updated documentation for new tools, SSE support, and improved installation/configuration instructions
26+
27+
- **Test Coverage**
28+
- Added and updated tests for new tools and features
29+
830
## Version 1.0.3
931
- **Code Generation Capabilities**: Added new code generation capability 🎭
1032
- `start_codegen_session`: Start a new session to record Playwright actions

0 commit comments

Comments
 (0)