Playwright MCP for Cursor: Setup & Config
Playwright MCP lets Cursor operate browsers using structured accessibility data.
What you can do with Playwright in Cursor
Choose structured browser interaction with persistent state and detailed inspection tools.
- Inspect console errors and individual network requests.
- Keep browser state across a long-running agent workflow.
Before you start: Playwright in Cursor
- Node.js 18 or later
- An MCP-compatible client
Add the command to your client's MCP configuration. Browser selection, headless operation, and connection settings are configurable through documented arguments.
Playwright Cursor configuration
Choose Cursor configuration scope
For Playwright MCP, open Project: .cursor/mcp.json User: ~/.cursor/mcp.json. Merge into mcpServers at project or user scope.
Add Playwright MCP to Cursor
Use the playwright-mcp entry below in mcpServers. Keep Playwright MCP's documented stdio connection fields and your other Cursor entries.
Check Playwright MCP in Cursor
Playwright MCP: Enable in Cursor’s MCP settings; inspect tools.
Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
{
"mcpServers": {
"playwright-mcp": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
],
"env": {}
}
}
}Playwright tools available to Cursor
Playwright's stored tool list documents 25 tools; compare it with Cursor's connected tool list, because the stored list is not a live check.
- browser_close
Find browser_close under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Shut the active page.
- browser_resize
Find browser_resize under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_console_messages
Find browser_console_messages under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_handle_dialog
Find browser_handle_dialog under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_emulate_media
Find browser_emulate_media under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_evaluate
Find browser_evaluate under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_file_upload
Find browser_file_upload under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_drop
Find browser_drop under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_find
Find browser_find under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_fill_form
Find browser_fill_form under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_press_key
Find browser_press_key under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_type
Find browser_type under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_navigate
Find browser_navigate under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
- browser_navigate_back
Find browser_navigate_back under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Return to the preceding page in browser history.
- browser_network_requests
Find browser_network_requests under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
List captured network requests with reference numbers.
- browser_network_request
Find browser_network_request under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Inspect headers or body data for a numbered network request.
- browser_run_code_unsafe
Find browser_run_code_unsafe under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Execute a Playwright snippet in the server process; this permits arbitrary JavaScript execution.
- browser_take_screenshot
Find browser_take_screenshot under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Capture a page image; use an accessibility snapshot to guide actions.
- browser_snapshot
Find browser_snapshot under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Read the current page as an accessibility tree.
- browser_click
Find browser_click under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Click a page element.
- browser_drag
Find browser_drag under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Drag from one page element to another.
- browser_hover
Find browser_hover under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Position the pointer over an element.
- browser_select_option
Find browser_select_option under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Choose an entry from a dropdown control.
- browser_tabs
Find browser_tabs under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Inspect, open, switch, or close tabs.
- browser_wait_for
Find browser_wait_for under Playwright in Cursor's MCP settings; inspect its arguments when the agent requests a call.
Pause for matching text, its disappearance, or an elapsed interval.
Troubleshooting Playwright in Cursor
- Cursor must find npx @playwright/mcp@latest (Node.js/npm) for Playwright MCP. Enable the project/user entry in MCP settings and inspect its tools.
- Playwright MCP uses stdio here: Cursor must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Requires Node.js 18 or later.
- Known limitation: Tool schemas and accessibility trees can use more context than the separate CLI workflow.
- Known limitation: Origin filters are not a security boundary.
- General Cursor troubleshooting lives in the /clients/cursor guide.
Playwright MCP — details. Cursor guide