@uarlouski/testrail-mcp-server 1.9.0 → 1.10.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/README.md +4 -0
- package/dist/index.js +1 -1
- package/dist/tools/get_cases.js +11 -1
- package/dist/tools/get_sections.js +13 -2
- package/package.json +20 -12
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"></a>
|
|
16
16
|
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.9-blue.svg" alt="TypeScript"></a>
|
|
17
17
|
<a href="https://github.com/uarlouski/testrail-mcp-server"><img src="https://img.shields.io/github/stars/uarlouski/testrail-mcp-server.svg?style=social&label=Star" alt="GitHub stars"></a>
|
|
18
|
+
<a href="https://glama.ai/mcp/servers/uarlouski/testrail-mcp-server"><img src="https://glama.ai/mcp/servers/uarlouski/testrail-mcp-server/badges/score.svg" alt="Score Badge"></a>
|
|
18
19
|
</p>
|
|
19
20
|
|
|
20
21
|
<p align="center">
|
|
@@ -152,6 +153,9 @@ Once configured, turbo-charge your QA workflow by asking your AI assistant:
|
|
|
152
153
|
|
|
153
154
|
The TestRail MCP Server provides heavily typed, descriptive tools designed specifically for LLM interaction:
|
|
154
155
|
|
|
156
|
+
> **💡 Pro Tip: Handling Large Data Sets**
|
|
157
|
+
> For list-based tools like `get_cases` and `get_sections`, you can supply the `output_file` parameter with an absolute file path. The server will bypass the LLM context window by writing the raw JSON directly to disk and returning a concise summary, allowing you to run external scripts against the export!
|
|
158
|
+
|
|
155
159
|
### 🔭 Discovery & Navigation
|
|
156
160
|
| Tool | Functionality |
|
|
157
161
|
|------|-------------|
|
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ if (!parseResult.success) {
|
|
|
42
42
|
const { TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY, TESTRAIL_ENABLE_SHARED_STEPS } = parseResult.data;
|
|
43
43
|
const server = new McpServer({
|
|
44
44
|
name: "TestRail MCP Server",
|
|
45
|
-
version: "1.
|
|
45
|
+
version: "1.10.0",
|
|
46
46
|
});
|
|
47
47
|
const client = new TestRailClient(TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY);
|
|
48
48
|
const tools = [
|
package/dist/tools/get_cases.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import fs from "fs";
|
|
2
3
|
import { validateCaseFields } from "../utils/validator.js";
|
|
3
4
|
const parameters = {
|
|
4
5
|
project_id: z.number().describe("The ID of the project. Use get_projects to find available projects"),
|
|
@@ -10,12 +11,13 @@ const parameters = {
|
|
|
10
11
|
filter: z.record(z.string(), z.string()).optional().describe("Optional API-side filters (more efficient for large datasets). Supported: priority_id, type_id, created_by, updated_by, milestone_id, refs, created_after, created_before, updated_after, updated_before. Use comma-separated values for IDs. Example: {\"priority_id\": \"1,2\", \"type_id\": \"3\"}"),
|
|
11
12
|
where: z.record(z.string(), z.any()).optional().describe("Optional client-side filter for any field including custom fields (filters after fetching all cases). Supports exact value matching. Example: {\"custom_automation_status\": 1, \"priority_id\": 2}"),
|
|
12
13
|
fields: z.array(z.string()).optional().describe("Additional fields to include in response beyond id, title, and suite_id. Use get_case_fields to see available fields. Example: [\"priority_id\", \"type_id\", \"custom_automation_status\"]"),
|
|
14
|
+
output_file: z.string().optional().describe("Absolute file path to save the JSON response to. Use this for large datasets to avoid blowing up context limits."),
|
|
13
15
|
};
|
|
14
16
|
export const getCasesTool = {
|
|
15
17
|
name: "get_cases",
|
|
16
18
|
description: "Get all test cases for a project. Filter by section, API params (priority, type), or any field including custom fields via 'where'. Returns case IDs, titles, and any additional requested fields.",
|
|
17
19
|
parameters,
|
|
18
|
-
handler: async ({ project_id, section, filter, where, fields }, client) => {
|
|
20
|
+
handler: async ({ project_id, section, filter, where, fields, output_file }, client) => {
|
|
19
21
|
const caseFields = await client.getCaseFields();
|
|
20
22
|
if (fields) {
|
|
21
23
|
validateCaseFields(fields, caseFields);
|
|
@@ -59,6 +61,14 @@ export const getCasesTool = {
|
|
|
59
61
|
return result;
|
|
60
62
|
}),
|
|
61
63
|
};
|
|
64
|
+
if (output_file) {
|
|
65
|
+
await fs.promises.writeFile(output_file, JSON.stringify(response), "utf-8");
|
|
66
|
+
return {
|
|
67
|
+
success: true,
|
|
68
|
+
message: `Successfully exported ${response.cases.length} cases to ${output_file}`,
|
|
69
|
+
file: output_file
|
|
70
|
+
};
|
|
71
|
+
}
|
|
62
72
|
return response;
|
|
63
73
|
}
|
|
64
74
|
};
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import fs from "fs";
|
|
2
3
|
import { SectionSchema } from "../types/testrail.js";
|
|
3
4
|
const parameters = {
|
|
4
5
|
project_id: z.number().describe("The ID of the project. Use get_projects to find available projects"),
|
|
6
|
+
output_file: z.string().optional().describe("Absolute file path to save the JSON response to. Use this for large datasets to avoid blowing up context limits."),
|
|
5
7
|
};
|
|
6
8
|
export const getSectionsTool = {
|
|
7
9
|
name: "get_sections",
|
|
8
10
|
description: "Get all sections for a project. Returns section IDs and names that can be used with add_case",
|
|
9
11
|
parameters,
|
|
10
|
-
handler: async ({ project_id }, client) => {
|
|
12
|
+
handler: async ({ project_id, output_file }, client) => {
|
|
11
13
|
const sections = await client.getSections(project_id);
|
|
12
|
-
|
|
14
|
+
const response = {
|
|
13
15
|
sections: sections.map(s => SectionSchema.parse(s)),
|
|
14
16
|
};
|
|
17
|
+
if (output_file) {
|
|
18
|
+
await fs.promises.writeFile(output_file, JSON.stringify(response), "utf-8");
|
|
19
|
+
return {
|
|
20
|
+
success: true,
|
|
21
|
+
message: `Successfully exported ${response.sections.length} sections to ${output_file}`,
|
|
22
|
+
file: output_file
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return response;
|
|
15
26
|
}
|
|
16
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uarlouski/testrail-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.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",
|
|
@@ -11,13 +11,6 @@
|
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "rimraf dist && tsc",
|
|
16
|
-
"start": "node dist/index.js",
|
|
17
|
-
"dev": "ts-node src/index.ts",
|
|
18
|
-
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
19
|
-
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage"
|
|
20
|
-
},
|
|
21
14
|
"keywords": [
|
|
22
15
|
"mcp",
|
|
23
16
|
"model-context-protocol",
|
|
@@ -40,10 +33,10 @@
|
|
|
40
33
|
"homepage": "https://github.com/uarlouski/testrail-mcp-server#readme",
|
|
41
34
|
"license": "Apache-2.0",
|
|
42
35
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
44
37
|
"archiver": "^7.0.1",
|
|
45
|
-
"dotenv": "^17.
|
|
46
|
-
"zod": "^4.3
|
|
38
|
+
"dotenv": "^17.4.2",
|
|
39
|
+
"zod": "^4.4.3"
|
|
47
40
|
},
|
|
48
41
|
"devDependencies": {
|
|
49
42
|
"@types/archiver": "^7.0.0",
|
|
@@ -53,6 +46,21 @@
|
|
|
53
46
|
"rimraf": "^6.1.3",
|
|
54
47
|
"ts-jest": "^29.4.6",
|
|
55
48
|
"ts-node": "^10.9.2",
|
|
56
|
-
"typescript": "^5.9.3"
|
|
49
|
+
"typescript": "^5.9.3",
|
|
50
|
+
"@jest/globals": "^29.7.0"
|
|
51
|
+
},
|
|
52
|
+
"devEngines": {
|
|
53
|
+
"packageManager": {
|
|
54
|
+
"name": "pnpm",
|
|
55
|
+
"version": "11.1.2",
|
|
56
|
+
"onFail": "error"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "rimraf dist && tsc",
|
|
61
|
+
"start": "node dist/index.js",
|
|
62
|
+
"dev": "ts-node src/index.ts",
|
|
63
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
64
|
+
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage"
|
|
57
65
|
}
|
|
58
66
|
}
|