Back to MCP Catalog
Playwright Plus Python MCP
Browser AutomationPython
A Model Context Protocol server for Browser Automation

About this MCP

Playwright Plus Python MCP is a powerful browser automation server that integrates with the Model Context Protocol. It enables AI assistants to interact with web browsers through a comprehensive set of tools for navigation, element interaction, and content extraction. With capabilities like taking screenshots, clicking elements, filling forms, and executing JavaScript, this MCP server empowers AI systems to perform complex web-based tasks.

Documentation

Overview

Playwright Plus Python MCP provides a set of browser automation tools that allow AI assistants to interact with web pages. This MCP server leverages the Playwright library to enable capabilities like navigating to URLs, taking screenshots, clicking elements, filling forms, and executing JavaScript code.

Installation

Prerequisites

  • Python 3.x
  • UV package manager (recommended)

Installation Methods

Using UV (Recommended)

uv install playwright-plus-python-mcp

After installation, you'll need to install the Playwright browsers:

playwright install

For Claude Desktop

Configure the MCP server in your Claude Desktop configuration file:

On MacOS: Edit ~/Library/Application\ Support/Claude/claude_desktop_config.json

On Windows: Edit %APPDATA%/Claude/claude_desktop_config.json

Add the following configuration:

"mcpServers": {
  "playwright-server": {
    "command": "uvx",
    "args": [
      "playwright-server"
    ]
  }
}

For development/unpublished servers, use:

"mcpServers": {
  "playwright-server": {
    "command": "uv",
    "args": [
      "--directory",
      "PATH_TO_YOUR_PROJECT_DIRECTORY",
      "run",
      "playwright-server"
    ]
  }
}

Available Tools

playwright_navigate

Navigates to a specified URL. Creates a new session if none exists.

Parameters:

  • url (string, required): The URL to navigate to

Example:

playwright_navigate(url="https://example.com")

playwright_screenshot

Takes a screenshot of the current page or a specific element.

Parameters:

  • name (string, required): Filename for the screenshot
  • selector (string, optional): CSS selector for a specific element. If omitted, takes a full-page screenshot

Example:

playwright_screenshot(name="homepage", selector=".main-content")

playwright_click

Clicks an element on the page using a CSS selector.

Parameters:

  • selector (string, required): CSS selector for the element to click

Example:

playwright_click(selector="#submit-button")

playwright_fill

Fills out an input field with specified text.

Parameters:

  • selector (string, required): CSS selector for the input field
  • value (string, required): Text to enter into the field

Example:

playwright_fill(selector="#search-input", value="search query")

playwright_evaluate

Executes JavaScript code in the browser console.

Parameters:

  • script (string, required): JavaScript code to execute

Example:

playwright_evaluate(script="document.querySelector('.menu').style.display = 'block';")

playwright_click_text

Clicks an element on the page by its text content.

Parameters:

  • text (string, required): Text content of the element to click

Example:

playwright_click_text(text="Submit")

playwright_get_text_content

Gets the text content of all visible elements.

Example:

playwright_get_text_content()

playwright_get_html_content

Gets the HTML content of a specific element.

Parameters:

  • selector (string, required): CSS selector for the element

Example:

playwright_get_html_content(selector="main")

Resources

The server also implements a simple note storage system with:

  • Custom note:// URI scheme for accessing individual notes
  • Each note resource has a name, description, and text/plain mimetype

Prompts

The server provides a summarize-notes prompt that creates summaries of all stored notes:

  • Optional "style" argument to control detail level (brief/detailed)
  • Generates prompt combining all current notes with style preference

Debugging

For debugging the MCP server, it's recommended to use the MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory PATH_TO_YOUR_PROJECT_DIRECTORY run playwright-server

The Inspector will display a URL that you can access in your browser to begin debugging.

Use Cases

  • Web scraping and data extraction
  • Automated testing of web applications
  • Web-based workflows and form submissions
  • Capturing visual evidence through screenshots
  • Interacting with web elements programmatically

Related MCPs

Playwright MCP Server
Browser AutomationJavaScript

A Model Context Protocol server that enables LLMs to automate browsers using Playwright

MCP Server Playwright
Browser AutomationTypeScript

Browser automation capabilities for LLMs using Playwright

Puppeteer MCP Server
Browser AutomationTypeScript

Browser automation capabilities for LLMs using Puppeteer

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.