Skip to main content

playwright-mcp

Playwright wrapper for MCP (Model Context Protocol). This server enables LLM-powered clients to control a browser for automation tasks.

Components

Resources

The server exposes resources for accessing browser screenshots:

  • Screenshot resource URI: screenshot://{page_id}
  • Screenshot resources are automatically available for all open pages

Prompts

The server provides a prompt to help clients interpret web pages:

  • interpret-page: Analyzes the current web page content and structure
    • Optional page_id argument to select which page to interpret
    • Optional focus argument to focus on specific aspects (full, forms, navigation, text)
    • Returns both text analysis and a screenshot of the page

Tools

The server implements a comprehensive set of browser automation tools:

  • Browser navigation

    • navigate: Go to a specific URL
    • new_page: Create a new browser page with a specific ID
    • switch_page: Switch to a different browser page
    • get_pages: List all available browser pages
  • Page interaction

    • click: Click on an element using CSS selector
    • type: Type text into an input element
    • wait_for_selector: Wait for an element to appear on the page
  • Content extraction

    • get_text: Get text content from an element
    • get_page_content: Get the entire page HTML
    • take_screenshot: Capture visual state of the page or element

Configuration

Install Dependencies

uv add playwright
playwright install chromium

Quickstart

Install

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

Development/Unpublished Servers Configuration
"mcpServers": {
  "playwright-mcp": {
    "command": "uv",
    "args": [
      "--directory",
      "/Users/shannon/Workspace/artivus/playwright-mcp",
      "run",
      "playwright-mcp"
    ]
  }
}
Published Servers Configuration
"mcpServers": {
  "playwright-mcp": {
    "command": "uvx",
    "args": [
      "playwright-mcp"
    ]
  }
}

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /Users/shannon/Workspace/artivus/playwright-mcp run playwright-mcp

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Metadata

Release files for playwright-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for playwright-mcp 0.1.0
File Size Uploaded Provenance
playwright_mcp-0.1.0.tar.gz 21.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for playwright-mcp 0.1.0
File Interpreter ABI Platform
playwright_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.6 kB

Release files / playwright_mcp-0.1.0.tar.gz

Download URL playwright_mcp-0.1.0.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
82dd9272399f0163db6c7e8768d9cda63163f0850f63fca3f934cf98b1d97212
BLAKE2b-256 checksum
How to use checksums
21a821e97b0c6b2caa450212d2d05249690c0714db8815fd1a4c8b9cc94ad90b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.23

Release files / playwright_mcp-0.1.0-py3-none-any.whl

Download URL playwright_mcp-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84839a3bc1260e1d928bf27d60d17bdf4a9f9f2c5c7022169e5de2b2c292141f
BLAKE2b-256 checksum
How to use checksums
95efcd9c2f16def35ccdd7a215ae019a5d0be785c19785e2a51fd481feca84b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.23

Security for playwright-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page