K6
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.
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
Maintainer
Works with
Installation
Manual Installation
npx k6Configuration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 versionClone 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.txtCreate 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);
}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"
]
}
}
}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/k6K6 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.
K6 Alternatives — Similar Developer Tools Servers
Looking for alternatives to K6? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up K6 in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.