@uarlouski/testrail-mcp-server 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/testrail.js
CHANGED
|
@@ -112,6 +112,10 @@ export class TestRailClient {
|
|
|
112
112
|
}
|
|
113
113
|
return this.projectsPromise;
|
|
114
114
|
}
|
|
115
|
+
async getLabels(projectId) {
|
|
116
|
+
const url = `${API_BASE_V2}/get_labels/${projectId}`;
|
|
117
|
+
return this.paginateAll(url, 'labels');
|
|
118
|
+
}
|
|
115
119
|
async getTests(runId, statusId) {
|
|
116
120
|
let url = `${API_BASE_V2}/get_tests/${runId}`;
|
|
117
121
|
if (statusId && statusId.length > 0) {
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { getTestsTool } from "./tools/get_tests.js";
|
|
|
19
19
|
import { addResultsTool } from "./tools/add_results.js";
|
|
20
20
|
import { addAttachmentToRunTool } from "./tools/add_attachment_to_run.js";
|
|
21
21
|
import { addResultsForCasesTool } from "./tools/add_results_for_cases.js";
|
|
22
|
+
import { getLabelsTool } from "./tools/get_labels.js";
|
|
22
23
|
import { removeNullish } from "./utils/sanitizer.js";
|
|
23
24
|
import z from "zod";
|
|
24
25
|
const EnvSchema = z.object({
|
|
@@ -34,7 +35,7 @@ if (!parseResult.success) {
|
|
|
34
35
|
const { TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY } = parseResult.data;
|
|
35
36
|
const server = new McpServer({
|
|
36
37
|
name: "TestRail MCP Server",
|
|
37
|
-
version: "1.
|
|
38
|
+
version: "1.8.0",
|
|
38
39
|
});
|
|
39
40
|
const client = new TestRailClient(TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY);
|
|
40
41
|
const tools = [
|
|
@@ -54,6 +55,7 @@ const tools = [
|
|
|
54
55
|
addResultsTool,
|
|
55
56
|
addResultsForCasesTool,
|
|
56
57
|
addAttachmentToRunTool,
|
|
58
|
+
getLabelsTool,
|
|
57
59
|
];
|
|
58
60
|
for (const tool of tools) {
|
|
59
61
|
server.registerTool(tool.name, {
|
|
@@ -14,6 +14,7 @@ const FIELD_TYPE_NAMES = {
|
|
|
14
14
|
11: "Step Results",
|
|
15
15
|
12: "Multi-select",
|
|
16
16
|
13: "Scenarios",
|
|
17
|
+
14: "List",
|
|
17
18
|
};
|
|
18
19
|
function getFieldTypeName(typeId) {
|
|
19
20
|
return FIELD_TYPE_NAMES[typeId] || `Unknown (${typeId})`;
|
|
@@ -45,6 +46,7 @@ export const SYSTEM_FIELDS = [
|
|
|
45
46
|
{ system_name: "estimate", label: "Estimate", type: "String", is_required: false },
|
|
46
47
|
{ system_name: "milestone_id", label: "Milestone", type: "Integer", is_required: false },
|
|
47
48
|
{ system_name: "refs", label: "References", type: "String", is_required: false },
|
|
49
|
+
{ system_name: "labels", label: "Labels", type: "List", is_required: false, comment: "Use get_labels tool to get available labels/tags." },
|
|
48
50
|
];
|
|
49
51
|
export const getCaseFieldsTool = {
|
|
50
52
|
name: "get_case_fields",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { LabelSchema } from "../types/testrail.js";
|
|
3
|
+
const parameters = {
|
|
4
|
+
project_id: z.number().describe("The ID of the project to retrieve labels for"),
|
|
5
|
+
};
|
|
6
|
+
export const getLabelsTool = {
|
|
7
|
+
name: "get_labels",
|
|
8
|
+
description: "Get all available test case labels (sometimes called tags) for a project. Returns label IDs and titles that can be used when creating or updating test cases.",
|
|
9
|
+
parameters,
|
|
10
|
+
handler: async ({ project_id }, client) => {
|
|
11
|
+
const labels = await client.getLabels(project_id);
|
|
12
|
+
return {
|
|
13
|
+
labels: labels.map(l => LabelSchema.parse(l)),
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
};
|
package/dist/types/testrail.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uarlouski/testrail-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"mcpName": "io.github.uarlouski/testrail-mcp-server",
|
|
5
5
|
"description": "Model Context Protocol (MCP) server for TestRail integration, enabling LLMs to fetch test cases and metadata.",
|
|
6
6
|
"main": "dist/index.js",
|