Enable TEA MCP Enhancements
Enable TEA MCP Enhancements
Section titled âEnable TEA MCP EnhancementsâConfigure Model Context Protocol (MCP) servers to enable live browser verification, exploratory mode, and recording mode in TEA workflows.
What are MCP Enhancements?
Section titled âWhat are MCP Enhancements?âMCP (Model Context Protocol) servers enable AI agents to interact with live browsers during test generation. This allows TEA to:
- Explore UIs interactively - Discover actual functionality through browser automation
- Verify selectors - Generate accurate locators from real DOM
- Validate behavior - Confirm test scenarios against live applications
- Debug visually - Use trace viewer and screenshots during generation
When to Use This
Section titled âWhen to Use ThisâFor UI Testing:
- Want exploratory mode in
test-design(browser-based UI discovery) - Want recording mode in
atddorautomate(verify selectors with live browser) - Want healing mode in
automate(fix tests with visual debugging) - Need accurate selectors from actual DOM
- Debugging complex UI interactions
For API Testing:
- Want healing mode in
automate(analyze failures with trace data) - Need to debug test failures (network responses, request/response data, timing)
- Want to inspect trace files (network traffic, errors, race conditions)
For Both:
- Visual debugging (trace viewer shows network + UI)
- Test failure analysis (MCP can run tests and extract errors)
- Understanding complex test failures (network + DOM together)
Donât use if:
- You donât have MCP servers configured
Prerequisites
Section titled âPrerequisitesâ- BMad Method installed
- TEA agent available
- IDE with MCP support (Cursor, VS Code with Claude extension)
- Node.js v18 or later
- Playwright installed
Available MCP Servers
Section titled âAvailable MCP ServersâTwo Playwright MCP servers (actively maintained, continuously updated):
1. Playwright MCP - Browser Automation
Section titled â1. Playwright MCP - Browser AutomationâCommand: npx @playwright/mcp@latest
Capabilities:
- Navigate to URLs
- Click elements
- Fill forms
- Take screenshots
- Extract DOM information
Best for: Exploratory mode, recording mode
2. Playwright Test MCP - Test Runner
Section titled â2. Playwright Test MCP - Test RunnerâCommand: npx playwright run-test-mcp-server
Capabilities:
- Run test files
- Analyze failures
- Extract error messages
- Show trace files
Best for: Healing mode, debugging
Recommended: Configure Both
Section titled âRecommended: Configure BothâBoth servers work together to provide full TEA MCP capabilities.
1. Configure MCP Servers
Section titled â1. Configure MCP ServersâAdd to your IDEâs MCP configuration:
{ "mcpServers": { "playwright": { "command": "npx", "args": ["@playwright/mcp@latest"] }, "playwright-test": { "command": "npx", "args": ["playwright", "run-test-mcp-server"] } }}See TEA Overview for IDE-specific config locations.
2. Enable in BMAD
Section titled â2. Enable in BMADâAnswer âYesâ when prompted during installation, or set in config:
tea_use_mcp_enhancements: true3. Verify MCPs Running
Section titled â3. Verify MCPs RunningâEnsure your MCP servers are running in your IDE.
How MCP Enhances TEA Workflows
Section titled âHow MCP Enhances TEA Workflowsâtest-design: Exploratory Mode
Section titled âtest-design: Exploratory ModeâWithout MCP:
- TEA infers UI functionality from documentation
- Relies on your description of features
- May miss actual UI behavior
With MCP: TEA can open live browser to:
"Let me explore the profile page to understand the UI"
[TEA navigates to /profile][Takes screenshot][Extracts accessible elements]
"I see the profile has:- Name field (editable)- Email field (editable)- Avatar upload button- Save button- Cancel button
I'll design tests for these interactions."Benefits:
- Accurate test design based on actual UI
- Discovers functionality you might not describe
- Validates test scenarios are possible
atdd: Recording Mode
Section titled âatdd: Recording ModeâWithout MCP:
- TEA generates selectors from best practices
- TEA infers API patterns from documentation
With MCP (Recording Mode):
For UI Tests:
[TEA navigates to /login with live browser][Inspects actual form fields]
"I see:- Email input has label 'Email Address' (not 'Email')- Password input has label 'Your Password'- Submit button has text 'Sign In' (not 'Login')
I'll use these exact selectors."For API Tests:
[TEA analyzes trace files from test runs][Inspects network requests/responses]
"I see the API returns:- POST /api/login â 200 with { token, userId }- Response time: 150ms- Required headers: Content-Type, Authorization
I'll validate these in tests."Benefits:
- UI: Accurate selectors from real DOM
- API: Validated request/response patterns from trace
- Both: Tests work on first run
automate: Healing + Recording Modes
Section titled âautomate: Healing + Recording ModesâWithout MCP:
- TEA analyzes test code only
- Suggests fixes based on static analysis
- Generates tests from documentation/code
With MCP:
Healing Mode (UI + API):
[TEA opens trace file][Analyzes screenshots + network tab]
UI failures: "Button selector changed from 'Save' to 'Save Changes'"API failures: "Response structure changed, expected {id} got {userId}"
[TEA makes fixes][Verifies with trace analysis]Recording Mode (UI + API):
UI: [Inspects actual DOM, generates verified selectors]API: [Analyzes network traffic, validates request/response patterns]
[Generates tests with verified patterns][Tests work on first run]Benefits:
- Visual debugging + trace analysis (not just UI)
- Verified selectors (UI) + network patterns (API)
- Tests verified against actual application behavior
Usage Examples
Section titled âUsage ExamplesâExploratory Mode Example
Section titled âExploratory Mode ExampleâUser: Run test-design
TEA: What feature are you designing tests for?
User: The checkout flow at https://shop.example.com
TEA: [With MCP] Let me explore the checkout flow[Opens browser][Navigates to checkout][Takes screenshots][Identifies all interactive elements]
TEA: I've explored the checkout flow. I found:- 4-step wizard (Cart â Shipping â Payment â Confirm)- Shipping options (Standard, Express, Overnight)- Payment methods (Credit Card, PayPal)- Promo code field- Order summary with real-time totals
Test design will cover all these scenarios.Recording Mode Example
Section titled âRecording Mode ExampleâUser: Run atdd for user registration feature
TEA: [With MCP] Let me verify the registration form selectors[Opens browser at /register][Inspects form]
TEA: I see the actual form has:- "Full Name" label (not "Name")- "Email Address" label (not "Email")- "Create Password" label (not "Password")- "I agree to Terms" checkbox- "Create Account" button (not "Register")
Generating tests with verified selectors...Healing Mode Example
Section titled âHealing Mode ExampleâUser: Run automate with healing mode
TEA: [With MCP] Running tests and checking for failures[Runs test suite][Test fails: selector not found]
TEA: Test failed on selector '.submit-btn'[Opens trace viewer][Sees button class changed to '.submit-button']
Fixing selector and verifying...[Updates test][Re-runs with MCP][Test passes]
Updated test with corrected selector.Troubleshooting
Section titled âTroubleshootingâMCP Servers Not Running
Section titled âMCP Servers Not RunningâProblem: TEA says MCP enhancements arenât available.
Causes:
- MCP servers not configured in IDE
- Config syntax error in JSON
- IDE not restarted after config
Solution:
# Verify MCP config file existsls ~/.cursor/config.json
# Validate JSON syntaxcat ~/.cursor/config.json | python -m json.tool
# Restart IDE# Cmd+Q (quit) then reopenBrowser Doesnât Open
Section titled âBrowser Doesnât OpenâProblem: MCP enabled but browser never opens.
Causes:
- Playwright browsers not installed
- Headless mode enabled
- MCP server crashed
Solution:
# Install browsersnpx playwright install
# Check MCP server logs (in IDE)# Look for error messages
# Try manual MCP servernpx @playwright/mcp@latest# Should start without errorsTEA Doesnât Use MCP
Section titled âTEA Doesnât Use MCPâProblem: tea_use_mcp_enhancements: true but TEA doesnât use browser.
Causes:
- Config not saved
- Workflow run before config update
- MCP servers not running
Solution:
# Verify configgrep tea_use_mcp_enhancements _bmad/bmm/config.yaml# Should show: tea_use_mcp_enhancements: true
# Restart IDE (reload MCP servers)
# Start fresh chat (TEA loads config at start)Selector Verification Fails
Section titled âSelector Verification FailsâProblem: MCP canât find elements TEA is looking for.
Causes:
- Page not fully loaded
- Element behind modal/overlay
- Element requires authentication
Solution: TEA will handle this automatically:
- Wait for page load
- Dismiss modals if present
- Handle auth if needed
If persistent, provide TEA more context:
"The element is behind a modal - dismiss the modal first""The page requires login - use credentials X"MCP Slows Down Workflows
Section titled âMCP Slows Down WorkflowsâProblem: Workflows take much longer with MCP enabled.
Cause: Browser automation adds overhead.
Solution: Use MCP selectively:
- Enable for: Complex UIs, new projects, debugging
- Disable for: Simple features, well-known patterns, API-only testing
Toggle quickly:
# For this feature (complex UI)tea_use_mcp_enhancements: true
# For next feature (simple API)tea_use_mcp_enhancements: falseRelated Guides
Section titled âRelated GuidesâGetting Started:
- TEA Lite Quickstart Tutorial - Learn TEA basics first
Workflow Guides (MCP-Enhanced):
- How to Run Test Design - Exploratory mode with browser
- How to Run ATDD - Recording mode for accurate selectors
- How to Run Automate - Healing mode for debugging
Other Customization:
- Integrate Playwright Utils - Production-ready utilities
Understanding the Concepts
Section titled âUnderstanding the Conceptsâ- TEA Overview - MCP enhancements in lifecycle
- Engagement Models - When to use MCP enhancements
Reference
Section titled âReferenceâ- TEA Configuration - tea_use_mcp_enhancements option
- TEA Command Reference - MCP-enhanced workflows
- Glossary - MCP Enhancements term
Generated with BMad Method - TEA (Test Architect)