关于 Advanced Zebrunner MCP Server
Advanced Zebrunner MCP Server 将 AI 助手连接到 Zebrunner 测试管理,面向 QA 团队。它整合分析、测试用例检查、报告和受控修改,并通过资源与提示词支持工作流。
主要功能
- 01获取测试用例、套件、运行和启动详情
- 02分析测试覆盖率与执行趋势
- 03按规则验证和改进测试用例
- 04生成测试代码与报告
- 05管理测试启动和运行数据
适用场景
- 01检查覆盖缺口与自动化准备情况
- 02依据团队规则检查或改进测试用例
- 03编制质量报告并调查失败原因
- 04管理测试启动与运行元数据
MCP 相关
该 MCP 服务提供 Zebrunner 测试管理、分析、报告和修改工具,以及资源与提示词。它支持 STDIO 和 Streamable HTTP 传输及多种认证模式。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
npx -y mcp-zebrunnerZEBRUNNER_URLBase URL for your Zebrunner instance (e.g., https://your-instance.zebrunner.com)ZEBRUNNER_LOGINYour Zebrunner username/loginZEBRUNNER_TOKEN密钥Your Zebrunner API authentication token (Personal API Token from Settings → API Tokens, or refreshToken from SSO session)TIMEOUTAPI request timeout in milliseconds (default: 30000)RETRY_ATTEMPTSNumber of retry attempts for failed API requests (default: 3)RETRY_DELAYDelay between retry attempts in milliseconds (default: 1000)MAX_PAGE_SIZEMaximum page size for paginated API requests (default: 100, max: 1000)DEFAULT_PAGE_SIZEDefault page size for paginated API requests (default: 10)DEBUGEnable debug logging (default: false)ENABLE_RULES_ENGINEEnable the rules engine for test case validation (default: auto-detected from mcp-zebrunner-rules.md file)STRICT_URL_VALIDATIONEnable strict URL validation for security (default: true)SKIP_URL_VALIDATION_ON_ERRORSkip URL validation if it fails (less secure, more permissive) (default: false)ENABLE_RATE_LIMITINGEnable rate limiting for API calls (default: true)MAX_REQUESTS_PER_SECONDMaximum API requests per second (default: 5, max: 100)RATE_LIMITING_BURSTAllow burst of API requests (default: 10, max: 200)PORTHTTP server port (required for StreamableHTTP mode)MCP_TRANSPORTTransport mode: stdio, http, or auto (default: auto)MCP_AUTH_MODE密钥Authentication mode: headers, oauth, or both (default: headers)MCP_SERVER_URLPublic URL of this MCP server (for OAuth metadata)本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
高级 Zebrunner MCP 服务
一个 Model Context Protocol(MCP) 服务,为 Zebrunner 带来高级分析、报告、故障取证和安全的 TCM 修改。此服务旨在与官方 Zebrunner MCP(beta)共存——请参阅下方的“双 MCP 设置”部分。
工具命名:此服务上的每个工具都以规范的
adv_<name>形式注册(例如adv_create_test_case、adv_list_test_runs),因此绝不会与官方 Zebrunner MCP 冲突。旧名称仍作为已弃用的别名保留,以便使用旧名称的提示词/脚本暂时继续运行;这些别名将在下一个主要版本中移除。
🆕 v9.4.4 — 测试运行元数据 Agent 体验:修改后的引导提示(更新前发现环境/配置;导入不会设置徽标);用于区分环境与 Build/Platform 的双 MCP 路由资源;为
adv_manage_test_run提供更丰富的工具情报。基于 v9.4.3 环境契约构建——请参阅 change-logs.md。v9.4.3 —
adv_prepare_jira_automation_plan+/jira-automation-plan提示词:将 Zebrunner 套件转换为结构化 Jira 计划;adv_manage_test_runPublic API 的environment支持{ name }/{ id }。请参阅 change-logs.md、TEST_PROMPTS.md §20。v9.3.1 — TCM 分页修复:正确遍历
get_all令牌、按root_suite_id限定子树范围、提供准确的批量元数据。请参阅 PUBLIC_API_PAGINATION.md 和 change-logs.md。v9.3.0 — 多 PR/周期测试影响:
change_batches[]、/test-impact-period、扩展版/test-impact。请参阅 TEST_IMPACT_WORKFLOW.md 和 TEST_IMPACT_PR_PERIOD_DESIGN.md。🆕 v9.2.7 — 新增
adv_scaffold_test_case向导(表单与对话相结合),可根据最佳实践编写测试用例,并自动检查相似用例且仅发出警告;此外,zebrunner-config.json支持可选的projectAliases,让工具既接受简称,也接受 Zebrunner 项目键。请参阅发行说明。🆕 v9.2.5 —
adv_get_test_authoring_trend(TAM 模板 7)补全了 22/22 个仪表板小组件的 MCP 覆盖。中枢工具、通过率视图、周期模式。请参阅 TEST_PROMPTS.md §18 和 change-logs.md。
v9.2.1 — 大模型可见指标(
include_call_metrics、会话明细)、紧凑模式扩展(+19 个工具)、格式/截断错误修复。请参阅 Token 效率指南 和 change-logs.md。
v9.2.0 — 可选的令牌/成本优化:
format:'compact'、detail:'summary'、adv_batch_get_test_cases、报告inline:false。默认设置不变。请参阅 change-logs.md。
v9.1.0 — 启动操作:
adv_rerun_launch_failures、adv_start_launch(Jenkins Build Now),以及/relaunch-regression-failures和/feature-scoped-launch提示词。请参阅 GitHub Release v9.1.0。📖 需要安装帮助? 请查看我们的**分步安装指南**,了解详细的设置说明。
🚀 通过 npm 安装? 请参阅我们的 MCP npm 安装指南,了解 Claude Desktop、Cursor、IntelliJ IDEA 和 ChatGPT Desktop 的配置方法。
📚 Test、Test Case 和 Launch 有何区别? 请参阅 术语与词汇表,了解定义、计数规则和指标计算方法。
🔥 为什么选择此服务
这是Advanced Zebrunner MCP 服务——它不仅能处理基本的测试用例管理,还能帮助 QA 团队借助 AI 更智能、更高效地开展工作。与官方 Zebrunner MCP(测试版,约 70 个工具,涵盖 Public REST、Reporting、TAM 和 Launcher)相比,此服务提供 76 个已注册的 adv_* 工具(70 个内联回归套件工具 + 6 个处理程序模块工具;请参阅 tools.json),并且可以与官方服务安全地并行运行:
- 报告与分析 — 仪表板、通过率趋势、回归稳定性报告、运行效率分析、缺陷审查和每周差异跟踪
- 测试覆盖率与分析 — 覆盖率缺口、自动化就绪度评分和跨套件分析
- 智能规则系统 — 三级质量规则,包含 100 多项自动检查点,用于验证和改进测试用例
- 截图与视频分析 — 由 sharp、ffmpeg 和 tesseract 提供支持的 OCR、图像处理和视频分析
- MCP 资源与提示词 — 使用
@注入上下文,并通过/工作流命令简化日常操作 - 多传输方式与多重身份验证 — STDIO、Streamable HTTP、自助式 OAuth、Okta SSO 和令牌交换(模式 1–5)
📑 目录
- 3.1. 此工具的特别之处
- 3.2. 规则如何协同工作
- 3.3. 为什么这很重要
- 3.4. 为你的项目自定义规则
- 6.1. 方法 1:与 Claude Desktop/Code 搭配使用
- 6.2. 方法 2:作为独立服务运行
- 6.3. 方法 3:基于智能 URL 的分析 🚀
- 7.1. 📋 测试用例管理
- 7.2. 🌳 测试套件层级与组织
- 7.3. 🔧 变更工具
- 7.4. 🔍 测试覆盖率与分析
- 7.5. 🧪 测试代码生成与验证
- 7.6. 🚀 启动与执行管理
- 7.7. 📊 报告与分析
- 7.8. 🏃 测试运行管理
- 7.9. 🎯 面向管理的快捷命令
- 9.1. 👩💻 手动 QA 工程师
- 9.2. 🤖 测试自动化工程师与 SDET
- 9.3. 👨💻 开发者
- 9.4. 👔 测试经理与团队负责人
- 9.5. 🏢 项目负责人和产品经理
🎯 这是什么工具?
此工具可让你:
- 从 Zebrunner 检索测试用例和测试套件
- 分析测试覆盖率并生成测试代码
- 获取测试执行结果和启动详情
- 使用智能规则进行自动检查,验证测试用例质量
- 生成报告并从测试数据中获取洞察
- 借助 AI 提供的建议和自动修复来改进测试用例
所有操作都可以通过 AI 助手中的自然语言命令完成!
🧠 智能规则系统
此工具的特别之处
我们的 MCP 服务包含一套先进的 三级规则系统,可彻底改变你处理测试用例的方式:
🎯 测试用例审查规则(test_case_review_rules.md)
- 用途:核心质量标准和编写指南
- 功能:定义编写高质量测试用例的基本原则
- 关键领域:独立性、单一职责、全面的前置条件、完整的步骤覆盖
- 适用工具:
adv_validate_test_case和adv_improve_test_case
✅ 测试用例分析检查点(test_case_analysis_checkpoints.md)
- 用途:包含 100 多个检查点的详细验证清单
- 功能:提供细化的验证标准,以便全面分析测试用例
- 关键领域:结构验证、自动化就绪情况、平台考量、质量保证
- 适用工具:
adv_validate_test_case,用于全面评分和问题检测
⚙️ MCP Zebrunner 规则(mcp-zebrunner-rules.md)
- 用途:用于测试生成和覆盖率分析的技术配置
- 功能:定义框架检测模式、代码模板和覆盖率阈值
- 关键领域:框架检测、测试生成模板、覆盖率阈值、质量标准
- 适用工具:
adv_generate_draft_test_by_key和adv_get_enhanced_test_coverage_with_rules
规则如何协同工作
graph TD
A[Test Case] --> B[adv_validate_test_case]
B --> C[test_case_review_rules.md]
B --> D[test_case_analysis_checkpoints.md]
B --> E[Validation Result + Issues]
E --> F[adv_improve_test_case]
F --> G[AI-Powered Improvements]
A --> H[adv_generate_draft_test_by_key]
H --> I[mcp-zebrunner-rules.md]
H --> J[Generated Test Code]
A --> K[adv_get_enhanced_test_coverage_with_rules]
K --> I
K --> L[Coverage Analysis + Rules Validation]
为什么这很重要
- 一致性:所有团队成员都遵循相同的质量标准
- 自动化:通过自动验证减少人工审查时间
- 学习:新团队成员通过 AI 反馈学习最佳实践
- 自定义:根据项目的具体需求调整规则
- 持续改进:AI 根据经过验证的模式提出改进建议
为项目自定义规则
你可以自定义以下三个规则文件中的任意一个:
# Copy default rules to customize
cp test_case_review_rules.md my-project-review-rules.md
cp test_case_analysis_checkpoints.md my-project-checkpoints.md
cp mcp-zebrunner-rules.md my-project-technical-rules.md
# Use custom rules in validation
"Validate test case PROJ-123 using custom rules from my-project-review-rules.md"
自定义示例:
- 移动项目:添加针对移动平台的验证规则
- API 项目:重点关注 API 测试模式和数据验证
- 不同框架:自定义代码生成模板
- 公司标准:与组织的测试指南保持一致
📋 前提条件
你需要了解的内容
- 基本的命令行用法(打开终端、运行命令)
- 你的 Zebrunner 凭据(登录信息和 API 令牌)
- 测试管理基础知识(测试用例、测试套件)
软件要求
- Node.js 18 或更高版本——在此下载
- npm(随 Node.js 一同提供)
- 能够访问具有 API 凭据的 Zebrunner 实例
如何检查是否已安装 Node.js
打开终端/命令提示符并运行:
node --version
npm --version
如果看到版本号,就可以开始了!
🚀 快速入门指南
💡 需要更详细的说明? 查看我们的**更详细的分步安装指南**,其中包含故障排除提示和针对不同平台的说明。
第 1 步:获取代码
选择以下一种方式:
选项 A:从代码仓库克隆(推荐)
git clone https://github.com/maksimsarychau/mcp-zebrunner.git
cd mcp-zebrunner
选项 B:下载并解压
下载项目文件并将其解压到一个文件夹中。
第 2 步:安装依赖项
npm install
第 3 步:配置 Zebrunner 连接
在项目文件夹中创建一个 .env 文件,填入 Zebrunner 详情:
# Your Zebrunner instance URL (without trailing slash)
ZEBRUNNER_URL=https://your-company.zebrunner.com/api/public/v1
# Your Zebrunner login (usually your email)
[email protected]
# Your Zebrunner API token (get this from your Zebrunner profile)
ZEBRUNNER_TOKEN=your_api_token_here
# Optional: Enable debug logging (default: false)
DEBUG=false
# Optional: Enable intelligent rules system (auto-detected if rules file exists)
ENABLE_RULES_ENGINE=true
如何获取 Zebrunner API 令牌:
- 登录你的 Zebrunner 实例
- 前往个人资料设置
- 找到“API Access”部分
- 生成新的 API 令牌
- 将令牌复制到你的
.env文件中
第 4 步:构建项目
npm run build
第 5 步:测试连接
npm run test:health
如果你看到“✅ Health check completed”,就可以开始使用了!
🔄 更新到新版本
查看当前版本
# Check your current version
npm run version
# or manually check package.json
cat package.json | grep '"version"'
更新步骤
# 1. Pull latest changes from master branch
git pull origin master
# 2. Install any new dependencies
npm install
# 3. Rebuild the project
npm run build
# 4. Test your connection (requires valid .env file)
npm run test:health
重要说明:
- ✅ 健康检查要正常运行,必须正确配置
.env文件 - ✅ 更新后请重启 Claude Desktop/Code,以重新加载 MCP 服务
- ✅ 更新前请查看发行说明,了解是否存在重大变更
如果健康检查失败,请检查 .env 配置和 Zebrunner 凭据。
🔧 使用方法
方法 1:与 Claude Desktop/Code 搭配使用(推荐)
将此配置添加到 Claude Desktop 或 Claude Code 设置中。**重要:**必须使用项目文件夹的完整绝对路径。
{
"mcpServers": {
"mcp-zebrunner": {
"command": "node",
"args": ["/full/absolute/path/to/mcp-zebrunner/dist/server.js"],
"env": {
"ZEBRUNNER_URL": "https://your-company.zebrunner.com/api/public/v1",
"ZEBRUNNER_LOGIN": "[email protected]",
"ZEBRUNNER_TOKEN": "your_api_token_here",
"DEBUG": "false",
"ENABLE_RULES_ENGINE": "true",
"DEFAULT_PAGE_SIZE": "100",
"MAX_PAGE_SIZE": "100"
}
}
}
}
路径示例:
- Windows:
C:\\Users\\YourName\\Projects\\mcp-zebrunner\\dist\\server.js - macOS/Linux:
/Users/YourName/Projects/mcp-zebrunner/dist/server.js
替代方法:命令行集成(Claude Code)
你也可以使用命令行添加此服务:
claude mcp add mcp-zebrunner \
--env ZEBRUNNER_URL="https://your-company.zebrunner.com/api/public/v1" \
--env ZEBRUNNER_LOGIN="[email protected]" \
--env ZEBRUNNER_TOKEN="your_api_token_here" \
--env DEBUG="false" \
--env ENABLE_RULES_ENGINE="true" \
-- node /full/absolute/path/to/mcp-zebrunner/dist/server.js
**重要:**将 /full/absolute/path/to/mcp-zebrunner/ 替换为项目文件夹的实际完整路径。
方法 2:作为独立服务运行
开发模式(自动重新加载)
npm run dev
生产模式
npm start
方法 3:基于智能 URL 的分析 🚀
**v5.4.1+ 新增:**Claude 可以自动检测 Zebrunner URL,并使用最佳设置进行分析!
只需在对话中粘贴 Zebrunner URL,Claude 就会自动:
- 解析 URL,提取项目、启动和测试 ID
- 调用相应的分析工具
- 使用推荐设置(启用视频、屏幕截图和 AI 分析)
📋 支持的 URL 模式
1. 测试分析 URL
https://your-workspace.zebrunner.com/projects/PROJECT/automation-launches/LAUNCH_ID/tests/TEST_ID
执行结果:
- Claude 自动调用
adv_analyze_test_failure - 提取:
projectKey、testRunId(启动 ID)、testId - 启用:
includeVideo: true、analyzeScreenshotsWithAI: true,以及所有诊断功能
示例:
User: "Analyze https://your-workspace.zebrunner.com/projects/MCP/automation-launches/120911/tests/5455386"
Claude automatically calls:
{
projectKey: "MCP",
testRunId: 120911,
testId: 5455386,
includeVideo: true,
analyzeScreenshotsWithAI: true,
includeLogs: true,
includeScreenshots: true,
analyzeSimilarFailures: true,
screenshotAnalysisType: "detailed",
format: "detailed"
}
2. 启动分析 URL
https://your-workspace.zebrunner.com/projects/PROJECT/automation-launches/LAUNCH_ID
执行结果:
- Claude 自动调用
adv_detailed_analyze_launch_failures - 提取:
projectKey、testRunId(启动 ID) - 启用:
includeScreenshotAnalysis: true,进行全面分析
示例:
User: "Analyze https://your-workspace.zebrunner.com/projects/MCP/automation-launches/120911"
Claude automatically calls:
{
projectKey: "MCP",
testRunId: 120911,
filterType: "without_issues",
includeScreenshotAnalysis: true,
screenshotAnalysisType: "detailed",
format: "summary",
executionMode: "sequential"
}
✨ 高级用法
覆盖默认设置
Claude 能理解自然语言指令来覆盖设置:
User: "Analyze https://...url... but without screenshots"
→ Claude sets: analyzeScreenshotsWithAI: false
User: "Analyze https://...url... in jira format"
→ Claude sets: format: "jira"
User: "Quick analysis of https://...url..."
→ Claude sets: format: "summary", screenshotAnalysisType: "basic"
多个 URL
在一次请求中分析多个测试/启动:
User: "Compare these failures:
https://your-workspace.zebrunner.com/projects/MCP/automation-launches/120911/tests/5455386
https://your-workspace.zebrunner.com/projects/MCP/automation-launches/120911/tests/5455390"
→ Claude analyzes both sequentially and compares results
跨工作区支持
⚠️ 来自不同工作区的 URL 会显示警告,但仍会尝试分析:
User: "Analyze https://other-workspace.zebrunner.com/..."
→ Claude warns: "URL is from 'other-workspace.zebrunner.com' but configured workspace is 'your-workspace.zebrunner.com'"
→ Proceeds with analysis using available credentials
📖 URL 模式参考
| 组成部分 | 示例 | 提取为 | 使用它的工具 |
|---|---|---|---|
| 工作区 | your-workspace.zebrunner.com | 仅用于验证 | 不适用 |
| 项目键 | MCP | projectKey | 所有工具 |
| 启动 ID | 120911 | testRunId | 所有工具 |
| 测试 ID | 5455386 | testId | 仅限 adv_analyze_test_failure |
🎯 为什么使用基于 URL 的分析?
✅ 更快:无需手动指定 ID
✅ 更方便:直接从 Zebrunner UI 复制并粘贴 URL
✅ 更优化:自动使用推荐设置
✅ 更智能:Claude 会识别意图并调整参数
✅ 更灵活:可无缝使用自然语言覆盖默认设置
💡 实用技巧
- 直接从 Zebrunner 获取:查看测试/启动项时,直接从浏览器复制 URL
- 批量分析:粘贴多个 URL,并用换行符分隔
- 自定义设置:添加自然语言指令以覆盖默认设置
- 快速检查:URL 非常适合用于快速询问“这里发生了什么?”
- 生成报告:结合格式要求,例如:“为 https://...url... 生成 JIRA 工单”
🤝 双 MCP 设置(官方 zebrunner + Advanced)
Zebrunner 现已提供官方托管 MCP(测试版),地址为
https://{workspace}.zebrunner.com/api/mcp。可以在同一个 Cursor / Claude 会话中同时运行两个服务:此服务上的每个工具都使用
adv_<name> 前缀,因此绝不会与官方工具冲突。
.cursor/mcp.json 示例:
{
"mcpServers": {
"zebrunner": {
"url": "https://your-workspace.zebrunner.com/api/mcp",
"headers": {
"X-Zebrunner-Username": "[email protected]",
"X-Zebrunner-Api-Token": "<your-zebrunner-api-token>"
}
},
"mcp-zebrunner": {
"command": "npx",
"args": ["-y", "mcp-zebrunner"],
"env": {
"ZEBRUNNER_URL": "https://your-workspace.zebrunner.com/api/public/v1",
"ZEBRUNNER_LOGIN": "[email protected]",
"ZEBRUNNER_TOKEN": "<your-zebrunner-api-token>"
}
}
}
}
同时连接两个服务时,可参考以下原则:
使用 zebrunner(官方)执行 | 使用 mcp-zebrunner(Advanced)执行 |
|---|---|
list_projects、共享步骤、替换/关闭测试运行、自定义字段创建 | 故障取证、运行时与不稳定性分析 |
服务端 filter DSL;问题排查时上传文件和截图内容 | 报告、仪表板、回归分析器 |
批量启动/测试评论、问题关联、启动器/预设 CRUD、launch_tests | 预览/确认 TCM 变更;Jenkins 立即构建 / 重新运行失败项 |
在聊天中,使用 mode: "routing" 询问 adv_about_mcp_tools,或打开
zebrunner://mcp-routing 资源,以查看完整的实时生成差异和路由表。
🛠️ 可用工具
连接后,你可以通过 AI 助手使用自然语言调用这些工具。本节按类别介绍全部 76 个 adv_* 工具(参见 tools.json)。如需查看包含每个工具自然语言示例的完整目录,请参见 TOOLS_CATALOG.md。
**仪表板小组件:**全部 22 个 Zebrunner 仪表板模板均已支持 MCP(v9.2.5)。示例提示词和 npm run test:api 验证方法请参见 docs/TEST_PROMPTS.md §18。
高效利用令牌读取
大型 TCM 导出可能会占用大量上下文。可使用以下可选启用参数(默认值保持向后兼容)。完整指南: docs/TOKEN_EFFICIENCY.md。
| 技术 | 示例 | 适用场景 |
|---|---|---|
format: 'compact' | adv_get_all_tcm_test_cases_by_project with format:'compact' | 精简 JSON(比美化的 json 小约 22%) |
detail: 'summary' | adv_get_test_cases_by_suite_smart with detail:'summary' | 筛选后使用——仅返回 id、key、标题、优先级、automationState 和 webUrl |
adv_batch_get_test_cases | { case_keys: ["MCP-1","MCP-2"], detail:"summary", format:"compact" } | 一次获取候选列表,无需进行 N 次往返 |
adv_generate_report inline: false | 将 HTML/PNG 写入磁盘,并返回路径 | 在聊天客户端中查看大型仪表板 |
count_only: true | 任何批量 TCM/套件读取 | 仅获取指标,不返回数据 |
| Env flags (off) | MCP_COMPACT_DEFAULTS=true、MCP_SUMMARY_DEFAULTS=true | 评估通过后切换服务器级默认设置 |
工作流: 使用 detail:'summary' + format:'compact' 列出/筛选 → 在创建/更新前,通过 adv_get_test_case_by_key 获取完整内容(步骤、前置条件)。
可提供给助手的提示词示例:
- “列出 MCP 项目中的测试用例,使用摘要详情和精简 JSON。”
- “通过一次批量调用获取 MCP-1 和 MCP-2,使用摘要详情和精简格式。”
- “为 MCP 生成质量仪表板,设置 inline false——保存到磁盘。”
工具命名: 所有工具均以
adv_<name>的形式提供(例如adv_get_test_case_by_key)。在提示词、脚本中,以及同时连接官方 MCP 和 Advanced MCP 时,请使用这些名称。旧版短名称(get_test_case_by_key等)已弃用,仅在设置ZEBRUNNER_REGISTER_LEGACY_ALIASES=true时注册。
📋 测试用例管理
核心测试用例工具
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_get_test_case_by_key | 获取详细的测试用例信息 | "获取测试用例 MCP-123 的详细信息" | 所有角色 |
adv_batch_get_test_cases | 按键获取多个测试用例(部分成功) | "获取 MCP-1 和 MCP-2,并提供摘要详情" | 所有角色 |
adv_get_test_cases_advanced | 按自动化状态、日期进行高级筛选 | "获取创建于 2025-01-01 之后且自动化状态为 'Manual' 的测试用例" | QA、SDET |
adv_get_test_cases_by_automation_state | 按特定自动化状态筛选 | "显示项目 MCP 中所有 'Not Automated' 的测试用例" | SDET、经理 |
adv_get_test_case_by_title | 按标题搜索测试用例(部分匹配) | "查找标题包含 'login functionality' 的测试用例" | 所有角色 |
adv_get_test_case_by_filter | 按套件、日期、优先级、自动化状态进行高级筛选 | "获取套件 491 中创建于 2025-01-01 之后且优先级较高的测试用例" | QA、经理 |
adv_get_automation_states | 列出可用的自动化状态 | "项目 MCP 有哪些可用的自动化状态?" | 所有角色 |
adv_get_automation_priorities | 列出可用的优先级及其 ID | "显示项目 MCP 的所有优先级级别" | 所有角色 |
批量测试用例操作
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_get_all_tcm_test_cases_by_project | 获取所有测试用例(支持分页) | "获取项目 MCP 的所有测试用例" | 经理、负责人 |
adv_get_all_tcm_test_cases_with_root_suite_id | 获取所有测试用例及层级信息 | "获取所有测试用例及其根套件信息" | 分析师 |
adv_get_test_cases_by_suite_smart | 智能获取套件中的测试用例,自动识别根级/子级 | "在项目 MCP 中使用智能模式获取套件 18824 的测试用例" | QA、分析师 |
测试用例变更历史
大多数测试用例工具都支持可选的变更历史增强功能——获取每个测试用例的修改审计日志。这有助于了解步骤何时变更、自动化状态何时转换,或测试用例何时弃用。
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
include_history | boolean | false | 为每个测试用例附加一个包含已解析变更条目的 history 数组 |
history_filter | steps_only | events_only | all |
history_limit | number (1–100) | 20 | 每个测试用例的最大历史条目数 |
支持的工具: adv_get_test_case_by_key、adv_get_test_cases_advanced、adv_get_test_cases_by_automation_state、adv_get_test_case_by_title、adv_get_test_case_by_filter、adv_get_all_tcm_test_cases_by_project、adv_get_test_cases_by_suite_smart
提示词示例:
"Get test case MCP-29 with change history"→ 设置include_history=true"Show me MCP-29 history, events only"→ 设置include_history=true、history_filter='events_only'"Get all automated test cases with their last 5 changes"→ 设置include_history=true、history_limit=5
检测到的事件: became_automated、became_manual、became_deprecated、became_undeprecated、steps_changed、preconditions_changed、postconditions_changed,以及针对任何项目专属自动化状态动态生成的 became_<state_name>。
🌳 测试套件层级与组织
套件管理
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_list_test_suites | 分页列出套件 | "List test suites for project MCP" | 所有角色 |
adv_get_suite_hierarchy | 按层级树状展示 | "Show me the hierarchy of test suites with depth 3" | 管理者、QA |
adv_get_root_suites | 获取顶层套件 | "Show me all root suites for project MCP" | 管理者 |
adv_get_all_subsuites | 获取所有子套件 | "Get all subsuites from root suite 18697" | QA、分析师 |
套件分析工具
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_get_tcm_suite_by_id | 按 ID 获取套件(simple:快速直接调用 API,full:增强层级信息) | "Show me suite 20421 in project MCP" | 所有角色 |
adv_get_tcm_test_suites_by_project | 全面列出套件 | "Get all suites for project MCP with hierarchy" | 管理者 |
adv_get_all_tcm_test_case_suites_by_project | 分页获取所有 TCM 测试用例套件 | "Get all TCM test case suites for project MCP" | 管理者、分析师 |
adv_get_root_id_by_suite_id | 查找任意套件所属的根套件 | "What's the root suite for suite 12345?" | 分析师 |
🔧 变更工具
安全模型: 每个变更工具都遵循两次调用确认门控。第一次调用会返回预览;只有在用户批准后,才应传入
confirm: true来执行变更。所有变更都会记录到审计日志~/.mcp-zebrunner-audit.jsonl。使用dry_run: true检查原始负载。后续步骤引导(v7.2.2): 每次成功变更后,服务都会附加一个
Tip:区块,引导 LLM 执行最有用的下一步操作(例如“验证质量”“发布草稿”“填充测试运行”)。这些提示会根据条件显示——若提示内容重复,则会省略。例如,如果已经使用了review: true,就会省略质量检查提示。创建的测试用例始终会强制设为draft=true,且提示始终会提醒 LLM 通过adv_update_test_case发布。这种做法受到 Strands Agents 引导模式的启发,无需臃肿的系统提示词即可提供及时指导。
套件变更
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_create_test_suite | 创建新的测试套件 | "Create root suite 'Payments' in project MCP" | QA、管理者 |
adv_update_test_suite | 更新现有测试套件(完整 PUT) | "Rename suite 18697 to 'Login & Registration'" | QA、管理者 |
测试用例变更
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_create_test_case | 创建新的测试用例,并在运行时验证优先级、自动化状态和自定义字段。附件支持 {file_path}。可选的 source_case_key 可用于从现有测试用例预先填充内容。 | "Create test case 'Verify login' in suite 17470 for project MCP" | QA、SDET |
adv_update_test_case | 按 ID 或键部分更新测试用例(PATCH)。附件支持 {file_path},可上传本地文件。 | "Attach /Users/me/screenshot.png to test case MCP-42" | QA、SDET |
🔍 测试覆盖率与分析
测试影响(PR / 代码变更) (v9.2.8)
| 工具 | 描述 | 使用示例 | 最适合 |
|---|---|---|---|
adv_analyze_test_impact | 根据精简的语义上下文,对受代码变更影响的 Zebrunner 用例进行排序 | "Analyze test impact for diary edit + serving size changes on PROJ2" | 开发者、SDET |
使用 /test-impact MCP 提示词(可选 pr_url)获取工作流引导。请参阅 TEST_IMPACT_WORKFLOW.md。通过 .env.example 配置 repositoryProjectMap。
覆盖率分析
| 工具 | 描述 | 使用示例 | 适用人群 |
|---|---|---|---|
adv_get_test_coverage_by_test_case_steps_by_key | 分析实现覆盖率 | "Analyze coverage for MCP-123 against this code: [paste code]" | 开发者、SDET |
adv_get_enhanced_test_coverage_with_rules | 基于规则的覆盖率分析 | "Enhanced coverage analysis for MCP-123 with framework detection" | SDET、负责人 |
重复项分析
| 工具 | 描述 | 使用示例 | 适用人群 |
|---|---|---|---|
adv_analyze_test_cases_duplicates | 根据步骤相似度查找并分组相似的测试用例 | "Analyze suite 12345 for duplicates with 80% similarity threshold" | QA 经理、SDET |
adv_analyze_test_cases_duplicates_semantic | 借助大模型进行高级语义分析和步骤聚类 | "Semantic analysis of suite 12345 with step clustering and medoid selection" | 高级 QA、测试架构师 |
🔗 可点击链接功能:两种重复项分析工具均支持指向 Zebrunner Web UI 的可点击链接:
- 添加
include_clickable_links: true,即可让 Markdown 输出中的测试用例键可点击 - 启用后,JSON/DTO 格式会自动包含
webUrl字段 - 链接根据
ZEBRUNNER_URL环境变量生成 - 示例:
"Analyze suite 17585 for duplicates with clickable links enabled"
🧪 测试代码生成与验证
AI 驱动的工具
| 工具 | 描述 | 使用示例 | 适用人群 |
|---|---|---|---|
adv_generate_draft_test_by_key | 通过框架检测生成测试代码 | "Generate Java/Carina test for MCP-123 based on this implementation" | SDET、开发者 |
adv_validate_test_case | 质量验证并提供改进建议 | "Validate test case MCP-123 and suggest improvements" | QA、经理 |
adv_improve_test_case | 专用改进工具 | "Improve test case MCP-123 with specific suggestions" | QA、SDET |
🚀 启动与执行管理
启动操作 ⭐ 管理者必备
| 工具 | 描述 | 使用示例 | 最适合人群 |
|---|---|---|---|
adv_get_launch_details | 全面的启动信息;可选使用 includeJobParameters 来发现 Jenkins 的「立即构建」 | "获取启动 118685 的详情和作业参数" | 经理、负责人、SDET |
adv_rerun_launch_failures | 🆕 v9.1.0 对一个或多个启动重新运行失败/中止的测试(预览/确认) | "重新运行项目 android 中启动 132522 的失败项" | 经理、SDET |
adv_start_launch | 🆕 v9.1.0 触发 Jenkins 立即构建(不是 Launch Launchers);预览/确认 | "立即构建 android 里程碑 26.19.0 build 50977 的回归" | 经理、SDET |
adv_get_launch_summary | 快速查看启动概况 | "显示启动 118685 的摘要" | 经理 |
adv_get_all_launches_for_project | 分页列出各次启动执行记录 | "列出项目 MCP 上个月的启动记录" | 经理、负责人 |
adv_get_all_launches_with_filter | 按里程碑/构建/名称搜索启动记录 | "查找里程碑 2.1.0 和构建 'mcp-app-2.1.0' 的启动记录" | 经理、负责人 |
adv_generate_weekly_regression_stability_report | 每周回归稳定性报告,包含 WoW 变化、关联问题和严格符合 Jira 格式的输出。支持启动列表或基于构建的自动发现(按版本段查找构建,必要时验证 launch.build)。 | "MCP 每周稳定性报告:(120906 vs 120814),(120901 vs 120809)" 或 "构建 9117 vs 48886 的每周稳定性报告" | 经理、负责人 |
adv_analyze_regression_runtime | 回归运行效率分析 — 每次启动的耗时、尝试/重运行明细、可配置的时长分类(短/中/长)、测试和测试用例的双重指标(平均运行时间、WRI)、含测试用例数量的时长分布,以及带变化量跟踪的基线比较。 | "分析 iOS 项目最新里程碑的回归运行时间。显示 WRI 和每个测试用例的 WRI。" 或 "比较最新与上一里程碑的运行时间" | 经理、负责人、SDET |
adv_analyze_regression_runtime— 使用示例:
- “分析 iOS 项目最新里程碑的回归运行时间。显示每项测试和每个测试用例的平均运行时间,以及 WRI 和每个测试用例的 WRI。”
- “分析三个项目各自最新里程碑的回归运行时间。比较每个团队中落入短、中、长时长区间的测试用例数量。”
- “分析 Android 项目最新与上一里程碑的回归运行时间。分别显示两者的 WRI 和每个测试用例的 WRI。效率是提高了还是降低了?”
- “使用 medium_threshold_seconds: 120 和 long_threshold_seconds: 300 分析回归运行时间。显示各个区间包含哪些测试。”
- “每个时长区间中,每个测试用例的平均耗时是多少?长时间运行的测试覆盖的测试用例是否也相应更多?”
📊 报告与分析
测试失败分析 🆕 重大突破
| 工具 | 描述 | 使用示例 | 最适用于 |
|---|---|---|---|
adv_analyze_test_failure | 对失败的测试进行深入取证分析,包含日志、截图、错误分类和建议。**v5.11.0 新增:**与上次通过的执行记录进行比较!显示发生了哪些变化(日志、时长、环境)。此外:format: 'jira' 可生成可直接粘贴到 Jira 的工单,自动设置优先级和标签,并附上可点击的 🎥 视频链接! | "分析 launch 120806 中的测试失败 5451420,并与上次通过的执行记录进行比较" | QA 工程师、SDET、经理 |
adv_get_test_execution_history | 🆕 **v5.11.0 新增!**跟踪各次 launch 中的测试执行趋势。查看通过/失败历史、查找上次通过的执行记录并计算通过率。**关键检测:**突出显示测试在所有近期运行中均失败的情况! | "显示测试 5478492 的执行历史" 或 "测试 5478492 是否一直失败?" | QA 工程师、SDET、经理 |
adv_detailed_analyze_launch_failures | 🚀 v4.12.1 增强分析没有关联问题的失败,具备 Claude 级智能和 Jira 格式支持。自动深入分析并提供执行摘要、时间线、模式和优先级。**新增:**为整个 launch 生成可直接用于 Jira 的工单! | "分析 launch 120806 中的失败" 或使用 format: 'jira' | QA 经理、SDET、团队负责人 |
✅ 已在 v5.2.4 修复! 可靠性提升与视频链接
- 🎥 已修复视频 URL:现在使用 test-sessions API(
/api/reporting/v1/launches/{id}/test-sessions)可靠地提取视频附件- 🛡️ 全面的错误处理:妥善处理缺失的截图/日志(返回空数组,而不是抛出错误)
- 🚫 不再出现“no result received”错误:所有 API 调用都包含适当的 try-catch 块和回退方案
- 🐛 更便于调试:在配置中启用
debug: true时,提供更完善的日志记录- 📊 架构更新:同时支持新旧 API 结构,保持向后兼容性
🎫 v4.12.1 新增! 适用于 Jira 的工单格式
- 使用
format: 'jira'生成可直接粘贴到 Jira 的工单- 根据稳定性和影响自动计算优先级
- 智能标签:
test-automation、locator-issue、flaky-test等- 完整的 Jira 标记语法:表格、面板、代码块、可点击链接
- 🎥 突出显示的视频链接:精美面板 + 链接部分
- 可直接复制粘贴:无需手动排版
- 每张工单可节省 5-10 分钟,并保证质量一致
🧠 v4.11.1 增强!
adv_detailed_analyze_launch_failures可自动进行深度综合分析,就像 Claude 手动分析一样:
- 🎯 执行摘要:关键发现、模式和稳定性指标
- 📅 时间线分析:失败首次出现的时间及其进展追踪
- 🔬 模式分析:按根本原因分组,列出受影响的测试和稳定性百分比
- 🎯 基于优先级的建议:🔴 HIGH / 🟡 MEDIUM / 🟢 LOW,并附影响分析
- 📋 增强的测试详情:完整的错误消息、堆栈跟踪、时间戳
- ❓ 智能后续问题:引导下一步调查
- 智能筛选:默认仅分析没有关联问题的测试
- 可选的 AI 截图分析,适用于所有测试
- 无需手动跟进——一次调用即可掌握完整情况!
🆕 v5.11.0 新增! 测试执行历史记录与对比
- 📊 追踪执行趋势:使用
adv_get_test_execution_history查看各次启动中的通过/失败历史记录- 🔄 与上次通过记录对比:
adv_analyze_test_failure新增compareWithLastPassed参数
- 对比日志(检测新错误)
- 对比耗时(发现性能回退)
- 对比环境(设备/平台变化)
- 对比截图(视觉差异)
- ⚠️ 关键情况检测:当测试在近期所有执行中均失败时,自动突出显示
- 🎯 回归分析:准确查看通过与失败的运行之间发生了哪些变化
- 📈 通过率指标:计算测试随时间变化的稳定性
- 示例提示词请参阅 TOOLS_CATALOG.md!
截图分析与视觉取证 🎯 在 v4.11.0 中增强
| 工具 | 描述 | 用法示例 | 适用人群 |
|---|---|---|---|
adv_download_test_screenshot | 使用身份验证从 Zebrunner 下载受保护的截图 | "Download screenshot from https://your-workspace.zebrunner.com/files/abc123 for test 5451420" | QA 工程师、自动化工程师 |
adv_analyze_screenshot | 使用 OCR、UI 检测和 Claude Vision 进行视觉分析 | "Analyze screenshot https://your-workspace.zebrunner.com/files/abc123 with OCR and detailed analysis" | QA 工程师、SDET、开发者 |
📸 已增强! 截图分析现已直接集成到
adv_analyze_test_failure和analyze_launch_failures中,无需单独调用!详情请参阅截图分析指南。
平台与结果分析 ⭐ 管理人员必备
| 工具 | 描述 | 用法示例 | 适用人群 |
|---|---|---|---|
adv_get_platform_results_by_period | 汇总指定时间段内某个项目的测试结果、通过率和统计数据 | "Get results for MCP during last 7 days" 或 "Show pass rate for MCP" | 管理人员、负责人 |
adv_get_top_bugs | 出现频率最高的缺陷 | "Show me top 10 bugs from last week" | 管理人员、开发者 |
adv_get_bug_review | 详细的缺陷审查,包含失败分析、优先级细分和自动获取详细信息 | "Get bug review with full failure details for top 10 bugs" | 管理人员、QA、开发者 |
adv_get_bug_failure_info | 按哈希码提供完整的失败信息(自动获取的替代方案) | "Get failure info for hashcode 1051677506" | 开发者、SDET |
adv_get_project_milestones | 可用里程碑 | "Get all milestones for project MCP" | 管理人员、项目经理 |
报告组件的时间段行为: period 会原样传递给 Zebrunner 组件(例如 Today、Month、Last 30 Days)。如果所选组件不支持某个特定的时间段标签,API 将返回错误。
项目发现
| 工具 | 描述 | 使用示例 | 适用对象 |
|---|---|---|---|
adv_get_available_projects | 发现所有可访问的项目 | "What projects can I access?" | 所有角色 |
adv_test_reporting_connection | 测试 API 连通性 | "Test my connection to Zebrunner" | 所有角色 |
adv_about_mcp_tools | 总结工具、提示词、资源,或显示会话指标。模式:summary、tool、prompts、resources、metrics | "Using Zebrunner MCP make a summary of all tools with examples" 或 "Show me tool usage metrics for this session" | 所有角色 |
🏃 测试运行管理
公共 API 测试运行 ⭐ 强大的分析工具
| 工具 | 描述 | 使用示例 | 适用对象 |
|---|---|---|---|
adv_list_test_runs | 高级测试运行筛选 | "Get test runs from last 30 days with status 'FAILED'" | 管理者、SDET |
adv_get_test_run_by_id | 测试运行详细信息 | "Get details for test run 12345" | 管理者、QA |
adv_list_test_run_test_cases | 特定测试运行中的测试用例 | "Show me all test cases in test run 12345" | QA、分析师 |
配置管理
| 工具 | 描述 | 使用示例 | 适用对象 |
|---|---|---|---|
adv_get_test_run_result_statuses | 可用的结果状态 | "What result statuses are configured for project MCP?" | QA、SDET |
adv_get_test_run_configuration_groups | 配置选项 | "Show me configuration groups for project MCP" | SDET、负责人 |
📎 MCP 资源与提示词(新增)
完整指南: docs/RESOURCES_AND_PROMPTS.md — 详细用法、示例、参考表和贡献者指南。
除了工具外,该服务还提供 15 个资源和 22 个 MCP 提示词(/pass-rate、/jira-automation-plan 等),帮助用户发现功能并自动化复杂工作流。
资源 — @ 上下文注入
资源是只读参考数据,可通过 @ 菜单附加到对话中。它们可帮助 AI 使用准确的参数值,而不是猜测。
| 资源 | 提供的内容 |
|---|---|
@zebrunner://reports/types | 6 种报告类型,包含参数、默认值和示例 |
@zebrunner://periods | 12 个有效的时间段值(区分大小写) |
@zebrunner://charts | 图表格式、类型和 17 个受支持的工具 |
@zebrunner://formats | 5 类输出格式及其有效值 |
@zebrunner://projects | 所有可访问项目的键和 ID |
@zebrunner://projects/{key}/suites | 项目的根测试套件 |
@zebrunner://projects/{key}/suite-hierarchy | 完整的套件树及父子关系 |
@zebrunner://projects/{key}/automation-states | 自动化状态名称和 ID |
@zebrunner://projects/{key}/priorities | 优先级及其 ID |
@zebrunner://projects/{key}/milestones | 进行中和已完成的里程碑 |
@zebrunner://projects/{key}/result-statuses | 测试运行结果状态 |
@zebrunner://projects/{key}/configuration-groups | 测试运行配置组和选项 |
@zebrunner://projects/{key}/fields | 系统字段和自定义字段定义 |
快速示例:
@ zebrunner://reports/types
@ zebrunner://projects
Generate an executive dashboard for all starred projects.
提示词 — / 工作流命令
提示词是预先构建的工作流指令,可通过 / 命令菜单触发。每个提示词都会引导 AI 执行经过测试的多工具编排。
| 提示词 | 参数 | 功能说明 |
|---|---|---|
/pass-rate | projects | 跨平台通过率及目标对比 |
/runtime-efficiency | projects | 运行时指标及里程碑差值 |
/automation-coverage | projects | 7 项指标覆盖率 + 自动化接入率 |
/executive-dashboard | projects | 适用于站会的 5 部分仪表板 |
/release-readiness | project, milestone? | 提供证据的发布 Go/No-Go 评估 |
/suite-coverage | projects | 各测试套件的覆盖率表(TOTAL + TOTAL REGRESSION) |
/regression-summary | project, milestone?, build? | 回归结果概览、新缺陷、主要缺陷、最慢的测试 |
/review-test-case | case_key | 验证并改进测试用例 |
/launch-triage | project | 回归后的失败分析 |
/relaunch-regression-failures | projects, milestone?, build?, period? | 🆕 v9.1.0 查找启动失败项并批量重新运行失败项 |
/feature-scoped-launch | project, feature, suite_name?, build? | 🆕 v9.1.0 功能关键词 → test_run_rules → 按根测试套件立即构建 |
/flaky-review | project | 检测不稳定测试 + 稳定性改进计划 |
/find-duplicates | project, suite_id? | 结构与语义重复项分析 |
/daily-qa-standup | projects | 每日站会摘要及行动项 |
/automation-gaps | projects | 自动化待办事项优先级排序 |
/project-overview | project | 全面的项目健康状况卡片 |
/session-metrics | (none) | 显示当前会话的工具使用统计 |
快速示例:
/executive-dashboard
projects: android,ios,web
🎯 面向管理的快捷命令
📈 每日站会报告
# Get yesterday's results
"Get platform results for last 7 days for project MCP"
# Check recent failures
"Show me top 5 bugs from last week"
# Review recent launches
"Get all launches for project MCP from last 3 days"
🔍 测试套件优化
# Basic duplicate analysis
"Analyze suite 12345 for duplicates with 80% similarity threshold"
# Advanced semantic analysis with step clustering
"Semantic analysis of suite 12345 with 85% step clustering and medoid selection"
# Analyze specific test cases for duplicates
"Analyze test cases MCP-123, MCP-124, MCP-125 for duplicates"
# Project-wide duplicate analysis (use with caution - large datasets)
"Analyze project MCP for test case duplicates with 85% similarity"
# Get detailed similarity matrix with pattern types
"Analyze suite 12345 for duplicates with similarity matrix included"
# Two-phase clustering with semantic insights
"Semantic duplicate analysis with step clustering threshold 90% and insights enabled"
# Enable clickable links for easy navigation
"Analyze suite 17585 for duplicates with clickable links enabled"
📊 每周管理报告
# Comprehensive project health
"Get all launches for project MCP with milestone filter"
# Platform performance analysis
"Get iOS and Android test results for the last month"
# Quality metrics
"Get all test cases by automation state for project MCP"
🎯 里程碑与发布规划
# Milestone tracking
"Get project milestones for MCP with completion status"
# Build-specific results
"Get launches for build 'mcp-app-2.1.0-release' and milestone '2.1.0'"
# Release readiness
"Get automation readiness for all test cases in project MCP"
🐞 问题分析与故障排除
# Bug analysis
"Show me top 10 most frequent bugs with issue links"
# Failure investigation
"Get test run 12345 details with all test cases"
# Platform-specific issues
"Get Android test results for last 7 days with failure analysis"
🎭 按角色划分的提示词与工作流
👩💻 手动 QA 工程师
每日测试用例审查
"Get test case MCP-45 details and validate its quality"
"Show me all test cases in suite 18708 that need improvement"
"Validate test case MCP-67 and suggest specific improvements"
"Find test cases with title containing 'login' to review authentication tests"
"Get test cases from suite 491 with high priority for today's testing"
测试用例创建与改进
"I'm writing a test case for login functionality. What should I include based on our quality standards?"
"Improve test case MCP-89 - it's missing some preconditions"
"Check if test case MCP-12 is ready for manual execution"
测试套件整理
"Show me the hierarchy of test suites for project MYAPP to understand the structure"
"Get all subsuites from Authentication suite to review test coverage"
"List test cases in suite 18708 and identify which ones need validation"
"Find test cases with title containing 'payment' to organize payment testing"
"Get all high priority test cases from suite 491 for release testing"
覆盖率分析
"I executed test case MCP-34 manually. Here's what I did: [paste your execution notes]. Analyze coverage against the documented steps."
"Compare test case MCP-56 with this manual testing session: [paste session details]"
🤖 测试自动化工程师与 SDET
自动化就绪度评估
"Validate test case MCP-78 for automation readiness"
"Get all test cases in suite 18708 and identify which ones are ready for automation"
"Check test case MCP-23 - does it have clear, unambiguous steps for automation?"
"Find test cases with title containing 'API' to prioritize API automation"
"Get automation priorities to understand which test cases to automate first"
"Get test cases from suite 491 with 'Not Automated' state for automation planning"
测试代码生成
"Generate Java/Carina test code for MCP-45 based on this existing framework: [paste framework code]"
"Create JavaScript/Jest test for MCP-67 using this test structure: [paste test example]"
"Generate Python/Pytest code for MCP-89 with these page objects: [paste page object code]"
覆盖率分析与验证
"Analyze test coverage for MCP-34 against this automated test: [paste test code]"
"Enhanced coverage analysis for MCP-56 with rules validation - here's my implementation: [paste code]"
"Compare test case MCP-78 steps with this Selenium test: [paste selenium code]"
框架集成
"Generate test code for MCP-45 using our Carina framework with these page objects: [paste existing code]"
"Create test automation for MCP-67 that integrates with this CI/CD pipeline: [paste pipeline config]"
"Generate API test for MCP-89 using this RestAssured setup: [paste API test framework]"
批量自动化分析
"Validate all test cases in Authentication suite for automation readiness"
"Generate coverage report for all test cases in project MYAPP"
"Identify test cases in suite 18708 that have automation blockers"
"Find test cases with title containing 'regression' for automation sprint planning"
"Get test cases from suite 491 created after 2025-01-01 with high priority for next automation cycle"
"Get automation priorities and states to create automation roadmap"
👨💻 开发人员
测试用例理解
"Get test case MCP-45 details to understand what I need to implement"
"Show me test cases related to login functionality in project MYAPP"
"Explain test case MCP-67 requirements in developer-friendly format"
"Find test cases with title containing 'authentication' for my feature development"
"Get high priority test cases from suite 491 that I need to implement"
实现验证
"I implemented this feature: [paste code]. Analyze coverage against test case MCP-34"
"Here's my API implementation: [paste code]. Check coverage against test case MCP-56"
"Validate my UI implementation against test case MCP-78: [paste component code]"
测试代码生成
"Generate unit tests for test case MCP-45 using Jest framework"
"Create integration tests for MCP-67 based on this API: [paste API code]"
"Generate test data setup for MCP-89 using this database schema: [paste schema]"
Bug 分析
"Get test execution results for launch 118685 to understand recent failures"
"Show me top bugs from last week related to my feature area"
"Get detailed bug review for Android project from last 14 days"
"Show me comprehensive failure information for hashcode 1051677506"
"What are the top 50 bugs affecting our project this month?"
"Give me a summary of bug failures with reproduction dates from last 7 days"
"Analyze test case MCP-34 - why might it be failing in automation?"
👔 测试经理与团队负责人
团队质量指标
"Get quality metrics for all test cases in project MYAPP"
"Show me test cases that need improvement in suite 18708"
"Generate quality report for test cases created this month"
"Find test cases with title containing 'critical' to assess critical path quality"
"Get automation priorities to align team efforts with business priorities"
"Get test cases from suite 491 with high priority that need quality improvements"
测试套件分析
"Show me the complete test suite hierarchy for project MYAPP"
"Analyze test coverage across all suites in project MYAPP"
"Get automation readiness status for all test cases in Authentication suite"
团队绩效与规划
"Get test execution results by platform for the last 30 days"
"Show me top 10 most frequent bugs to prioritize fixes"
"Analyze test case quality trends in project MYAPP"
"Get all launches for project MYAPP from last 30 days with milestone tracking"
"Show me platform results for last 7 days to track team performance"
"Get test runs with status 'FAILED' from last week for team retrospective"
流程改进
"Validate all test cases in suite 18708 to identify common quality issues"
"Generate improvement recommendations for test cases created by junior team members"
"Analyze which test cases are consistently failing automation"
"Get top 10 bugs from last month to identify process improvements"
"Show me test runs with detailed failure analysis for process optimization"
"Get automation readiness metrics across all test cases"
"Find test cases with title containing 'flaky' to address test stability"
"Get test cases from suite 491 with medium priority that could be automated"
"Get automation priorities to optimize team resource allocation"
报告与利益相关方沟通
"Generate comprehensive test coverage report for project MYAPP in markdown format"
"Get test execution summary for launch 118685 for stakeholder presentation"
"Show me test quality metrics and improvement suggestions for quarterly review"
"Get platform results by period for executive dashboard"
"Create milestone progress report with test execution data"
"Generate weekly team performance report with launch and bug metrics"
日常管理任务
"Get all launches for project MYAPP from yesterday"
"Show me top 5 bugs from last 7 days with issue links"
"Get platform results for iOS and Android from last week"
"Check automation readiness for upcoming release milestone"
"Get test run details for failed runs from last 24 hours"
"Show me project milestones and their completion status"
🏢 项目所有者与产品经理
项目健康状况概览
"Get overall test coverage status for project MYAPP"
"Show me test execution results by platform for the last quarter"
"Generate project testing health report in markdown format"
"Get all launches for project MYAPP with milestone and build tracking"
"Show me platform results summary for executive review"
"Get project milestones with completion status and testing metrics"
功能测试状态
"Get test cases related to [feature name] in project MYAPP"
"Show me test execution results for [feature name] functionality"
"Analyze test coverage for [epic/story] requirements"
"Get launches filtered by milestone for feature release tracking"
"Show me test runs for specific build versions"
质量保证指标
"Get quality metrics for all test cases in project MYAPP"
"Show me test case validation results and improvement areas"
"Generate testing quality report for stakeholder presentation"
"Get top bugs analysis for quality trend assessment"
"Show me automation vs manual testing ratio across the project"
"Find test cases with title containing 'smoke' to assess smoke test coverage"
"Get automation priorities to communicate testing strategy to stakeholders"
"Get test cases from suite 491 with critical priority for risk assessment"
风险评估
"Show me top 10 most frequent bugs in project MYAPP"
"Get test cases that are not ready for automation and assess risk"
"Analyze test execution trends to identify potential quality risks"
"Get platform-specific failure rates for the last month"
"Show me test runs with high failure rates for risk mitigation"
"Get milestone-based testing progress for release risk assessment"
规划与资源分配
"Get automation readiness assessment for all test cases in project MYAPP"
"Show me test cases that need quality improvement and estimate effort"
"Analyze test suite structure to identify optimization opportunities"
"Get testing resource utilization by platform and time period"
"Show me milestone testing progress for sprint planning"
"Get comprehensive launch analysis for capacity planning"
"Find test cases with title containing 'performance' to plan performance testing"
"Get automation priorities to allocate automation resources effectively"
"Get test cases from suite 491 created in last month to plan review sessions"
高管报告
"Generate executive dashboard with platform results and bug trends"
"Get quarterly testing metrics with milestone progress"
"Show me ROI analysis of automation vs manual testing efforts"
"Create board-ready testing status report with key metrics"
"Get testing velocity trends for project timeline assessment"
📖 输出格式
所有工具均支持多种输出格式:
json- 结构化数据(默认)markdown- 包含分区和表格的丰富格式输出string- 易于阅读的文本摘要dto- 原始数据对象
示例:
"Get test case PROJ-123 in markdown format"
"Show me test suites as JSON"
⚙️ 配置选项
环境变量
# Required (STDIO mode) / Optional (HTTP selfauth mode — see below)
ZEBRUNNER_URL=https://your-instance.zebrunner.com/api/public/v1
[email protected]
ZEBRUNNER_TOKEN=your_api_token
# Optional - HTTP Authentication Mode
MCP_AUTH_MODE=selfauth # Enable per-user credential form (Mode 3)
MCP_TRANSPORT=http # Use HTTP transport
PORT=3000 # HTTP server port
TOKEN_STORE_KEY=your-secret # Encryption key for stored credentials
TOKEN_STORE_PATH=./tokens.enc # Path for encrypted credential store
# Optional - Basic Settings
DEBUG=false # Enable detailed logging (default: false)
DEFAULT_PAGE_SIZE=100 # Default items per page (optional)
MAX_PAGE_SIZE=100 # Maximum items per page (optional)
# Optional - Intelligent Rules System
ENABLE_RULES_ENGINE=true # Enable intelligent rules (auto-detected if rules file exists)
MCP_RULES_FILE=custom-rules.md # Custom technical rules file (optional)
MIN_COVERAGE_THRESHOLD=70 # Minimum coverage percentage (optional)
REQUIRE_UI_VALIDATION=true # Require UI validation in tests (optional)
REQUIRE_API_VALIDATION=true # Require API validation in tests (optional)
实例配置文件(zebrunner-config.json)
MCP 服务在项目根目录中附带一个 zebrunner-config.json,其中包含特定实例的设置。自定义此文件,以使服务适配你的 Zebrunner 工作区。如果文件缺失或包含无效值,系统会自动使用内置默认值。
{
"projectAliases": {
"web": "WEB",
"android": "AND",
"ios": "IOS",
"api": "WEB"
},
"testConnectionProjectKey": "MCP",
"widgetTemplates": {
"RESULTS_BY_PLATFORM": 8,
"TOP_BUGS": 4,
"BUG_REVIEW": 9,
"FAILURE_INFO": 6,
"FAILURE_DETAILS": 10
},
"dashboardNames": {
"weeklyResults": "Weekly results",
"bugsReproRate": "Bugs repro rate"
},
"platformMap": {
"web": [],
"api": ["api"],
"android": [],
"ios": ["ios"]
},
"featureAreaKeywords": {
"quicklog": "Search & Quick Log",
"search": "Search & Quick Log",
"notification": "Notifications"
},
"localeTestRunRules": {
"enabled": true,
"projectKeys": ["AND", "IOS", "WEB"],
"enUsOnlyFeatureSuites": ["Plans", "Workout Routines", "Recipe Discovery"],
"suiteNameMatch": "includes"
},
"relaunchFailures": {
"excludeLaunchNamePatterns": ["Performance"],
"maxLaunchesPerPlatform": 50
}
}
| 键 | 说明 |
|---|---|
projectAliases | 将简称(web、android、ios、api 等)映射到 Zebrunner 项目键(WEB、AND 等)。用于报告工具、脚手架向导选择器、adv_prepare_jira_automation_plan、测试影响路由,以及未设置 platformByProjectKey 时的 Jira 平台推断。 |
testConnectionProjectKey | 未设置环境变量时,adv_test_reporting_connection 工具使用的项目键。 |
widgetTemplates | 报告工具使用的 SQL 小组件模板数字 ID。这些 ID 因租户而异;如果报告返回空数据,请检查你的 Zebrunner 实例。 |
dashboardNames | 小组件 SQL 查询使用的仪表板显示名称。必须与 Zebrunner 工作区中的仪表板名称一致。 |
platformMap | 将平台别名映射到小组件 SQL PLATFORM 筛选值。 |
featureAreaKeywords | 关键词到标签的映射,用于回归稳定性报告,将测试名称归入不同功能领域。根据应用的功能结构进行自定义。 |
localeTestRunRules | 项目范围的 Build Now 规则——参见下文。当 locale ≠ en_US 时由 adv_start_launch 使用。 |
relaunchFailures | 项目范围的重新运行规则——参见下文。由 /relaunch-regression-failures 使用,并由 adv_rerun_launch_failures 引用。 |
可以省略单个键——只有你指定的键会覆盖默认值。
项目专属自动化规则(localeTestRunRules 和 relaunchFailures)
这些可选配置块用于配置各项目的启动变更工作流。它们不会影响只读工具、TCM 工具或配置范围之外的项目。
localeTestRunRules — 当有效区域设置不是 en_US 时,adv_start_launch(Jenkins Build Now)的规则:
| 子键 | 说明 |
|---|---|
enabled | 总开关。设为 false 可完全禁用基于区域设置的 NOT_TAGS 逻辑。 |
projectKeys | 规则适用的 Zebrunner 项目键(例如 ["MCP", "DEF"])。其他项目不受影响。 |
enUsOnlyFeatureSuites | 仅支持英语的 TCM 功能套件名称;预览时会通过 test_run_rules 中的 NOT_TAGS 自动排除。 |
suiteNameMatch | "exact" 或 "includes" — 发现功能套件 ID 时匹配套件名称的方式。 |
relaunchFailures — /relaunch-regression-failures 提示词和批量重新运行指南:
| 子键 | 说明 |
|---|---|
excludeLaunchNamePatterns | 发现失败项时要跳过的启动名称(不区分大小写的子字符串匹配)。默认值:["Performance"]。 |
maxLaunchesPerPlatform | 提示词工作流中每个平台的上限(默认值 50,与 adv_rerun_launch_failures 的最大值一致)。 |
/feature-scoped-launch 不会使用 zebrunner-config.json 中的 Jenkins suite_path — 提示词会从参数、最近的启动记录中解析该路径,或向用户询问。
示例
CUSTOMER 风格的部署(仓库 zebrunner-config.json 中附带的默认配置):
"localeTestRunRules": {
"enabled": true,
"projectKeys": ["MCP", "DEF", "WEB"],
"enUsOnlyFeatureSuites": ["Plans", "Workout Routines", "Recipe Discovery"],
"suiteNameMatch": "includes"
},
"relaunchFailures": {
"excludeLaunchNamePatterns": ["Performance"],
"maxLaunchesPerPlatform": 50
}
通用/非 CUSTOMER 部署(例如演示时仅使用项目 MCP,不排除任何区域设置):
"projectAliases": { "web": "WEB", "android": "AND", "ios": "IOS", "api": "WEB" },
"testConnectionProjectKey": "MCP",
"localeTestRunRules": { "enabled": false },
"relaunchFailures": {
"excludeLaunchNamePatterns": [],
"maxLaunchesPerPlatform": 50
}
通过 env 进行最小覆盖(Docker/K8s 环境中不挂载配置文件时):
ZEBRUNNER_CONFIG_JSON='{"localeTestRunRules":{"enabled":false},"relaunchFailures":{"excludeLaunchNamePatterns":["Benchmark"]}}'
另请参阅:docs/RESOURCES_AND_PROMPTS.md,了解提示词和工具如何使用这些设置。
每位用户的 Zebrunner URL(v8.1.0+)
在 HTTP 模式下使用 MCP_AUTH_MODE=selfauth 且未设置 ZEBRUNNER_URL 时,每位用户都需要在登录表单中提供自己的 Zebrunner 实例 URL。这样,一个 MCP 服务就可以为来自不同 Zebrunner 组织的用户提供多租户服务。
- 登录表单会显示 Zebrunner URL 字段(例如
https://mcp.zebrunner.com) - 用户可以在
/settings更新 URL、凭据,或断开连接 - 每位用户的 URL 会与凭据一同加密存储在令牌存储中
- 如果将
ZEBRUNNER_URL设为环境变量,URL 字段会隐藏,并全局使用该环境变量的值(现有行为不变)
规则系统配置
规则系统会自动检测并使用项目根目录中的规则文件:
自动检测
如果项目根目录中存在 mcp-zebrunner-rules.md 文件,规则引擎将自动启用。
自定义规则文件
你可以自定义以下三种规则:
- 测试用例审查规则(
test_case_review_rules.md)
# Custom Test Case Review Rules
## Rule 1: Title Quality
- Titles must be descriptive and specific
- Minimum length: 10 characters
- Should not contain vague terms like "test", "check"
## Rule 2: Test Steps
- Each step must have clear action and expected result
- Steps should be numbered and sequential
- Avoid combining multiple actions in one step
- 分析检查点(
test_case_analysis_checkpoints.md)
# Custom Analysis Checkpoints
## Independence Assessment
- [ ] Can this test case run independently?
- [ ] Are all preconditions explicitly stated?
- [ ] No dependencies on other test cases?
## Automation Readiness
- [ ] All steps are unambiguous?
- [ ] Technical feasibility confirmed?
- [ ] Stable selectors available?
- 技术规则(
mcp-zebrunner-rules.md)
# Technical Configuration
## Coverage Thresholds
- Overall Coverage: 80%
- Critical Steps: 95%
- UI Validation Steps: 85%
## Framework Detection
**Java/TestNG**:
- Keywords: @Test, TestNG, WebDriver
- File patterns: *Test.java, *Tests.java
🧪 测试你的配置
运行健康检查
npm run test:health
测试 API 连接
npm run smoke
运行完整测试套件
npm test
运行特定类型的测试
npm run test:unit # Fast unit tests
npm run test:integration # API integration tests
npm run test:e2e # End-to-end tests
🔍 故障排除
常见问题
“Authentication failed”或 401 错误
- ✅ 检查
ZEBRUNNER_LOGIN和ZEBRUNNER_TOKEN - ✅ 确认 API 令牌仍然有效
- ✅ 确保你的用户在 Zebrunner 中拥有适当的权限
“Project not found”或 404 错误
- ✅ 检查项目密钥的拼写(例如,“MYAPP”,而不是“myapp”)
- ✅ 确认你有权访问 Zebrunner 中的项目
- ✅ 某些端点可能并非在所有 Zebrunner 实例中都可用
“Connection timeout”错误
- ✅ 检查
ZEBRUNNER_URL是否正确 - ✅ 确保你的网络可以访问 Zebrunner 实例
- ✅ 尝试在配置中增加超时时间
MCP 集成无法正常工作
- ✅ 确认
dist/server.js的路径正确 - ✅ 检查项目是否已成功构建(
npm run build) - ✅ 确保已在 MCP 配置中设置环境变量
- ✅ 查看 Claude Desktop/Code 日志中的错误消息
adv_about_mcp_tools 显示“Total tools: 0”
- ✅ 升级到 v9.2.9+(npm/Docker 安装会将工具目录嵌入
dist/) - ✅ 升级后重新构建:
npm run build(git clone),或重新安装软件包 / 拉取 Docker 镜像
规则引擎无法正常工作
- ✅ 检查
.env文件中的ENABLE_RULES_ENGINE=true - ✅ 确认规则文件存在且包含有意义的内容
- ✅ 更改规则文件后重启 MCP 服务
- ✅ 检查调试日志中的规则解析错误
调试模式
启用详细日志记录以排查问题:
DEBUG=true
这将显示:
- API 请求和响应
- 错误详情和堆栈跟踪
- 性能指标
- 功能可用性
- 规则解析和验证详情
获取帮助
- 检查日志 - 启用调试模式并查找错误消息
- 测试连接 - 运行
npm run test:health - 验证配置 - 仔细检查
.env文件 - 检查 Zebrunner 权限 - 确保你的用户拥有适当的访问权限
- 验证规则文件 - 确保规则文件包含有意义的内容
- 报告问题 - 如果发现错误,请在 https://github.com/maksimsarychau/mcp-zebrunner/issues 提交问题
🎯 示例工作流
工作流 1:测试用例评审(手动 QA)
1. "Get test case PROJ-123 details"
2. "Validate test case PROJ-123"
3. "Improve test case PROJ-123 with specific suggestions"
4. "Check if test case PROJ-123 is ready for manual execution"
工作流 2:测试自动化(SDET)
1. "Validate test case PROJ-456 for automation readiness"
2. "Generate Java/Carina test code for PROJ-456"
3. "Analyze coverage between test case and my implementation"
4. "Get automation readiness assessment"
工作流 3:实现验证(开发人员)
1. "Get test case PROJ-789 details to understand requirements"
2. "Analyze coverage for PROJ-789 against my implementation"
3. "Generate unit tests based on test case requirements"
4. "Validate implementation completeness"
工作流 4:质量管理(团队负责人)
1. "Get quality metrics for all test cases in project MYAPP"
2. "Show me test cases that need improvement"
3. "Generate team quality report"
4. "Identify automation readiness across the project"
工作流 5:项目健康状况(产品经理)
1. "Get overall test coverage status for project MYAPP"
2. "Show me test execution results by platform"
3. "Generate project testing health report"
4. "Identify quality risks and improvement opportunities"
🔧 高级功能
批量操作
一次处理多个测试用例:
"Validate all test cases in suite 18708"
"Generate coverage report for all test cases in project MYAPP"
"Improve all test cases that have quality issues"
自定义输出格式
按所需格式获取数据:
"Get test cases as JSON for API integration"
"Show test suite hierarchy in markdown for documentation"
"Generate quality report in markdown for stakeholder presentation"
筛选和搜索
查找所需内容:
"Get test cases created after 2025-01-01"
"Find test cases with automation state 'Manual'"
"Show me test cases that are not ready for automation"
基于规则的分析
利用智能验证:
"Validate test case PROJ-123 using custom rules from my-project-rules.md"
"Enhanced coverage analysis with framework-specific rules"
"Generate improvement suggestions based on team quality standards"
📚 其他文档
📖 工具参考
- TOOLS_CATALOG.md - 全部 76 个
adv_*工具的完整目录,附带自然语言示例 - docs/TEST_PROMPTS.md - 各工具的测试提示词;§18 涵盖全部 22 个仪表板小组件(MCP + API 验证)
- docs/archive/TCM_TAM_WIDGET_BACKLOG.md - 已归档的小组件模板 ↔ MCP 对照表(当前版本:TEST_PROMPTS §18)
- docs/RESOURCES_AND_PROMPTS.md - MCP 资源与提示词——完整使用指南、参考表和贡献者指南
- INSTALL-GUIDE.md - 📥 分步安装和设置指南
🧠 智能规则系统
- docs/INTELLIGENT_RULES_SYSTEM.md - 🧠 3 层智能规则系统完整指南
- docs/archive/RULES_QUICK_REFERENCE.md - ⚡ 规则系统命令和配置快速参考
📋 规则文件(可自定义)
- test_case_review_rules.md - 🎯 核心质量标准和编写指南
- test_case_analysis_checkpoints.md - ✅ 100+ 个详细验证检查点
- mcp-zebrunner-rules.md - ⚙️ 测试生成和覆盖率分析的技术配置
🔍 专项指南
- docs/archive/SCREENSHOT_ANALYSIS.md - 📸 截图下载和视觉分析指南
- change-logs.md - 📝 版本历史和功能更新
- GitHub Release v9.1.0 - 🆕 v9.1.0 发行说明——启动突变、提示词和配置
🛠️ 功能文档
- docs/TERMINOLOGY.md - 📖 测试、测试用例、测试运行和启动——术语表与计数规则
- docs/archive/NEW_LAUNCHER_TOOL.md - 关于启动和报告工具的详细信息
- docs/archive/SUITE_HIERARCHY.md - 套件层级功能完整指南
- docs/archive/TEST_CASE_VALIDATION_IMPLEMENTATION.md - 测试用例验证系统详情
- docs/archive/ENHANCED_VALIDATION_FEATURES.md - 高级验证和改进功能
🤝 贡献
- Fork 此代码库
- 创建功能分支
- 添加更改并编写相应测试
- 确保所有测试通过:
npm test - 提交拉取请求
📄 许可证
许可证
本项目采用 AGPL-3.0 许可证,以确保对 MCP 服务的所有改进均保持开源,尤其是在软件作为网络服务部署时。
如果你修改并运行服务,使用户能够通过网络与其交互(例如通过 Claude Desktop / Cursor 客户端),你必须向这些用户提供完整的修改后源代码。
允许商业用途。如需闭源修改或企业许可,请联系作者。 详情请参阅 LICENSE.md 文件。
🎉 准备就绪!
完成设置后:
- 测试连接:运行
npm run test:health - 配置 AI 助手,连接 MCP 服务
- 开始提问,了解你的测试用例!
可以尝试以下首批命令:
- “列出项目 [YOUR_PROJECT_KEY] 的测试套件”
- “获取测试用例 [YOUR_TEST_CASE_KEY] 的详细信息”
- “验证测试用例 [YOUR_TEST_CASE_KEY]”
- “向我展示测试套件层级结构”
智能规则系统将帮助确保你的测试用例符合质量标准,并适用于手动执行和自动化测试。祝测试愉快!🚀
首次推送时间:2025 年 9 月 22 日(周一)00:54:41 +0200
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。