# BrowserStack MCP

> BrowserStack lets you manage entire cross-browser testing pipelines right from your AI agent. You can list projects, track build statuses (passed, failed, running), retrieve specific session details, and dump raw logs for debugging without ever leaving your IDE or chat window.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** cross-browser-testing, automated-testing, ci-cd, test-automation, mobile-testing, qa-testing

## Description

Running automated tests across different browsers used to mean constant context switching—jumping between your IDE, the CI/CD dashboard, and the BrowserStack site just to figure out why a test failed. This MCP changes that. It connects all that data into your AI agent's natural conversation flow. You can list every project you run builds on, then dive deep into recent build outcomes, seeing exactly which sessions passed or timed out. If something breaks, you don't just get an error message; you retrieve the raw text execution logs of the failed session directly into the chat for rapid debugging. Plus, it keeps track of your quota, letting you know if you’re hitting parallel session limits before a build fails due to throttling. For access to this comprehensive set of tools, check Vinkius—it's where all compatible MCPs live.

## Tools

### list_projects
Lists all test projects you have set up on BrowserStack Automate.

### get_project
Retrieves full details for a specific project, including its linked recent builds.

### list_builds
Gets a list of your most recent automation builds and their current status (running, failed, etc.).

### get_build
Fetches all session details associated with a specific build ID.

### get_session
Retrieves full information for one test session, including its video and log URLs.

### get_session_logs
Pulls the raw text execution logs for a specific session to help you debug failed steps.

### list_browsers
Lists all supported operating systems and browsers required for configuring your test capabilities.

### get_plan
Shows current plan details, including parallel sessions used and remaining capacity.

### delete_session
Removes a specific BrowserStack session using its unique ID.

### delete_build
Deletes an entire build from your account using the build ID.

## Prompt Examples

**Prompt:** 
```
List my recent automation builds and summarize their outcomes.
```

**Response:** 
```
You have 4 recent builds:
1. 'Nightly Regression #120' - Passed (Dur: 14:02)
2. 'PR-Check #491' - Passed (Dur: 2:15)
3. 'Payment Flow E2E' - Failed (Dur: 4:30) (Build ID: e4da3b...)
4. 'Hotfix-Deploy-Prod' - Running (Dur: 1:12)

Would you like me to dive into the 'Payment Flow E2E' build and fetch the failed session logs?
```

**Prompt:** 
```
Fetch the logs for the failed session in build e4da3b.
```

**Response:** 
```
I retrieved the session inside the build (Session ID: 7a912f). Here is the relevant snippet from the execution logs:

```text
[14:23:45] POST /session/7a912f/element - Request payload: {"using":"css selector","value":"#checkout-btn"}
[14:23:50] NoSuchElementError: no such element: Unable to locate element: {"method":"css selector","selector":"#checkout-btn"}
```

The test failed because the `#checkout-btn` element could not be found after 5 seconds of rendering.
```

**Prompt:** 
```
Check how many parallel sessions our current plan allows.
```

**Response:** 
```
According to your `Automate Enterprise` plan, your team is allowed 20 parallel sessions globally. Currently, 18 parallel sessions are in use, and 0 sessions are queued. You have room to start 2 more concurrent threads without throttling.
```

## Capabilities

### List and track projects
You can list every test project you manage on BrowserStack Automate.

### Check build status
Retrieve a summary of recent automation builds, including their duration and ultimate success or failure status.

### Get detailed session info
Fetch comprehensive details for any specific test session, including which OS and browser combination was used.

### Download raw logs
Dump the full text execution logs from a failing session to analyze exactly where the script broke down.

### Monitor usage limits
Check your current plan's parallel session usage and how many sessions are waiting in the queue.

### Manage resources
Delete entire builds or individual test sessions when they are no longer needed.

## Use Cases

### The nightly build fails silently
A QA engineer notices a failure in the latest Nightly Regression run. Instead of logging into BrowserStack, they prompt their agent to use `list_builds` to find the failed ID, then ask for `get_session_logs` on that failing session to pinpoint the exact line of code or element selector causing the timeout.

### Checking deployment readiness
A developer needs to know if their test suite can handle a new load. They ask the agent to check `get_plan` to confirm available parallel session capacity, ensuring they don't exceed their current team limits before kicking off pre-production tests.

### Investigating environment discrepancies
A test fails only on Chrome running Windows 10. The agent uses `get_session` to retrieve the full OS/browser configuration payload for that specific run, confirming if the expected environment was actually used.

### Cleaning up old resources
A DevOps engineer needs space on their account and identifies three old builds. They instruct the agent to use `delete_build` on all three IDs, freeing up capacity for current testing cycles.

## Benefits

- Stop clicking through dashboards. You get a summary of build outcomes, including the duration and status, instantly by using `list_builds`.
- When a test fails, you don't just see 'Error.' Instead, your agent uses `get_session_logs` to dump the precise text output where the script broke down.
- Keep track of resource usage. Before starting a massive suite, check your concurrency limits using `get_plan` so you know if you’re going to throttle out.
- Debug failures with precision. By calling `get_session`, you get OS and browser stats for any session, telling you exactly what environment failed.
- Manage clutter quickly. If a test run is done or corrupted, use `delete_build` or `delete_session` to clean up the account without manual navigation.

## How It Works

The bottom line is that your AI agent handles all the API calls, so you never have to leave your conversation window.

1. Subscribe to this MCP and enter your BrowserStack Username and Access Key into your AI client.
2. Ask your agent to list recent builds, or ask for the details of a specific test project you want to investigate.
3. Your agent processes the data and returns structured information—like build statuses, session logs, or quota usage—right in the chat.

## Frequently Asked Questions

**How do I check my parallel session limits using BrowserStack MCP?**
Use the `get_plan` tool. It will show your current team usage and how many more concurrent sessions you can start before hitting a limit.

**Can BrowserStack MCP help me debug a specific failed test session?**
Yes, use `get_session_logs`. This tool retrieves the raw text execution logs, which is exactly what's needed to see the underlying failure reason in the chat.

**What is the difference between `list_builds` and `get_project` with BrowserStack MCP?**
`list_builds` gives you a summary of recent runs across all projects. Use `get_project` if you want to see the detailed history, builds, and metadata for one specific project ID.

**If I delete a build using BrowserStack MCP, does it affect other data?**
No, running `delete_build` only removes that specific build record. Other projects or active sessions remain completely unaffected by the action.

**Does this MCP support all OS/browser combos for automation?**
You can check supported combinations using `list_browsers`. This tool provides a list of every OS and browser version you need to know about when setting up capabilities.