
How to add Playwright Server (Python) to Cursor
MCP server exposing Playwright browser-automation tools: navigate, click, fill, screenshot and scrape pages. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 188★ · stdio · no auth
Cursor config for Playwright Server (Python)
{
"mcpServers": {
"playwright-server-python": {
"command": "uvx",
"args": [
"playwright-server"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Playwright Server (Python) config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Playwright Server (Python)'s tools to confirm it's connected.
Before you start
- uv (Python package/runner used to launch the server, e.g. uvx)
- An MCP client such as Claude Desktop
- Playwright (installed as a dependency of the server package)
What Playwright Server (Python) can do in Cursor
playwright_navigateNavigates to a specified URL. Automatically creates a new session if there is no active session. Requires a `url` argument (string).
playwright_screenshotTakes a screenshot of the current page or a specific element. Requires a `name` (string) for the screenshot file name; optional `selector` (string) for a CSS selector — without it, a full-page screenshot is taken.
playwright_clickClicks an element on the page using a CSS selector. Requires a `selector` argument (string).
playwright_fillFills out an input field. Requires a `selector` (string) for the input field and a `value` (string) to fill.
playwright_evaluateExecutes JavaScript code in the browser console. Requires a `script` argument (string).
playwright_click_textClicks an element on the page by its text content. Requires a `text` argument (string).
playwright_get_text_contentGets the text content of all visible elements on the page.
playwright_get_html_contentGets the HTML content of the page. Requires a `selector` argument (string) for the element.
Security
Exposes a `playwright_evaluate` tool that executes arbitrary JavaScript in the browser console, which can run untrusted code against any visited page. The README's Configuration section is an unfilled TODO; the published-server config (`uvx playwright-server`) assumes the package is available on PyPI, otherwise use the development config pointing `--directory` at a local checkout.
Playwright Server (Python) + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Playwright Server (Python) config there under the "mcpServers" key and restart the client.
Is Playwright Server (Python) safe to use with Cursor?
Exposes a `playwright_evaluate` tool that executes arbitrary JavaScript in the browser console, which can run untrusted code against any visited page. The README's Configuration section is an unfilled TODO; the published-server config (`uvx playwright-server`) assumes the package is available on PyPI, otherwise use the development config pointing `--directory` at a local checkout.
How do I install and run it?
Add it to your Claude Desktop config under `mcpServers`. The README shows a published config using `command: "uvx"` with args `["playwright-server"]`, and a development config using `uv` with `--directory` pointing at a local checkout.
Does it need an API key?
No. The README documents no authentication or API key; it runs locally over stdio.
How do I select elements to interact with?
Most tools take a CSS `selector`, but `playwright_click_text` lets you click by visible text content instead.