mcp-server-puppeteer-py

MCP.Pizza Chef: twolven

The mcp-server-puppeteer-py is a Python-based MCP server that leverages Playwright to provide robust browser automation capabilities. It allows large language models (LLMs) to interact with real web pages by navigating, executing JavaScript, taking screenshots, and interacting with page elements such as forms. This server offers improved error handling and detailed logging compared to its TypeScript counterpart, making it a stable and reliable choice for integrating browser automation into AI workflows. It supports configurable timeouts, console log monitoring, and comprehensive page interaction features, enabling advanced web automation tasks within the MCP ecosystem.

Unmaintained · No commits in 20 months.

Use This MCP server To

Automate web page navigation and interaction Capture full-page or element screenshots Execute JavaScript in real browser contexts Fill and submit web forms programmatically Monitor browser console logs for debugging Integrate browser automation into AI workflows Test web applications with real browser sessions

README

Puppeteer MCP Server (Python Implementation)

A Model Context Protocol server that provides browser automation capabilities using Playwright (Python's equivalent to Puppeteer). This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.

Overview

This Python implementation provides a stable alternative to the TypeScript version, offering the same capabilities with improved error handling and logging. It uses Playwright, which is the Python equivalent to Puppeteer, providing robust browser automation capabilities.

Key Features

  • Full browser automation
  • Page navigation
  • Screenshot capture (full page or elements)
  • Form interaction (clicking and filling)
  • JavaScript execution
  • Console log monitoring
  • Configurable timeouts
  • Detailed error handling
  • Comprehensive logging

Prerequisites

  • Python 3.8+
  • pip (Python package installer)

Installation

  1. Install the required packages:
pip install -r requirements.txt
  1. Install Playwright browsers:
playwright install

Usage

Starting the Server

Run the server directly:

python puppeteer_server.py

mcp-server-puppeteer-py FAQ

How do I install the mcp-server-puppeteer-py?
Install Python 3.8+, then run 'pip install -r requirements.txt' to install dependencies.
What browser automation library does this server use?
It uses Playwright, the Python equivalent of Puppeteer, for robust browser automation.
Can this server capture screenshots of web pages?
Yes, it supports capturing full-page or specific element screenshots.
Does it support executing JavaScript on web pages?
Yes, you can run arbitrary JavaScript in the browser context.
How does the server handle errors and logging?
It provides detailed error handling and comprehensive logging for easier debugging.
Is this server compatible with multiple LLM providers?
Yes, it works with OpenAI, Anthropic Claude, and Google Gemini models via MCP.
Can it interact with web forms?
Yes, it supports clicking, filling, and submitting forms on web pages.
What Python version is required?
Python 3.8 or higher is required to run this server.