@uarlouski/testrail-mcp-server 1.6.1 β 1.7.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 +85 -106
- package/dist/client/testrail.js +3 -0
- package/dist/index.js +5 -1
- package/dist/tools/add_results_for_cases.js +24 -0
- package/dist/tools/get_priorities.js +13 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
<
|
|
2
|
-
<h1
|
|
3
|
-
<p
|
|
4
|
-
A Model Context Protocol (MCP) server
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>π TestRail MCP Server</h1>
|
|
3
|
+
<p>
|
|
4
|
+
<strong>A high-performance Model Context Protocol (MCP) server connecting AI assistants (Claude, Cursor, Windsurf) directly to TestRail.</strong><br>
|
|
5
|
+
<em>Seamlessly search, create, update, and execute test cases using natural language.</em>
|
|
5
6
|
</p>
|
|
6
|
-
</
|
|
7
|
+
</div>
|
|
7
8
|
|
|
8
9
|
<p align="center">
|
|
9
10
|
<a href="https://www.npmjs.com/package/@uarlouski/testrail-mcp-server"><img src="https://badge.fury.io/js/@uarlouski%2Ftestrail-mcp-server.svg" alt="npm version"></a>
|
|
10
11
|
<a href="https://www.npmjs.com/package/@uarlouski/testrail-mcp-server"><img src="https://img.shields.io/npm/dm/@uarlouski/testrail-mcp-server.svg" alt="npm downloads"></a>
|
|
11
|
-
<a href="https://github.com/uarlouski/testrail-mcp-server/actions/workflows/ci.yml"><img src="https://github.com/uarlouski/testrail-mcp-server/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
12
|
+
<a href="https://github.com/uarlouski/testrail-mcp-server/actions/workflows/ci.yml"><img src="https://github.com/uarlouski/testrail-mcp-server/actions/workflows/ci.yml/badge.svg" alt="CI Status"></a>
|
|
12
13
|
<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>
|
|
13
14
|
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-5.9-blue.svg" alt="TypeScript"></a>
|
|
14
15
|
<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>
|
|
@@ -16,35 +17,35 @@
|
|
|
16
17
|
|
|
17
18
|
---
|
|
18
19
|
|
|
19
|
-
## Why TestRail MCP Server?
|
|
20
|
+
## π Why Choose TestRail MCP Server?
|
|
20
21
|
|
|
21
|
-
Managing test cases manually is tedious. With the TestRail MCP Server
|
|
22
|
+
Managing test cases manually is tedious and error-prone. With the **TestRail MCP Server**, your AI assistant (whether itβs **Claude, Cursor, Windsurf**, or any MCP-compliant client) interacts directly with your TestRail instance. Instruct it to find test cases, draft new ones, kick off test runs, and record test resultsβall through natural conversation.
|
|
22
23
|
|
|
23
|
-
**No context switching. No copy-pasting. Just ask.**
|
|
24
|
+
**No context switching. No tedious copy-pasting. Just ask your AI.**
|
|
24
25
|
|
|
25
|
-
## β¨ Features
|
|
26
|
+
## β¨ Key Features & Capabilities
|
|
26
27
|
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
| **π Discovery** | Browse projects, suites, and sections to map your
|
|
30
|
-
| **π Case Management** | Fetch, create, update, and bulk-edit test cases with
|
|
31
|
-
| **βΆοΈ
|
|
32
|
-
| **π§ Context-Aware** |
|
|
28
|
+
| Capability | Description |
|
|
29
|
+
|------------|-------------|
|
|
30
|
+
| **π Intelligent Discovery** | Browse projects, test suites, and sections to automatically map your QA organization. |
|
|
31
|
+
| **π Full Case Management** | Fetch, create, update, and bulk-edit test cases with comprehensive custom field support. |
|
|
32
|
+
| **βΆοΈ Actionable Execution** | Create test runs, update results by `test_id` or `case_id`, attach files, and track statuses. |
|
|
33
|
+
| **π§ Context-Aware AI** | Dynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data. |
|
|
33
34
|
|
|
34
|
-
## π Quick Start
|
|
35
|
+
## π Quick Start Guide
|
|
35
36
|
|
|
36
|
-
### 1.
|
|
37
|
+
### 1. Obtain Your TestRail API Key
|
|
37
38
|
|
|
38
|
-
Navigate to **My Settings β API Keys** in your TestRail
|
|
39
|
+
Navigate to **My Settings β API Keys** in your TestRail platform and generate a new key for authentication.
|
|
39
40
|
|
|
40
41
|
### 2. Configure Your MCP Client
|
|
41
42
|
|
|
42
|
-
Add the server to your MCP client configuration. Below are examples for popular
|
|
43
|
+
Add the server to your chosen MCP client configuration. Below are examples for popular AI IDEs and assistants:
|
|
43
44
|
|
|
44
45
|
<details>
|
|
45
|
-
<summary><strong
|
|
46
|
+
<summary><strong>π€ Claude Desktop</strong></summary>
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
Add this to your `claude_desktop_config.json`:
|
|
48
49
|
|
|
49
50
|
```json
|
|
50
51
|
{
|
|
@@ -61,13 +62,12 @@ Edit your `claude_desktop_config.json`:
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
```
|
|
64
|
-
|
|
65
65
|
</details>
|
|
66
66
|
|
|
67
67
|
<details>
|
|
68
|
-
<summary><strong
|
|
68
|
+
<summary><strong>β¨οΈ Cursor</strong></summary>
|
|
69
69
|
|
|
70
|
-
Open **Settings β MCP** and add a new
|
|
70
|
+
Open **Settings β Features β MCP** and add a new configuration:
|
|
71
71
|
|
|
72
72
|
```json
|
|
73
73
|
{
|
|
@@ -84,13 +84,12 @@ Open **Settings β MCP** and add a new server:
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
|
-
|
|
88
87
|
</details>
|
|
89
88
|
|
|
90
89
|
<details>
|
|
91
|
-
<summary><strong
|
|
90
|
+
<summary><strong>π Windsurf</strong></summary>
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
Update your Windsurf MCP configuration file:
|
|
94
93
|
|
|
95
94
|
```json
|
|
96
95
|
{
|
|
@@ -107,111 +106,91 @@ Add to your Windsurf MCP configuration:
|
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
108
|
```
|
|
110
|
-
|
|
111
109
|
</details>
|
|
112
110
|
|
|
113
111
|
<details>
|
|
114
|
-
<summary><strong
|
|
115
|
-
|
|
116
|
-
Any MCP-compliant client can use this server. The configuration pattern is the same β point it at the `npx` command with the required environment variables.
|
|
112
|
+
<summary><strong>π Other MCP Clients</strong></summary>
|
|
117
113
|
|
|
114
|
+
Any MCP-compliant client can utilize this server. The pattern is universalβpoint your client at the `npx` command with the required environment variables.
|
|
118
115
|
</details>
|
|
119
116
|
|
|
120
|
-
### 3.
|
|
117
|
+
### 3. See It in Action
|
|
121
118
|
|
|
122
|
-
Once configured,
|
|
119
|
+
Once configured, turbo-charge your QA workflow by asking your AI assistant:
|
|
123
120
|
|
|
124
|
-
- *"List all projects in TestRail"*
|
|
125
|
-
- *"Show me
|
|
126
|
-
- *"Create a test case for
|
|
127
|
-
- *"Start a new test run
|
|
128
|
-
- *"Mark test
|
|
121
|
+
- *"List all projects in TestRail to find the latest active project."*
|
|
122
|
+
- *"Show me all test cases in section 5 of project 3."*
|
|
123
|
+
- *"Create a comprehensive test case for 'Login Validation' with detailed steps."*
|
|
124
|
+
- *"Start a new test run containing cases from section 5."*
|
|
125
|
+
- *"Mark test case ID 1042 as passed with the comment 'Tested successfully on staging'."*
|
|
129
126
|
|
|
130
|
-
|
|
127
|
+
---
|
|
131
128
|
|
|
132
|
-
|
|
133
|
-
|---------------------|-------------|:--------:|
|
|
134
|
-
| `TESTRAIL_INSTANCE_URL` | Your TestRail instance URL (e.g., `https://example.testrail.io`) | β
|
|
|
135
|
-
| `TESTRAIL_USERNAME` | Your TestRail email address | β
|
|
|
136
|
-
| `TESTRAIL_API_KEY` | Your TestRail API key ([how to get one](https://support.testrail.com/hc/en-us/articles/7077039051412-Accessing-the-TestRail-API)) | β
|
|
|
129
|
+
## βοΈ Environment Variables
|
|
137
130
|
|
|
138
|
-
|
|
131
|
+
| Variable | Description | Required |
|
|
132
|
+
|----------|-------------|:--------:|
|
|
133
|
+
| `TESTRAIL_INSTANCE_URL` | Your TestRail instance URL (e.g., `https://example.testrail.io`) | β
|
|
|
134
|
+
| `TESTRAIL_USERNAME` | Your TestRail user email address | β
|
|
|
135
|
+
| `TESTRAIL_API_KEY` | Your TestRail API key ([Guide](https://support.testrail.com/hc/en-us/articles/7077039051412-Accessing-the-TestRail-API)) | β
|
|
|
139
136
|
|
|
140
|
-
|
|
137
|
+
---
|
|
141
138
|
|
|
142
|
-
|
|
143
|
-
|------|-------------|
|
|
144
|
-
| `get_projects` | List all available projects in your TestRail instance |
|
|
145
|
-
| `get_sections` | Navigate the folder/section hierarchy of a test suite |
|
|
139
|
+
## π οΈ Complete Tool Reference
|
|
146
140
|
|
|
147
|
-
|
|
141
|
+
The TestRail MCP Server provides heavily typed, descriptive tools designed specifically for LLM interaction:
|
|
148
142
|
|
|
149
|
-
|
|
143
|
+
### π Discovery & Navigation
|
|
144
|
+
| Tool | Functionality |
|
|
150
145
|
|------|-------------|
|
|
151
|
-
| `
|
|
152
|
-
| `
|
|
153
|
-
| `create_case` | Create a new test case with full custom field support |
|
|
154
|
-
| `update_case` | Modify an existing test case's fields, title, or steps |
|
|
155
|
-
| `update_cases` | Bulk-update multiple test cases simultaneously |
|
|
156
|
-
|
|
157
|
-
### Test Execution
|
|
146
|
+
| `get_projects` | List all available active and completed projects in your instance. |
|
|
147
|
+
| `get_sections` | Navigate the precise folder/section hierarchy of any test suite. |
|
|
158
148
|
|
|
159
|
-
|
|
149
|
+
### π Test Case Management
|
|
150
|
+
| Tool | Functionality |
|
|
160
151
|
|------|-------------|
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
| Tool |
|
|
152
|
+
| `get_cases` | Query test cases with advanced filtering (priority, template, type, etc.) and pagination. |
|
|
153
|
+
| `get_case` | Fetch complete, structured details of a specific test case, including custom steps and fields. |
|
|
154
|
+
| `create_case` | Seamlessly create a new test case equipped with robust custom field validation. |
|
|
155
|
+
| `update_case` | Modify an existing test case's steps, metadata, or titles. |
|
|
156
|
+
| `update_cases` | Execute bulk-updates on multiple test cases simultaneously to save time. |
|
|
157
|
+
|
|
158
|
+
### βΆοΈ Test Execution & Tracking
|
|
159
|
+
| Tool | Functionality |
|
|
169
160
|
|------|-------------|
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
###
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
git clone https://github.com/uarlouski/testrail-mcp-server.git
|
|
185
|
-
cd testrail-mcp-server
|
|
186
|
-
npm install
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Build
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
npm run build
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Run Tests
|
|
161
|
+
| `add_run` | Generate a new, focused test run directly in TestRail. |
|
|
162
|
+
| `get_tests` | Retrieve individual tests for a specific test run, with optional status filtering. |
|
|
163
|
+
| `add_results` | Submit test results to a test run using the specific `test_id`. |
|
|
164
|
+
| `add_results_for_cases` | Submits results to a run mapping directly to `case_id`s, streamlining automation workflows. |
|
|
165
|
+
| `add_attachment_to_run` | Attach logs, files, or zipped artifacts directly to an ongoing test run. |
|
|
166
|
+
|
|
167
|
+
### π§ System Metadata
|
|
168
|
+
| Tool | Functionality |
|
|
169
|
+
|------|-------------|
|
|
170
|
+
| `get_statuses` | Systematically list all configured test statuses (Passed, Failed, Blocked, Retest, etc.). |
|
|
171
|
+
| `get_priorities` | Retrieve priority levels configured within your instance structure. |
|
|
172
|
+
| `get_case_fields` | Discover custom field definitions, formats, and UI dropdown options. |
|
|
173
|
+
| `get_templates` | Identify available case templates to mandate correct AI structuring. |
|
|
196
174
|
|
|
197
|
-
|
|
198
|
-
npm test
|
|
199
|
-
```
|
|
175
|
+
---
|
|
200
176
|
|
|
201
177
|
## π€ Contributing
|
|
202
|
-
|
|
203
|
-
Contributions are welcome! Please feel free to open an [issue](https://github.com/uarlouski/testrail-mcp-server/issues) or submit a pull request.
|
|
178
|
+
Open-source contributions are actively welcomed! Please feel free to open an [issue](https://github.com/uarlouski/testrail-mcp-server/issues) for feature requests or submit a pull request for improvements.
|
|
204
179
|
|
|
205
180
|
## π License
|
|
206
|
-
|
|
207
|
-
This project is licensed under the [Apache License 2.0](LICENSE).
|
|
181
|
+
This project is securely licensed under the [Apache License 2.0](LICENSE).
|
|
208
182
|
|
|
209
183
|
---
|
|
210
184
|
|
|
211
185
|
<p align="center">
|
|
212
|
-
<b>TestRail MCP Server</b> Β·
|
|
186
|
+
<b>TestRail MCP Server</b> Β· Engineered with the <a href="https://modelcontextprotocol.io">Model Context Protocol</a>
|
|
213
187
|
</p>
|
|
214
188
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
189
|
+
<!-- SEO Keywords -->
|
|
190
|
+
<div align="center">
|
|
191
|
+
<p>
|
|
192
|
+
<small>
|
|
193
|
+
<b>Keywords:</b> TestRail MCP Server, Model Context Protocol, TestRail API Integration, AI Test Management, LLM Testing Tools, Claude TestRail Plugin, Cursor TestRail, Windsurf QA Tool, Test Case Automation, QA AI Assistant, MCP Server Developer Tools, Prompt Engineering TestRail, Test Run Tracking, QA Productivity Automation.
|
|
194
|
+
</small>
|
|
195
|
+
</p>
|
|
196
|
+
</div>
|
package/dist/client/testrail.js
CHANGED
|
@@ -122,6 +122,9 @@ export class TestRailClient {
|
|
|
122
122
|
async addResults(runId, results) {
|
|
123
123
|
return this.post(`${API_BASE_V2}/add_results/${runId}`, { results });
|
|
124
124
|
}
|
|
125
|
+
async addResultsForCases(runId, results) {
|
|
126
|
+
return this.post(`${API_BASE_V2}/add_results_for_cases/${runId}`, { results });
|
|
127
|
+
}
|
|
125
128
|
async addAttachmentToRun(runId, filePath, filename) {
|
|
126
129
|
const fileBuffer = await fs.promises.readFile(filePath);
|
|
127
130
|
const blob = new Blob([fileBuffer]);
|
package/dist/index.js
CHANGED
|
@@ -14,9 +14,11 @@ import { getSectionsTool } from "./tools/get_sections.js";
|
|
|
14
14
|
import { getProjectsTool } from "./tools/get_projects.js";
|
|
15
15
|
import { addRunTool } from "./tools/add_run.js";
|
|
16
16
|
import { getStatusesTool } from "./tools/get_statuses.js";
|
|
17
|
+
import { getPrioritiesTool } from "./tools/get_priorities.js";
|
|
17
18
|
import { getTestsTool } from "./tools/get_tests.js";
|
|
18
19
|
import { addResultsTool } from "./tools/add_results.js";
|
|
19
20
|
import { addAttachmentToRunTool } from "./tools/add_attachment_to_run.js";
|
|
21
|
+
import { addResultsForCasesTool } from "./tools/add_results_for_cases.js";
|
|
20
22
|
import { removeNullish } from "./utils/sanitizer.js";
|
|
21
23
|
import z from "zod";
|
|
22
24
|
const EnvSchema = z.object({
|
|
@@ -32,7 +34,7 @@ if (!parseResult.success) {
|
|
|
32
34
|
const { TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY } = parseResult.data;
|
|
33
35
|
const server = new McpServer({
|
|
34
36
|
name: "TestRail MCP Server",
|
|
35
|
-
version: "1.
|
|
37
|
+
version: "1.7.0",
|
|
36
38
|
});
|
|
37
39
|
const client = new TestRailClient(TESTRAIL_INSTANCE_URL, TESTRAIL_USERNAME, TESTRAIL_API_KEY);
|
|
38
40
|
const tools = [
|
|
@@ -47,8 +49,10 @@ const tools = [
|
|
|
47
49
|
createCaseTool,
|
|
48
50
|
addRunTool,
|
|
49
51
|
getStatusesTool,
|
|
52
|
+
getPrioritiesTool,
|
|
50
53
|
getTestsTool,
|
|
51
54
|
addResultsTool,
|
|
55
|
+
addResultsForCasesTool,
|
|
52
56
|
addAttachmentToRunTool,
|
|
53
57
|
];
|
|
54
58
|
for (const tool of tools) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ResultSchema } from "../types/testrail.js";
|
|
3
|
+
const parameters = {
|
|
4
|
+
run_id: z.number().describe("The ID of the test run"),
|
|
5
|
+
results: z.array(z.object({
|
|
6
|
+
case_id: z.number().describe("The ID of the test case. Use get_cases with a project_id to retrieve available case IDs"),
|
|
7
|
+
status_id: z.number().describe("The ID of the test status (e.g. Passed, Failed). Use get_statuses to retrieve available status IDs"),
|
|
8
|
+
comment: z.string().optional().describe("Optional comment/description for the result"),
|
|
9
|
+
defects: z.string().optional().describe("Optional comma-separated list of defect IDs"),
|
|
10
|
+
})).describe("Array of results to add. Each result must have case_id and status_id"),
|
|
11
|
+
};
|
|
12
|
+
export const addResultsForCasesTool = {
|
|
13
|
+
name: "add_results_for_cases",
|
|
14
|
+
description: "Add one or more test results to a test run using case IDs instead of test IDs",
|
|
15
|
+
parameters,
|
|
16
|
+
handler: async ({ run_id, results }, client) => {
|
|
17
|
+
const response = await client.addResultsForCases(run_id, results);
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
added_count: response.length,
|
|
21
|
+
results: response.map(r => ResultSchema.parse(r)),
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PrioritySchema } from "../types/testrail.js";
|
|
2
|
+
const parameters = {};
|
|
3
|
+
export const getPrioritiesTool = {
|
|
4
|
+
name: "get_priorities",
|
|
5
|
+
description: "Get all available test case priorities (e.g. Critical, High, Medium, Low). Returns priority IDs and names that can be used when creating or updating test cases.",
|
|
6
|
+
parameters,
|
|
7
|
+
handler: async (_args, client) => {
|
|
8
|
+
const priorities = await client.getPriorities();
|
|
9
|
+
return {
|
|
10
|
+
priorities: priorities.map(p => PrioritySchema.parse(p)),
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uarlouski/testrail-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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",
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
"homepage": "https://github.com/uarlouski/testrail-mcp-server#readme",
|
|
41
41
|
"license": "Apache-2.0",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
43
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
44
44
|
"archiver": "^7.0.1",
|
|
45
|
-
"dotenv": "^17.
|
|
46
|
-
"zod": "^4.3.
|
|
45
|
+
"dotenv": "^17.3.1",
|
|
46
|
+
"zod": "^4.3.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/archiver": "^7.0.0",
|
|
50
50
|
"@types/jest": "^30.0.0",
|
|
51
|
-
"@types/node": "^25.0
|
|
52
|
-
"jest": "^30.
|
|
53
|
-
"rimraf": "^6.1.
|
|
51
|
+
"@types/node": "^25.5.0",
|
|
52
|
+
"jest": "^30.3.0",
|
|
53
|
+
"rimraf": "^6.1.3",
|
|
54
54
|
"ts-jest": "^29.4.6",
|
|
55
55
|
"ts-node": "^10.9.2",
|
|
56
56
|
"typescript": "^5.9.3"
|