Browser Automation MCP Server

by Raghu6798

Integrations

  • Uses .env files to securely store and access environment variables, particularly for API keys like the Mistral AI API key

  • Specialized scraping capabilities for GitHub repositories, focusing on extracting README content and code blocks

  • Searches Google and returns top search results for any query, allowing the agent to find relevant information across the web

🤖 ブラウザ自動化エージェント

MCP(モデル制御プログラム)をベースに構築された強力なブラウザ自動化ツール。ウェブスクレイピング機能とLLMベースのインテリジェンスを組み合わせます。このエージェントは、Google検索、ウェブページへのナビゲーション、GitHub、Stack Overflow、ドキュメントサイトなど、様々なウェブサイトからコンテンツをインテリジェントにスクレイピングできます。

🚀 機能

  • 🔍 Google 検索統合: あらゆるクエリに対する上位の検索結果を検索して取得します
  • 🕸️ インテリジェントな Web スクレイピング: さまざまな Web サイトの種類に合わせたスクレイピング戦略:
    • 📂 GitHubリポジトリ
    • 💬 Stack Overflow の質問と回答
    • 📚 ドキュメントページ
    • 🌐 一般的なウェブサイト
  • 🧠 AIを活用した処理:スクレイピングしたコンテンツの理解と処理にMistral AIを使用
  • 🥷 ステルスモード: ブラウザの指紋保護を実装し、検出を回避します
  • 💾 コンテンツ保存: スクレイピングしたページのスクリーンショットとテキストコンテンツの両方を自動的に保存します

🏗️ 建築

このプロジェクトでは、MCP を利用したクライアント サーバー アーキテクチャを使用します。

  • 🖥️ サーバー: ブラウザの自動化とWebスクレイピングタスクを処理します
  • 👤 クライアント: Mistral AI と LangGraph を使用して AI インターフェースを提供します
  • 📡 通信: クライアント・サーバー通信にstdioを使用する

⚙️ 要件

  • 🐍 Python 3.8 以上
  • 🎭 劇作家
  • 🧩 MCP(モデル制御プログラム)
  • 🔑 ミストラル AI API キー

📥 インストール

  1. リポジトリをクローンします。
git clone https://github.com/yourusername/browser-automation-agent.git cd browser-automation-agent
  1. 依存関係をインストールします:
pip install -r requirements.txt
  1. Playwright ブラウザをインストールします。
playwright install
  1. プロジェクト ルートに.envファイルを作成し、Mistral AI API キーを追加します。
MISTRAL_API_KEY=your_api_key_here

📋 使用方法

サーバーの実行

python main.py

クライアントの実行

python client.py

サンプルインタラクション

サーバーとクライアントの両方が実行されたら:

  1. プロンプトが表示されたらクエリを入力してください
  2. エージェントは次のことを行います。
    • 🔍 Googleで関連する結果を検索する
    • 🧭 上位の結果へ移動
    • 📊 ウェブサイトの種類に基づいてコンテンツをスクレイピングする
    • 📸 スクリーンショットとコンテンツをファイルに保存する
    • 📤 処理済みの情報を返す

🛠️ ツールの機能

get_top_google_url

🔍 Google で検索し、指定されたクエリの上位の結果 URL を返します。

browse_and_scrape

🌐 URL に移動し、Web サイトの種類に基づいてコンテンツをスクレイピングします。

scrape_github

📂 GitHub リポジトリから README コンテンツとコード ブロックを抽出することに特化しています。

scrape_stackoverflow

💬 Stack Overflow ページから質問、回答、コメント、コード ブロックを抽出します。

scrape_documentation

📚 ドキュメントコンテンツとコード例の抽出に最適化されています。

scrape_generic

🌐 一般的な Web サイトから段落テキストとコード ブロックを抽出します。

📁 ファイル構造

browser-automation-agent/ ├── main.py # MCP server implementation ├── client.py # Mistral AI client implementation ├── requirements.txt # Project dependencies ├── .env # Environment variables (API keys) └── README.md # Project documentation

📤 出力ファイル

エージェントは、タイムスタンプ付きの 2 種類の出力ファイルを生成します。

  • 📸 final_page_YYYYMMDD_HHMMSS.png : 最終ページ状態のスクリーンショット
  • 📄 scraped_content_YYYYMMDD_HHMMSS.txt : ページから抽出したテキストコンテンツ

⚙️ カスタマイズ

コード内の次のパラメータを変更できます。

  • 🖥️ ブラウザウィンドウのサイズ: browse_and_scrapewidthheight調整します
  • 👻 ヘッドレスモード: ブラウザ操作を非表示にするにはheadless=Trueを設定します
  • 🔢 Google検索結果の数: get_top_google_urlnum_resultsを変更する

❓ トラブルシューティング

  • 🔌 接続の問題: サーバーとクライアントが別々のターミナルで実行されていることを確認してください
  • 🎭 Playwright エラー: ブラウザにplaywright installされていることを確認してください
  • 🔑 APIキーエラー: Mistral APIキーが.envファイルに正しく設定されていることを確認してください
  • 🛣️ パスエラー: 必要に応じてclient.py内のmain.pyへのパスを更新してください

📜 ライセンス

MITライセンス

🤝 貢献する

貢献を歓迎します!お気軽にプルリクエストを送信してください。


🧩 MCP、🎭 Playwright、🧠 Mistral AI で構築

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Google を検索したり、Web ページに移動したり、GitHub、Stack Overflow、ドキュメント サイトなどのさまざまな Web サイトからコンテンツを抽出したりできるブラウザ自動化ツールを通じて、インテリジェントな Web スクレイピングを可能にします。

  1. 🚀 機能
    1. 🏗️ 建築
      1. ⚙️ 要件
        1. 📥 インストール
          1. 📋 使用方法
            1. サーバーの実行
            2. クライアントの実行
            3. サンプルインタラクション
          2. 🛠️ ツールの機能
            1. get_top_google_url
            2. browse_and_scrape
            3. scrape_github
            4. scrape_stackoverflow
            5. scrape_documentation
            6. scrape_generic
          3. 📁 ファイル構造
            1. 📤 出力ファイル
              1. ⚙️ カスタマイズ
                1. ❓ トラブルシューティング
                  1. 📜 ライセンス
                    1. 🤝 貢献する

                      Related MCP Servers

                      • A
                        security
                        A
                        license
                        A
                        quality
                        Enables web content scanning and analysis by fetching, analyzing, and extracting information from web pages using tools like page fetching, link extraction, site crawling, and more.
                        Last updated -
                        6
                        7
                        TypeScript
                        MIT License
                      • A
                        security
                        F
                        license
                        A
                        quality
                        Enables browser automation using Python scripts, offering operations like taking webpage screenshots, retrieving HTML content, and executing JavaScript.
                        Last updated -
                        4
                        18
                        Python
                        • Linux
                      • A
                        security
                        A
                        license
                        A
                        quality
                        A server that provides web scraping and intelligent content searching capabilities using the Firecrawl API, enabling AI agents to extract structured data from websites and perform content searches.
                        Last updated -
                        5
                        2
                        TypeScript
                        MIT License
                        • Apple
                        • Linux
                      • A
                        security
                        F
                        license
                        A
                        quality
                        A server that provides tools to scrape websites and extract structured data from them using Firecrawl's APIs, supporting both basic website scraping in multiple formats and custom schema-based data extraction.
                        Last updated -
                        2
                        JavaScript

                      View all related MCP servers

                      ID: zeo3zz0qtv