Playwright MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add --transport http -H "Authorization: Bearer YOUR_APIFY_TOKEN" playwright-mcp-6659 https://jiri-spilka--playwright-mcp-server.apify.actor/mcp
Required:Authorization
README.md

Browser automation using Playwright and structured accessibility snapshots.

Playwright MCP Server

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually tuned models.

About this MCP Server: To understand how to connect to and utilize this MCP server, you can refer to the official Model Context Protocol documentation at mcp.apify.com.

Connection URL

MCP clients can connect to this server at:

https://jiri-spilka--playwright-mcp-server.apify.actor/mcp

Client Configuration

To connect to this MCP server, use the following configuration in your MCP client:

{
  "mcpServers": {
    "playwright": {
      "url": "https://jiri-spilka--playwright-mcp-server.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}

Note: Replace YOUR_APIFY_TOKEN with your actual Apify API token. You can find your token in the Apify Console.

Links

๐Ÿšฉ Claim this MCP server

All credits to the original authors of https://github.com/microsoft/playwright-mcp To claim this server, please write to ai@apify.com.

Key features

  • ๐Ÿš€ Uses Playwright's accessibility tree instead of pixel-based input for faster, lighter operation
  • ๐Ÿ“Š Works with structured data only - no vision models required
  • ๐ŸŽฏ Applies tools deterministically, avoiding the ambiguity of screenshot approaches
  • ๐ŸŒ Supports Apify Proxy (datacenter, residential, custom) and other Apify features

Use cases

  • ๐ŸŒ Web navigation and form filling
  • ๐Ÿ“‹ Structured data extraction
  • ๐Ÿงช LLM-driven automated testing
  • ๐Ÿค– Browser automation for AI agents

Tools ([source](https://github.com/microsoft/playwright-mcp))

Tools

Core automation
  • browser_click

    • Title: Click
    • Description: Perform click on a web page
    • Parameters:
      • element (string): Human-readable element description used to obtain permission to interact with the element
      • ref (string): Exact target element reference from the page snapshot
      • doubleClick (boolean, optional): Whether to perform a double click instead of a single click
      • button (string, optional): Button to click, defaults to left
    • Read-only: false
  • browser_close

    • Title: Close browser
    • Description: Close the page
    • Parameters: None
    • Read-only: true
  • browser_console_messages

    • Title: Get console messages
    • Description: Returns all console messages
    • Parameters: None
    • Read-only: true
  • browser_drag

    • Title: Drag mouse
    • Description: Perform drag and drop between two elements
    • Parameters:
      • startElement (string): Human-readable source element description used to obtain the permission to interact with the element
      • startRef (string): Exact source element reference from the page snapshot
      • endElement (string): Human-readable target element description used to obtain the permission to interact with the element
      • endRef (string): Exact target element reference from the page snapshot
    • Read-only: false
  • browser_evaluate

    • Title: Evaluate JavaScript
    • Description: Evaluate JavaScript expression on page or element
    • Parameters:
      • function (string): () => { /* code / } or (element) => { / code */ } when element is provided
      • element (string, optional): Human-readable element description used to obtain permission to interact with the element
      • ref (string, optional): Exact target element reference from the page snapshot
    • Read-only: false
  • browser_file_upload

    • Title: Upload files
    • Description: Upload one or multiple files
    • Parameters:
      • paths (array): The absolute paths to the files to upload. Can be a single file or mul

Tools (6)

browser_clickPerform click on a web page
browser_closeClose the page
browser_console_messagesReturns all console messages
browser_dragPerform drag and drop between two elements
browser_evaluateEvaluate JavaScript expression on page or element
browser_file_uploadUpload one or multiple files

Environment Variables

AuthorizationrequiredBearer token for Apify API authentication

Configuration

claude_desktop_config.json
{"mcpServers": {"playwright": {"url": "https://jiri-spilka--playwright-mcp-server.apify.actor/mcp", "headers": {"Authorization": "Bearer YOUR_APIFY_TOKEN"}}}}

Try it

โ†’Navigate to https://example.com and extract the main heading and all links.
โ†’Fill out the contact form on the current page with my name and email address.
โ†’Click the 'Submit' button on the page and wait for the confirmation message.
โ†’Evaluate the page content to find all elements with a specific class name.
โ†’Upload the file at /path/to/document.pdf to the file input field on the page.

Frequently Asked Questions

What are the key features of Playwright MCP Server?

Uses Playwright's accessibility tree for faster, lighter operation. Works with structured data without requiring vision models. Deterministic tool application for reliable browser interaction. Supports Apify Proxy for advanced network routing.

What can I use Playwright MCP Server for?

Automated web navigation and form filling. Structured data extraction from complex websites. LLM-driven automated testing of web applications. Browser automation for autonomous AI agents.

How do I install Playwright MCP Server?

Install Playwright MCP Server by running: Configure your MCP client with the provided URL and API token.

What MCP clients work with Playwright MCP Server?

Playwright MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Playwright MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare