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

Mobile and browser Control with the MCP server

Test your app on real Android and iOS devices, or your website on real desktop browsers, using natural language prompts with the BrowserStack MCP server.

Run these tests directly from your AI assistant, such as GitHub Copilot, Claude, Cursor, or ChatGPT.

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

Your AI assistant starts a real device or browser. It then taps or clicks, types, scrolls, and takes screenshots, one step at a time. Device sessions run on BrowserStack App Automate, and browser sessions run on BrowserStack Automate.

You can watch each session live and view its video on the App Automate dashboard or the Automate dashboard.

Mobile and Browser Control works on both the remote MCP server and the local MCP server.

To test apps on real devices, you need an App Automate license. To test websites in desktop browsers, you need an Automate license. Contact BrowserStack support to enable a license for your account.

Workflows and tools

Your AI assistant finds the right capability with searchCapability and runs it with invokeCapability. A capability is one action that the MCP server can run, such as starting a session or tapping an element. You don’t need to name a capability in your prompt. Describe the outcome you want, and your AI assistant picks the capability for you. For how searchCapability and invokeCapability work, see Core tools with the BrowserStack MCP server.

The Capabilities column lists what invokeCapability runs for each workflow.

The Works on column shows whether a workflow works on devices, browsers, or both. For the full lists, see BrowserStack App Automate supported devices and BrowserStack Automate supported browsers.

Devices and browsers

Ask your AI assistant which devices or browsers you can test on.

Workflow Description Works on Capabilities
Find a device to test on Lists the Android and iOS devices your account can use, with the exact names a session needs. It doesn’t show whether a device is free right now. Devices list_devices
Find your dedicated devices Lists the dedicated devices on your account. The list is empty if your account has no dedicated devices. Devices list_dedicated_devices
Find a browser to test on Lists the desktop OS, browser, and browser version combinations that you can use. Browsers list_browsers

Apps

Ask your AI assistant to find an app you uploaded, or upload a new app.

Workflow Description Works on Capabilities
Find an app you uploaded Lists the app builds already uploaded to App Automate, newest first, with their bs:// app IDs. You can list your own uploads or your whole team’s uploads. Devices list_app_builds
list_team_app_builds
Upload an app Uploads an .apk or .ipa file and returns its bs:// app ID. On the local MCP server, it uploads a file from your machine. It can also upload from a public download link. For how upload works on each server, see Upload your app. Devices upload_app_build_from_file
upload_app_build

Sessions

Ask your AI assistant to start, check, and end a session, or to run a whole test.

Workflow Description Works on Capabilities
Start a session Starts a real Android or iOS device with your app installed and open, or a real desktop browser. Returns a session ID. A browser starts without a page, so go to a page next. You can set the OS version of a device, or the screen resolution of a browser. To get the session links, check the session. Both create_session
Check a session Shows a session’s status, dashboard link, shareable link, and video link. The video at that link is complete only after the session ends. Both get_session
End a session Marks the session passed or failed with a reason, which shows on the dashboard. Then ends the session and releases the device or browser. The video stays available. Both set_session_status
delete_session
Test an app step by step Starts a real device with your app, taps, types, and swipes through a flow, takes a screenshot after each step, and ends the session. Devices create_session
find_element
click_element
send_keys
perform_actions
take_screenshot
set_session_status
delete_session
Test a website step by step Starts a real browser, opens your website, clicks, types, and scrolls through a flow, takes a screenshot after each step, and ends the session. Browsers create_session
navigate_to
click_element
send_keys
scroll_page
take_screenshot
set_session_status
delete_session

Actions

Ask your AI assistant to interact with your app or website, such as tapping, typing, scrolling, swiping, and taking screenshots.

Workflow Description Works on Capabilities
Take a screenshot Takes a screenshot of the device screen or the current page. Both take_screenshot
Tap or click an element Finds an element and taps or clicks it. On a device, it finds the element by its ID, accessibility ID, or XPath. In a browser, it finds the element by CSS selector, XPath, or link text. Both find_element
click_element
Type into a field Types text into a field. To replace what the field already holds, clear the field first. In a browser, a new line at the end of the text submits the form. Both send_keys
clear_element
Scroll In a browser, scroll_page scrolls the page by a distance or to the top or bottom, and scroll_to_element brings an element into view. On Android, scroll_gesture scrolls a list or screen up or down. On iOS, scroll_view scrolls up or down, or until a chosen element is visible. Both scroll_page
scroll_to_element
scroll_gesture
scroll_view
Go back Goes back one screen or page. On iOS, it works on screens with a standard navigation bar. Both press_back
go_back
Go to a page Opens a URL in the browser. It can also go forward or refresh the page. Browsers navigate_to
go_forward
refresh_page
Pick an option in a drop-down list Clicks the option you want in the list. Browsers click_element
Close the keyboard Closes the on-screen keyboard on Android and iOS. Devices hide_keyboard
Swipe Swipes up, down, left, or right across the screen. Devices perform_actions
Press a key on Android Presses a key on an Android device, such as home, enter, or recent apps. Devices press_keycode
Press a button on iOS Presses the Home button or a volume button on an iPhone or iPad. Devices press_button
Open, close, or restart an app Opens or closes the app under test, or another app installed on the device. To restart an app, close it and then open it. To name another app, use its appId on Android and its bundleId on iOS. Devices launch_app
terminate_app
Rotate the screen Rotates the screen to portrait or landscape. Devices set_orientation

Upload your app

To test an app, upload it to App Automate first. For more information on uploading apps, refer to Upload and manage apps.

Each app you upload gets an app ID that starts with bs://. Your AI assistant uses this ID to install the app. How you upload depends on the MCP server you use.

  • Remote MCP server: Your AI assistant can’t read files on your machine, so you run the upload command yourself:
    1. Your AI assistant uses the help-asset-upload tool to give you a curl command for your app file.
    2. You run the command on your command line. It uploads the app to App Automate and returns a bs:// app ID.
    3. You give the app ID to your AI assistant, and it starts testing.

    You can also reuse an app you already uploaded, or upload from a public download link with upload_app_build.

  • Local MCP server: Your AI assistant uploads the file for you with upload_app_build_from_file. The file must be inside the folder set in MCP_UPLOAD_BASE_DIR.

Example prompts

Try the following prompts after you set up the BrowserStack MCP server:

Example prompt Result
Which iPhones running iOS 17 can I use on BrowserStack? Lists the iPhones that offer iOS 17 on your account.
Open bs://YOUR_APP_ID on a Samsung Galaxy S23. Walk through sign-up and take a screenshot after each step. Starts a session on a real device, taps and types through the flow, and returns a screenshot of each screen.
Open bstackdemo.com in Chrome on Windows 11, add iPhone 12 to the cart, and take a screenshot of the cart. Starts a desktop browser session, opens the page, clicks through the flow, and returns a screenshot of the cart.
End the session, mark it failed with the reason: cart total is wrong, and give me the video link. Marks the session failed with the reason, ends it, and returns the video link from the dashboard.

Sessions and limits

Each device and browser session has the following limits:

  • A session ends after 90 seconds with no command. To raise this, ask for a longer idle timeout in the prompt that starts the session, for example, “with a 15-minute idle timeout”. The maximum is 900 seconds for a device and 300 seconds for a browser. You can’t change the idle timeout after the session starts.
  • A session also ends after 2 hours in total.
  • End each session when you finish, so the device or browser is free for your next test.

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