Puppeteer MCP 服务器(Python 实现) logo

Puppeteer MCP 服务器(Python 实现)

Community
twolven

MCP server providing browser automation via Playwright (Python), enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser.

Publishertwolven
Repositorymcp-server-puppeteer-py
LanguagePython
Forks
8
Stars
18
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Puppeteer MCP 服务器(Python 实现) exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    18 stars and 8 forks from the linked repository.

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:
bash
pip install -r requirements.txt
  1. Install Playwright browsers:
bash
playwright install

Usage

Starting the Server

Run the server directly:

bash
python puppeteer_server.py

Claude Desktop Configuration

Add this to your Claude configuration file:

json
{
  "mcpServers": {
    "puppeteer": {
      "command": "python",
      "args": ["path/to/puppeteer.py"]
    }
  }
}

Available Tools

puppeteer_navigate

Navigate to any URL in the browser.

json
{
  "name": "puppeteer_navigate",
  "arguments": {
    "url": "https://example.com",
    "timeout": 60000  // optional, defaults to 60000ms
  }
}

puppeteer_screenshot

Capture screenshots of the entire page or specific elements.

json
{
  "name": "puppeteer_screenshot",
  "arguments": {
    "name": "my_screenshot",
    "selector": "#specific-element",  // optional
    "width": 1280,  // optional, default: 1280
    "height": 720,  // optional, default: 720
    "timeout": 30000  // optional, defaults to 30000ms
  }
}

puppeteer_click

Click elements on the page.

json
{
  "name": "puppeteer_click",
  "arguments": {
    "selector": ".button-class",
    "timeout": 30000  // optional, defaults to 30000ms
  }
}

puppeteer_fill

Fill out input fields.

json
{
  "name": "puppeteer_fill",
  "arguments": {
    "selector": "#input-id",
    "value": "text to fill",
    "timeout": 30000  // optional, defaults to 30000ms
  }
}

puppeteer_evaluate

Execute JavaScript in the browser console.

json
{
  "name": "puppeteer_evaluate",
  "arguments": {
    "script": "document.title",
    "timeout": 30000  // optional, defaults to 30000ms
  }
}

Error Handling

The server provides detailed error messages for common scenarios:

  • Navigation failures
  • Element not found
  • Timeout errors
  • JavaScript execution errors
  • Screenshot failures

Logging

Comprehensive logging is implemented with different levels:

  • INFO: Standard operations
  • ERROR: Operation failures
  • DEBUG: Detailed execution information

Notes

  • Browser launches in non-headless mode for better debugging
  • Default viewport size is 1280x720
  • All timeouts are configurable
  • Console logs are captured and stored
  • Screenshots are stored in memory with base64 encoding

Contributing

Contributions are welcome! Please read the repository's contributing guidelines before submitting pull requests.

Author

Todd Wolven - Lead AI Software Developer and open-source GenAI engineer

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Installation

TypingMind
{
  "mcpServers": {
    "mcp-server-puppeteer-py": {
      "command": "python",
      "args": [
        "path/to/puppeteer.py"
      ]
    }
  }
}

Use Puppeteer MCP 服务器(Python 实现) MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Puppeteer MCP 服务器(Python 实现) is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Puppeteer MCP 服务器(Python 实现) as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Puppeteer MCP 服务器(Python 实现) MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-server-puppeteer-py": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Puppeteer MCP 服务器(Python 实现) MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Puppeteer MCP 服务器(Python 实现) MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Puppeteer MCP 服务器(Python 实现) to help me with this task?
Puppeteer MCP 服务器(Python 实现)
Sure. I read it.
Here is what I found using Puppeteer MCP 服务器(Python 实现).

Frequently asked questions

What is the Puppeteer MCP 服务器(Python 实现) MCP server used for?

Puppeteer MCP 服务器(Python 实现) is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Puppeteer MCP 服务器(Python 实现) MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Puppeteer MCP 服务器(Python 实现) with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Puppeteer MCP 服务器(Python 实现) MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Puppeteer MCP 服务器(Python 实现) connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Puppeteer MCP 服务器(Python 实现) MCP to TypingMind?

Puppeteer MCP 服务器(Python 实现) runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Puppeteer MCP 服务器(Python 实现) MCP provide in TypingMind?

Puppeteer MCP 服务器(Python 实现) exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Puppeteer MCP 服务器(Python 实现) MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Puppeteer MCP 服务器(Python 实现) requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