MCP Directory

How to add Playwright Server (Python) to Windsurf

MCP server exposing Playwright browser-automation tools: navigate, click, fill, screenshot and scrape pages. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 14, 2026 · 188 · stdio · no auth

Windsurf 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

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the Playwright Server (Python) config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5Playwright Server (Python)'s tools become available to Cascade.

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 Windsurf

playwright_navigate

Navigates to a specified URL. Automatically creates a new session if there is no active session. Requires a `url` argument (string).

playwright_screenshot

Takes 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_click

Clicks an element on the page using a CSS selector. Requires a `selector` argument (string).

playwright_fill

Fills out an input field. Requires a `selector` (string) for the input field and a `value` (string) to fill.

playwright_evaluate

Executes JavaScript code in the browser console. Requires a `script` argument (string).

playwright_click_text

Clicks an element on the page by its text content. Requires a `text` argument (string).

playwright_get_text_content

Gets the text content of all visible elements on the page.

playwright_get_html_content

Gets 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) + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the Playwright Server (Python) config there under the "mcpServers" key and restart the client.

Is Playwright Server (Python) safe to use with Windsurf?

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.

View repo Full Playwright Server (Python) page