Playwright MCP Server Python
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Playwright MCP Server Python

A Python Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server exposes a set of tools for navigating, interacting with, and extracting data from web pages.
Note: This is an independent, community-maintained Python implementation. It is not affiliated with, endorsed by, or derived from Microsoft's official Playwright MCP server (which is a Node.js/TypeScript project using accessibility snapshots). This project uses Playwright's standard Python API directly.
Features
Navigation: Navigate to URLs, go back/forward, reload pages
Interaction: Click elements, type text, wait for selectors
Extraction: Get text content, page HTML, page title, URL
Screenshots: Take full-page or element screenshots (base64 PNG via MCP resources)
Multi-page: Create and switch between multiple browser pages
JavaScript Evaluation: Execute arbitrary JS in page context
Related MCP server: Playwright MCP Server
Installation
Obtain development version from https://github.com/themanyone/playwright-mcp-server-python.git
git clone https://github.com/themanyone/playwright-mcp-server-python.git
cd playwright-mcp-server-python
# From source
pip install -e .
# Or install with dev dependencies
pip install -e ".[dev]"
# Install Playwright browsers
playwright install chromiumUsage
As an MCP Server (stdio)
# Run with default settings (headless chromium)
playwright-mcp
# Run with custom options
playwright-mcp --headed --browser firefox --timeout 60000
# With additional browser args
playwright-mcp --browser-arg "--disable-web-security" --browser-arg "--no-sandbox"As a Library
from playwright_mcp import create_server, ServerConfig, BrowserConfig
# Custom configuration
config = ServerConfig(
browser=BrowserConfig(
headless=True,
browser_type="chromium",
),
default_timeout=30000,
)
server = create_server(config)
await server.run_stdio()Available Tools
Tool | Description |
| Navigate to a URL |
| Click on an element by selector |
| Type text into an input element |
| Get text content from an element |
| Get the current page HTML content |
| Take a screenshot of page or element |
| Create a new browser page |
| Switch to a different browser page |
| List all available browser pages |
| Wait for an element to be visible |
| Evaluate JavaScript in page context |
| Get the page title |
| Get the current page URL |
| Navigate back in history |
| Navigate forward in history |
| Reload the current page |
Resources
The server exposes screenshot resources at URIs like screenshot://{page_id}.
Configuration
BrowserConfig
Option | Type | Default | Description |
| bool |
| Run browser in headless mode |
| str |
| Browser engine (chromium, firefox, webkit) |
| tuple[str] |
| Additional browser launch arguments |
| float |
| Slow down operations by ms |
| bool |
| Open DevTools on launch |
ServerConfig
Option | Type | Default | Description |
| str |
| Server name |
| str |
| Server version |
| BrowserConfig |
| Browser configuration |
| float |
| Default timeout in ms |
Development
# Run tests
pytest
# Type checking
mypy playwright_mcp
# Linting
ruff check playwright_mcp
# Format
ruff format playwright_mcpArchitecture
playwright_mcp/
├── config.py # Configuration dataclasses
├── browser.py # Browser lifecycle management
├── tools.py # Tool definitions (MCP schema)
├── executor.py # Tool execution logic
├── handlers.py # MCP request handlers
├── server.py # Main server class
├── cli.py # Command-line interface
└── __main__.py # Entry pointRelationship to Other Projects
Project | Language | Approach | MCP Transport |
This project | Python | Direct Playwright API | stdio |
Node.js/TypeScript | Accessibility snapshots | stdio / SSE | |
Node.js | CLI + Skills | N/A (CLI) |
License
Playwright® is a trademark of Microsoft Corporation. This project is an independent implementation using the Playwright Python library under its Apache 2.0 license.
This project includes the Playwright library (also Apache 2.0 licensed by Microsoft Corporation). See NOTICE for attribution details.
Blame
Mostly vibe-coded "from scratch" with crush agent using NVIDIA: Nemotron 3 Ultra. And without consulting the original Node.js/TypeScript that had no Fedora package at the time, and could not be fixed to work with crush. Some bits contributed by themanyone. Examine source code before running. Use at your own risk.
Mastodon https://mastodon.social/@themanyone
Linkedin https://www.linkedin.com/in/henry-kroll-iii-93860426/
Buy me a coffee https://buymeacoffee.com/isreality
Thanks for trying out Playwright MCP Server Python!
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Automate cloud browsers to navigate websites, interact with elements, and extract structured data.…
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables browser automation using Python scripts, offering operations like taking webpage screenshots, retrieving HTML content, and executing JavaScript.423-
- AlicenseNot gradedqualityDmaintenanceEnables browser automation and web scraping with multi-session management, supporting page navigation, element interaction, network request capture, and content extraction across multiple concurrent browser instances.11 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables browser automation via Chrome, allowing navigation, clicking, typing, screenshotting, and replayable flows for web tasks.-
- AlicenseNot gradedqualityDmaintenanceProvides browser automation using Selenium, supporting Chrome and Firefox, with tools for navigation, element interaction, screenshots, and more.1Mulan Permissive Software , Version 2