Python Puppeteer MCP server for browser automation with Playwright and LLM integration
The Puppeteer MCP Server is a robust, Python-based implementation of a Model Context Protocol (MCP) server that leverages Playwright to provide advanced browser automation capabilities. This server is designed to enable AI applications, such as Claude Desktop and other clients using MCP, to interact with web pages in a seamless manner, performing tasks like page navigation, screenshot capturing, form interactions, and JavaScript execution within a real-browser environment.
The Puppeteer MCP Server offers comprehensive browser automation capabilities, allowing AI applications to navigate between URLs, fill out forms, click on elements, and execute custom JavaScript. These features are essential for developing versatile AI workflows that require interaction with web content.
puppeteer_navigate tool.puppeteer_screenshot tool, which is crucial for data collection and analysis.puppeteer_click and puppeteer_fill, allowing AI applications to simulate user interactions with web pages by clicking on specific elements or filling out input fields.puppeteer_evaluate tool, providing a powerful means for enhancing interaction and data extraction.The Puppeteer MCP Server implements the MCP protocol to facilitate communication between AI applications (clients) and data sources/tools. The protocol ensures secure and efficient interaction, with each client using commands like puppeteer_navigate and puppeteer_screenshot.
Install Required Packages
pip install -r requirements.txt
Install Playwright Browsers
playwright install
Run the Server
python puppeteer_server.py
puppeteer_navigate and puppeteer_screenshot tools to navigate through URLs and capture necessary screenshots. Store these images for further analysis.puppeteer_click and puppeteer_fill tools to simulate user interactions, ensuring accurate form filling and data entry.| MCP Client | Resources | Tools | Prompts | Status |
|---|---|---|---|---|
| Claude Desktop | ✅ | ✅ | ✅ | Full Support |
| Continue | ✅ | ✅ | ✅ | Full Support |
| Cursor | ❌ | ✅ | ❌ | Tools Only |
{
"mcpServers": {
"puppeteer": {
"command": "python",
"args": ["path/to/puppeteer.py"]
}
}
}
The Puppeteer MCP Server is designed to support multiple AI applications, ensuring seamless integration and robust performance. Below is a compatibility matrix highlighting the supported features:
| Feature | Claude Desktop | Continue | Cursor |
|---|---|---|---|
| Navigation | ✅ | ✅ | ✅ |
| Screenshot | ✅ | ✅ | ❌ |
| Form Interaction | ✅ | ✅ | ❌ |
| JavaScript | ✅ | ✅ | ❌ |
To configure the server, use environment variables for settings such as API keys or timeouts. An example configuration is provided below:
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
How does Puppeteer MCP Server ensure compatibility with different AI clients?
What are the supported configurations for viewport size and timeouts?
Can I track console logs generated by the server operations?
How do I handle errors during web navigation or element interactions?
Is the Puppeteer MCP Server suitable for enterprise-scale AI applications?
Contributions are welcome! Before submitting pull requests, please refer to the repository's contributing guidelines available under CONTRIBUTING.md. Contributions should follow established coding standards and be thoroughly tested.
For more information on the Model Context Protocol (MCP) and its applications, visit the official MCP documentation. Additionally, explore resources like the ModelContextProtocol GitHub repository for further integration examples and support.
By leveraging the Puppeteer MCP Server, developers can enhance AI application capabilities with powerful browser automation tools, ensuring seamless interaction between clients and web-based data sources.
This comprehensive documentation positions the Puppeteer MCP Server as a valuable tool in AI application development, emphasizing its robust features, compatibility, and integration capabilities within the broader MCP ecosystem.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration