BrowserStack MCP Server: Test Management & Debugging
Manage and debug tests with the MCP server: run manual or automated cases, fix code, and collaborate via Cursor, Claude, or any MCP client using plain English
npx -y @browserstack/mcp-serverOverview
BrowserStack MCP Server is a local server that exposes BrowserStack testing capabilities through the Model Context Protocol (MCP). It lets developers and AI tools (IDEs, LLMs, or agentic workflows) run and manage manual and automated tests, debug failures, and apply fixes — using plain-English prompts from any MCP-capable client. The server reduces context switching by keeping project context, logs, and testing actions accessible in one place and enabling interactions directly from tools like VS Code, Cursor, or Claude.
Use cases include launching real-device sessions, running cross‑browser automated suites (Playwright, Selenium, etc.), performing local accessibility scans, and triaging failures with AI-driven observability. The MCP server acts as a bridge between your development environment and BrowserStack’s cloud infrastructure so teams can iterate faster and collaborate around test lifecycle events.
Features
- Run manual web and mobile tests on real browsers and devices in BrowserStack’s cloud.
- Execute automated test suites (Playwright, Selenium, Jest, etc.) on BrowserStack infrastructure.
- Localhost testing: access and test sites running on your machine without deploying.
- Accessibility (a11y) scans with AI-suggested fixes and guidance to meet WCAG/ADA standards.
- Natural language interaction: manage tests, request runs, and debug using plain English prompts.
- Integrations with MCP clients (VS Code, Cursor, Claude) for in‑IDE/AI workflows.
- Test management capabilities: create test cases, plans, and trigger runs from prompts.
- Observability integration: fetch logs, screenshots, and session traces to speed root-cause analysis.
Installation / Configuration
Prerequisites
- Node.js >= 18 (recommended LTS: 22.15.0)
- A BrowserStack account and API credentials (set as environment variables or config file)
Check Node version:
# Recommended: v22.15.0
Upgrade Node (macOS Homebrew):
&&
Upgrade Node (nvm):
&& &&
Upgrade Node (Windows nvm-windows):
nvm install 22.15.0
nvm use 22.15.0
Install the MCP server (local dev dependency):
# install as a project dependency
# or run without installing
Basic configuration
- Provide BrowserStack credentials and any project-specific config via environment variables or a config file. Typical variables:
- BROWSERSTACK_USERNAME
- BROWSERSTACK_ACCESS_KEY
- MCP_SERVER_PORT (optional)
Example (Linux/macOS):
Starting the server
# start the server (local mode)
# or if installed as a script in package.json
One-click IDE setup
- BrowserStack provides one-click links to set up MCP in supported clients (VS Code, Cursor). Use those links to configure the client to communicate with your local MCP server.
Available Resources
- GitHub repo: https://github.com/browserstack/mcp-server
- BrowserStack docs:
- Test Platform & device grid: https://www.browserstack.com/test-platform
- Test Observability: https://www.browserstack.com/docs/test-observability
- Accessibility testing: https://www.browserstack.com/docs/accessibility
- MCP ecosystem: works with any client that implements the Model Context Protocol (Cursor, Claude and others)
Use Cases (concrete examples)
Manual web testing (plain-English)
- Prompt in your MCP client:
"Open my site running on http://localhost:3000 in the latest Chrome on Windows 11."
- The MCP server will provision a BrowserStack session and stream the remote browser to your client.
Manual mobile testing
- Prompt:
"Open my iOS app build on an iPhone 15 Pro Max and reproduce a crash I reported."
- Start a real-device session, capture logs and video, and attach artifacts to the test case.
Run automated test suites
- Port and run your Playwright/Selenium tests on BrowserStack:
"Run my Playwright test suite on BrowserStack across Chrome and Firefox."
- The server can trigger CI-like runs, collect results, and surface failing traces and screenshots.
AI-assisted debugging & fixes
- When a test fails, request:
"My tests failed with a timeout on element X — show logs and suggest fixes."
- Retrieve logs, stack traces, and AI-suggested code edits. Apply patches back to files in your IDE if desired.
Accessibility scans
- Run local a11y scans and get remediation suggestions:
"Scan http://localhost:3000 for accessibility issues and propose fixes for WCAG AA."
- Receive a report with issues, severity, and suggested code or markup changes.
Test management from prompts
- Create or update test plans and trigger runs:
"Create a new test plan 'Login Flow' and run it against latest Chrome on Windows."
Tips for developers
- Keep BrowserStack credentials secure — use CI secrets or environment management tools.
- Use localhost tunneling (provided by the server) to test services behind your firewall.
- Combine automated runs with manual replay sessions to speed triage.
- Integrate MCP server start/stop into your dev scripts to ensure consistent local workflows.
For code examples, client integrations, and advanced configuration, see the project repository on GitHub: https://github.com/browserstack/mcp-server