The BrowserStack MCP Server allows you to manage test cases, execute tests, debug issues, and fix code directly within tools like Cursor, Claude, or any MCP-enabled client using natural language. This server connects BrowserStack's comprehensive test platform to your favorite AI tools, reducing context switching and enabling testing through plain English prompts.
Create a .vscode/mcp.json
file with the following content:
{
"servers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "<username>",
"BROWSERSTACK_ACCESS_KEY": "<access_key>"
}
}
}
}
In VSCode, click the "Start" button in the MCP Server to start the server.
Create a .cursor/mcp.json
file with the following content:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "<username>",
"BROWSERSTACK_ACCESS_KEY": "<access_key>"
}
}
}
}
Create a ~/claude_desktop_config.json
file with the following content:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "<username>",
"BROWSERSTACK_ACCESS_KEY": "<access_key>"
}
}
}
}
Click the "MCP Servers" icon in the navigation bar, select the "Installed" tab, and click the "Configure MCP Servers" button. Then use the following configuration:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": ["-y", "@browserstack/mcp-server@latest"],
"env": {
"BROWSERSTACK_USERNAME": "<username>",
"BROWSERSTACK_ACCESS_KEY": "<access_key>"
}
}
}
}
For an automated installation with Claude Desktop:
npx -y @smithery/cli install @browserstack/mcp-server --client claude
Test mobile apps on real devices across the latest OS versions:
# Open app on specific device
"open my app on a iPhone 15 Pro Max"
# Debug app crashes
"My app crashed on Android 14 device, can you help me debug?"
Test websites on various browsers and devices:
# Test your websites
"open my website hosted on localhost:3001 on Edge"
"open browserstack.com on latest version of Chrome"
Run, debug, and fix automated tests on BrowserStack:
# Port test suite to BrowserStack
"Setup test suite to run on BrowserStack infra"
# Run tests on BrowserStack
"Run my tests on BrowserStack"
# AI powered debugging of test failures
"My App Automate tests have failed, can you help me fix the new failures?"
Identify and fix accessibility issues:
# Scan accessibility issues during development
"Scan & help fix accessibility issues for my website running locally on localhost:3000"
# Scan accessibility issues on production site
"Run accessibility scan & identify issues on my website - www.bstackdemo.com"
Create and manage test cases:
# Create project & folder structure
"create new Test management project named My Demo Project with two sub folders - Login & Checkout"
# Add test cases
"add invalid login test case in Test Management project named My Demo Project"
# List added test cases
"list high priority Login test cases from Test Management project - My Demo Project"
# Create test run
"create a test run for Login tests from Test Management project - My Demo Project"
# Update test results
"update test results as passed for Login tests test run from My Demo Project"
Generate and automate tests using BrowserStack's AI:
# Test case generator agent
"With Browserstack AI, create relevant test cases for my PRD located at /usr/file/location"
# Low code authoring agent
"With Browserstack AI, automate my manual test case X, added in Test Management"
# Self healing agent
"Help fix flaky tests in my test script with Browserstack AI self healing"
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "browserstack" '{"command":"npx","args":["-y","@browserstack/mcp-server@latest"],"env":{"BROWSERSTACK_USERNAME":"<username>","BROWSERSTACK_ACCESS_KEY":"<access_key>"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": [
"-y",
"@browserstack/mcp-server@latest"
],
"env": {
"BROWSERSTACK_USERNAME": "<username>",
"BROWSERSTACK_ACCESS_KEY": "<access_key>"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"browserstack": {
"command": "npx",
"args": [
"-y",
"@browserstack/mcp-server@latest"
],
"env": {
"BROWSERSTACK_USERNAME": "<username>",
"BROWSERSTACK_ACCESS_KEY": "<access_key>"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect