Skip to main content

🚀 ⚡️ 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.

Metadata

Release files for iflow-mcp_qainsights_k6-mcp-server 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_qainsights_k6-mcp-server 0.1.2
File Size Uploaded
iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz 376.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_qainsights_k6-mcp-server 0.1.2
File Interpreter ABI Platform
iflow_mcp_qainsights_k6_mcp_server-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 381.6 kB

Release files / iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz

Download URL iflow_mcp_qainsights_k6_mcp_server-0.1.2.tar.gz
Size 376.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f4de53a64d652131eac8825746f35c91a2cf2c25a0d47b2903c72451b3b1335
BLAKE2b-256 checksum
How to use checksums
1ec9656b74554d7140f0158311050d9ebb34180df525b9e48276f3ece4994adb
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / iflow_mcp_qainsights_k6_mcp_server-0.1.2-py3-none-any.whl

Download URL iflow_mcp_qainsights_k6_mcp_server-0.1.2-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40d1de36733a604edfe0d2f6ccf3088c74a10132f900ec671be9b08f2a3f9c1d
BLAKE2b-256 checksum
How to use checksums
a155f05fcb48e437438df55d53a75aee51dadf1db9cfddad6277f31e938556aa
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page