Skip to content
🤖 Consolidated, AI-optimized BMAD docs: llms-full.txt. Fetch this plain text file for complete context.
🚀 Build your own BMad modules and share them with the community! Get started or submit to the marketplace.

Configure Browser Automation

TEA can interact with live browsers during test generation: verify selectors, explore UIs, capture evidence, and debug failures. Two tools do this, and auto mode combines them.

TEA’s browser automation is controlled by tea_browser_automation in _bmad/tea/config.yaml:

tea_browser_automation: 'auto' # auto | cli | mcp | none
ModeBehavior
autoTEA picks the right tool per action: CLI for quick lookups, MCP for complex flows. Falls back gracefully if only one tool is installed. (Recommended)
cliCLI only. MCP ignored even if configured.
mcpMCP only. CLI ignored even if installed. Same as the old tea_use_mcp_enhancements: true.
noneNo browser interaction. TEA generates from docs and code analysis only.
Terminal window
npm install -g @playwright/cli@latest # Install globally (Node.js 18+)
playwright-cli install --skills # Register as an agent skill

The global npm install is one-time. The skills install (playwright-cli install --skills) should be run from your project root; it registers skills in your active tool’s project skills directory (for example, Claude Code uses .claude/skills/ and Codex uses .agents/skills/). Agents without skills support can still use the CLI directly via playwright-cli --help.

Add these MCP server entries to your tool’s configuration file:

{
"mcpServers": {
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
},
"playwright-test": {
"type": "stdio",
"command": "npx",
"args": ["playwright", "run-test-mcp-server"]
},
"smartbear": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@smartbear/mcp@latest"],
"env": {
"PACT_BROKER_BASE_URL": "https://{tenant}.pactflow.io",
"PACT_BROKER_TOKEN": "<your-api-token>"
}
}
}
}

The smartbear server is optional. Add it only if you use the Pact MCP integration for contract testing workflows. See the pact-mcp knowledge fragment for details.

ToolConfig FileFormat
Claude Code~/.claude.jsonJSON (mcpServers)
Codex~/.codex/config.tomlTOML ([mcp_servers])
Gemini CLI~/.gemini/settings.jsonJSON (mcpServers)
Cursor~/.cursor/mcp.jsonJSON (mcpServers)
Windsurf~/.codeium/windsurf/mcp_config.jsonJSON (mcpServers)
VS Code (Copilot).vscode/mcp.jsonJSON (servers)

Claude Code tip: Prefer the claude mcp add CLI over manual JSON editing; it sets the correct type field and validates the config. Use -s user for global (all projects) or omit for per-project (default).

Claude Code and Codex support adding MCP servers from the command line:

Terminal window
# Claude Code: Playwright (use -s user for global, omit for per-project)
claude mcp add -s user --transport stdio playwright -- npx -y @playwright/mcp@latest
claude mcp add -s user --transport stdio playwright-test -- npx playwright run-test-mcp-server
# Claude Code: SmartBear (Pact). Use add-json for servers with env vars
claude mcp add-json -s user smartbear \
'{"type":"stdio","command":"npx","args":["-y","@smartbear/mcp@latest"],"env":{"PACT_BROKER_BASE_URL":"https://{tenant}.pactflow.io","PACT_BROKER_TOKEN":"<your-token>"}}'
# Codex: Playwright
codex mcp add playwright -- npx -y @playwright/mcp@latest
codex mcp add playwright-test -- npx playwright run-test-mcp-server
# Codex: SmartBear (Pact)
codex mcp add smartbear -- npx -y @smartbear/mcp@latest

Codex uses TOML instead of JSON. If editing the config file manually:

[mcp_servers.playwright]
command = "npx"
args = ["-y", "@playwright/mcp@latest"]
[mcp_servers.playwright-test]
command = "npx"
args = ["playwright", "run-test-mcp-server"]
[mcp_servers.smartbear]
command = "npx"
args = ["-y", "@smartbear/mcp@latest"]
[mcp_servers.smartbear.env]
PACT_BROKER_BASE_URL = "https://{tenant}.pactflow.io"
PACT_BROKER_TOKEN = "<your-api-token>"

Note the key is mcp_servers (underscored), not mcpServers.

An explicit request in your prompt wins (“use the CLI to explore this page”). Otherwise TEA takes the CLI for stateless work (snapshots, locator verification, evidence capture) and MCP for stateful flows (multi-tab, file uploads, repeated edits, self-healing). If only one tool is installed it uses that one; with neither it behaves as none.

Full selection rules: TEA Overview: Browser Automation.

WorkflowDefault Tool (auto)Use Case
test-designCLIPage discovery, snapshots (stateless)
atddCLI + MCPCLI for baseline capture, MCP for complex interactions
automateCLI + MCPCLI for selector verification, MCP for healing
test-reviewCLITraces, screenshots, network (stateless evidence)
nfr-assessCLINetwork monitoring, timing (stateless)

Even in auto mode, you can override per-request:

"Use the CLI to snapshot the login page"
"Open MCP browser and walk through the checkout wizard"

TEA will honor your explicit request.

The old boolean flag tea_use_mcp_enhancements has been replaced:

Old SettingNew Equivalent
tea_use_mcp_enhancements: truetea_browser_automation: "auto"
tea_use_mcp_enhancements: falsetea_browser_automation: "none"

The BMAD installer will auto-migrate existing configs.

Terminal window
# Verify CLI is installed
playwright-cli --version
# Install if missing
npm install -g @playwright/cli@latest
# Install skills
playwright-cli install --skills
  1. Check MCP servers are configured in your IDE
  2. Restart your IDE after configuration changes
  3. Verify: npx @playwright/mcp@latest --version

Auto mode logs its decisions:

  • “Using CLI for snapshot (stateless discovery)”
  • “Using MCP for multi-step recording (stateful flow)”

Check the workflow output for these messages.

If you see orphaned browser processes:

Terminal window
# List active sessions
playwright-cli list
# Close a specific session
playwright-cli -s=tea-explore close
# Emergency cleanup (kills ALL sessions -- use only manually)
playwright-cli close-all