Skip to main content
Glama

MCP Operator

by willer

MCPブラウザオペレーター

ブラウザ自動化用のモデル制御プロトコル (MCP) サーバー。これにより、LLM は Web ブラウザを制御し、Web ページと対話し、標準化された JSON-RPC インターフェイスを通じて Web コンテンツを分析できるようになります。

特徴

  • ブラウザ管理: ブラウザインスタンスの作成、ナビゲート、操作、および終了
  • ジョブ管理: ジョブIDでブラウザ操作のステータスを追跡
  • Webインタラクション: OpenAIのComputer Use APIを使用して自然言語の指示を実行する
  • ブラウザツール: コンソールログ、ネットワークアクティビティ、スクリーンショットなどにアクセスします
  • 監査: アクセシビリティ、パフォーマンス、SEO、その他のウェブページの監査を実行します

要件

  • Python 3.11以上
  • 劇作家
  • OpenAI API キー(コンピュータ使用 API 用)

インストール

  1. このリポジトリをクローンします:
    git clone https://github.com/yourusername/operator-mcp.git cd operator-mcp
  2. 依存関係をインストールします:
    pip install -e .
  3. Playwright ブラウザをインストールします。
    playwright install chromium
  4. OpenAI API キーを設定します。
    export OPENAI_API_KEY=your-api-key

使用法

MCP サーバーを起動します。

./run-server

サーバーは、MCP プロトコルに従って、stdin で JSON-RPC 要求をリッスンし、stdout で応答します。

実行可能スクリプト

  • run-server - MCP サーバー (メイン エントリ ポイント) を実行します。
    # Run the MCP server ./run-server # Run with specific log directory ./run-server --log-dir /path/to/logs # Run in debug mode ./run-server --debug
  • run-tests - すべてのテストを実行します(ユニットまたは統合のみのオプション付き)
    # Run all tests ./run-tests # Run only unit tests (faster) ./run-tests --unit-only # Run only integration tests ./run-tests --integration-only # Run with verbose output ./run-tests --verbose # Run a specific test ./run-tests --test TestBrowserOperatorMethods
  • run-test-harness - インタラクティブなテストのためにMCP Inspectorを使用してサーバーを実行します
    # Run with the MCP Inspector for interactive testing ./run-test-harness

コアメソッド

ブラウザ管理
  • ブラウザの作成: 新しいブラウザインスタンスを初期化する
    { "jsonrpc": "2.0", "id": 1, "method": "mcp__browser-operator__create-browser", "params": { "project_name": "my-project" } }
  • ブラウザをナビゲート: ブラウザを指定された URL に誘導します
    { "jsonrpc": "2.0", "id": 2, "method": "mcp__browser-operator__navigate-browser", "params": { "project_name": "my-project", "url": "https://example.com" } }
  • ブラウザの操作: ブラウザとの対話のための自然言語指示を実行する
    { "jsonrpc": "2.0", "id": 3, "method": "mcp__browser-operator__operate-browser", "params": { "project_name": "my-project", "instruction": "Find the heading on this page and tell me what it says." } }
  • ブラウザを閉じる: ブラウザインスタンスを終了します
    { "jsonrpc": "2.0", "id": 4, "method": "mcp__browser-operator__close-browser", "params": { "project_name": "my-project" } }
ジョブ管理
  • ジョブステータスの取得: ジョブIDで操作のステータスと結果を取得します。
    { "jsonrpc": "2.0", "id": 5, "method": "mcp__browser-operator__get-job-status", "params": { "job_id": "job-12345" } }
  • ジョブ一覧: 最近のブラウザ操作ジョブを表示する
    { "jsonrpc": "2.0", "id": 6, "method": "mcp__browser-operator__list-jobs", "params": { "limit": 10 } }
ユーザーノート
  • メモを追加: ブラウザ操作に関するメモを作成して保存します
    { "jsonrpc": "2.0", "id": 7, "method": "mcp__browser-operator__add-note", "params": { "name": "My Note", "content": "Important information about this browser session" } }

追加の方法

