🚀 ⚡️ K6 Mcp Server
k6 MCP server
Overview
What is k6 MCP Server?
The ### k6 MCP Server is a powerful tool designed for performance testing and load testing of applications. It leverages the capabilities of the k6 testing framework, which is known for its efficiency and ease of use. The MCP (Microservices Control Plane) Server allows users to manage and orchestrate multiple k6 test scripts, enabling seamless integration into CI/CD pipelines and providing a centralized platform for monitoring and analyzing performance metrics.
Features of k6 MCP Server
- Centralized Management: The k6 MCP Server provides a single interface to manage multiple performance tests, making it easier to organize and execute tests across different environments.
- Real-time Monitoring: Users can monitor test results in real-time, allowing for immediate insights into application performance and quick identification of bottlenecks.
- Integration with CI/CD: The server can be easily integrated into existing CI/CD workflows, facilitating automated performance testing as part of the development process.
- Scalability: Designed to handle a large number of concurrent users, the k6 MCP Server can simulate complex user scenarios to test application performance under load.
- Detailed Reporting: The server generates comprehensive reports that provide insights into various performance metrics, helping teams make informed decisions based on data.
How to Use k6 MCP Server
- Installation: Begin by installing the k6 MCP Server on your preferred environment. Follow the official documentation for detailed installation instructions.
- Configuration: Configure the server settings to match your testing requirements. This includes setting up test scripts, user scenarios, and performance thresholds.
- Running Tests: Use the server interface to initiate performance tests. You can select specific test scripts and define the number of virtual users to simulate.
- Monitoring: While tests are running, monitor the performance metrics in real-time through the server dashboard.
- Analyzing Results: After the tests are completed, review the generated reports to analyze performance data and identify any issues that need addressing.
Frequently Asked Questions
What is the primary purpose of the k6 MCP Server?
The primary purpose of the k6 MCP Server is to facilitate performance testing and load testing of applications, providing a centralized platform for managing multiple test scripts and monitoring results.
Can I integrate k6 MCP Server with my existing CI/CD pipeline?
Yes, the k6 MCP Server is designed to integrate seamlessly with CI/CD pipelines, allowing for automated performance testing as part of the development workflow.
How does k6 MCP Server handle large-scale tests?
The k6 MCP Server is built to scale, allowing users to simulate a large number of concurrent users and complex user scenarios, making it ideal for testing applications under heavy load.
What kind of reports does the k6 MCP Server generate?
The k6 MCP Server generates detailed performance reports that include metrics such as response times, throughput, error rates, and resource utilization, helping teams understand application performance comprehensively.
Is there a license for using k6 MCP Server?
Yes, the k6 MCP Server is available under the MIT license, which allows for free use, modification, and distribution.
Details
🚀 ⚡️ 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:
- Python 3.12 or higher
- k6 load testing tool (Installation guide)
- uv package manager (Installation guide)
📦 Installation
- Clone the repository:
git clone https://github.com/qainsights/k6-mcp-server.git
- Install the required dependencies:
uv pip install -r requirements.txt
- 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
- 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);
}
- 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"
]
}
}
}
- 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
📝 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.
Server Config
{
"mcpServers": {
"k-6-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--qainsights--k6-mcp-server--k-6-mcp-server",
"python main.py"
],
"env": {}
}
}
}