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

Building a Browser Harness MCP for AI Agents

by jiin-kim109

Construcción de un arnés de navegador/MCP para agentes de IA

Un arnés de navegador construido con Playwright, MCP y el SDK de GitHub Copilot.

Configuración

npm install
npx playwright install chromium

Establece las variables de entorno de 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"

Por defecto, el arnés inicia Playwright Chromium. Para conectar con Chrome en su lugar, inícialo con un perfil dedicado y exporta su endpoint 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

Ejecución

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

Ejecuta las tareas en directo:

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

El entorno de ejecución de código no es un límite de seguridad. Ejecuta el código generado en un proceso aislado o en una VM antes de usar este patrón con entrada no fiable.

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