- Home
- MCP servers
- Playwright MCP Electron
Playwright MCP Electron
- javascript
0
GitHub Stars
javascript
Language
4 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"robertn702-playwright-mcp-electron": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest",
"--executable-path",
"/path/to/electron",
"--cwd",
"/path/to/your/electron/app"
]
}
}
}You will run a Model Context Protocol (MCP) server that automates both web browsers and Electron desktop applications using Playwright. This server lets you control and test Electron apps with the same reliable, structured access that MCP provides for web automation, so you can automate complex UI flows across web pages and Electron windows alike.
How to use
To use the Playwright MCP Electron server, connect an MCP client and start the server. By default the server runs in Electron mode, enabling automation of Electron apps in addition to traditional browser automation. If you want standard browser automation instead, specify a browser channel such as Chrome by adding a browser option.
How to install
Prerequisites you need before installing: node.js version 18 or newer installed on your machine. Ensure you have an MCP client ready (for example VS Code, Cursor, Windsurf, Claude Desktop, Goose, or any MCP-compatible client). You will install the server via npx using the following configuration snippet.
{
"mcpServers": {
"playwright-electron": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest"
]
}
}
}
To run Electron mode with a specific Electron executable and working directory for your app, extend the configuration as shown here.
{
"mcpServers": {
"playwright-electron": {
"command": "npx",
"args": [
"@robertn702/playwright-mcp-electron@latest",
"--executable-path", "/path/to/electron",
"--cwd", "/path/to/your/electron/app"
]
}
}
}
If you prefer to run a standalone MCP server for headless operation without a display, you can start it directly and then point your MCP client to its SSE endpoint.
npx @robertn702/playwright-mcp-electron@latest --port 8931
{
"mcpServers": {
"playwright": {
"url": "http://localhost:8931/sse"
}
}
}
Additional installation notes
You can also configure the server to operate in a single file or use specific tooling in your environment. The Electron configuration options enable you to specify the Electron executable path and the working directory for your app, which is especially useful when testing desktop applications.
Configuration
The Playwright MCP Electron server accepts a variety of command line options to control behavior. The options include selecting the browser, enabling headless mode, setting the host port, and configuring origins allowed or blocked for network requests. When using Electron, you typically set the executable path to Electron and can optionally pass the app’s working directory.
Key configuration example for Electron mode using a JSON file or inline configuration: this enables Electron automation and points the server to your app.
Electron specifics and tools
In addition to standard browser automation, this server offers Electron-specific tools that let you interact with the Electron main process and manage windows. Use these tools to execute JavaScript in the Electron main process, list windows, access the first window, and obtain a BrowserWindow reference for advanced control.
Examples of Electron-specific usage include evaluating code in the main process, listing windows, and interacting with the app’s UI using standard browser automation tools.
Tools and available actions
The server exposes a rich set of tooling in two modes. Snapshot mode uses accessibility snapshots for speed and reliability, while Vision mode uses screenshots for visual-based interactions. You can enable Vision mode by starting the server with the --vision flag.
Example tools usage
The following are representative tool endpoints you can use, described in detail with their parameters and behavior. These enable common automation tasks such as taking snapshots, clicking elements, typing text, uploading files, handling dialogs, and navigating pages.
Navigation and resources
Navigate to URLs, move between tabs, and manage browser windows with the provided navigation and tab tools. You can also capture page snapshots or take screenshots, generate PDFs, and list network requests or console messages for debugging.
Troubleshooting and notes
If you encounter issues where a browser is not installed, call the browser install tool to install the required browser. You can run with persistent or isolated profiles to manage session data across runs. When using isolated mode, storage state is not saved between sessions unless you specify a storage state file.
Available tools
browser_snapshot
Capture accessibility snapshot of the current page, this is better than screenshot.
browser_click
Perform click on a web page.
browser_drag
Perform drag and drop between two elements.
browser_hover
Hover over an element on the page.
browser_type
Type text into an editable element.
browser_select_option
Select an option in a dropdown.
browser_press_key
Press a key on the keyboard.
browser_wait_for
Wait for text to appear or disappear or a specified time to pass.
browser_file_upload
Upload one or multiple files.
browser_handle_dialog
Handle a dialog.
browser_navigate
Navigate to a URL.
browser_navigate_back
Go back to the previous page.
browser_navigate_forward
Go forward to the next page.
browser_take_screenshot
Take a screenshot of the current page.
browser_pdf_save
Save page as PDF.
browser_network_requests
List all network requests since page load.
browser_console_messages
Get console messages.
browser_install
Install the browser specified in the config.
browser_close
Close the browser.
browser_resize
Resize the browser window.
browser_tab_list
List tabs.
browser_tab_new
Open a new tab.
browser_tab_select
Select a tab by index.
browser_tab_close
Close a tab.
browser_generate_playwright_test
Generate a Playwright test for a given scenario.
browser_screen_capture
Take a screenshot in Vision mode.
browser_screen_move_mouse
Move mouse to a given position in Vision mode.
browser_screen_click
Click in Vision mode at coordinates.
browser_screen_drag
Drag in Vision mode.
browser_screen_type
Type text in Vision mode.