MCP ExplorerExplorer

K6 Mcp Experiment

@oleiadeon a month ago
1 MIT
FreeCommunity
AI Systems
k6 MCP for Claude enables HTTP load testing via the Claude chat interface.

Overview

What is K6 Mcp Experiment

k6-mcp-experiment is a Model Capabilities Provider (MCP) designed for Anthropic Claude, enabling users to run k6 load tests directly from the Claude chat interface.

Use cases

Use cases include testing the performance of web applications, validating server capacity under load, and conducting stress tests to identify potential bottlenecks in web services.

How to use

To use k6-mcp-experiment, clone the repository, build and install it using Go, and configure the Claude developer settings to include the k6 MCP server. After setup, you can run load tests by interacting with the Claude chat interface.

Key features

Key features include the ability to run HTTP load tests against any website with a simple prompt, configure the number of virtual users and iterations, and receive test results directly in the Claude chat.

Where to use

k6-mcp-experiment can be used in web performance testing, load testing for applications, and any scenario where HTTP requests need to be simulated to assess website performance.

Content

k6 MCP for Claude

This is a Model Capabilities Provider (MCP) for Anthropic Claude that enables running k6 load tests directly from the Claude chat interface.

Features

  • Run HTTP load tests against any website with a simple prompt
  • Configure the number of virtual users and iterations
  • Get test results directly in your Claude chat

Requirements

  • Go (1.18+)
  • k6 installed on your system
  • Anthropic Claude desktop app

Installation

  1. Clone this repository:

    git clone https://github.com/grafana/k6-mcp.git
    cd k6-mcp
    
  2. Build and install:

    go install
    

Setting Up Claude to Use k6 MCP

  1. Create or update your Claude developer configuration file at the following location:

    • macOS: /Users/<username>/Library/Application Support/Claude/claude-dev-config.json
    • Windows: %APPDATA%\Claude\claude-dev-config.json
    • Linux: ~/.config/Claude/claude-dev-config.json
  2. Add the k6 MCP configuration:

    {
      "mcpServers": {
        "k6": {
          "command": "/usr/local/go/bin/go",
          "args": [
            "run",
            "-C",
            "/path/to/your/k6-mcp",
            "github.com/grafana/k6-mcp"
          ]
        }
      }
    }

    Note: Replace /path/to/your/k6-mcp with the actual path to your cloned repository.

    Example for macOS:

    {
      "mcpServers": {
        "k6": {
          "command": "/usr/local/go/bin/go",
          "args": [
            "run",
            "-C",
            "/Users/username/Dev/grafana/k6-mcp",
            "github.com/grafana/k6-mcp"
          ]
        }
      }
    }
  3. Restart the Claude desktop app to apply changes.

Running Locally for Development

To run the MCP server locally for development:

go run .

The server will start and listen for input on stdin and write to stdout.

Using k6 MCP with Claude

Once your MCP is set up, you can ask Claude to run load tests with commands like:

Run a load test against https://example.com with 5 users and 20 iterations

Claude will use the k6 MCP to generate and run the test, then display the results in the chat.

Troubleshooting

If you encounter issues:

  1. Check the logs at:

    • macOS: /Users/<username>/Library/Logs/Claude/mcp-server-k6.log
    • Windows: %APPDATA%\Claude\Logs\mcp-server-k6.log
    • Linux: ~/.local/share/Claude/logs/mcp-server-k6.log
  2. Ensure k6 is properly installed and available in your PATH

  3. Verify that your Claude developer configuration is correct

Extending the MCP

This MCP uses interfaces for script generation and execution, making it easy to add new functionality:

  • Implement custom ScriptGenerator interfaces for different types of tests
  • Create a new K6Executor implementation to use the k6 Go library directly instead of the CLI

License

MIT

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers