ð â¡ïž K6 Mcp ãµãŒããŒ
k6 MCPãµãŒããŒ
æŠèŠ
k6 MCPãµãŒããŒãšã¯ïŒ
k6 MCPãµãŒããŒã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãã¹ããšè² è·ãã¹ãã®ããã«èšèšããã匷åãªããŒã«ã§ããããã¯ãå¹çæ§ãšäœ¿ããããã§ç¥ãããk6ãã¹ããã¬ãŒã ã¯ãŒã¯ã®æ©èœã掻çšããŠããŸããMCPïŒãã€ã¯ããµãŒãã¹ã³ã³ãããŒã«ãã¬ãŒã³ïŒãµãŒããŒã¯ããŠãŒã¶ãŒãè€æ°ã®k6ãã¹ãã¹ã¯ãªããã管çããã³ãªãŒã±ã¹ãã¬ãŒã·ã§ã³ã§ããããã«ããCI/CDãã€ãã©ã€ã³ãžã®ã·ãŒã ã¬ã¹ãªçµ±åãå¯èœã«ããããã©ãŒãã³ã¹ã¡ããªã¯ã¹ã®ç£èŠãšåæã®ããã®éäžãã©ãããã©ãŒã ãæäŸããŸãã
k6 MCPãµãŒããŒã®ç¹åŸŽ
- äžå€®ç®¡ç: k6 MCPãµãŒããŒã¯ãè€æ°ã®ããã©ãŒãã³ã¹ãã¹ãã管çããããã®åäžã®ã€ã³ã¿ãŒãã§ãŒã¹ãæäŸããç°ãªãç°å¢ã§ã®ãã¹ãã®æŽçãšå®è¡ã容æã«ããŸãã
- ãªã¢ã«ã¿ã€ã ç£èŠ: ãŠãŒã¶ãŒã¯ãã¹ãçµæããªã¢ã«ã¿ã€ã ã§ç£èŠã§ããã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ã«é¢ããå³æã®æŽå¯ãåŸãŠãããã«ããã¯ãè¿ éã«ç¹å®ã§ããŸãã
- CI/CDãšã®çµ±å: ãµãŒããŒã¯æ¢åã®CI/CDã¯ãŒã¯ãããŒã«ç°¡åã«çµ±åã§ããéçºããã»ã¹ã®äžéšãšããŠèªååãããããã©ãŒãã³ã¹ãã¹ããä¿é²ããŸãã
- ã¹ã±ãŒã©ããªãã£: 倧éã®åæãŠãŒã¶ãŒãåŠçã§ããããã«èšèšãããŠãããk6 MCPãµãŒããŒã¯ãè² è·ã®äžã§ã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ããã¹ãããããã®è€éãªãŠãŒã¶ãŒã·ããªãªãã·ãã¥ã¬ãŒã·ã§ã³ã§ããŸãã
- 詳现ãªã¬ããŒã: ãµãŒããŒã¯ãããŸããŸãªããã©ãŒãã³ã¹ã¡ããªã¯ã¹ã«é¢ããæŽå¯ãæäŸããå æ¬çãªã¬ããŒããçæããããŒã ãããŒã¿ã«åºã¥ããŠæ å ±ã«åºã¥ããæææ±ºå®ãè¡ãã®ã«åœ¹ç«ã¡ãŸãã
k6 MCPãµãŒããŒã®äœ¿ç𿹿³
- ã€ã³ã¹ããŒã«: ã奜ã¿ã®ç°å¢ã«k6 MCPãµãŒããŒãã€ã³ã¹ããŒã«ããŸãã詳现ãªã€ã³ã¹ããŒã«æé ã«ã€ããŠã¯å ¬åŒããã¥ã¡ã³ããåç §ããŠãã ããã
- èšå®: ãã¹ãèŠä»¶ã«åãããŠãµãŒããŒèšå®ãæ§æããŸããããã«ã¯ããã¹ãã¹ã¯ãªããããŠãŒã¶ãŒã·ããªãªãããã³ããã©ãŒãã³ã¹éŸå€ã®èšå®ãå«ãŸããŸãã
- ãã¹ãã®å®è¡: ãµãŒããŒã€ã³ã¿ãŒãã§ãŒã¹ã䜿çšããŠããã©ãŒãã³ã¹ãã¹ããéå§ããŸããç¹å®ã®ãã¹ãã¹ã¯ãªãããéžæããã·ãã¥ã¬ãŒã·ã§ã³ããä»®æ³ãŠãŒã¶ãŒã®æ°ãå®çŸ©ã§ããŸãã
- ç£èŠ: ãã¹ããå®è¡ãããŠããéããµãŒããŒããã·ã¥ããŒããéããŠãªã¢ã«ã¿ã€ã ã§ããã©ãŒãã³ã¹ã¡ããªã¯ã¹ãç£èŠããŸãã
- çµæã®åæ: ãã¹ããå®äºããåŸãçæãããã¬ããŒãã確èªããŠããã©ãŒãã³ã¹ããŒã¿ãåæãã察åŠãå¿ èŠãªåé¡ãç¹å®ããŸãã
ãããã質å
k6 MCPãµãŒããŒã®äž»ãªç®çã¯äœã§ããïŒ
k6 MCPãµãŒããŒã®äž»ãªç®çã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãã¹ããšè² è·ãã¹ããä¿é²ããè€æ°ã®ãã¹ãã¹ã¯ãªããã管çããçµæãç£èŠããããã®éäžãã©ãããã©ãŒã ãæäŸããããšã§ãã
æ¢åã®CI/CDãã€ãã©ã€ã³ã«k6 MCPãµãŒããŒãçµ±åã§ããŸããïŒ
ã¯ããk6 MCPãµãŒããŒã¯CI/CDãã€ãã©ã€ã³ãšã·ãŒã ã¬ã¹ã«çµ±åã§ããããã«èšèšãããŠãããéçºã¯ãŒã¯ãããŒã®äžéšãšããŠèªååãããããã©ãŒãã³ã¹ãã¹ããå¯èœã«ããŸãã
k6 MCPãµãŒããŒã¯å€§èŠæš¡ãã¹ããã©ã®ããã«åŠçããŸããïŒ
k6 MCPãµãŒããŒã¯ã¹ã±ãŒã«ããããã«æ§ç¯ãããŠããããŠãŒã¶ãŒã¯å€§éã®åæãŠãŒã¶ãŒãè€éãªãŠãŒã¶ãŒã·ããªãªãã·ãã¥ã¬ãŒã·ã§ã³ã§ãããããéãè² è·ã®äžã§ã¢ããªã±ãŒã·ã§ã³ããã¹ãããã®ã«çæ³çã§ãã
k6 MCPãµãŒããŒã¯ã©ã®ãããªã¬ããŒããçæããŸããïŒ
k6 MCPãµãŒããŒã¯ãå¿çæéãã¹ã«ãŒãããããšã©ãŒçããªãœãŒã¹å©çšçãªã©ã®ã¡ããªã¯ã¹ãå«ã詳现ãªããã©ãŒãã³ã¹ã¬ããŒããçæããããŒã ãã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãå æ¬çã«çè§£ããã®ã«åœ¹ç«ã¡ãŸãã
k6 MCPãµãŒããŒã䜿çšããããã®ã©ã€ã»ã³ã¹ã¯ãããŸããïŒ
ã¯ããk6 MCPãµãŒããŒã¯MITã©ã€ã»ã³ã¹ã®äžã§æäŸãããŠãããç¡æã§äœ¿çšã倿Žãé åžãå¯èœã§ãã
詳现
ð â¡ïž 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.
ãµãŒããŒèšå®
{
"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": {}
}
}
}