browserstack-mcp-gateway
Facilitates interaction with BrowserStack's extensive cloud testing environment for executing both scripted and exploratory tests across a vast array of real hardware and virtual browsing platforms. It provides integrated utilities for diagnosing failures, iterating on code fixes, and validating adherence to digital accessibility standards within continuous development lifecycles.
Author

browserstack
Quick Info
Actions
Tags
BrowserStack Cloud Interface Utility
Unified Testing Ecosystem Core
Orchestrate test execution, manage quality assurance cycles, pinpoint technical faults, and even implement code corrections—directly within preferred environments like Cursor, Claude, or any MCP-compliant client, leveraging natural language commands.
Execute Tests Across Environments:
Effortlessly link the BrowserStack Quality Assurance Fabric to your preferred generative AI interfaces, IDEs, or agentic workflow systems.
Leverage Conversational Input:
Oversee, initiate, troubleshoot testing routines, and apply code patches utilizing straightforward, plain-English directives.
Minimized Cognitive Load:
Maintain developer focus—preserve all project context centrally and trigger operational commands straight from your integrated development environment or Large Language Model interface.
⚡️ Simplified Initial Setup via One-Click
Select the corresponding button below to integrate the MCP client into your target IDE:
Prerequisite Check: Node Runtime Requirement
- Ensure your Node.js installation is version
18.0or newer. - Verify using the command:
node --version. The recommended stable build isv22.15.0(LTS). - Guide to Node Upgrade:
-
- On macOS (using Homebrew):
brew update && brew upgrade node. If using (nvm):nvm install 22.15.0 && nvm use 22.15.0 && nvm alias default 22.15.0
- On macOS (using Homebrew):
-
- On Windows (using nvm-windows):
nvm install 22.15.0 && nvm use 22.15.0
- On Windows (using nvm-windows):
- 👉 Alternatively, obtain the official Node.js LTS installer here
.
💡 Operational Scenarios
📱 Mobile Application Validation
Conduct exploratory testing on actual mobile hardware spanning the most current operating system releases. Replicate defects and debug application failures without complex local environment provisioning. Below are illustrative commands for interacting with mobile applications on BrowserStack's comprehensive real-device cloud: bash
Initiate application launch on a chosen hardware model
"initiate application launch on an iPhone 15 Pro Max"
Request diagnostic assistance for application termination events
"My application terminated unexpectedly on an Android 14 platform; please assist with debugging analysis."
- Bypass emulator inaccuracies; validate application performance characteristics on genuine hardware. Advanced App Performance Profiling features allow for real-time inspection of crashes and resource bottlenecks.
- Gain access to all predominant hardware units and OS revisions via our device catalog. We uphold stringent Service Level Agreements guaranteeing the availability of newly launched hardware in our global data centers on the day of release (launch day announcement).
🌐 Web Surface Validation
Analogous to mobile application diagnostics, these prompts facilitate testing of your web properties across BrowserStack's expansive inventory of physical and virtual browsers. Do you lack a specific browser, like Edge, installed locally? We provide comprehensive coverage!
bash
Validate local web services or public URLs
"load my locally served web application from localhost:3001 within the Edge browser" "navigate to browserstack.com using the most current Chrome iteration"
- Verify website functionality across the full spectrum of operating systems and browser engines. We offer support for every mainstream browser engine across all major OS platforms.
- Achieve seamless validation of web properties hosted on your local machine—no prerequisite deployment to a remote infrastructure is necessary!
🧪 Automated Script Execution (Selenium, Playwright, Accessibility Checks, etc..)
Automatically analyze, pinpoint root causes, and even suggest remediation for failing test scripts directly within your coding environment or LLM interface. Retrieve diagnostic artifacts instantly, isolate failure origins, and apply context-aware corrections. Eliminate iterative debugging cycles. Here are illustrative directives for initiating/diagnosing/refining automated testing routines on BrowserStack's Test Platform:
bash
Reconfigure test suite for execution on BrowserStack infrastructure
"Configure my existing test collection to execute utilizing BrowserStack's backend resources"
Initiate test suite execution
“Execute my defined test sequences via BrowserStack services”
AI-driven diagnostic analysis for test failures
"My App Automate sequences have encountered failures; please apply analysis to resolve the newly reported issues."
- Rectify failures reported by your Continuous Integration/Delivery pipeline by leveraging our best-in-class Test Observability capabilities. Discover supplementary details here.
- Execute tests authored in standard frameworks like Jest, Playwright, Selenium, and others, leveraging the BrowserStack Test Platform.
🌐 Compliance and Accessibility Auditing
Detect accessibility deviations early via automated, local scanning mechanisms. Receive instantaneous, AI-generated corrective suggestions with a single command. Eliminate the need for extensive documentation review or unexpected CI compliance violations. Ensure adherence to WCAG and ADA standards utilizing our dedicated Accessibility Validation utility.
bash
Initiate accessibility evaluation during development phase
"Scan and propose fixes for accessibility violations on my locally hosted website at localhost:3000"
Evaluate live, deployed asset
“Perform a comprehensive accessibility audit and enumerate deficiencies for the site located at www.bstackdemo.com”
📋 Quality Assurance Artifact Management
Compose and maintain test specifications, define test execution plans, and trigger test runs using descriptive, natural language input. Below are representative prompts demonstrating how to utilize BrowserStack's Test Management features via the MCP server utility:
bash
Define project hierarchy and directory structure
"Establish a new Test Management entity titled 'E-commerce Portal' containing sub-sections for 'User Authentication' and 'Transaction Processing'"
Inject a new test case
"Introduce a verification step designated 'Negative Credential Attempt' into the 'User Authentication' sub-section within the 'E-commerce Portal' project"
Retrieve a list of defined test cases
"Display all high-urgency verification steps within the 'User Authentication' section of the 'E-commerce Portal' entity"
Schedule a test execution cycle
"Orchestrate a test execution run targeting all steps within the 'User Authentication' sub-section of the 'E-commerce Portal' entity"
Update status of an execution cycle
"Set the final status to 'Success' for the verification cycle designated for 'User Authentication' steps within the 'E-commerce Portal' entity"
🧪 Accessing BrowserStack's Generative Agents
Leverage BrowserStack's advanced AI agents to draft complete test suites from Product Requirement Documents (PRDs), transform manual steps into executable low-code automation sequences, and automatically repair brittle test scripts exhibiting instability. These capabilities are natively embedded into your operational flow. Below are several example directives for engaging the BrowserStack AI Agents:
bash
Test case generation utilizing PRD input
"Employing Browserstack AI, construct pertinent test scenarios based on the PRD artifact situated at /usr/file/location"
Low-code automation authoring agent
“Utilize Browserstack AI to convert manual verification step X, documented in Test Management, into automated scripts”
Automated script stabilization agent
“Engage Browserstack AI's self-healing mechanisms to correct intermittent failures observed in my current test script”
🛠️ Deployment Procedures
📋 Prerequisites for Utility Integration
Prerequisite Note: Node Runtime Requirement
- Confirm Node.js version is
18.0or greater. - Check current version with
node --version. Target recommendation:v22.15.0(LTS)
One-Click Environment Configuration
Click the links below to provision the MCP utility directly into your IDE:
Alternative Configuration Pathways
-
Establish a BrowserStack Entitlement
-
Register for a BrowserStack Account if one is not yet established.
-
ℹ️ Open-source project maintainers may qualify for a complimentary service tier here.
-
After securing access (and selecting an appropriate service tier), retrieve your unique
usernameandaccess_keyfrom the Account Profile Settings. -
Prerequisite Check: Node Runtime Requirement
- Verify Node.js version is
18.0or higher. - Use the command:
node --version. Recommended build:v22.15.0(LTS)
- Verify Node.js version is
-
Install the MCP Communication Hub Locally
-
For VSCode (Copilot - Agent Mode): Configuration file location:
.vscode/mcp.json:-
Identify or Generate the Config File: Examine the root directory of your project for a directory named .vscode. Note that this directory is often concealed; visibility may require adjusting file explorer settings.
-
If the directory structure is absent, create the .vscode subdirectory.
-
Within .vscode, instantiate a new file named
mcp.json. -
Populate the Configuration: Open
mcp.jsonand integrate the subsequent JSON structure. -
Substitute
<username>and<access_key>with your authentic BrowserStack credentials.
-
{
"servers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "
- In the VSCode interface, ensure you activate the
Startcontrol associated with the MCP Server to initiate the connection.
#### ** Alternative VSCode Copilot Integration Method**
-
Access the settings pane by clicking the gear icon to select available Tools
2. A contextual menu will appear centered at the top of the editor. Navigate down this menu and select the 'Introduce New MCP Conduit'
3. Choose the 'Install via NPM Registry' option (Install from an NPM package) - this is the third selection in the list
4. Input the required NPM package identifier: (@browserstack/mcp-server)
5. Input your registered BrowserStack credentials (username and access key)
-
For Cursor IDE: Configuration file at
.cursor/mcp.json:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "
- For Claude Desktop: Configuration file path is
~/claude_desktop_config.json:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "
- For Cline (If applicable)
Click the “MCP Servers” icon situated in the navigational sidebar. Select the “Provisioned” tab. Activate the “Configure MCP Servers” button located near the footer of the panel.
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "
Integrating via Smithery
To automate the deployment of the BrowserStack Validation Conduit for Claude Desktop using Smithery:
bash npx -y @smithery/cli install @browserstack/mcp-server --client claude
💡 Index of Available BrowserStack MCP Utilities
Currently, this integration supports 20 distinct utilities.
🧾 Test Case Orchestration
createProjectOrFolder— Generates a new Test Management project and/or organizational sub-directories for test artifact grouping. Returns identifiers for the Folder ID, Project ID, and a direct hyperlink to the TM Project Dashboard. Illustrative Directive
text Instantiate a fresh Test Management unit titled 'Retail Application' incorporating two organizational segments - 'Authentication' and 'Purchase Flow'
createTestCase— Appends a manually defined verification step beneath a specified project/folder (requires project reference identifiers like PR-xxxxx and a specific folder ID). Illustrative Directive
text Insert a verification step named 'Incorrect Coupon Code Handling' into the Authentication segment of the 'Retail Application' project, referencing Project ID: PR-53617, Folder ID: 117869
listTestCases— Retrieves a manifest of test cases belonging to a designated project (supports filtering criteria such as severity level, execution status, or descriptive tags). Illustrative Directive
text Display all high-priority verification steps contained within the 'Retail Application' entity, constrained by project_identifier: PR-59457
createTestRun— Formulates a new test execution batch (suite) targeting a selected subset of test cases within a defined project. Illustrative Directive
text Schedule an execution run for all steps located in the Authentication segment of the 'Retail Application' entity, titling the run 'Major Release Candidate v1.0 Authentication Validation'
listTestRuns— Fetches a catalog of existing test execution batches for a project (filtering options include execution dates, assigned personnel, or current state). Illustrative Directive
text List all scheduled test runs associated with the 'Retail Application' entity that were initiated during the prior week and are currently in a 'Processing' state
updateTestRun— Applies partial modifications to an existing test run (e.g., updating completion status, metadata tags, explanatory notes, or associated test cases). Illustrative Directive
text Modify the execution batch identified as 1043 within the 'Retail Application' entity, marking it as finalized with the explanatory annotation 'Full regression cycle concluded'
addTestResult— Records the outcome of a manual execution (Success/Failure/Obstructed/Omitted) for a specific test case within an active run. Illustrative Directive
text Log the result as 'Successful' for the test case named 'Incorrect Coupon Code Handling' within execution batch ID 1043 belonging to the 'Retail Application' entity
createTestCasesFromFile— Enables mass creation of test specifications imported from an external document (e.g., PDF specification file). Illustrative Directive
text Ingest test specifications from the file located at '/Users/xyz/testcases.pdf' into the 'Retail Application' project structure
⚙️ BrowserStack SDK Provisioning / Automated Execution
setupBrowserStackAutomateTests— Initializes the BrowserStack SDK for executing web validation routines on the cloud platform (with optional activation of Percy for visual regression checking). Illustrative Directive
text Execute my Selenium-JUnit5 test scripts written in Java targeting Chrome and Firefox environments. Activate Percy integration for concurrent visual verification.
fetchAutomationScreenshots— Retrieves image captures generated during a specified Automate or App Automate testing session. Illustrative Directive
text Obtain all captured screenshots associated with Automate session ID abc123xyz relevant to my desktop validation series
🔍 Telemetry and Diagnostics
getFailureLogs— Fetches error documentation for Automate/App Automate operations (can be scoped by Build ID for App Automate scenarios). Illustrative Directive
text Retrieve diagnostic logs for session ID: 21a864032a7459f1e7634222249b316759d6827f, which corresponds to Build ID: dt7ung4wmjittzff8kksrjadjax9gzvbscoyf9qn from the App Automate run
📱 On-Demand Mobile Testing (App Live)
runAppLiveSession— Initiates a live, exploratory testing session for a mobile application running on a physical device provisioned in the cloud. Illustrative Directive
text Launch my iOS application binary on an iPhone 15 Pro Max running iOS version 17. The application package location is /Users/xyz/app.ipa
💻 Live Web Session Interface
runBrowserLiveSession— Commences a real-time interactive session for validating website functionality across desktop or mobile browser environments. Illustrative Directive
text Load the domain www.google.com within the most current Microsoft Edge iteration running on the Windows 11 operating system
📲 Automated Mobile Testing (App Automate)
takeAppScreenshot— Starts the application on a designated device and captures a preliminary visual confirmation snapshot. This utility's primary role is to verify successful application launch. Illustrative Directive
text Capture a validation screenshot of my Android application running on a Google Pixel 6 device with Android 12 during an App Automate process. Application file path: /Users/xyz/app-debug.apk
runAppTestsOnBrowserStack— Executes automated mobile test suites (e.g., Espresso/XCUITest frameworks) directly on remote physical hardware. Illustrative Directive
text Deploy Espresso test artifacts contained in /tests/checkout.zip targeting Galaxy S21 and Pixel 6 devices running Android 12. The main application file resides at /apps/beta-release.apk under the 'Checkout Flow' project context
♿ Digital Compliance Auditing
accessibilityExpert— Consults the A11y Specialist for guidance on WCAG standards (2.0/2.1/2.2), mobile/web usability principles, and industry best practices. Illustrative Directive
text Detail the specific WCAG requirements that govern the presentation of error feedback messages for form fields rendered on mobile web interfaces.
startAccessibilityScan— Initiates an automated web compliance scan and furnishes a link to the resulting diagnostic report. Illustrative Directive
text Execute a full accessibility assessment against the web property located at "www.example.com"
🤖 BrowserStack Intelligent Agents
fetchSelfHealedSelectors— Retrieves AI-corrected element selectors that address script flakiness caused by underlying Document Object Model (DOM) modifications. Illustrative Directive
text Retrieve and apply self-corrected selectors to resolve instability in Automate session ID session_9482 utilizing the MCP interface
createLCASteps— Programmatically generates Low Code Automation (LCA) procedural steps derived from a defined manual test case stored in Test Management. Illustrative Directive
text Transform the manual verification sequence named 'Add Item to Basket' within the 'Retail Application' project into corresponding LCA workflow steps
uploadProductRequirementFile— Uploads specification documents (PRD, visual mockups, PDFs) to obtain a mapping identifier, which is subsequently used bycreateTestCasesFromFile. Illustrative Directive
text Upload the PRD document from /Users/xyz/Desktop/login-flow.pdf and instruct BrowserStack AI to derive test scenarios from its content
🚀 Networked MCP Conduit (Remote)
Remote MCP eliminates the complexity of local setup and binary management, offering a fully functional testing interface accessible over the network.
Key Advantages:
-
✅ Seamless operation within controlled enterprise network perimeters, bypassing firewall restrictions or local installation mandates.
-
✅ Secure authentication via OAuth integration—eliminating the need for hardcoded credentials or manual key management.
Constraints:
- ❌ Inability to facilitate Local Testing (e.g., debugging applications protected by VPNs, firewalls, or running on localhost). Local Testing necessitates the use of a BrowserStack Local MCP variant.
- ❌ Minor potential for increased communication latency, although typically negligible during routine operational use.
Configuration Instructions:
-
For VSCode (Copilot - Agent Mode): Configuration file location:
.vscode/mcp.json:- Locate or Create the Configuration File:
- Navigate to the root project folder and verify the existence of the usually hidden
.vscodedirectory. Consult expansion notes if required for location confirmation. - If the directory is missing, provision it.
- Within the
.vscodedirectory, ensure a file namedmcp.jsonexists. -
To designate the Remote BrowserStack MCP endpoint instead of the default local one, integrate the following JSON payload:
Alternative Path to Remote MCP Integration
-
Step 1. Initiate tool selection by clicking the gear mechanism in the interface
-
Step 2. In the tool selection panel appearing centrally at the top, scroll to the bottom and select 'Introduce New MCP Server'
-
Step 3. Select the 'HTTP Endpoint' option
-
Step 4. Input the designated Remote MCP Server URL: https://mcp.browserstack.com/mcp
-
Step 5. Assign the server identifier as : browserstack
-
Step 6. In VSCode, activate the 'Start MCP Server' function, followed by confirming the connection prompt by clicking "Allow"
🤝 Recommended Client Applications
- For scenarios involving automated testing and diagnostic deep-dives, we suggest leveraging Github Copilot or Cursor.
- For interactive, exploratory testing sessions (Live Testing scenarios), Claude Desktop is the preferred complementary client.
⚠️ Critical Information
- The BrowserStack MCP Conduit is subject to ongoing feature augmentation; only a subset of the total MCP specification is currently implemented. Further capabilities will be introduced shortly.
- Command invocation relies on the intermediary MCP Client, which in turn depends on an underlying Large Language Model. This dependency structure may introduce minor stochasticity resulting in unpredictable outcomes. We encourage the submission of feedback or suggestions via an issue report for discussion.
📝 Collaboration Guidelines
We enthusiastically welcome external contributions! Please initiate an issue to discuss any proposed modifications. 👉 Review Contribution Protocols Here
📞 Support Channels
For technical assistance, please utilize the following resources:
- Log an issue in our GitHub repository if you encounter difficulties specifically related to the MCP Communication Hub.
- Contact our primary support desk for all ancillary inquiries.
🚀 Upcoming Enhancements
Anticipate significant feature rollouts soon! Have ideas for expansion? Please raise an issue to propose the concept. WIKIPEDIA: A headless browser functions as a web browser devoid of a visual graphical interface. Headless browser instances enable programmatic control over a webpage within an environment mirroring standard web browsers, but they are executed through a terminal interface or network protocols. These are exceptionally valuable for quality assurance processes because they replicate browser rendering capabilities, including stylesheet interpretation (layout, typography, color), and full execution of dynamic scripts like JavaScript and Ajax, functionality often unavailable in alternative testing methodologies. Since version 59 of Google Chrome and version 56 of Firefox, built-in remote control APIs have been standardized, rendering previous solutions, such as PhantomJS, largely obsolete.
== Primary Applications == The core utility cases for headless browsing environments involve: Test automation within contemporary web application frameworks (web validation) Generating high-fidelity snapshots of web pages. Executing automated validation routines for JavaScript libraries. Automating complex user interactions with web interfaces.
=== Secondary Applications === Headless agents are also potent tools for web data extraction (scraping). Google indicated in 2009 that employing a headless agent could aid in indexing content from sites relying heavily on Ajax for rendering. Conversely, headless agents have been exploited for adverse activities such as: Launching Distributed Denial of Service (DDoS) attacks against web services. Artificially inflating advertisement view counts. Automating website interaction in unauthorized manners (e.g., credential stuffing attacks). However, a comprehensive traffic analysis conducted in 2018 revealed no discernible preference among malicious actors for headless browser utilization. Evidence does not support the notion that headless agents are disproportionately employed over standard browsers for illicit activities like DDoS attacks, SQL injection exploits, or cross-site scripting vulnerabilities.
== Operational Mechanisms == Given that major browser vendors now natively incorporate headless mode via dedicated APIs, specialized software has emerged to provide a unified interface for browser control. Key examples include:
Selenium WebDriver – An implementation of the WebDriver protocol conforming to W3C standards. Playwright – A Node.js library designed for automating Chromium, Firefox, and WebKit engines. Puppeteer – A Node.js library specialized in automating Chrome or Firefox instances.
=== Test Automation Context === Several established software tools and testing frameworks embed headless browser functionality into their validation apparatus.
Capybara incorporates headless browsing, utilizing either WebKit or Headless Chrome engines to simulate user behavior in its testing protocols. Jasmine defaults to Selenium but offers configuration options to utilize WebKit or Headless Chrome for browser-level tests. Cypress, a leading frontend testing framework. QF-Test, a commercial software tool for GUI-based automated testing, supports headless browser utilization.
=== Alternative Methodologies === Another architectural approach involves utilizing libraries that expose browser-like APIs directly within the runtime environment. For instance, Deno incorporates browser APIs intrinsically. For the Node.js ecosystem, jsdom offers the most comprehensive emulation. While most of these alternatives support fundamental browser capabilities (HTML parsing, cookie management, XHR requests, limited JavaScript execution), they frequently lack actual DOM rendering and possess restricted event handling support. They typically execute with faster throughput compared to full browser simulations.
