Patchright Lite MCP Server

Integrations

  • Provides a containerized version of the Patchright MCP server, accessible through Docker Hub for easy deployment and integration with AI tools

  • Allows GitHub Copilot to leverage Patchright's stealth browser automation capabilities through VS Code, enabling undetected web scraping and interaction

Patchright Lite MCP サーバー

Patchright Node.js SDKをラップし、AIモデルにステルスブラウザ自動化機能を提供する、合理化されたモデルコンテキストプロトコル(MCP)サーバーです。この軽量サーバーは、よりシンプルなAIモデルを容易に利用できるよう、必須機能に特化しています。

Patchright とは何ですか?

Patchrightは、Playwrightテストおよび自動化フレームワークの検出されないバージョンです。Playwrightの代替として設計されていますが、アンチボットシステムによる検出を回避するための高度なステルス機能を備えています。Patchrightは、以下を含む様々な検出手法にパッチを適用します。

  • Runtime.enable リーク
  • Console.enable リーク
  • コマンドフラグの漏洩
  • 一般的な検出ポイント
  • クローズドシャドウルートインタラクション

この MCP サーバーは、Patchright の Node.js バージョンをラップし、シンプルで標準化されたプロトコルを通じて AI モデルでその機能を利用できるようにします。

特徴

  • シンプルなインターフェース: 4つの必須ツールのみでコア機能に焦点を合わせています
  • ステルス自動化: Patchrightのステルスモードを使用して検出を回避します
  • MCP 標準: AI 統合を容易にするモデル コンテキスト プロトコルを実装
  • Stdioトランスポート: シームレスな統合のために標準入出力を使用します

前提条件

  • Node.js 18歳以上
  • npmまたはyarn

インストール

  1. このリポジトリをクローンします:
    git clone https://github.com/yourusername/patchright-lite-mcp-server.git cd patchright-lite-mcp-server
  2. 依存関係をインストールします:
    npm install
  3. TypeScript コードをビルドします。
    npm run build

使用法

次のコマンドでサーバーを実行します。

npm start

これにより、stdio トランスポートを使用してサーバーが起動し、MCP をサポートする AI ツールと統合できるようになります。

AIモデルとの統合

クロードデスクトップ

claude-desktop-config.jsonファイルに以下を追加します。

{ "mcpServers": { "patchright": { "command": "node", "args": ["path/to/patchright-lite-mcp-server/dist/index.js"] } } }

GitHub Copilot を使用した VS Code

VS Code CLI を使用して MCP サーバーを追加します。

code --add-mcp '{"name":"patchright","command":"node","args":["path/to/patchright-lite-mcp-server/dist/index.js"]}'

利用可能なツール

サーバーは 4 つの必須ツールのみを提供します。

1. 閲覧

ブラウザを起動し、URL に移動してコンテンツを抽出します。

Tool: browse Parameters: { "url": "https://example.com", "headless": true, "waitFor": 1000 }

戻り値:

  • ページタイトル
  • 表示されるテキストのプレビュー
  • ブラウザID(後続の操作用)
  • ページID(後続の操作用)
  • スクリーンショットのパス

2. 交流する

ページ上で簡単な操作を実行します。

Tool: interact Parameters: { "browserId": "browser-id-from-browse", "pageId": "page-id-from-browse", "action": "click", // can be "click", "fill", or "select" "selector": "#submit-button", "value": "Hello World" // only needed for fill and select }

戻り値:

  • アクション結果
  • 現在のURL
  • スクリーンショットのパス

3. 抽出

現在のページから特定のコンテンツを抽出します。

Tool: extract Parameters: { "browserId": "browser-id-from-browse", "pageId": "page-id-from-browse", "type": "text" // can be "text", "html", or "screenshot" }

戻り値:

  • 要求されたタイプに基づいて抽出されたコンテンツ

4. 閉じる

ブラウザを閉じてリソースを解放します。

Tool: close Parameters: { "browserId": "browser-id-from-browse" }

使用フローの例

  1. ブラウザを起動してサイトに移動します。
    Tool: browse Parameters: { "url": "https://example.com/login", "headless": false }
  2. ログインフォームに記入してください:
    Tool: interact Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "action": "fill", "selector": "#username", "value": "user@example.com" }
  3. パスワードを入力してください:
    Tool: interact Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "action": "fill", "selector": "#password", "value": "password123" }
  4. ログインボタンをクリックします:
    Tool: interact Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "action": "click", "selector": "#login-button" }
  5. ログインを確認するためのテキストを抽出します:
    Tool: extract Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "type": "text" }
  6. ブラウザを閉じます:
    Tool: close Parameters: { "browserId": "browser-id-from-step-1" }

セキュリティに関する考慮事項

  • このサーバーは強力な自動化機能を提供します。責任を持って倫理的にご利用ください。
  • ウェブサイトの利用規約に違反するアクションの自動化は避けてください。
  • レート制限に留意し、リクエストでウェブサイトに過負荷をかけないようにしてください。

ライセンス

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

謝辞

  • Kaliiiiiiiiii-Vinyzu による Patchright-nodejs
  • modelcontextprotocol によるモデルコンテキストプロトコル

Dockerの使用

このサーバーは Docker を使用して実行できます。

docker run -it --rm dylangroos/patchright-mcp

ローカルでDockerイメージを構築する

Docker イメージをビルドします。

docker build -t patchright-mcp .

コンテナを実行します。

docker run -it --rm patchright-mcp

Dockerハブ

変更がメインブランチにマージされると、イメージは自動的にDocker Hubに公開されます。最新のイメージはdylangroos/patchright-mcpで入手できます。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

AI モデルが Patchright を使用してステルス ブラウザー自動化を実行できるようにし、重要な Web インタラクション機能を提供しながらアンチボット システムによる検出を回避できるようにする、合理化されたモデル コンテキスト プロトコル サーバーです。

  1. Patchright とは何ですか?
    1. 特徴
      1. 前提条件
        1. インストール
          1. 使用法
            1. AIモデルとの統合
              1. クロードデスクトップ
              2. GitHub Copilot を使用した VS Code
            2. 利用可能なツール
              1. 1. 閲覧
              2. 2. 交流する
              3. 3. 抽出
              4. 4. 閉じる
            3. 使用フローの例
              1. セキュリティに関する考慮事項
                1. ライセンス
                  1. 謝辞
                    1. Dockerの使用
                      1. ローカルでDockerイメージを構築する
                      2. Dockerハブ

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables Claude and other LLMs to make HTTP requests with realistic browser fingerprinting, bypassing common anti-bot measures and interacting with websites more naturally.
                      Last updated -
                      3
                      Python
                      MIT License
                      • Linux
                      • Apple
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A web browser automation server that allows AI assistants to control Chrome with persistent state management, enabling complex browsing tasks through asynchronous browser operations.
                      Last updated -
                      1
                      Python
                      • Apple
                    • -
                      security
                      A
                      license
                      -
                      quality
                      AI-driven browser automation server that implements the Model Context Protocol to enable natural language control of web browsers for tasks like navigation, form filling, and visual interaction.
                      Last updated -
                      1
                      Python
                      MIT License
                      • Apple
                    • -
                      security
                      -
                      license
                      -
                      quality
                      A Model Context Protocol server that enables AI assistants to control Chrome browsers through the Chrome DevTools Protocol, allowing for navigation, clicking, typing, and extracting page information.
                      Last updated -
                      3
                      TypeScript

                    View all related MCP servers

                    ID: drc72bkluy