MCP server exposing Playwright browser automation capabilities
Project description
Playwright MCP Server
A microservice that exposes Playwright browser automation capabilities through the MCP (Microservice Communication Protocol) interface.
Features
- Launch browser pages with specified URLs
- Take screenshots of web pages
- Manage multiple browser instances
- Clean browser resources efficiently
- Get page titles and other information
Installation
From PyPI
pip install playwright-mcp-server
From Source
git clone https://github.com/yourusername/playwright-mcp-server.git
cd playwright-mcp-server
pip install -e .
After installation, you'll need to install the Playwright browser binaries:
playwright install
Usage
As a Command Line Tool
After installation, you can run the server directly from the command line:
playwright-mcp-server
As a Library
from playwright_mcp_server import run_server
# Start the server
run_server()
Available Tools
The MCP server exposes the following tools:
- launch_page(webPageURL): Launch a new page with the given URL
- close_page(page_id): Close the page with the given ID
- take_screenshot(page_id, screenshotPath): Take a screenshot of the page
- get_page_title(page_id): Get the title of the page
- get_active_pages(): Get information about all active pages
- cleanup(): Clean up all Playwright resources
Project Structure
playwright-mcp-server/
├── playwright_mcp_server/
│ ├── __init__.py
│ ├── main.py
│ └── playwrightHandler.py
├── setup.py
└── README.md
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file playwright_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: playwright_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a59ab703c843f7a2be22059f157b2f66c8048027d73fccd004f88a36b08f4029
|
|
| MD5 |
49b0c68533a8487d35d86824eb769536
|
|
| BLAKE2b-256 |
7ccd02d5635c98feff4c57ee21372a0e7c62ce4fcc255bf9010279cb95f6df05
|
File details
Details for the file playwright_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: playwright_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645a4e0d3da20855b39801d020a31b12353325ec852f807a9c5359890856809d
|
|
| MD5 |
fa27bd42fdb3c4945f1dde8d094a6a17
|
|
| BLAKE2b-256 |
301c6f5bcadf5846525ab54dca92c61d6bdcb983c7c864913aba9678bf20163d
|