
grafana/mcp-k6 是从 https://github.com/grafana/mcp-k6. 导入的 MCP 服务器候选
概览
grafana/mcp-k6 是从 https://github.com/grafana/mcp-k6. 导入的 MCP 服务器候选
概述(AI 翻译)
一个实验性的 MCP(模型上下文协议)服务器,用于 K6,使用 Go 编写。它提供脚本验证、测试执行、文档浏览和引导脚本生成。
[!重要] 该项目仍处于实验阶段。请期待尖锐的改进,保持本地克隆的更新,并分享反馈或问题,以便我们快速迭代。
特色
工具
- 脚本验证:
validate_script以最小配置(1 VU,1 次迭代)运行 k6 脚本,并返回可操作错误以帮助快速生成正确代码。 - 测试执行:
run_script在本地运行 k6 性能测试,并可选择 VU、持续时间和迭代覆盖,并在可能的情况下从结果中提取洞见。 - 文档浏览:
list_sections和get_documentation提供官方 k6 文档的结构化导航,并允许针对特定部分检索完整 markdown。文档在首次使用时下载,缓存本地,并通过定期的陈旧性检查自动保持新鲜。
资源
- 最佳实践资源:全面的k6脚本指南和模式,帮助你编写有效、习用法且正确的测试。
提示
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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 upgradeif 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.
安装
docker run --rm -i grafana/mcp-k6配置
{
"mcpServers": {
"remote-k6": {
"url": "http://your-server-ip:8080/mcp"
}
}
}