Overview
What is mcp-server-playwright?
mcp-server-playwright is an experimental MCP server that uses Playwright to control a browser, enabling AI-driven browser automation. It provides a set of tools to open, close, and navigate browser pages programmatically.
How to use mcp-server-playwright?
Install dependencies with pnpm install (requires bun and pnpm). Configure your MCP client with the JSON shown in the README, setting the CHROME_PATH and MUSER_DATA_DIR environment variables. Then invoke the available tools through your MCP client.
Key features of mcp-server-playwright
- Open a browser with an optional URL.
- Close a specific page by page number.
- Close the entire browser.
- Navigate to a specified URL.
- Open a new page in a new tab.
- Get readability content of the current page.
Use cases of mcp-server-playwright
- Automate web browsing tasks via AI assistants.
- Extract readable content from web pages programmatically.
- Control multiple browser tabs for testing or scraping.
- Integrate browser actions into MCP-powered workflows.
FAQ from mcp-server-playwright
What runtime dependencies does it require?
It requires bun and pnpm installed on your system. The server is run with bun.
How do I configure the Chrome browser path?
Set the CHROME_PATH environment variable in the MCP configuration to the path of your Chrome executable. Also set MUSER_DATA_DIR to your Chrome user data directory.
What tools are available?
Tools include: open-browser, close-page, close-browser, navigate-to-page, open-new-page, and get-page-content. Each tool has its own parameters as described in the README.
Is this project production-ready?
No, it is described as an experimental project aimed at implementing browser control through AI.
Where does the browser data live?
The user data directory is specified via the MUSER_DATA_DIR environment variable, which points to the Chrome user data path on your local machine.