Skip to main content
Glama

🚀 ⚡️ k6-mcp-サーバー

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

✨ 特徴

  • モデルコンテキストプロトコルフレームワークとのシンプルな統合

  • カスタムテスト期間と仮想ユーザー(VU)のサポート

  • k6 負荷テストを実行するための使いやすい API

  • 環境変数で設定可能

  • リアルタイムテスト実行出力

Related MCP server: JMeter MCP Server

🔧 前提条件

始める前に、以下がインストールされていることを確認してください。

📦 インストール

  1. リポジトリをクローンします。

git clone https://github.com/yourusername/k6-mcp-server.git
  1. 必要な依存関係をインストールします。

uv pip install -r requirements.txt
  1. 環境変数を設定する (オプション): プロジェクト ルートに.envファイルを作成します。

K6_BIN=/path/to/k6  # Optional: defaults to 'k6' in system PATH

🚀 はじめに

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

import http from "k6/http";
import { sleep } from "k6";

export default function () {
  http.get("http://test.k6.io");
  sleep(1);
}
  1. お気に入りの MCP クライアント (Claude Desktop、Cursor、Windsurf など) で以下の仕様を使用して MCP サーバーを構成します。

{
  "mcpServers": {
    "k6": {
      "command": "/Users/naveenkumar/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/naveenkumar/Gits/k6-mcp-server",
        "run",
        "k6_server.py"
      ]
    }
  }
}
  1. LLMにテストの実行を指示します。例えば、 run k6 test for hello.js 。k6 mcpサーバーは、以下のいずれかのツールを利用してテストを開始します。

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

  • execute_k6_test_with_options : カスタム期間と VU でテストを実行する

k6-MCP

📝 APIリファレンス

K6テストを実行する

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

カスタムオプションでK6テストを実行する

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

🤝 貢献する

貢献を歓迎します!お気軽にプルリクエストを送信してください。

📄 ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

Available Tools

2 tools
execute_k6_testB

Execute a k6 load test.

Args: script_file: Path to the k6 test script (.js) duration: Duration of the test (e.g., "30s", "1m", "5m") vus: Number of virtual users to simulate

ParametersJSON Schema
NameRequiredDescriptionDefault
script_fileYes
durationNo30s
vusNo

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool executes a load test, implying a potentially resource-intensive operation, but does not disclose behavioral traits such as permissions needed, rate limits, whether it runs synchronously/asynchronously, or what happens on failure. This is a significant gap for a tool with mutation-like behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the main purpose, followed by parameter explanations in a structured 'Args:' section. Every sentence earns its place by clarifying parameters, though it could be slightly more concise by integrating the parameter details more seamlessly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of executing a load test (a mutation-like operation), no annotations, and no output schema, the description is incomplete. It covers the basic purpose and parameters but lacks critical context such as return values, error handling, or execution behavior. This is adequate as a minimum but has clear gaps for safe agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all three parameters: 'script_file' as a path to a .js file, 'duration' with examples of time formats, and 'vus' as the number of virtual users. This adds substantial value beyond the bare schema, though it could include more details like valid ranges or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Execute a k6 load test' with a specific verb ('execute') and resource ('k6 load test'). It distinguishes from the sibling tool 'execute_k6_test_with_options' by being the basic version, though this distinction is implied rather than explicit. The purpose is not vague or tautological.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying parameters for a basic load test, but does not explicitly state when to use this tool versus the sibling 'execute_k6_test_with_options'. No exclusions or alternatives are mentioned, leaving the agent to infer that this is for simpler tests without additional options.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_k6_test_with_optionsB

Execute a k6 load test with custom duration and VUs.

Args: script_file: Path to the k6 test script (.js) duration: Duration of the test (e.g., "30s", "1m", "5m") vus: Number of virtual users to simulate

ParametersJSON Schema
NameRequiredDescriptionDefault
script_fileYes
durationYes
vusYes

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool executes a load test but doesn't mention critical behaviors like whether it's destructive (e.g., impacts system performance), requires specific permissions, has rate limits, or what happens upon execution (e.g., returns results, runs in background). This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The parameter explanations are concise and directly relevant. However, the 'Args:' section formatting is slightly redundant with the schema but still earns its place by clarifying semantics.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation tool (executing tests), the description is incomplete. It lacks information on return values, error handling, prerequisites (e.g., script availability), and behavioral implications. For a tool that likely affects system resources, this is inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It effectively adds meaning by explaining all three parameters: 'script_file' as a path to a .js file, 'duration' with format examples, and 'vus' as number of virtual users. This provides clear semantics beyond the bare schema, though it could be more detailed (e.g., constraints on values).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Execute a k6 load test with custom duration and VUs.' It specifies the verb ('execute'), resource ('k6 load test'), and key customizable parameters. However, it doesn't explicitly differentiate from its sibling 'execute_k6_test' (mentioned in context), which would be needed for a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its sibling 'execute_k6_test' or any alternatives. It mentions custom parameters but doesn't explain scenarios where this tool is preferred over simpler versions or when it should be avoided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updates
    • First observedexecute_k6_test
    • First observedexecute_k6_test_with_options

TDQS

C2.8/5.0

Scored across 2 tools

Disambiguation1/5

The two tools are essentially identical in purpose and functionality, both executing k6 load tests with the exact same parameters (script_file, duration, vus). The only difference is the tool name, which creates confusion rather than clarity. An agent would have no meaningful basis to choose between them.

Naming Consistency3/5

Both tools follow a consistent snake_case pattern with 'execute_k6_test' as the base, which is readable. However, the second tool's name 'execute_k6_test_with_options' is redundant since the first tool already accepts options (duration and VUs), making the naming somewhat inconsistent in logic despite matching the format.

Tool Count2/5

With only 2 tools, the server feels thin for a load testing domain, as it lacks operations like listing tests, getting results, or managing test configurations. The tools are redundant, so the effective count is even lower, failing to cover basic workflows beyond a single execution action.

Completeness2/5

The server is severely incomplete for k6 load testing, missing essential operations such as retrieving test results, monitoring test status, or managing test scripts. It only offers execution with no way to access outcomes, leaving agents unable to perform a full testing lifecycle.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers