A Model Context Protocol (MCP) server implementation for running k6 load tests. - Simple integration with Model Context Protocol framework - Support for custom test durations and virtual users (VUs) - Easy-to-use API for running k6 load tests - Configurable through environment variables - Real-time test execution output Before you begin, ensure you have the following installed: - Python 3.12 or hi
Add this skill
npx mdskills install QAInsights/k6-mcp-serverWell-documented MCP server for k6 load testing with clear setup and usage examples
1# ๐ โก๏ธ k6-mcp-server23A Model Context Protocol (MCP) server implementation for running k6 load tests.45## โจ Features67- Simple integration with Model Context Protocol framework8- Support for custom test durations and virtual users (VUs)9- Easy-to-use API for running k6 load tests10- Configurable through environment variables11- Real-time test execution output1213## ๐ง Prerequisites1415Before you begin, ensure you have the following installed:1617- Python 3.12 or higher18- k6 load testing tool ([Installation guide](https://grafana.com/docs/k6/latest/set-up/install-k6/))19- uv package manager ([Installation guide](https://github.com/astral-sh/uv))2021## ๐ฆ Installation22231. Clone the repository:2425```bash26git clone https://github.com/qainsights/k6-mcp-server.git27```28292. Install the required dependencies:3031```bash32uv pip install -r requirements.txt33```34353. Set up environment variables (optional):36 Create a `.env` file in the project root:3738```bash39K6_BIN=/path/to/k6 # Optional: defaults to 'k6' in system PATH40```4142## ๐ Getting Started43441. Create a k6 test script (e.g., `test.js`):4546```javascript47import http from "k6/http";48import { sleep } from "k6";4950export default function () {51 http.get("http://test.k6.io");52 sleep(1);53}54```55562. Configure the MCP server using the below specs in your favorite MCP client (Claude Desktop, Cursor, Windsurf and more):5758```json59{60 "mcpServers": {61 "k6": {62 "command": "/path/to/bin/uv",63 "args": [64 "--directory",65 "/path/to/k6-mcp-server",66 "run",67 "k6_server.py"68 ]69 }70 }71}7273```743. Now ask the LLM to run the test e.g. `run k6 test for hello.js`. The k6 mcp server will leverage either one of the below tools to start the test.7576- `execute_k6_test`: Run a test with default options (30s duration, 10 VUs)77- `execute_k6_test_with_options`: Run a test with custom duration and VUs7879808182## ๐ API Reference8384### Execute K6 Test8586```python87execute_k6_test(88 script_file: str,89 duration: str = "30s", # Optional90 vus: int = 10 # Optional91)92```9394### Execute K6 Test with Custom Options9596```python97execute_k6_test_with_options(98 script_file: str,99 duration: str,100 vus: int101)102```103104## โจ Use cases105106- LLM powered results analysis107- Effective debugging of load tests108109## ๐ค Contributing110111Contributions are welcome! Please feel free to submit a Pull Request.112113## ๐ License114115This project is licensed under the MIT License - see the LICENSE file for details.116
Full transparency โ inspect the skill content before installing.