Skip to main content
Glama
twolven

Puppeteer MCP Server

by twolven

Puppeteer MCP サーバー (Python 実装)

Playwright(Python版Puppeteer)を用いたブラウザ自動化機能を提供するモデルコンテキストプロトコル(LLM)サーバー。このサーバーにより、LLMはWebページとのインタラクション、スクリーンショットの取得、そして実際のブラウザ環境でのJavaScript実行が可能になります。

概要

このPython実装は、TypeScript版の安定した代替手段であり、エラー処理とログ出力が改善された上でTypeScript版と同等の機能を提供します。PuppeteerのPython版であるPlaywrightを使用し、堅牢なブラウザ自動化機能を提供します。

Related MCP server: Puppeteer MCP Server

主な特徴

  • 完全なブラウザ自動化

  • ページナビゲーション

  • スクリーンショットキャプチャ(ページ全体または要素)

  • フォームインタラクション(クリックと入力)

  • JavaScript実行

  • コンソールログ監視

  • 設定可能なタイムアウト

  • 詳細なエラー処理

  • 包括的なログ記録

前提条件

  • Python 3.8以上

  • pip (Python パッケージインストーラー)

インストール

  1. 必要なパッケージをインストールします。

pip install -r requirements.txt
  1. Playwright ブラウザをインストールします。

playwright install

使用法

サーバーの起動

サーバーを直接実行します。

python puppeteer_server.py

クロードデスクトップ構成

Claude 構成ファイルに以下を追加します。

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

利用可能なツール

操り人形師ナビゲート

ブラウザで任意の URL に移動します。

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

操り人形師のスクリーンショット

ページ全体または特定の要素のスクリーンショットをキャプチャします。

{
  "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
  }
}

操り人形師クリック

ページ上の要素をクリックします。

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

操り人形師の塗りつぶし

入力フィールドに入力します。

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

操り人形師の評価

ブラウザコンソールで JavaScript を実行します。

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

エラー処理

サーバーは、一般的なシナリオに対して詳細なエラー メッセージを提供します。

  • ナビゲーションの失敗

  • 要素が見つかりません

  • タイムアウトエラー

  • JavaScript実行エラー

  • スクリーンショットの失敗

ログ記録

包括的なログ記録はさまざまなレベルで実装されています。

  • 情報: 標準操作

  • エラー: 操作失敗

  • DEBUG: 詳細な実行情報

注記

  • デバッグを向上させるために、ブラウザは非ヘッドレスモードで起動します

  • デフォルトのビューポートサイズは1280x720です

  • すべてのタイムアウトは設定可能

  • コンソールログがキャプチャされ保存されます

  • スクリーンショットはbase64エンコードでメモリに保存されます

貢献

貢献を歓迎します。プルリクエストを送信する前に、リポジトリの貢献ガイドラインをお読みください。

ライセンス

このプロジェクトは、Apache 2.0 ライセンスに基づいてライセンスされています。詳細については、LICENSE ファイルを参照してください。

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
    32
    19,640
    5,633
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides browser automation capabilities using Puppeteer, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
    7
    23,406
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, generate test code, scrape web content, and execute JavaScript in real browser environments.
    31
    19,640
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with web pages through browser automation, supporting web scraping, form filling, navigation, and other browser-based tasks using Playwright.
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…

  • A Model Context Protocol server for Wix AI tools

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/twolven/mcp-server-puppeteer-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server