@uarlouski/testrail-mcp-server 2.8.0 → 2.9.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 +1 -0
- package/dist/index.js +1 -1
- package/dist/tools/cases/export_cases_for_rag.js +14 -3
- package/package.json +5 -7
package/README.md
CHANGED
|
@@ -165,6 +165,7 @@ To ensure smooth transitions, deprecated tools remain available by default (`TES
|
|
|
165
165
|
| Deprecated Tool | Replacement | Status |
|
|
166
166
|
|-----------------|-------------|--------|
|
|
167
167
|
| `add_attachment_to_run` | `add_attachment` (`entity_type: "case" \| "run"`) | Deprecated in `2.3.0`, scheduled for removal in `3.0.0` |
|
|
168
|
+
| `get_sections` | `query_section` (`action: "many"`) | Deprecated in `2.8.0`, scheduled for removal in `3.0.0` |
|
|
168
169
|
|
|
169
170
|
> **💡 Token Tip**: If you are not using legacy tools, set `TESTRAIL_ENABLE_DEPRECATED_TOOLS=false` in your environment to eliminate deprecated tool definitions from the LLM prompt and save tokens!
|
|
170
171
|
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ if (!parseResult.success) {
|
|
|
27
27
|
const { TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY, TESTRAIL_ENABLE_SHARED_STEPS, TESTRAIL_ENABLE_CASE_HISTORY, TESTRAIL_ENABLE_RAG_TOOLS, TESTRAIL_ALLOW_WRITE_OPERATIONS, TESTRAIL_ALLOW_READ_OPERATIONS, TESTRAIL_ALLOW_DELETE_OPERATIONS, TESTRAIL_ENABLE_DEPRECATED_TOOLS, TESTRAIL_DISABLED_TOOLS } = parseResult.data;
|
|
28
28
|
const server = new McpServer({
|
|
29
29
|
name: "TestRail MCP Server",
|
|
30
|
-
version: "2.
|
|
30
|
+
version: "2.9.0",
|
|
31
31
|
});
|
|
32
32
|
const client = new TestRailClient(TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY);
|
|
33
33
|
let tools;
|
|
@@ -13,7 +13,7 @@ const parameters = {
|
|
|
13
13
|
filter: z.record(z.string(), z.string()).optional().describe("Optional API-side filters (e.g. priority_id, type_id, milestone_id, refs, created_after, etc.)."),
|
|
14
14
|
where: z.record(z.string(), z.any()).optional().describe("Optional client-side filter for any field including custom fields (filters after fetching cases). Supports exact value matching. Example: {\"custom_automation_status\": 1}"),
|
|
15
15
|
output_dir: z.string().optional().describe("Directory to save exported files. Defaults to an auto-generated directory in the current working directory."),
|
|
16
|
-
ignored_fields: z.array(z.string()).optional().describe("Optional list of custom field names or system names to ignore/exclude from export (e.g. ['custom_review_status', 'review_status']). Supports both full system_name and stripped field names. Core metadata attributes (case_id, title, section, priority, references, labels) cannot be ignored."),
|
|
16
|
+
ignored_fields: z.array(z.string()).optional().describe("Optional list of custom field names or system names to ignore/exclude from export (e.g. ['custom_review_status', 'review_status']). Supports both full system_name and stripped field names. Core metadata attributes (case_id, revision_id, title, section, priority, references, labels) cannot be ignored."),
|
|
17
17
|
};
|
|
18
18
|
function formatStepsSeparated(steps) {
|
|
19
19
|
return steps.map((step, idx) => {
|
|
@@ -122,9 +122,10 @@ function buildMarkdownBody(testCase, sectionName, markdownFields) {
|
|
|
122
122
|
}
|
|
123
123
|
return mdLines.join("\n").trim() + "\n";
|
|
124
124
|
}
|
|
125
|
-
function buildMetadataAttributes(testCase, sectionName, priority, metadataFields) {
|
|
125
|
+
function buildMetadataAttributes(testCase, sectionName, priority, metadataFields, revisionId) {
|
|
126
126
|
const metadataAttributes = {
|
|
127
127
|
case_id: testCase.id,
|
|
128
|
+
revision_id: revisionId,
|
|
128
129
|
title: testCase.title,
|
|
129
130
|
section: sectionName,
|
|
130
131
|
priority: priority,
|
|
@@ -206,8 +207,18 @@ export const exportCasesForRagTool = {
|
|
|
206
207
|
const templateId = testCase.template_id;
|
|
207
208
|
const applicableFields = caseFields.filter(field => field.include_all || (templateId !== null && templateId !== undefined && field.template_ids.includes(templateId)));
|
|
208
209
|
const { markdownFields, metadataFields } = categorizeCustomFields(testCase, applicableFields, ignoredFieldsSet);
|
|
210
|
+
let revisionId = null;
|
|
211
|
+
try {
|
|
212
|
+
const history = await client.getCaseHistory(testCase.id);
|
|
213
|
+
if (history && history.length > 0) {
|
|
214
|
+
revisionId = Math.max(...history.map(h => h.id));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
revisionId = null;
|
|
219
|
+
}
|
|
209
220
|
const markdownContent = buildMarkdownBody(testCase, sectionName, markdownFields);
|
|
210
|
-
const metadataAttributes = buildMetadataAttributes(testCase, sectionName, priority, metadataFields);
|
|
221
|
+
const metadataAttributes = buildMetadataAttributes(testCase, sectionName, priority, metadataFields, revisionId);
|
|
211
222
|
const docFilename = `C${testCase.id}.md`;
|
|
212
223
|
const metaFilename = `C${testCase.id}.md.metadata.json`;
|
|
213
224
|
await fs.promises.writeFile(path.join(targetDir, docFilename), markdownContent, "utf-8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uarlouski/testrail-mcp-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.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",
|
|
@@ -55,9 +55,7 @@
|
|
|
55
55
|
"rimraf": "^6.1.3",
|
|
56
56
|
"ts-jest": "^29.4.6",
|
|
57
57
|
"ts-node": "^10.9.2",
|
|
58
|
-
"typescript": "^5.9.3"
|
|
59
|
-
"vitepress": "^1.6.4",
|
|
60
|
-
"vue": "^3.5.41"
|
|
58
|
+
"typescript": "^5.9.3"
|
|
61
59
|
},
|
|
62
60
|
"devEngines": {
|
|
63
61
|
"packageManager": {
|
|
@@ -72,8 +70,8 @@
|
|
|
72
70
|
"dev": "ts-node src/index.ts",
|
|
73
71
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
74
72
|
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
|
|
75
|
-
"docs:dev": "
|
|
76
|
-
"docs:build": "
|
|
77
|
-
"docs:preview": "
|
|
73
|
+
"docs:dev": "pnpm --prefix docs dev",
|
|
74
|
+
"docs:build": "pnpm --prefix docs build",
|
|
75
|
+
"docs:preview": "pnpm --prefix docs preview"
|
|
78
76
|
}
|
|
79
77
|
}
|