# Sauce Labs MCP

> Sauce Labs MCP connects your entire UI/E2E test execution environment to your chat agent. Stop bouncing between CI dashboards and the Sauce Labs site just to check a build status or find an error log. This tool lets you monitor job results, diagnose failures, and manage concurrency limits—all right where you're chatting.

## Overview
- **Category:** ship-it
- **Price:** Free
- **Tags:** automated-testing, ui-testing, e2e-testing, test-automation, pipeline-monitoring, quality-assurance

## Description

Connecting Sauce Labs via this MCP puts your entire test automation workflow directly into your chat agent. Instead of logging into the dashboard to check if a build passed or failed, you simply ask your AI client. You can quickly check the status of recent builds and drill down into specific job results, seeing pass/fail ratios instantly. Need to free up resources? You can programmatically stop hung jobs, freeing up test concurrency limits right away. Beyond that, you can review current account activity levels or browse supported OS and browser combinations for your next matrix variable. This capability is managed by Vinkius, making it simple to connect this critical infrastructure into any MCP-compatible client.

This means QA engineers get immediate access to failure logs without navigating complex menus, and DevOps teams know their concurrency limits before the test queue backs up.

## Tools

### get_activity
Retrieves metrics about your current Sauce Labs account activity level.

### get_build_jobs
Lists every individual test job that ran within a specific build.

### get_build
Pulls all the detailed results and metadata for one specific test build run.

### get_concurrency
Retrieves your current account limits on parallel testing sessions.

### get_job
Gathers all the detailed information for a single, specific test job ID.

### get_status
Checks if the main Sauce Labs platform is currently available and operational.

### list_builds
Provides a list of all your most recent automation test builds.

### list_jobs
Lists the IDs and status of recent individual test jobs running on Sauce Labs.

### list_platforms
Retrieves a comprehensive list of all supported operating systems and browsers for testing.

### list_tunnels
Lists any active Sauce Connect tunnels currently running in your account.

### stop_job
Sends a command to immediately terminate any test job that is stuck or failing.

## Prompt Examples

**Prompt:** 
```
What is our current concurrency usage vs limit in Sauce Labs?
```

**Response:** 
```
I checked your concurrency data. You are currently using 12 out of your 25 allowed parallel sessions. There are currently no queued jobs. You have plenty of capacity to spin up a new test run.
```

**Prompt:** 
```
Show me the jobs that failed in my last automation build.
```

**Response:** 
```
In your most recent build ('Nightly Regression 2.4.1'), exactly 1 out of 45 jobs failed. Job ID: fbd198. The failure occurred on Chrome version 114 (Windows 10). Would you like the deep link to the video asset or the error log for this job?
```

**Prompt:** 
```
Stop the test job ID 4f4f391e0 because it's stuck.
```

**Response:** 
```
I've successfully terminated Job ID 4f4f391e0. The status has changed to 'aborted' and the underlying machine node has been freed, releasing 1 concurrent session to the pool.
```

## Capabilities

### Check Build Status
You can retrieve details for specific builds or list recent automation runs to track overall stability.

### Diagnose Test Jobs
The agent pulls detailed information on individual test jobs, showing their status and results within a build.

### Manage Resources
You can check current concurrency limits or list active Sauce Connect tunnels to monitor resource usage.

### Stop Failing Tests
If a test job hangs, you can issue a command to stop it immediately, freeing up system resources.

### Verify Platform Support
The agent lists all supported OS and browser combinations (like Appium or WebDriver) for your tests.

## Use Cases

### The Build Failed, I Need Answers Now
A QA engineer sees a build fail and asks the agent for details. The agent checks the `list_builds` to find the latest run, then uses `get_build_jobs` to pinpoint which specific job failed, giving the exact failure context in seconds.

### The Test Queue is Stuck
A DevOps engineer notices tests aren't running. They use the agent to check `list_tunnels` and find an abandoned connection. They then execute `stop_job` on the stale job ID, releasing capacity for the waiting queue.

### Platform Support Check
A developer is adding a new test matrix variable but isn't sure if Chrome on Ubuntu is supported. They ask the agent to run `list_platforms`, instantly verifying compatibility before writing more code.

### Checking Overall Health
Before starting a massive regression suite, an engineer asks about system capacity. The agent runs `get_activity` and `get_concurrency`, confirming they have enough parallel sessions available for the run.

## Benefits

- Stop jumping between dashboards. Your agent pulls job details, build statuses, and error logs directly into the chat window, saving time and mental overhead.
- Manage resources instantly. If a test hangs, use the `stop_job` capability to free up concurrency limits immediately, preventing your entire pipeline from backing up.
- Stay ahead of capacity issues. Use `get_concurrency` or `list_tunnels` to check account usage before running high-volume tests, ensuring you never hit a hard limit unexpectedly.
- Speed up diagnosis. Instead of manually checking logs for every failure, the agent gives you actionable build reports and error metadata right when you ask.
- Broaden your testing scope. Need to test on an obscure OS/browser combo? Use `list_platforms` to verify support instantly without leaving your workflow.

## How It Works

The bottom line is you get real-time insight into complex testing infrastructure without leaving your conversation window.

1. Subscribe to this MCP using your Sauce Labs credentials, providing your Username, Access Key, and operating Region.
2. Connect your preferred AI client (like Claude or Cursor) through the Vinkius catalog.
3. Ask your agent a question about test status, concurrency, or job results. It will run the necessary commands and provide the answer directly in the chat.

## Frequently Asked Questions

**How do I check if my Sauce Labs account has enough capacity using the Sauce Labs MCP?**
You use the `get_concurrency` tool. It reports your current usage versus your total allowed parallel sessions, letting you know instantly if a test run will fail due to resource limits.

**I need help finding my latest failed job using Sauce Labs MCP.**
Use `list_builds` first to find the correct build ID. Then, request that specific build's details with `get_build`, and finally narrow it down by listing jobs using `get_build_jobs`.

**What is the purpose of `stop_job` in the Sauce Labs MCP?**
`stop_job` sends a command to immediately terminate any running test job that has become stuck or unresponsive, freeing up resources for other tests.

**Can I check which browsers are supported using Sauce Labs MCP?**
Yes, run the `list_platforms` tool. It gives you a comprehensive list of every OS and browser combination currently available in your account.