MCP Directory

How to add Playwright Server (Python) to Claude Desktop

MCP server exposing Playwright browser-automation tools: navigate, click, fill, screenshot and scrape pages. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.

Last updated June 14, 2026 ยท 188โ˜… ยท stdio ยท no auth

Claude Desktop 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 Claude Desktop โ†’ Settings โ†’ Developer โ†’ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
  2. 2Paste the Playwright Server (Python) config below under the top-level "mcpServers" key.
  3. 3Fill in any placeholder secrets (API keys, paths) in the snippet.
  4. 4Save the file, then fully quit and reopen Claude Desktop.
  5. 5Open a chat and confirm Playwright Server (Python)'s tools appear under the ๐Ÿ”Œ tools menu.

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 Claude Desktop

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) + Claude Desktop FAQ

Where is the Claude Desktop config file?

Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_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 Claude Desktop?

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