# Grafana k6 Cloud MCP

> Grafana k6 Cloud MCP lets you manage your entire performance testing lifecycle through natural conversation with your AI agent. You can list existing load tests, start new runs, stop active sessions instantly, and retrieve detailed metrics like latency, throughput, and error rates. It also checks if your application meets specific Service Level Objectives (SLOs), all without navigating multiple dashboards.

## Overview
- **Category:** ship-it
- **Price:** Free
- **Tags:** load-testing, performance-engineering, stress-testing, test-automation, cloud-infrastructure, metrics

## Description

Managing performance testing used to mean clicking through a dozen dashboards just to get the numbers you needed. Now, your AI agent handles it. This MCP connects directly to your k6 Cloud account, letting you run complex load tests and then ask questions about the results—like, "Did the checkout flow fail when we hit 500 virtual users?" You can start a test, wait for it to finish, and immediately pull back aggregated metrics on response time or failure rates. It’s all conversational.

It gives you full control over your testing process, from listing projects across different organizations to getting the raw data needed for audits. When working with Vinkius in your AI client, you get access to this specialized set of tools alongside thousands of others, meaning performance analysis is just one query away. You don't need to jump between ten different tabs; you just talk to your agent.

## Tools

### list_tests
Lists all load tests available in your k6 Cloud account, showing their status and ID.

### get_test
Retrieves the complete script configuration and details for a specific k6 test.

### list_runs
Lists all past and current test runs, showing their status (like QUEUED or FINISHED), duration, and VUs.

### get_run
Gets full details about a specific k6 test run, including metadata.

### start_test_run
Initiates a brand new load test run on the k6 Cloud infrastructure, returning a unique ID for tracking.

### stop_test_run
Stops an active k6 Cloud test session immediately when you need to save resources or abort testing.

### list_organizations
Provides a list of all organizations under your k6 account, along with member counts.

### list_projects
Lists all testing projects within a specific organization.

### get_run_metrics
Calculates and returns detailed performance metrics for any completed test run, like latency or data received.

### get_run_thresholds
Retrieves the specific evaluation results to confirm if a finished test passed or failed against defined SLOs.

## Prompt Examples

**Prompt:** 
```
List all my load tests in k6 Cloud
```

**Response:** 
```
I've found 4 load tests: 'API Stress Test' (ID: 123), 'Checkout Flow' (ID: 456), 'Inventory Spike' (ID: 789), and 'Frontend Smoke' (ID: 012). Which one would you like to check the last run status for?
```

**Prompt:** 
```
Show me the performance metrics for the last run of the 'API Stress Test'
```

**Response:** 
```
Retrieving metrics for run ID 'run-98765'… Average response time: 142ms, P95: 285ms, Failed requests: 0.2%, Max VUs: 500. All metrics are within acceptable ranges. Would you like me to check the threshold details?
```

**Prompt:** 
```
Start a new test run for 'Checkout Flow' (ID: 456)
```

**Response:** 
```
Trigging new run for 'Checkout Flow'… Done. New Run ID is 'run-13579'. It's currently in the QUEUED state. I'll let you know when the first VUs start injecting traffic.
```

## Capabilities

### List and manage load tests
Retrieves a list of all available k6 Cloud test names, IDs, scripts, and their last run statuses.

### Control test execution runs
Starts new test sessions or immediately halts running tests to manage resources.

### Analyze performance metrics
Pulls aggregated data for completed runs, showing things like average response time, throughput, and total errors.

### Verify Service Level compliance
Checks detailed threshold results to confirm if your application meets defined SLOs after a test run.

### Monitor ongoing sessions
Polls running tests for their current status, letting you track transitions like QUEUED or RUNNING.

## Use Cases

### Investigating Post-Deployment Regression
An SRE notices high latency in production. They ask their agent to list_tests for the 'API Checkout' suite, start a new test run with a moderate load, and then use get_run_metrics to instantly compare the average response time against historical baselines.

### Auditing Compliance History
A QA Automation specialist needs proof that the payment gateway passed compliance checks last quarter. They ask the agent to list_runs for the 'Payment Gateway' project and then use get_run_thresholds on specific run IDs to compile a comprehensive audit report.

### Simulating Peak Traffic Spikes
A Performance Engineer wants to see how the system handles Black Friday traffic. They ask to start_test_run, targeting 1000 VUs over 3 minutes, and then monitor its status using get_run to ensure it completes without error.

### Managing Complex Environments
A DevOps team is testing three different microservice versions. They use list_organizations first, then list_projects for each, allowing the agent to manage and track results across disparate environments simultaneously.

## Benefits

- You instantly get a full picture of your test environment by using list_organizations and list_projects. Instead of manually navigating complex folder structures, you ask the agent to show you all available projects across multiple organizations.
- Stop wasting time clicking through status tabs. You can start a new test run with start_test_run and monitor its progress in real-time without leaving your chat window until it finishes running.
- Need proof that your application meets SLOs? Don't guess. Using get_run_thresholds, you ask the agent for precise results to verify if performance requirements were met after a major release.
- Analyzing failure patterns is fast. Instead of looking at raw logs, calling get_run_metrics gives you aggregated data on error rates and average response times—all in plain language format.
- Control your testing costs by using stop_test_run to abort an active session instantly if the test goes wrong or hits a resource limit too soon.

## How It Works

The bottom line is you use natural language commands instead of API calls and web forms to manage your entire performance testing workflow.

1. Subscribe to this MCP and provide your k6 Cloud API Token.
2. Connect the credentials to any MCP-compatible AI client (Claude, Cursor, etc.).
3. Ask your agent a direct question like, "Start a load test for Project X" or "What were the latency metrics?"

## Frequently Asked Questions

**How do I check the status of a running test with Grafana k6 Cloud MCP?**
You use list_runs to see all active and completed test sessions. This allows you to monitor if the run is QUEUED, RUNNING, or FINISHED without guessing.

**Can I start a new load test run using Grafana k6 Cloud MCP?**
Yes, calling start_test_run immediately kicks off a new session. The agent returns the unique ID you need to track it and manage resources later.

**What kind of metrics does get_run_metrics provide for Grafana k6 Cloud?**
This tool provides crucial performance data, including average response time (latency), throughput, VUs used, and the count of failed requests.

**Does Grafana k6 Cloud MCP help me check SLOs?**
Yes, using get_run_thresholds lets you verify if your application met pre-set Service Level Objectives. It's a direct compliance check for any given test run.

**Do I need to know the k6 script code to use Grafana k6 Cloud MCP?**
No, you don't. You only interact with the agent using plain English commands; the MCP handles the underlying connection and execution of the scripts.