Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

BrowserStack App Automate with the MCP server

Use natural language prompts in your AI assistant to run automated app tests and take verification screenshots on real devices with the BrowserStack MCP server.

Use the BrowserStack MCP server to run automated app tests and take quick verification screenshots in App Automate directly from your AI assistant, such as GitHub Copilot, Claude, or Cursor. Skip the dashboard and start testing your app on any real device with prompts.

To set up the server, see get started with the BrowserStack MCP server.

To use App Automate tools on the MCP server, you need an App Automate license. Contact BrowserStack support to enable a license for your account.

Streamline app automation testing from your IDE

Use the following tools to set up the BrowserStack SDK, run app automation tests, and fetch screenshots from BrowserStack App Automate sessions, all through natural language prompts:

Run automated app tests (runAppTestsOnBrowserStack)

Use the runAppTestsOnBrowserStack tool to run your automated mobile tests (Espresso, XCUITest, etc.) on real devices in the cloud. This is the primary tool for executing your test suites.

Take app screenshot (takeAppScreenshot)

Use the takeAppScreenshot tool to quickly verify your app has launched successfully on a device. This tool launches the app on a specified device and captures a screenshot.

The following example shows GitHub Copilot in VS Code calling the takeAppScreenshot tool:

App Automate example prompt and tool call for screenshots

Tool reference

Use the takeAppScreenshot tool to quickly verify your app launch, and the runAppTestsOnBrowserStack tool to run automated mobile tests (Espresso, XCUITest, etc.) on real devices in the cloud.

For a complete list of supported devices, refer to the BrowserStack App Automate supported devices page.

Example prompt Description Input parameters Invoked tool
Take a screenshot of my app on Google Pixel 6 with Android 12 while testing on App Automate. App file path: /Users/xyz/app-debug.apk Launches the app on a specified device and captures a screenshot to verify it has launched successfully. • App path (required)
• Device name (required)
• Platform name (required)
• Platform version (required)
takeAppScreenshot
List failed test IDs for build auto_bld_6641. Lists test IDs from a BrowserStack Automate build. You can filter by status (e.g., failed). • Build ID (required)
• Status filter (optional)
listTestIds
Set up App Automate SDK for Java and Appium, then run on Pixel 7 (Android 14) and iPhone 15 (iOS 17). Sets up App Automate SDK integration for Appium tests (multiple languages). Not for Espresso or XCUITest bundles. • Language (required)
• Framework (required)
• Device name(s) (required)
• Platform version(s) (required)
setupBrowserStackAppAutomateTests
Run Espresso tests from /tests/checkout.zip on Galaxy S21 and Pixel 6 (Android 12). App: /apps/beta-release.apk under project Checkout Flow. Runs prebuilt native Espresso (Android) or XCUITest (iOS) suites by uploading the app and tests. Not for Appium or SDK setups. • App path (required)
• Test suite path (required)
• Device name(s) (required)
• Platform version (required)
• Project (optional)
runAppTestsOnBrowserStack

Common workflows

The BrowserStack MCP server supports the following workflows for complex testing scenarios. Each workflow shows the sequence of tools and automated actions.

Ensure you have active licenses for all the BrowserStack products in your workflows, such as App Automate and Percy, before running these prompts. Contact BrowserStack support to enable a license for your account.

Rapid SDK setup and integration

Run your automated app testing project on BrowserStack by integrating the BrowserStack SDK, configuring devices, and enabling visual testing with Percy. Enabling Percy tests is optional.

Tools invoked: setupBrowserStackAppAutomateTests, runAppTestsOnBrowserStack

Example prompts:

  • Set up App Automate SDK for my Appium (Python) project, configure it to run on Pixel 7 and iPhone 15, and enable Percy for visual testing.

  • Set up BrowserStack SDK for my Appium project, run these automated tests on BrowserStack using MCP server.
    Project: [Insert GitHub URL]
    Framework: Appium
    Language: Java
    Target Devices: Samsung Galaxy S23, iPhone 14 Pro
    Enable Percy: true (optional)

Supported framework on App Automate is Appium. The MCP server can automatically set up the BrowserStack SDK for this framework to run your app automation tests on BrowserStack App Automate.

The MCP server performs the following actions:

  1. Detects your project’s framework and language, such as Appium and Java.

  2. Installs the necessary BrowserStack SDK and dependencies into your project.

  3. Configures the browserstack.yml file with your requested devices, such as Pixel 7 and iPhone 15.

  4. Enables Percy for visual testing if requested.

The following example shows GitHub Copilot in VS Code calling the setupBrowserStackAppAutomateTests tool to set up an Appium project:

GitHub Copilot prompt to run Appium tests on BrowserStack App Automate and the resulting setupBrowserStackAppAutomateTests tool call

Run tests and debug failures

Automate the complete execution and debugging loop by running tests, identifying failures, and using AI to determine the root cause (RCA).

Tools invoked: runAppTestsOnBrowserStack, getBuildId, listTestIds, fetchRCA

Example prompts:

  • “Run my Espresso tests on BrowserStack. Once finished, list any failed test IDs.”

  • “List failed test IDs for build . Fetch the RCA for each failure and suggest code fixes to resolve them."

The MCP server performs the following actions:

  1. Executes your test suite on the BrowserStack App Automate cloud.

  2. Retrieves the specific Build ID and filters the list for status=failed.

  3. Fetches RCA logs to diagnose if the failure is due to a script error, app crash, or device issue.

  4. Provides AI-generated code fix suggestions based on the RCA logs.

For more help, see the following pages:

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle