QK

qainsights/k6-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

26 stars 7 forks 品質 64 トレンド 11MIT

k6 MCP サーバー

概要

K6ロードテストを実行するためのモデルコンテキストプロトコル(MCP)サーバーの実装。 - モデルコンテキストプロトコルフレームワークとの簡単な統合 - カスタムテストの期間と仮想ユーザー(VUs)のサポート - k6ロードテストを実行するための使いやすいAPI - 環境変数を介して構成可能 - リアルタイムテスト実行出力 開始する前に、次のインストールを行ってください。 - Python 3.12以上 - k6ロードテストツール(インストールガイド) - uvパッケージマネージャ(インストールガイド) 3. 環境変数(オプション):プロジェクトルートで.envファイルを作成します。 1。 k6テストスクリプトを作成します(例、test.js): 2. お気に入りのMCPクライアント(Claude Desktop、Cursor、Windsurfなど)で以下のスペックを使用してMCPサーバーを構成する。 3。 LLM にテストを実行するように要求します。例えば、hello.js の k6 のテストを実行します。 k6 mcp サーバーは、以下のツールのいずれかを使用してテストを開始します.

概要(AI 翻訳)

K6ロードテストを実行するためのモデルコンテキストプロトコル(MCP)サーバーの実装。

✨ 機能

  • モデルコンテキストプロトコルフレームワークとの簡単な統合
  • カスタムテスト期間と仮想ユーザー(VUs)のサポート
  • k6ロードテストを実行するための使いやすいAPI
  • 環境変数によって構成可能
  • リアルタイムテスト実行出力

384 前提条件

開始する前に、次のインストールを行ってください。

  • Python 3.12以上
  • k6ロードテストツール(インストールガイド)
  • uvパッケージマネージャ(インストールガイド)

インストール

  1. リポジトリのクローン化:

  2. 必要な依存関係を取付けて下さい:

  3. 環境変数をセットアップして下さい(任意): プロジェクトルートの[.envファイルを作成します。

OST 始める

  1. k6テストスクリプト(例、[test.js]])を作成します。

  2. お気に入りのMCPクライアント(Claude Desktop、Cursor、Windsurfなど)で以下のスペックを使用してMCPサーバーを構成する。

3。 LLM にテスト e.g. run k6 test for hello.js を実行するように依頼します。 k6 mcp サーバーは、以下のツールのいずれかを使用してテストを開始します。

  • [execute_k6_test]: デフォルトオプションでテストを実行します(30秒の長さ、10 VU)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

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

📝 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.

GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "k6": { "command": "/path/to/bin/uv", "args": [ "--directory", "/path/to/k6-mcp-server", "run", "k6_server.py" ] } } }