You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Playwright browser automation in AWF agentic workflows currently uses the Playwright MCP server (mcr.microsoft.com/playwright/mcp) running in a separate Docker container with --network host. This creates persistent networking challenges:
Container-to-container routing: The agent container and Playwright container live on different networks, requiring host.docker.internal workarounds (see Playwright and local dev #2406, gh-aw#29825)
Bridge IP fragility: Previous approach used bridge IP detection (ip -4 route get 1.1.1.1) which was unreliable across AWF configurations
Extra container overhead: A full MCP server container for browser automation adds startup time, memory, and complexity
Token inefficiency: MCP's large tool schemas and verbose accessibility trees consume model context
Proposal: Use @playwright/cli Instead
Microsoft now offers Playwright CLI (@playwright/cli), a CLI+SKILLS-based interface specifically designed for coding agents.
Modern coding agents increasingly favor CLI-based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands.
Factor
MCP Container (current)
CLI (proposed)
Networking
❌ Separate container, needs host.docker.internal
✅ Runs in agent container, native localhost access
Token usage
❌ Large tool schemas + accessibility trees in context
✅ Concise CLI commands, minimal context usage
Startup time
❌ Pull + start separate container
✅ Already installed, instant
Complexity
❌ MCP gateway routing, container orchestration
✅ Simple CLI calls via bash tool
localhost access
❌ Requires routing hacks
✅ Direct access to services in same container
Maintenance
❌ Container image pinning, digest updates
✅ npm dependency version
When MCP Is Still Appropriate
Per Microsoft's guidance, MCP remains relevant for:
Exploratory automation requiring persistent state
Self-healing tests with iterative reasoning over page structure
Problem
Playwright browser automation in AWF agentic workflows currently uses the Playwright MCP server (
mcr.microsoft.com/playwright/mcp) running in a separate Docker container with--network host. This creates persistent networking challenges:host.docker.internalworkarounds (see Playwright and local dev #2406, gh-aw#29825)ip -4 route get 1.1.1.1) which was unreliable across AWF configurationsProposal: Use
@playwright/cliInsteadMicrosoft now offers Playwright CLI (
@playwright/cli), a CLI+SKILLS-based interface specifically designed for coding agents.How It Works
Why CLI is Better for AWF
From Microsoft's own documentation:
host.docker.internallocalhostaccessbashtoolWhen MCP Is Still Appropriate
Per Microsoft's guidance, MCP remains relevant for:
Most AWF smoke tests and doc testing workflows do not need these capabilities.
Implementation Plan
Phase 1: Proof of Concept
@playwright/cliin the AWF agent container image (or usenpx @playwright/cli@latest)playwright-cli install --skillsduring container setupPhase 2: Migrate Existing Workflows
docs-noob-tester.md— currently uses bridge IP /host.docker.internaldaily-multi-device-docs-tester.md— viewport testingvisual-regression-checker.md— screenshot comparisonunbloat-docs.md— doc page analysisPhase 3: AWF Integration
@playwright/clias optional pre-installed tool in agent containerplaywright_prompt.mdin gh-aw setup actionsplaywright-cliecosystem identifier for network allowlistmcr.microsoft.com/playwright/mcpcontainer approach for standard use casesQuestions to Resolve
@playwright/clibundle Chromium, or does it neednpx playwright install chromium?Related
host.docker.internalworkaround (closed)