Get your setup working faster. Join our Discord for optimisation tips from elite testers.Join our Discord
Set up the local BrowserStack MCP server
Install and configure the local BrowserStack MCP server for your AI-enabled client.
The BrowserStack Model Context Protocol (MCP) server is a secure local gateway that connects your AI-enabled clients, such as Cursor, or VS Code with GitHub Copilot or Cline, directly to the BrowserStack real device cloud. It acts as a command-line bridge, so you can use natural language prompts to run tests on websites and mobile apps.
Key benefits
Running the MCP server locally gives you the following benefits:
Test websites and apps hosted on your local machine or behind a corporate firewall.
Test your development and staging environments on thousands of real devices and browsers.
Keep your BrowserStack credentials and sensitive project details securely on your machine.
Authentication
The local MCP server uses your BrowserStack username and access key for API key-based authentication. You can provide your credentials in one of the following ways:
As environment variables, which we recommend.
In plain text in the MCP config file.
Install the MCP server locally
After you complete the prerequisites, you can install the server in one of the following ways:
Globally, making it available across all your projects.
A global installation enables the MCP server for your user account in a specific client. This is the simplest way to get started. You can install the server in your preferred client using either a one-click installation or a manual setup.
One-click installation
We support a one-click installation for VS Code and Cursor. Before you begin, ensure your IDE is already installed. Use the following links to start the installation:
In the input field that appears at the top of the IDE, enter your credentials as follows:
First, enter your BrowserStack username and press Enter.
Next, enter your access key and press Enter.
Click the gear icon on the plugin page and select Start Server.
Video: Install and run the MCP server in VS Code with GitHub Copilot
The following steps use Cursor as the IDE:
Click the Install in Cursor link. The MCP server plugin page opens in Cursor.
In the input fields that appear, enter your BrowserStack username and access key.
Click Install.
Start the server after one-click setup
After you save your BrowserStack credentials, the BrowserStack MCP server starts automatically.
Video: Install and run the MCP server in Cursor
Manual installation
To install manually, you need to create a configuration file in a user-level directory. Since the exact path is different for each client, choose your IDE below to see the specific instructions.
VS Code supports AI assistants such as GitHub Copilot and Cline. Follow these steps to set up the MCP server configuration file in your user-level VS Code configuration.
Follow the steps below to set up the MCP server configuration file in your user-level VS Code configuration using GitHub Copilot as the AI assistant:
Click the Tools icon in the GitHub Copilot Activity Bar to open the Tools menu.
Alternatively, open the Command Palette by selecting View > Command Palette from the top menu, or by pressing Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on macOS. Run the MCP: Add Server command, and then skip to step 3.
Select Add MCP Server.
Select Install from an npm package.
For the package name, enter @browserstack/mcp-server.
Enter your BrowserStack username and access key when prompted, and press Enter.
Start the server in VS Code
To start the BrowserStack MCP server within VS Code, first open its configuration file, mcp.json. On macOS, this file is typically found at ~/Library/Application Support/Code/User/mcp.json.
With the file open, click the Start button provided in the VS Code editor’s interface to initialize the server.
Video: Install the MCP server in VS Code
Follow the steps below to set up the MCP server configuration file in your user-level VS Code configuration using Cline as the AI assistant:
Click the Manage MCP Servers icon in the bottom navigation bar on Cline chat window.
Click the gear icon on the resulting MCP Servers window.
Click the Configure MCP Servers button to open the cline_mcp_settings.json configuration file.
Paste the following JSON into the file and update it with your BrowserStack credentials:
The MCP server starts automatically after you save the cline_mcp_settings.json file with your BrowserStack credentials. To confirm that the server is running, click the navigation bar in the Cline chat window and check that the toggle is on.
Video: Install and run the MCP server using Cline
Follow these steps to set up the MCP server configuration file in your user-level Cursor configuration:
Create the file: In your user root directory, create a file at the following path: .cursor/mcp.json. Cursor creates the .cursor folder if it doesn’t exist. For example, on macOS the full path is /Users/username/.cursor/mcp.json.
Add the configuration: Paste the following content into the new mcp.json file:
After you save your BrowserStack credentials, the BrowserStack MCP server starts automatically.
Video: Install the MCP server in Cursor
Or install the BrowserStack plugin for Cursor
The plugin adds the local MCP server along with BrowserStack testing skills. It reads your credentials from the BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY environment variables, so set both before you start Cursor.
Then open the BrowserStack plugin on Cursor Marketplace and select Add to Cursor, or run /add-plugin browserstack in Cursor chat. The server starts with the credentials from your environment.
The following steps use Claude Desktop:
Create the file: Create a file named claude_desktop_config.json in the Claude Desktop configuration folder. On macOS, the folder is ~/Library/Application Support/Claude/. On Windows, it is %APPDATA%\Claude\.
You can also go to Settings > Developer in Claude Desktop and click Edit Config. This opens claude_desktop_config.json and creates it if it doesn’t exist, so you don’t need to find the folder.
Add the configuration: Paste the following JSON into the file and update it with your credentials:
GitHub Copilot works in several editors. For VS Code, follow the VS Code > GitHub Copilot tab.
GitHub Copilot CLI
In a copilot session, run /mcp add, enter browserstack as the name, and select Local with the command npx -y @browserstack/mcp-server@latest and your two credential environment variables.
Create %USERPROFILE%\.mcp.json for all solutions, or .mcp.json in the solution folder for one solution. Add the same servers JSON as JetBrains, and then open Copilot Chat in Agent mode.
Let your agent do the setup
Most AI coding agents can install and configure the server themselves. Copy and paste this prompt into your agent:
```text
Set up the local BrowserStack MCP server for this agent using the official setup guide at https://www.browserstack.com/docs/browserstack-mcp-server/get-started/local-mcp and the npm package @browserstack/mcp-server@latest. Ask me for my BrowserStack username and access key, and store them as the BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY environment variables.
```
Many MCP clients have their own command or settings screen for adding a server. Use the following table to find the command or configuration for your client:
Client
Command or configuration
Claude Code
claude mcp add --scope user browserstack -e BROWSERSTACK_USERNAME=YOUR_USERNAME -e BROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY -- npx -y @browserstack/mcp-server@latest
Add the JSON from the Cursor tab to ~/.cursor/mcp.json, or install the BrowserStack plugin for Cursor with BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY set in your environment.
Claude Desktop
Go to Settings > Developer > Edit Config, and then add the JSON from the Claude tab.
Windsurf
Go to Cascade > MCP servers > Add Server > Add custom server, with command npx, args ["-y","@browserstack/mcp-server@latest"], and the two credential environment variables.
Cline
Go to Manage MCP Servers > gear icon > Configure MCP Servers, and then add the JSON from the VS Code > Cline tab to cline_mcp_settings.json.
Kiro
In the Command Palette, run Kiro: Open user MCP config (JSON), and then add {"mcpServers":{"browserstack":{"command":"npx","args":["-y","@browserstack/mcp-server@latest"],"env":{"BROWSERSTACK_USERNAME":"YOUR_USERNAME","BROWSERSTACK_ACCESS_KEY":"YOUR_ACCESS_KEY"}}}} to ~/.kiro/settings/mcp.json.
Command npx, args ["-y","@browserstack/mcp-server@latest"], and env BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY.
Project-specific installation
A project-specific installation enables the server only for a particular project. This method offers more granular control, and the configuration is stored within the project’s directory. Choose an IDE from the options below to see the setup instructions:
If you are using NVM to manage multiple Node.js versions, refer to our NVM configuration guide to ensure the MCP server runs with the correct Node.js environment.
Start the server in VS Code with the GitHub Copilot agent
In your mcp.json file, click the Start button to run the server.
The following steps use Cursor as the IDE:
Create the file: In your project’s root directory, create a file at .cursor/mcp.json.
Add the configuration: Paste the following content into the file and update it with your BrowserStack credentials:
The BrowserStack MCP server starts automatically after you save your BrowserStack credentials in the .cursor/mcp.json file. To confirm that the server is running, check the Cursor MCP window and see that the toggle is on.
Claude Code reads project servers from .mcp.json in the project root. Add the server with the CLI:
Claude Code asks you to approve project servers the first time it opens the project.
Project config files are often committed to source control. Keep real credentials out of shared files, and use environment variables where the client supports them.
For VS Code, use the VS Code tab. For Visual Studio, add .mcp.json to the solution folder:
Open Copilot Chat in Agent mode and check that the BrowserStack tools are listed under the tools icon.
Project config files are often committed to source control. Keep real credentials out of shared files, and use environment variables where the client supports them.
Did this page help you?
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