k6
- python
24
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"qainsights-k6-mcp-server": {
"command": "/path/to/bin/uv",
"args": [
"--directory",
"/path/to/k6-mcp-server",
"run",
"k6_server.py"
],
"env": {
"K6_BIN": "/usr/local/bin/k6"
}
}
}
}You run load tests with MCP by hosting a dedicated server that bridges your k6 test scripts to the MCP ecosystem. This setup lets you configure test duration, virtual users, and real-time results through MCP clients, making load testing more collaborative and streamlined.
How to use
To run a k6 load test through the MCP server, first ensure your MCP client can reach your k6-mcp-server configuration. You’ll point the client to the MCP server configuration and instruct it to execute a k6 test script. The server exposes two test execution modes: a default mode with sensible defaults and a mode that accepts explicit duration and VU settings. Use the client to start the test, and observe real-time progress and results as the test runs.
How to install
Prerequisites you need to satisfy before installing the MCP server are clearly defined to ensure compatibility and smooth operation.
-
Install Python 3.12 or higher.
-
Install k6 load testing tool.
-
Install the uv package manager.
Next, clone the project repository and install dependencies.
- Clone the repository.
git clone https://github.com/qainsights/k6-mcp-server.git
- Install Python dependencies using uv.
uv pip install -r requirements.txt
- Configure the optional path to the k6 binary. Create a .env file in the project root and set K6_BIN to the k6 executable path.
K6_BIN=/path/to/k6 # Optional: defaults to 'k6' in system PATH
Configuration and startup
You run the MCP server through a local stdio-based command that's wired to start the MCP k6 test runner. Use this exact startup configuration in your MCP client to enable test execution.
{
"mcpServers": {
"k6": {
"command": "/path/to/bin/uv",
"args": [
"--directory",
"/path/to/k6-mcp-server",
"run",
"k6_server.py"
]
}
}
}
Available tools
execute_k6_test
Runs a k6 test script with default options (30s duration, 10 VUs) and returns results as the test progresses.
execute_k6_test_with_options
Runs a k6 test script with explicit duration and VUs as provided by the user.