Skip to main content

Model context protocol server for k6 load testing

Project description

🚀 ⚡️ k6-mcp-server

A Model Context Protocol (MCP) server implementation for running k6 load tests.

✨ Features

  • 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

🔧 Prerequisites

Before you begin, ensure you have the following installed:

📦 Installation

  1. Clone the repository:
git clone https://github.com/qainsights/k6-mcp-server.git
  1. Install the required dependencies:
uv pip install -r requirements.txt
  1. Set up environment variables (optional): Create a .env file in the project root:
K6_BIN=/path/to/k6  # Optional: defaults to 'k6' in system PATH

🚀 Getting Started

  1. Create a k6 test script (e.g., test.js):
import http from "k6/http";
import { sleep } from "k6";

export default function () {
  http.get("http://test.k6.io");
  sleep(1);
}
  1. Configure the MCP server using the below specs in your favorite MCP client (Claude Desktop, Cursor, Windsurf and more):
{
  "mcpServers": {
    "k6": {
      "command": "/path/to/bin/uv",
      "args": [
        "--directory",
        "/path/to/k6-mcp-server",
        "run",
        "k6_server.py"
      ]
    }
  }
}
  1. 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.
  • execute_k6_test: Run a test with default options (30s duration, 10 VUs)
  • execute_k6_test_with_options: Run a test with custom duration and VUs

k6-MCP

📝 API Reference

Execute K6 Test

execute_k6_test(
    script_file: str,
    duration: str = "30s",  # Optional
    vus: int = 10          # Optional
)

Execute K6 Test with Custom Options

execute_k6_test_with_options(
    script_file: str,
    duration: str,
    vus: int
)

✨ Use cases

  • LLM powered results analysis
  • Effective debugging of load tests

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz (376.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz.

File metadata

  • Download URL: iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz
  • Upload date:
  • Size: 376.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7f4de53a64d652131eac8825746f35c91a2cf2c25a0d47b2903c72451b3b1335
MD5 826cf82b25d68c7e2c91af43f48f1e52
BLAKE2b-256 1ec9656b74554d7140f0158311050d9ebb34180df525b9e48276f3ece4994adb

See more details on using hashes here.

File details

Details for the file iflow_mcp_qainsights_k6_mcp_server-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_qainsights_k6_mcp_server-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_qainsights_k6_mcp_server-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40d1de36733a604edfe0d2f6ccf3088c74a10132f900ec671be9b08f2a3f9c1d
MD5 5c6a6502c80f17be30dcd3870b05a268
BLAKE2b-256 a155f05fcb48e437438df55d53a75aee51dadf1db9cfddad6277f31e938556aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page