ブラウザデバッグツール
  • コンソールログを取得する: mcp__browser-tools__getConsoleLogs
  • コンソールエラーを取得する: mcp__browser-tools__getConsoleErrors
  • ネットワークログを取得する: mcp__browser-tools__getNetworkLogs
  • ネットワークエラーを取得する: mcp__browser-tools__getNetworkErrors
  • スクリーンショットを撮る: mcp__browser-tools__takeScreenshot
  • 選択した要素を取得する: mcp__browser-tools__getSelectedElement
  • ログの消去: mcp__browser-tools__wipeLogs
監査ツール
  • アクセシビリティ監査を実行: mcp__browser-tools__runAccessibilityAudit
  • パフォーマンス監査を実行: mcp__browser-tools__runPerformanceAudit
  • SEO 監査を実行: mcp__browser-tools__runSEOAudit
  • NextJS 監査を実行: mcp__browser-tools__runNextJSAudit
  • ベストプラクティス監査を実行する: mcp__browser-tools__runBestPracticesAudit
  • デバッガーモードを実行: mcp__browser-tools__runDebuggerMode
  • 監査モードの実行: mcp__browser-tools__runAuditMode

非同期ワークフローパターン

ブラウザ操作は非同期であり、ジョブベースのアプローチを使用します。

  1. 開始操作: job_idを返すブラウザメソッドを呼び出す
  2. 完了のポーリング: ジョブが完了するまで get-job-status を使用します
  3. プロセス結果: ジョブが完了すると���ジョブステータスから結果にアクセスします。

このアプローチにより、クライアントのタイムアウトを防ぎながら、複雑なブラウザ操作を完了することができます。

永続的なブラウザ状態

MCP オペレーターは、プロジェクト名でブラウザーが作成されるときに永続的な状態を維持します。

  • ブラウザの状態(Cookie、ローカルストレージ、セッションストレージ)はセッション間で保存されます
  • 複数のプロジェクトが独立したブラウザ状態を維持できる
  • ログインセッション、ショッピングカート、その他のパーソナライズされた状態を維持するのに役立ちます

プロジェクト構造

  • src/mcp_operator/ : メインパッケージ
    • __init__.py : パッケージの初期化
    • __main__.py : パッケージのエントリポイント
    • server.py : MCP サーバーの実装
    • browser.py : ブラウザ演算子の実装
    • cua/ : コンピュータ使用APIコンポーネント
      • agent.py : エージェントの実装
      • computer.py : コンピュータインターフェース
      • utils.py : ユーティリティ関数
  • run-server : MCP サーバーを実行するスクリプト
  • run-tests : ユニットテストと統合テストを実行するスクリプト
  • run-test-harness : MCP Inspectorで実行するスクリプト

発達

MCPインスペクターの使用

デバッグには、 MCP Inspectorを使用します。

# Use the included run-test-harness script ./run-test-harness # Or directly: npx @modelcontextprotocol/inspector ./run-server

これにより、MCP サーバーをテストするための Web インターフェイスが提供されます。

安全

  • 潜在的に有害なサイトのドメインブロック
  • ナビゲーション前のURL検証
  • 異なるブラウザインスタンス間のセッション分離
  • ファイルベースのログ記録(MCP プロトコルを維持するために stdout はありません)
-
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.

AI アシスタントが永続的な状態管理を使用して Chrome を制御できるようにし、非同期のブラウザ操作を通じて複雑なブラウジング タスクを可能にする Web ブラウザ自動化サーバーです。

  1. 特徴
    1. 要件
      1. インストール
        1. 使用法
          1. 実行可能スクリプト
          2. コアメソッド
          3. 追加の方法
        2. 非同期ワークフローパターン
          1. 永続的なブラウザ状態
            1. プロジェクト構造
              1. 発達
                1. MCPインスペクターの使用
              2. 安全

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  Enables AI agents to control web browsers via a standardized interface for operations like launching, interacting with, and closing browsers.
                  Last updated -
                  0
                  JavaScript
                • -
                  security
                  A
                  license
                  -
                  quality
                  A browser monitoring and interaction tool that enables AI applications to capture and analyze browser data through a Chrome extension, supporting functions like console monitoring, screenshots, DOM analysis, and website auditing.
                  Last updated -
                  1
                  JavaScript
                  MIT License
                • -
                  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

                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/willer/mcp-operator'

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