playwright-sse-mcp-server
5
The project provides a service that transforms Playwright into a Model Context Protocol (MCP) server, allowing clients to interact with Playwright capabilities via MCP. It involves easy setup using Docker and includes scripts for flexible server management.
playwright-sse-mcp-server
A service that offers Playwright as a Model Context Protocol (MCP) server, enabling MCP clients to utilize Playwright features.
Prerequisites
- Docker must be installed
- docker-compose must be installed
- A Docker network named mcp-network should be created
Setup and Launch
- Clone or download the repository
- Execute the following command at the project's root directory:
- Use
docker compose up --build
to run the server on the default port 3002.
- Use
Custom Port Setting
- Use
PORT=4000 docker compose up --build
to run the server on port 4000.
Usage
- Connect from containers in the same mcp-network via
playwright-sse-mcp-server:${PORT}/sse
, using port 3002 by default. - Connect from the host machine with
localhost:${PORT}/sse
.
Connecting from Roo Code
- Adjust MCP settings for Roo Code based on container environment or development container scenarios.
Convenient Usage
Use the provided shell script to start/stop the server from any directory.
Shell Script Usage
- Clone the project
- Update
.bashrc
or.zshrc
to include shell script - Reload the shell configuration with
source ~/.bashrc
Basic Commands
playwright-mcp-start
: Start the serverplaywright-mcp-stop
: Stop the serverplaywright-mcp-logs
: Show server logs
Customization
Modify the scripts/playwright-mcp.sh
file as needed.