Skip to main content
Glama
Building a Browser Harness MCP for AI Agents

Building a Browser Harness MCP for AI Agents

by jiin-kim109

AIエージェント向けブラウザハーネス/MCPの構築

Playwright、MCP、GitHub Copilot SDKで構築されたブラウザハーネスです。

セットアップ

npm install
npx playwright install chromium

Azure OpenAIの環境変数を設定します:

export AZURE_OPENAI_ENDPOINT="https://..."
export AZURE_OPENAI_API_KEY="..."
export AZURE_OPENAI_API_VERSION="2025-04-01-preview"
export AZURE_OPENAI_DEPLOYMENT="gpt-5.4"

デフォルトでは、ハーネスはPlaywright Chromiumを起動します。代わりにChromeに接続するには、専用プロファイルで起動し、CDPエンドポイントをエクスポートします:

google-chrome \
  --remote-debugging-port=9222 \
  --user-data-dir="$PWD/.agent-browser" \
  --no-first-run

export BROWSER_CDP_URL="http://127.0.0.1:9222"

Related MCP server: playwright-browser

実行

npm start -- "Open example.com and print the page title."

ライブタスクを実行します:

npm run eval
npm run eval -- --task amazon

コード実行ランタイムはセキュリティ境界ではありません。信頼できない入力でこのパターンを使用する前に、生成されたコードを分離されたプロセスまたはVMで実行してください。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers