BrowserStack Automate with the MCP server
Use natural language prompts in your AI assistant to set up the BrowserStack SDK, run web tests, and fetch screenshots and sessions with the BrowserStack MCP server.
Use the BrowserStack MCP server to set up the BrowserStack SDK, run web automation tests, and fetch screenshots and sessions from Automate builds directly from your AI assistant, such as GitHub Copilot, Claude, Cursor, or ChatGPT. Start your web tests or retrieve results with prompts.
To set up the server, see get started with the BrowserStack MCP server.
To use Automate tools on the MCP server, you need an Automate license. Contact BrowserStack support to enable a license for your account.
Workflows that use other BrowserStack products, such as Percy or Test Reporting & Analytics, also need an active license for those products.
Workflows and tools
Your assistant picks the right tool for each request. You donβt need to name a tool in your prompt. Describe the outcome, and the assistant picks the tool. The MCP server logs every tool call, so you can confirm which tool a prompt used.
Supported frameworks on Automate are Selenium, Cypress, Playwright, Puppeteer, and WebdriverIO. The MCP server can set up the BrowserStack SDK for these frameworks automatically. For the full list of browsers and devices, see BrowserStack Automate supported devices and browsers.
Test runs
| Workflow | What it does | Tool |
|---|---|---|
| Set up and run web tests | Integrates the BrowserStack SDK into your project and runs your web tests on real browsers in the cloud, with optional Percy visual testing. This is the primary tool for running your test suites. | setupBrowserStackAutomateTests |
Builds and sessions
| Workflow | What it does | Tool |
|---|---|---|
| Get session screenshots | Returns the screenshots captured during an Automate session, so you can review the visual results of a run. | fetchAutomationScreenshots |
| List sessions in a build | Returns the sessions in an Automate or App Automate build, with each sessionβs status, OS, browser or device, and dashboard and video links. The session IDs it returns work with getFailureLogs, fetchAutomationScreenshots, and fetchSelfHealedSelectors. |
listSessions |
Debugging
| Workflow | What it does | Tool |
|---|---|---|
| Run tests and debug failures | Runs your tests, finds the failed tests in the build, and fetches AI root cause analysis with suggested code fixes. Fixes are suggestions only and are never applied automatically. |
setupBrowserStackAutomateTestsgetBuildIdlistTestIdsfetchRCA
|
Use Playwright MCP with BrowserStack
You can also explore your website on BrowserStack desktop browsers with Playwright MCP, an open-source MCP server that you install yourself. Playwright MCP isnβt part of the BrowserStack MCP server. It connects straight to BrowserStack, which starts each session on a desktop browser. Your AI assistant then opens your website and tests it step by step, from natural language prompts.
To connect, you need your BrowserStack username and access key from your account profile.
Playwright MCP works with Chrome, Edge, Firefox, and Safari on Windows and macOS. To test an app on real Android and iOS devices with Appium MCP or WebdriverIO MCP, see Use Appium MCP or WebdriverIO MCP with BrowserStack.
Set up Playwright MCP
Install Playwright MCP
Follow the Playwright MCP setup guide.
Point Playwright MCP to a BrowserStack browser
Use the setting for your browser. In each one, replace YOUR_USERNAME and YOUR_ACCESS_KEY with your username and access key. The endpoint address tells BrowserStack which browser you want and signs you in. Keep your access key in a settings file or an environment variable.
Add the following setting to the MCP server settings. It requests the latest Chrome on Windows 11. For Edge, change chrome to edge.
Example prompt
Try the following prompt after you set up Playwright MCP:
| Example prompt | What your AI assistant does |
|---|---|
| Open example.com in Firefox on Windows 11. Sign in with the test account and take a screenshot of the home page. | Starts a session on a BrowserStack desktop browser, types and clicks through the sign-in, and returns a screenshot of the home page. |
View each session, with its video, on your Automate dashboard.
Sessions and parallels
- Each open session uses one parallel from your plan. When all your parallels are busy, new sessions wait in a queue.
- A session closes after 90 seconds with no command.
Related topics
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
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!