@uarlouski/testrail-mcp-server 1.6.0 β†’ 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 CHANGED
@@ -1,14 +1,15 @@
1
- <p align="center">
2
- <h1 align="center">TestRail MCP Server</h1>
3
- <p align="center">
4
- A Model Context Protocol (MCP) server that connects AI assistants to TestRail test management β€” search, create, update, and execute test cases using natural language.
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
- </p>
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, your AI assistant (Claude, Cursor, Windsurf, or any MCP-compliant client) talks directly to TestRail. Ask it to find test cases, create new ones, kick off test runs, or report results β€” all through natural conversation.
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
- | Category | Capabilities |
28
- |----------|-------------|
29
- | **πŸ” Discovery** | Browse projects, suites, and sections to map your test organization |
30
- | **πŸ“‹ Case Management** | Fetch, create, update, and bulk-edit test cases with full custom field support |
31
- | **▢️ Test Execution** | Create runs, record results, attach files, and track test statuses |
32
- | **🧠 Context-Aware** | Exposes templates, field definitions, priorities, and case types so LLMs generate valid, well-structured test cases |
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. Get Your TestRail API Key
37
+ ### 1. Obtain Your TestRail API Key
37
38
 
38
- Navigate to **My Settings β†’ API Keys** in your TestRail instance and generate a new key.
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 clients.
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>Claude Desktop</strong></summary>
46
+ <summary><strong>πŸ€– Claude Desktop</strong></summary>
46
47
 
47
- Edit your `claude_desktop_config.json`:
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>Cursor</strong></summary>
68
+ <summary><strong>⌨️ Cursor</strong></summary>
69
69
 
70
- Open **Settings β†’ MCP** and add a new server:
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>Windsurf</strong></summary>
90
+ <summary><strong>🌊 Windsurf</strong></summary>
92
91
 
93
- Add to your Windsurf MCP configuration:
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>Other MCP Clients</strong></summary>
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. Start Using It
117
+ ### 3. See It in Action
121
118
 
122
- Once configured, ask your AI assistant things like:
119
+ Once configured, turbo-charge your QA workflow by asking your AI assistant:
123
120
 
124
- - *"List all projects in TestRail"*
125
- - *"Show me the test cases in suite 1 of project 3"*
126
- - *"Create a test case for login validation with steps"*
127
- - *"Start a new test run with cases from section 5"*
128
- - *"Mark test 42 as passed with a comment"*
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
- ## βš™οΈ Configuration
127
+ ---
131
128
 
132
- | Environment Variable | Description | Required |
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
- ## πŸ› οΈ Available Tools
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
- ### Discovery
137
+ ---
141
138
 
142
- | Tool | Description |
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
- ### Test Case Management
141
+ The TestRail MCP Server provides heavily typed, descriptive tools designed specifically for LLM interaction:
148
142
 
149
- | Tool | Description |
143
+ ### πŸ”­ Discovery & Navigation
144
+ | Tool | Functionality |
150
145
  |------|-------------|
151
- | `get_cases` | Query test cases with filtering by priority, template, type, and more β€” supports pagination and recursive section fetching |
152
- | `get_case` | Fetch complete details of a specific test case including steps and custom fields |
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
- | Tool | Description |
149
+ ### πŸ“‹ Test Case Management
150
+ | Tool | Functionality |
160
151
  |------|-------------|
161
- | `add_run` | Create a new test run in TestRail |
162
- | `get_tests` | Get tests for a run, optionally filtered by status |
163
- | `add_results` | Submit one or more test results to a run |
164
- | `add_attachment_to_run` | Attach a file or zipped folder to a test run |
165
-
166
- ### Metadata
167
-
168
- | Tool | Description |
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
- | `get_statuses` | List all available test statuses (Passed, Failed, Blocked, etc.) |
171
- | `get_case_fields` | Retrieve custom field definitions and dropdown options |
172
- | `get_templates` | List available case templates for correct case structure |
173
-
174
- ## πŸ—οΈ Development
175
-
176
- ### Prerequisites
177
-
178
- - [Node.js](https://nodejs.org/) 18+
179
- - npm
180
-
181
- ### Setup
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
- ```bash
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> Β· Built with the <a href="https://modelcontextprotocol.io">Model Context Protocol</a>
186
+ <b>TestRail MCP Server</b> Β· Engineered with the <a href="https://modelcontextprotocol.io">Model Context Protocol</a>
213
187
  </p>
214
188
 
215
- <p align="center">
216
- <sub>Keywords: TestRail MCP Server, Model Context Protocol, TestRail API integration, AI test management, LLM testing tools, Claude TestRail, Cursor TestRail, Windsurf TestRail, test case automation, QA AI assistant, MCP server for testing, TestRail plugin, test run management, AI-powered QA</sub>
217
- </p>
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>
@@ -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.6.0",
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,7 @@
1
1
  {
2
2
  "name": "@uarlouski/testrail-mcp-server",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
+ "mcpName": "io.github.uarlouski/testrail-mcp-server",
4
5
  "description": "Model Context Protocol (MCP) server for TestRail integration, enabling LLMs to fetch test cases and metadata.",
5
6
  "main": "dist/index.js",
6
7
  "bin": {
@@ -39,17 +40,17 @@
39
40
  "homepage": "https://github.com/uarlouski/testrail-mcp-server#readme",
40
41
  "license": "Apache-2.0",
41
42
  "dependencies": {
42
- "@modelcontextprotocol/sdk": "^1.25.3",
43
+ "@modelcontextprotocol/sdk": "^1.27.1",
43
44
  "archiver": "^7.0.1",
44
- "dotenv": "^17.2.3",
45
- "zod": "^4.3.5"
45
+ "dotenv": "^17.3.1",
46
+ "zod": "^4.3.6"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@types/archiver": "^7.0.0",
49
50
  "@types/jest": "^30.0.0",
50
- "@types/node": "^25.0.9",
51
- "jest": "^30.2.0",
52
- "rimraf": "^6.1.2",
51
+ "@types/node": "^25.5.0",
52
+ "jest": "^30.3.0",
53
+ "rimraf": "^6.1.3",
53
54
  "ts-jest": "^29.4.6",
54
55
  "ts-node": "^10.9.2",
55
56
  "typescript": "^5.9.3"