K6

v1.0.0Developer Toolsstable

A Model Context Protocol (MCP) server implementation that allows AI assistants to run k6 load tests through natural language commands, supporting custom test durations and virtual users.

grafanak6mcpmodel-context-protocolperformance-testing
Share:
24
Stars
0
Downloads
0
Weekly
0/5

What is K6?

K6 is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server implementation that allows ai assistants to run k6 load tests through natural language commands, supporting custom test durations and virtual users.

A Model Context Protocol (MCP) server implementation that allows AI assistants to run k6 load tests through natural language commands, supporting custom test durations and virtual users.

This server falls under the Developer Tools and Monitoring & Observability categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) server implementation that al

Use Cases

Run load testing with k6 through natural language commands in Claude.
Configure custom test durations and virtual user counts without writing scripts.
QAInsights

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMar 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx k6

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use K6

k6-mcp-server is a Python-based MCP server that allows AI assistants to run k6 load tests through natural language commands. It exposes two tools — execute_k6_test for default settings (30 seconds, 10 virtual users) and execute_k6_test_with_options for custom duration and VU counts — letting developers trigger performance tests and get real-time output without writing k6 commands manually. It requires k6 to be installed on the system and is configured by pointing it to an existing k6 test script file.

Prerequisites

  • Python 3.12 or higher
  • k6 load testing tool installed (https://grafana.com/docs/k6/latest/set-up/install-k6/)
  • uv package manager installed (https://github.com/astral-sh/uv)
  • An MCP client such as Claude Desktop, Cursor, or Windsurf
  • An existing k6 test script (.js file) to run
1

Install k6

Install the k6 load testing tool on your system. It must be accessible in your PATH (or you can set K6_BIN to the full path).

# macOS
brew install k6

# Linux (Debian/Ubuntu)
sudo apt-get install k6

# Verify installation
k6 version
2

Clone the k6-mcp-server repository

Clone the repository and install Python dependencies using uv.

git clone https://github.com/QAInsights/k6-mcp-server.git
cd k6-mcp-server
uv pip install -r requirements.txt
3

Create a k6 test script

Write a k6 test script in JavaScript. The script uses the k6 HTTP API to define what to test.

// test.js
import http from 'k6/http';
import { sleep } from 'k6';

export default function () {
  http.get('http://test.k6.io');
  sleep(1);
}
4

Configure the MCP server in your client

Add the k6-mcp-server to your MCP client configuration. Point the --directory argument to your cloned repository path.

{
  "mcpServers": {
    "k6": {
      "command": "/path/to/bin/uv",
      "args": [
        "--directory",
        "/path/to/k6-mcp-server",
        "run",
        "k6_server.py"
      ]
    }
  }
}
5

Optionally configure the K6_BIN environment variable

If k6 is not in your system PATH, create a .env file in the project root and set K6_BIN to the full path of the k6 binary.

# .env
K6_BIN=/usr/local/bin/k6

K6 Examples

Client configuration

Claude Desktop configuration running k6-mcp-server via uv from the cloned repository directory.

{
  "mcpServers": {
    "k6": {
      "command": "/usr/local/bin/uv",
      "args": [
        "--directory",
        "/path/to/k6-mcp-server",
        "run",
        "k6_server.py"
      ]
    }
  }
}

Prompts to try

Natural language prompts to run k6 load tests using execute_k6_test and execute_k6_test_with_options.

- "Run a k6 load test using the script at /home/user/tests/api-test.js."
- "Run a k6 test for test.js with a duration of 60 seconds and 20 virtual users."
- "Execute a quick smoke test: run hello.js with 1 VU for 10 seconds."
- "Run my k6 script at ./tests/login-flow.js with default options and analyze the results."
- "Run a stress test using load-test.js with 100 virtual users for 5 minutes."

Troubleshooting K6

'k6: command not found' or 'K6_BIN is not set' error

Install k6 using your system's package manager (brew install k6 on macOS, or follow https://grafana.com/docs/k6/latest/set-up/install-k6/). If k6 is installed in a non-standard location, set K6_BIN=/full/path/to/k6 in a .env file in the project root.

uv command not found when starting the server

Install uv with: curl -LsSf https://astral.sh/uv/install.sh | sh and reload your shell. Then find the full path with: which uv and use that absolute path in the command field of your MCP client configuration.

k6 test script is not found or returns 'no such file' error

The script_file parameter requires a path to an existing .js k6 test file. Use an absolute path to avoid working directory confusion. Verify the file exists at the specified path before running the test.

Frequently Asked Questions about K6

What is K6?

K6 is a Model Context Protocol (MCP) server that model context protocol (mcp) server implementation that allows ai assistants to run k6 load tests through natural language commands, supporting custom test durations and virtual users. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install K6?

Follow the installation instructions on the K6 GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with K6?

K6 works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is K6 free to use?

Yes, K6 is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "k6": { "command": "npx", "args": ["-y", "k6"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use K6?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides