Mcp K6
k6 MCP server
An experimental MCP (Model Context Protocol) server for k6, written in Go. It offers script validation, test execution, documentation browsing, and guided script generation.
Important
This project is still experimental. Expect sharp edges, keep a local clone up to date, and share feedback or issues so we can iterate quickly.
Features
Tools
- Script Validation:
validate_scriptruns k6 scripts with minimal configuration (1 VU, 1 iteration) and returns actionable errors to help quickly produce correct code. - Test Execution:
run_scriptruns k6 performance tests locally with optional VUs, duration, and iteration overrides, and, when possible, extracts insights from the results. - Documentation Browsing:
list_sectionsandget_documentationprovide structured navigation of the official k6 docs and allow retrieving full markdown for specific sections. Docs are downloaded on first use, cached locally, and automatically kept fresh via periodic staleness checks.
Resources
- Best Practices Resources: Comprehensive k6 scripting guidelines and patterns to help you write effective, idiomatic, and correct tests.
Prompts
- Script Generation with
generate_script: Generate production-ready k6 test scripts from plain-English requirements. It automatically follows modern testing practices by leveraging embedded best practices and the official k6 documentation.
Getting Started
Choose your preferred installation method:
- 🐳 Option 1: Docker (Recommended)
- 🍎 Option 2: Homebrew macOS
- 🐧 Option 3: Package Installation (Linux)
- 💻 Option 4: Native Installation
- 🔧 Option 5: k6 Subcommand (xk6)
Option 1: Docker (Recommended)
The easiest way to get started. The Docker image includes k6 and all dependencies.
Prerequisites:
- Docker: Install from docker.com
Pull the official image:
docker pull grafana/mcp-k6:latest
Note
That's it! You're ready to run the containerized server.
Proceed to Editor Integrations to configure your editor.
Option 2: Homebrew macOS
Install mcp-k6 using Homebrew. k6 will be automatically installed as a dependency.
Installation:
# Add the grafana homebrew tap repository
brew tap grafana/grafana
# Install mcp-k6
brew install mcp-k6
# Verify installation
mcp-k6 --version
Note
To update to a newer version, download and install the latest formula again, or use brew upgrade if installed from the tap.
Proceed to Editor Integrations to configure your editor.
Option 3: Package Installation (Linux)
Pre-built packages are available for Debian/Ubuntu and RHEL/Fedora/CentOS distributions.
Version naming: Git tags include the
vprefix (e.g.v0.2.0), but release files drop it. ReplaceVERSIONbelow with just the numeric part (0.2.0).
Prerequisites:
- k6 (recommended): Should be installed for script execution
Debian/Ubuntu (.deb)
Download and install the .deb package from the latest release:
# For amd64 (x86_64)
curl -LO https://github.com/grafana/mcp-k6/releases/latest/download/mcp-k6_VERSION_linux_amd64.deb
sudo dpkg -i mcp-k6_0.2.0_linux_amd64.deb
# For arm64
curl -LO https://github.com/grafana/mcp-k6/releases/latest/download/mcp-k6_VERSION_linux_arm64.deb
sudo dpkg -i mcp-k6_0.2.0_linux_arm64.deb
Or install directly with apt:
# Download the package
curl -LO https://github.com/grafana/mcp-k6/releases/latest/download/mcp-k6_VERSION_linux_amd64.deb
# Install with apt (resolves dependencies)
sudo apt install ./mcp-k6_0.2.0_linux_amd64.deb
RHEL/Fedora/CentOS (.rpm)
From the project's README.