QTM4J MCP Server
QTM4J MCP 服务器
一个拥有 42 个工具 的 MCP 服务器,用于 QMetry Test Management for Jira (QTM4J)。通过 Claude Desktop、Claude Code、VS Code Copilot、Cursor 或任何支持 MCP 的客户端,搜索并管理测试用例、周期、执行、计划、文件夹、自动化规则和项目元数据。
分发方式:
npm:
qtm4j-mcp-serverMCP 注册表:
io.github.salehrifai42/qtm4j-mcp-serverGitHub:
salehrifai42/qmetrymcp
快速入门(无需克隆)
你需要一个 QMetry API 密钥(QMetry → API Keys)和 Node.js 18+。
Claude Desktop
编辑你的配置文件并重启 Claude:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"qtm4j": {
"command": "npx",
"args": ["-y", "qtm4j-mcp-server@^0.1"],
"env": {
"QTM4J_API_KEY": "your-api-key-here",
"QTM4J_REGION": "US"
}
}
}
}Claude Code (CLI)
claude mcp add qtm4j -e QTM4J_API_KEY=your-api-key-here -e QTM4J_REGION=US -- npx -y qtm4j-mcp-server@^0.1VS Code (GitHub Copilot Agent 模式)
在你的工作区创建 .vscode/mcp.json:
{
"servers": {
"qtm4j": {
"type": "stdio",
"command": "npx",
"args": ["-y", "qtm4j-mcp-server@^0.1"],
"env": {
"QTM4J_API_KEY": "${env:QTM4J_API_KEY}",
"QTM4J_REGION": "US"
}
}
}
}将 Copilot Chat 切换到 Agent 模式,qtm4j_* 工具将自动出现。
Cursor
添加到 ~/.cursor/mcp.json(或项目级别的 <project>/.cursor/mcp.json):
{
"mcpServers": {
"qtm4j": {
"command": "npx",
"args": ["-y", "qtm4j-mcp-server@^0.1"],
"env": { "QTM4J_API_KEY": "your-api-key-here" }
}
}
}上面的示例配置将包版本锁定为
^0.1,以防止未来的重大更新导致自动升级。如果你希望始终运行最新版本,请删除@^0.1后缀。
全局安装(启动更快)
npx 会在每次启动时重新解析包,这会增加几秒钟的启动延迟。如果你经常使用该服务器,请全局安装它并直接将客户端指向二进制文件:
npm install -g qtm4j-mcp-server然后在你的客户端配置中,替换 npx 命令:
{
"mcpServers": {
"qtm4j": {
"command": "qtm4j-mcp-server",
"env": {
"QTM4J_API_KEY": "your-api-key-here",
"QTM4J_REGION": "US"
}
}
}
}权衡:启动即时且可离线工作,但你需要运行 npm update -g qtm4j-mcp-server 来获取新版本。
Related MCP server: qtm4j-mcp-server
配置
变量 | 必需 | 默认 | 描述 |
| 是 | — | QMetry API 密钥,在每次请求时作为 |
| 否 |
|
|
💡 如果你的 QMetry 实例位于悉尼集群,请设置
QTM4J_REGION=AU。
工具
所有工具都以 qtm4j_ 为前缀,以避免与其他 MCP 服务器冲突。
领域 | 工具 |
测试用例 |
|
测试周期 |
|
测试执行 |
|
测试计划 |
|
文件夹 |
|
自动化 |
|
元数据 (只读) |
|
请参阅 docs/TOOLS.md 获取完整参考,并参阅 docs/COOKBOOK.md 获取同事可以粘贴到任何 MCP 客户端中的示例提示词。
每个工具都附带注释(readOnlyHint, destructiveHint, idempotentHint, openWorldHint),以便客户端决定是否需要请求确认。读取工具接受 response_format 参数(默认为 json,或 markdown 以获得人类可读的输出)。大型响应会自动截断为 25k 字符,并提示缩小查询范围。
所有工具都使用 Zod 验证输入,通过 startAt/maxResults 进行分页,并自动重试受速率限制(HTTP 429)的响应,采用指数退避策略(最多 3 次尝试)。
试用
连接后,询问你的助手类似以下内容:
在 QMetry 项目
<你的项目 ID>中搜索状态为 "To Do" 的测试用例,并显示前 5 个。
客户端将调用 qtm4j_search_test_cases 并渲染响应。
获取测试周期 FS-TR-747 中的所有执行,并将任何未执行的标记为通过。
工具调用示例
将下方的
10011替换为你的数字 Jira 项目 ID。在项目 URL 中查找它:…?projectId=10011&projectKey=FS。
// Search test cases
{
"name": "qtm4j_search_test_cases",
"arguments": {
"projectId": 10011,
"status": ["Approved"],
"maxResults": 20,
"response_format": "markdown"
}
}
// Update an execution result
// (executionResultId: 239444=Pass, 239441=Fail, 239443=Not Executed)
{
"name": "qtm4j_update_test_execution",
"arguments": {
"cycleId": "gxMbioKJsyEr3E",
"testCaseExecutionId": 287595809,
"executionResultId": 239444,
"comment": "Verified on staging"
}
}故障排除
工具未在我的客户端中显示。 编辑配置后重启客户端。检查
claude mcp list(Claude Code) 或 VS Code 的 MCP 面板以查看连接状态。首次运行时,npx -y qtm4j-mcp-server可能需要几秒钟来下载包。401 Unauthorized。 你的
QTM4J_API_KEY无效或已过期。在 QMetry → API Keys 中生成一个新的。执行或搜索端点返回 404。 许多端点需要内部数字
id,而不是像FS-TR-747这样的人类可读键。先调用qtm4j_get_test_cycle将键转换为内部 ID。文件夹响应为空或过大。 将
folderId传递给qtm4j_list_folders以限定在子树范围内——大型项目上的完整项目树可能会超过响应大小限制。projectId被拒绝。 使用数字 Jira 项目 ID(例如10011),而不是项目键("FS")。你可以在 Jira 项目 URL 中找到它:…?projectId=10011&projectKey=FS。
注意事项
搜索端点使用
POST /…/search—— 过滤器放在正文的filter下,分页/排序在查询字符串中。工具处理程序会为你封装这些。204 No Content响应解析为{ message: "…" }。Swagger 规范目前没有记录框架式的自动化导入结果端点(例如 JUnit/TestNG/Cucumber 摄取);自动化工具涵盖了规范中暴露的规则运行和规则链接流程。
开发
如果你想修改服务器,请进行本地设置:
git clone https://github.com/salehrifai42/qmetrymcp.git
cd qmetrymcp
npm install
npm run build
QTM4J_API_KEY=your-key npm start使用 MCP Inspector 测试更改:
QTM4J_API_KEY=your-key npx @modelcontextprotocol/inspector node dist/index.js错误和贡献
发现错误或想建议功能?在 https://github.com/salehrifai42/qmetrymcp/issues 打开一个 issue。欢迎提交 PR。
许可证
Available Tools
30 toolsbulk_update_test_executionsA
Apply the same execution result, environment, or build to multiple test case executions at once. Use testCycleTestCaseMapIds from get_test_cycle_executions (the 'testCycleTestCaseMapId' field). Returns 204 on success.
Inputs: cycleId (required), testCycleTestCaseMapIds (required), executionResultId, environmentId, +1 more.
clone_test_casesA
Bulk clone one or more test cases into a target project and optional folder. Returns a background task object with a taskId and progressUrl to poll for completion.
Inputs: testcaseIds (required), projectId (required), folderId.
create_folderA
Create a new folder under an existing parent folder. Use parentId=0 for root-level. folderName is required. Returns the created folder with its id. Use list_folders first to find valid parentId values.
Inputs: projectId (required), folderName (required), folderType (required), parentId (required), +1 more.
create_test_caseB
Create a new test case in QMetry. Returns the created test case object including its internal id and key (e.g. FS-TC-123). Priority, status, labels, and components use integer IDs — see field_reference.json for valid values.
Inputs: projectId (required), summary (required), precondition, priority, +7 more.
create_test_cycleA
Create a new test cycle in QMetry. Returns the created cycle with its internal id and key (e.g. FS-TR-123). Use list_folders with folderType=TESTCYCLE to find valid folderId values.
Inputs: projectId (required), summary (required), description, priority, +6 more.
create_test_planA
Create a new test plan in QMetry. Returns the created plan with its internal id and key (e.g. FS-TP-44). Use list_folders with folderType=TESTPLAN to find valid folderId values.
Inputs: projectId (required), summary (required), description, priority, +4 more.
create_test_stepsB
Add one or more test steps to a specific version of a test case. Each step has stepDetails (required), expectedResult, and testData. Returns the created step objects with their IDs.
Inputs: id (required), versionNo (required), steps (required).
delete_test_caseA
Permanently delete a specific version of a test case. If it is the only version, the test case is removed entirely. Returns 204 on success.
Inputs: id (required), versionNo (required).
delete_test_cycleA
Permanently delete a test cycle and all its execution records. This is irreversible. Returns 204 on success.
Inputs: id (required).
delete_test_planA
Permanently delete a test plan. This does not delete the linked test cycles. Returns 204 on success.
Inputs: id (required).
get_linked_test_cyclesA
List all test cycles currently linked to a test plan. Returns paginated list with id, key, status, priority per cycle. Use the plan's internal id (not key).
Inputs: id (required), startAt, maxResults, sort, +1 more.
get_test_caseA
Get a test case by its internal ID or key (e.g. FS-TC-31950). Returns an array of versions, each with versionNo, isLatestVersion, aiGenerated flag, and any test steps.
Inputs: id (required).
get_test_cycleA
Get a test cycle by its key (e.g. FS-TR-747) or internal id. Returns id, key, status, priority, projectId, archived flag. The internal 'id' returned here is required by get_test_cycle_executions and update_test_execution.
Inputs: id (required).
get_test_cycle_executionsA
List all test case executions linked to a test cycle. Requires the internal cycle id (from get_test_cycle, not the key). Returns testCycleTestCaseMapId (needed for bulk_update), testCaseExecutionId (needed for update_test_execution), key, status, and priority per test case.
Inputs: id (required), startAt, maxResults, sort, +1 more.
get_test_planA
Get a test plan by its key (e.g. FS-TP-43) or internal id. Returns id, key, projectId, archived flag. Use the internal 'id' when calling link/unlink/get_linked_test_cycles.
Inputs: id (required).
link_automation_ruleA
Associate an automation rule with a test cycle so it can be triggered for that cycle. automationRuleKey is the rule's string key from your QMetry automation config. Returns 200 on success.
Inputs: cycleId (required), automationRuleKey (required).
link_test_cycles_to_planA
Link one or more existing test cycles to a test plan. Use the plan's internal id (from get_test_plan or search_test_plans). testcycleIds are numeric integer IDs. Returns 204 on success.
Inputs: id (required), testcycleIds (required).
list_foldersA
List folders of a given type in a project as a nested tree with id, name, parentId, and children. Provide folderId to return only that subtree instead of the full project tree (recommended for large projects).
Inputs: projectId (required), folderType (required), folderId.
run_automation_rulesA
Trigger an automation rule to run against a specific test cycle. testCycleId is the internal id string (from get_test_cycle). Returns a background task object with taskId and progressUrl to poll for completion.
Inputs: automationRuleKey (required), projectId (required), testCycleId (required).
search_test_casesA
Search test cases in a project with optional filters. Returns total count and paginated data with id, key, version info, archived flag. Use status/priority name strings (e.g. 'To Do', 'High') not IDs. projectId must be numeric (10011). Set recursive=true with a folderId to count across all subfolders (returns total only, no data).
Inputs: projectId (required), labels, components, recursive, +9 more.
search_test_cyclesA
Search test cycles in a project. Returns total count and paginated list with id, key, status, priority, archived. The 'id' field in results is the internal ID needed for execution tools.
Inputs: projectId (required), folderId, status, priority, +6 more.
search_test_plansB
Search test plans in a project. Returns total count and paginated list with id, key, projectId, archived. The 'id' field is the internal ID needed for linking cycles.
Inputs: projectId (required), folderId, status, priority, +6 more.
unlink_automation_ruleA
Remove the association between an automation rule and a test cycle. Returns 200 on success.
Inputs: cycleId (required), automationRuleKey (required).
unlink_test_cycles_from_planA
Remove the link between one or more test cycles and a test plan. Does not delete the cycles themselves. Returns 204 on success.
Inputs: id (required), testcycleIds (required).
update_test_caseB
Update fields on a specific version of a test case. Requires both the test case id and versionNo (usually 1 for latest). Priority and status take integer IDs. Returns 204 on success.
Inputs: id (required), versionNo (required), summary, precondition, +7 more.
update_test_cycleA
Update a test cycle's metadata (summary, description, priority, status, dates, custom fields). Pass the internal id or key. Returns 204 on success.
Inputs: id (required), summary, description, priority, +5 more.
update_test_executionA
Update a single test case execution result inside a test cycle. Use testCaseExecutionId from get_test_cycle_executions. executionResultId: 239443=Not Executed, 239444=Pass, 239441=Fail, 239442=Work In Progress, 239440=Blocked. Returns 204 on success.
Inputs: cycleId (required), testCaseExecutionId (required), executionResultId, environmentId, +3 more.
update_test_planC
Update a test plan's priority or custom fields. Returns 204 on success.
Inputs: id (required), priority, customFields.
update_test_step_executionA
Update a single step-level execution result within a test case execution. testStepExecutionId comes from get_test_cycle_executions step data. Returns 200 with updated step data.
Inputs: cycleId (required), testStepExecutionId (required), executionResultId, actualResult, +1 more.
update_test_stepsA
Update existing test steps on a test case version. Each step must include its step id (from create_test_steps or get_test_case response). Returns the updated step objects.
Inputs: id (required), versionNo (required), steps (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 30 tools
Each tool targets a distinct entity or operation (folders, test cases, cycles, plans, executions, automation rules, linking). Despite high tool count, descriptions make purposes clear with no overlapping functionality.
All tools use a consistent verb_noun pattern in snake_case (e.g., create_folder, update_test_execution, search_test_plans). Variations between get/list/search are semantically justified by the operation type.
30 tools is on the high side, but the domain (test management) requires many entities and operations. While borderline heavy, most tools serve essential functions without redundancy.
Covers CRUD for core entities (test cases, cycles, plans, folders), steps, executions (single/bulk), linking, and automation. Missing delete for folders and some retrieval details, but core workflows are complete.
Maintenance
Related MCP Connectors
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
Official MCP server for Qase — manage test cases, runs, suites, defects via AI tools.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server to interact with the QMetry for Jira API, enabling management of test cases, test cycles, test plans, and more through well-defined tools.93269 npmApache 2.0
- AlicenseAqualityDmaintenanceMCP server for QTM4J (QMetry Test Management for Jira) Open API, enabling test case and cycle management via natural language.2150 npmMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Zephyr Scale test management enabling test case, test run, folder, and assignment operations via natural language.2MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects AI assistants to Xray Cloud for Jira test management, enabling natural language interaction with tests, test plans, executions, and CI result imports.MIT