Skip to main content
Glama

Playwright MCP

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

"mcpServers": { "playwright-mcp": { "command": "uv", "args": [ "--directory", "/Users/shannon/Workspace/artivus/playwright-mcp", "run", "playwright-mcp" ] } }
"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.

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Playwright wrapper for MCP that enables LLM-powered clients to control a browser for automation tasks.

  1. Components
    1. Resources
    2. Prompts
    3. Tools
  2. Configuration
    1. Install Dependencies
  3. Quickstart
    1. Install
  4. Development
    1. Building and Publishing
    2. Debugging

Related MCP Servers

  • -
    security
    A
    license
    -
    quality
    A MCP server that provides browser automation tools, allowing users to navigate websites, take screenshots, click elements, fill forms, and execute JavaScript through Playwright.
    Last updated -
    Python
    Apache 2.0
    • Apple
  • A
    security
    A
    license
    A
    quality
    A browser automation server providing Playwright capabilities for controlling web browsers, capturing screenshots, extracting content, and performing complex interactions through an MCP interface.
    Last updated -
    6
    Python
    Apache 2.0
    • Apple
  • -
    security
    F
    license
    -
    quality
    A service that provides Playwright browser automation functionality through Model Context Protocol (MCP), allowing clients to use Playwright features via SSE connections.
    Last updated -
    6
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, generate test code, scrape web content, and execute JavaScript in real browser environments.
    Last updated -
    31
    10,475
    TypeScript
    MIT License
    • Linux
    • Apple

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/misanthropic-ai/playwrite-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server