@uarlouski/testrail-mcp-server 2.10.0 β 3.0.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 +160 -36
- package/dist/tools/cases/add_case.js +1 -1
- package/dist/tools/cases/get_cases.js +3 -3
- package/dist/tools/commons/get_templates.js +1 -1
- package/dist/tools/runs/index.js +0 -2
- package/dist/tools/sections/index.js +1 -3
- package/dist/tools/sections/types.js +1 -1
- package/dist/utils/validator.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +24 -10
- package/dist/tools/runs/add_attachment_to_run.js +0 -23
- package/dist/tools/sections/get_sections.js +0 -35
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>π TestRail MCP Server</h1>
|
|
3
3
|
<p>
|
|
4
|
-
<strong>
|
|
4
|
+
<strong>Connect Claude, Cursor, Windsurf, and VS Code to TestRail β an open-source Model Context Protocol (MCP) server for AI-assisted test management.</strong>
|
|
5
5
|
</p>
|
|
6
6
|
<p>
|
|
7
|
-
Manage TestRail projects, search and create test cases, kick off test runs, record results, and attach files
|
|
7
|
+
Manage TestRail projects, search and create test cases, kick off test runs, record results, and attach files through natural-language conversation with your AI assistant β or from CI/CD with the bundled <code>testrail-cli</code>. Built for QA engineers and AI-assisted test automation.
|
|
8
8
|
</p>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
@@ -27,18 +27,38 @@
|
|
|
27
27
|
<img src="https://img.shields.io/badge/VS%20Code-007ACC?logo=visualstudiocode&logoColor=white" alt="VS Code">
|
|
28
28
|
</p>
|
|
29
29
|
|
|
30
|
+
<p align="center">
|
|
31
|
+
<a href="https://uarlouski.github.io/testrail-mcp-server/"><strong>π Documentation</strong></a> Β·
|
|
32
|
+
<a href="https://uarlouski.github.io/testrail-mcp-server/guide/getting-started"><strong>Getting Started</strong></a> Β·
|
|
33
|
+
<a href="https://uarlouski.github.io/testrail-mcp-server/reference/"><strong>Tool Reference</strong></a> Β·
|
|
34
|
+
<a href="https://uarlouski.github.io/testrail-mcp-server/guide/faq"><strong>FAQ</strong></a>
|
|
35
|
+
</p>
|
|
36
|
+
|
|
30
37
|
<!-- TODO: insert demo.gif β short screencast of asking "create a test case" in Claude or Cursor and seeing the case appear in TestRail -->
|
|
31
38
|
|
|
32
39
|
---
|
|
33
40
|
|
|
34
|
-
##
|
|
41
|
+
## What is the TestRail MCP Server?
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
The **TestRail MCP Server** is a free, open-source [Model Context Protocol](https://modelcontextprotocol.io) server that gives AI assistants direct, structured access to a [TestRail](https://www.testrail.com/) instance through the TestRail API v2. Once configured, an assistant such as **Claude Desktop, Cursor, Windsurf, or GitHub Copilot in VS Code** can search test cases, draft new ones, start test runs, record results, and upload attachments on your behalf β without you leaving the chat window.
|
|
44
|
+
|
|
45
|
+
It exposes **34 tools**, runs locally on **Node.js 18+** over the MCP stdio transport, and is licensed under **Apache 2.0**. There is nothing to host or deploy: your MCP client launches it on demand with `npx`.
|
|
37
46
|
|
|
38
47
|
**No context switching. No tedious copy-pasting. Just ask your AI.**
|
|
39
48
|
|
|
40
49
|
> [!NOTE]
|
|
41
|
-
> **Compatibility
|
|
50
|
+
> **Compatibility baseline**: tested and validated against **TestRail 10.6.2** (API v2). Older TestRail instances (including pre-7.x pagination) are also supported via built-in backward compatibility. TestRail Cloud and self-hosted TestRail Server both work.
|
|
51
|
+
|
|
52
|
+
## Table of contents
|
|
53
|
+
|
|
54
|
+
- [Key features](#-key-features--capabilities)
|
|
55
|
+
- [Quick start](#-quick-start-guide)
|
|
56
|
+
- [Command line interface & CI/CD](#οΈ-command-line-interface-cli--cicd-automation)
|
|
57
|
+
- [Environment variables](#οΈ-environment-variables--security-controls)
|
|
58
|
+
- [Available tools](#-available-tools)
|
|
59
|
+
- [FAQ](#-frequently-asked-questions)
|
|
60
|
+
- [Documentation](#-documentation--complete-tool-reference)
|
|
61
|
+
- [Contributing](#-contributing)
|
|
42
62
|
|
|
43
63
|
## β¨ Key Features & Capabilities
|
|
44
64
|
|
|
@@ -48,16 +68,18 @@ Managing test cases manually is tedious and error-prone. With the **TestRail MCP
|
|
|
48
68
|
| **π Full Case Management** | Fetch, create, update, and bulk-edit test cases with comprehensive custom field support. |
|
|
49
69
|
| **βΆοΈ Actionable Execution** | Create test runs, update results by `test_id` or `case_id`, attach files, and track statuses. |
|
|
50
70
|
| **π§ Context-Aware AI** | Dynamically exposes templates, fields, priorities, and statuses so LLMs generate valid, structured data. |
|
|
71
|
+
| **π₯οΈ CLI & CI/CD Native** | Run every tool from bash, GitHub Actions, GitLab CI, or Jenkins with zero LLM overhead. |
|
|
72
|
+
| **π Least-Privilege Controls** | Per-mode permissions plus per-tool allowlisting; destructive deletes are off by default. |
|
|
51
73
|
|
|
52
74
|
## π Quick Start Guide
|
|
53
75
|
|
|
54
|
-
### 1. Obtain
|
|
76
|
+
### 1. Obtain your TestRail API key
|
|
55
77
|
|
|
56
|
-
Navigate to **My Settings β API Keys** in
|
|
78
|
+
Navigate to **My Settings β API Keys** in TestRail and generate a new key. Copy it immediately β TestRail shows it only once. The API must also be enabled instance-wide under **Administration β Site Settings β API**.
|
|
57
79
|
|
|
58
|
-
### 2. Configure
|
|
80
|
+
### 2. Configure your MCP client
|
|
59
81
|
|
|
60
|
-
Add the server to your
|
|
82
|
+
Add the server to your MCP client configuration. The Claude Desktop example is shown below; Cursor, Windsurf, and VS Code use the same pattern (see the collapsible sections).
|
|
61
83
|
|
|
62
84
|
#### π€ Claude Desktop
|
|
63
85
|
|
|
@@ -83,7 +105,7 @@ Add this to your `claude_desktop_config.json`:
|
|
|
83
105
|
<details>
|
|
84
106
|
<summary><strong>β¨οΈ Cursor</strong></summary>
|
|
85
107
|
|
|
86
|
-
Open **Settings β
|
|
108
|
+
Open **Settings β MCP β Add new MCP server**, or edit `.cursor/mcp.json` in your project (`~/.cursor/mcp.json` for all projects):
|
|
87
109
|
|
|
88
110
|
```json
|
|
89
111
|
{
|
|
@@ -105,7 +127,7 @@ Open **Settings β Features β MCP** and add a new configuration:
|
|
|
105
127
|
<details>
|
|
106
128
|
<summary><strong>π Windsurf</strong></summary>
|
|
107
129
|
|
|
108
|
-
|
|
130
|
+
Edit `~/.codeium/windsurf/mcp_config.json`:
|
|
109
131
|
|
|
110
132
|
```json
|
|
111
133
|
{
|
|
@@ -124,21 +146,55 @@ Update your Windsurf MCP configuration file:
|
|
|
124
146
|
```
|
|
125
147
|
</details>
|
|
126
148
|
|
|
149
|
+
<details>
|
|
150
|
+
<summary><strong>π» VS Code</strong></summary>
|
|
151
|
+
|
|
152
|
+
Add to `.vscode/mcp.json`. The `inputs` block keeps your API key out of the file:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"inputs": [
|
|
157
|
+
{
|
|
158
|
+
"id": "testrail-api-key",
|
|
159
|
+
"type": "promptString",
|
|
160
|
+
"description": "TestRail API key",
|
|
161
|
+
"password": true
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"servers": {
|
|
165
|
+
"testrail": {
|
|
166
|
+
"command": "npx",
|
|
167
|
+
"args": ["-y", "@uarlouski/testrail-mcp-server@latest"],
|
|
168
|
+
"env": {
|
|
169
|
+
"TESTRAIL_INSTANCE_URL": "https://your-instance.testrail.io",
|
|
170
|
+
"TESTRAIL_USERNAME": "your@email.com",
|
|
171
|
+
"TESTRAIL_API_KEY": "${input:testrail-api-key}"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
</details>
|
|
178
|
+
|
|
127
179
|
<details>
|
|
128
180
|
<summary><strong>π Other MCP Clients</strong></summary>
|
|
129
181
|
|
|
130
|
-
Any MCP-compliant client can
|
|
182
|
+
Any MCP-compliant client can use this server, because it speaks the standard MCP **stdio** transport. Point your client at the `npx` command with the required environment variables β no port, URL, or transport configuration needed.
|
|
131
183
|
</details>
|
|
132
184
|
|
|
133
|
-
### 3. See
|
|
185
|
+
### 3. See it in action
|
|
134
186
|
|
|
135
|
-
|
|
187
|
+
Restart your client completely, then turbo-charge your QA workflow by asking your AI assistant:
|
|
136
188
|
|
|
137
189
|
- *"List all projects in TestRail to find the latest active project."*
|
|
138
190
|
- *"Show me all active users in the project to find the right assignee."*
|
|
139
191
|
- *"Show me all test cases in section 5 of project 3."*
|
|
140
192
|
- *"Create a comprehensive test case for 'Login Validation' with detailed steps."*
|
|
141
193
|
- *"Start a new test run containing cases from section 5."*
|
|
194
|
+
- *"Mark test case C1042 as passed with the comment 'verified on staging'."*
|
|
195
|
+
|
|
196
|
+
Full per-client setup instructions, including troubleshooting, are in the [Getting Started guide](https://uarlouski.github.io/testrail-mcp-server/guide/getting-started).
|
|
197
|
+
|
|
142
198
|
---
|
|
143
199
|
|
|
144
200
|
## π₯οΈ Command Line Interface (CLI) & CI/CD Automation
|
|
@@ -149,7 +205,7 @@ In addition to interacting via AI assistants, you can invoke any TestRail tool d
|
|
|
149
205
|
- **Pipeline-Native Output**: Emits clean JSON to `stdout` for piping into tools like `jq`, while diagnostics and errors go to `stderr`.
|
|
150
206
|
- **Zero Duplication**: Reuses the exact same API client, retry logic, and validation schemas as the MCP server.
|
|
151
207
|
|
|
152
|
-
### Invocation
|
|
208
|
+
### Invocation methods
|
|
153
209
|
|
|
154
210
|
```bash
|
|
155
211
|
# Method 1: Direct npx subcommand (Recommended)
|
|
@@ -164,7 +220,7 @@ npx -p @uarlouski/testrail-mcp-server testrail-cli <command> [flags]
|
|
|
164
220
|
|
|
165
221
|
### Examples
|
|
166
222
|
|
|
167
|
-
#### Query
|
|
223
|
+
#### Query projects (`query_project`)
|
|
168
224
|
```bash
|
|
169
225
|
# List all active projects
|
|
170
226
|
npx @uarlouski/testrail-mcp-server cli query_project --action many
|
|
@@ -173,7 +229,15 @@ npx @uarlouski/testrail-mcp-server cli query_project --action many
|
|
|
173
229
|
npx @uarlouski/testrail-mcp-server cli query_project --action one --project_id 1
|
|
174
230
|
```
|
|
175
231
|
|
|
176
|
-
####
|
|
232
|
+
#### Report automated test results (`add_results_for_cases`)
|
|
233
|
+
```bash
|
|
234
|
+
# Submit results by case_id β what your test framework already knows
|
|
235
|
+
npx @uarlouski/testrail-mcp-server cli add_results_for_cases \
|
|
236
|
+
--run_id 88 \
|
|
237
|
+
--results '[{"case_id":1042,"status_id":1,"comment":"Passed in CI"}]'
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### Export cases for knowledge base / RAG (`export_cases_for_rag`)
|
|
177
241
|
```bash
|
|
178
242
|
# Export all cases for a project into Markdown & metadata sidecars
|
|
179
243
|
npx @uarlouski/testrail-mcp-server cli export_cases_for_rag \
|
|
@@ -186,16 +250,17 @@ npx @uarlouski/testrail-mcp-server cli export_cases_for_rag \
|
|
|
186
250
|
--output_dir ./rag_exports
|
|
187
251
|
```
|
|
188
252
|
|
|
189
|
-
#### Command
|
|
253
|
+
#### Command discovery & flag documentation
|
|
190
254
|
```bash
|
|
191
255
|
# List all available commands
|
|
192
256
|
npx @uarlouski/testrail-mcp-server cli --help
|
|
193
257
|
|
|
194
258
|
# Show parameter options for a specific tool
|
|
195
259
|
npx @uarlouski/testrail-mcp-server cli query_project --help
|
|
196
|
-
npx @uarlouski/testrail-mcp-server cli export_cases_for_rag --help
|
|
197
260
|
```
|
|
198
261
|
|
|
262
|
+
See the [CLI & CI/CD guide](https://uarlouski.github.io/testrail-mcp-server/guide/cli) for complete GitHub Actions, GitLab CI, and Jenkins workflows.
|
|
263
|
+
|
|
199
264
|
---
|
|
200
265
|
|
|
201
266
|
## βοΈ Environment Variables & Security Controls
|
|
@@ -211,43 +276,102 @@ npx @uarlouski/testrail-mcp-server cli export_cases_for_rag --help
|
|
|
211
276
|
| `TESTRAIL_ALLOW_WRITE_OPERATIONS` | Allow write operations (e.g. adding/updating test cases, test runs, sections) | | `true` |
|
|
212
277
|
| `TESTRAIL_ALLOW_READ_OPERATIONS` | Allow read operations (e.g. retrieving projects, test cases, templates) | | `true` |
|
|
213
278
|
| `TESTRAIL_ALLOW_DELETE_OPERATIONS` | Allow delete operations (e.g. deleting cases or shared steps). Enabled strictly via `true`. | | `false` |
|
|
214
|
-
| `TESTRAIL_ENABLE_DEPRECATED_TOOLS` |
|
|
279
|
+
| `TESTRAIL_ENABLE_DEPRECATED_TOOLS` | Preserved for backward compatibility with existing host configurations. | | `true` |
|
|
215
280
|
| `TESTRAIL_DISABLED_TOOLS` | Comma-separated list of specific tool names to disable (e.g., `mutate_suite,delete_entity`). Fails if invalid tool names are specified. | | - |
|
|
216
281
|
|
|
217
|
-
|
|
282
|
+
With only the three required credentials, **26 of the 34 tools** are registered. Ready-made read-only and least-privilege configurations are in the [Configuration guide](https://uarlouski.github.io/testrail-mcp-server/guide/configuration).
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## π§° Available Tools
|
|
218
287
|
|
|
219
|
-
|
|
288
|
+
All 34 tools, grouped by area. Each declares a `read`, `write`, or `delete` mode, which the server surfaces to clients as MCP annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`).
|
|
220
289
|
|
|
221
|
-
|
|
|
222
|
-
|
|
223
|
-
|
|
|
224
|
-
|
|
|
290
|
+
| Area | Tools | Reference |
|
|
291
|
+
|------|-------|-----------|
|
|
292
|
+
| **Discovery & Navigation** | `query_project`, `query_suite`, `mutate_suite`, `query_section`, `mutate_section`, `get_users` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/discovery) |
|
|
293
|
+
| **Test Case Management** | `get_case`, `get_cases`, `add_case`, `update_case`, `update_cases`, `get_case_fields`, `resolve_case_field`, `get_case_history`, `export_cases_for_rag` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/cases) |
|
|
294
|
+
| **Execution & Tracking** | `query_run`, `mutate_run`, `get_tests`, `get_results`, `add_results`, `add_results_for_cases` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/execution) |
|
|
295
|
+
| **Attachments & Media** | `add_attachment`, `query_attachment` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/attachments) |
|
|
296
|
+
| **Shared Steps** | `get_shared_step`, `get_shared_steps`, `get_shared_step_history`, `add_shared_step`, `update_shared_step` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/shared-steps) |
|
|
297
|
+
| **System Metadata** | `get_statuses`, `get_priorities`, `get_case_fields`, `get_templates`, `get_labels`, `get_configurations` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/metadata) |
|
|
298
|
+
| **Deletion** | `delete_entity` | [Docs](https://uarlouski.github.io/testrail-mcp-server/reference/deletion) |
|
|
225
299
|
|
|
226
|
-
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## β Frequently Asked Questions
|
|
303
|
+
|
|
304
|
+
<details>
|
|
305
|
+
<summary><strong>Which AI assistants and MCP clients are supported?</strong></summary>
|
|
306
|
+
|
|
307
|
+
Any MCP-compliant client, because the server uses the standard MCP stdio transport. Setup is verified with Claude Desktop, Cursor, Windsurf, and VS Code. Other clients follow the same pattern: run `npx -y @uarlouski/testrail-mcp-server@latest` with three environment variables.
|
|
308
|
+
</details>
|
|
309
|
+
|
|
310
|
+
<details>
|
|
311
|
+
<summary><strong>Which TestRail versions are supported?</strong></summary>
|
|
312
|
+
|
|
313
|
+
The server targets TestRail API v2 and is tested against **TestRail 10.6.2**. Older instances work too β the client detects whether an endpoint returns a modern paginated response or a legacy bare array, so pre-7.x instances need no configuration. Both TestRail Cloud and self-hosted TestRail Server are supported.
|
|
314
|
+
</details>
|
|
315
|
+
|
|
316
|
+
<details>
|
|
317
|
+
<summary><strong>Is it safe to give an AI assistant write access to TestRail?</strong></summary>
|
|
318
|
+
|
|
319
|
+
Access is layered rather than all-or-nothing. Every tool declares a `read`, `write`, or `delete` mode; deletes are disabled unless you explicitly set `TESTRAIL_ALLOW_DELETE_OPERATIONS=true`. You can disable all writes with `TESTRAIL_ALLOW_WRITE_OPERATIONS=false`, or block individual tools by name with `TESTRAIL_DISABLED_TOOLS`. The server runs locally and talks only to your TestRail instance β there is no telemetry and no third-party service in the middle.
|
|
320
|
+
</details>
|
|
321
|
+
|
|
322
|
+
<details>
|
|
323
|
+
<summary><strong>Is it free?</strong></summary>
|
|
324
|
+
|
|
325
|
+
Yes β Apache 2.0 licensed, with no paid tier, licence key, or usage limit. You need your own TestRail subscription, and whatever your AI assistant costs. The CLI has no LLM cost at all.
|
|
326
|
+
</details>
|
|
327
|
+
|
|
328
|
+
<details>
|
|
329
|
+
<summary><strong>Can I use it in CI/CD without an AI assistant?</strong></summary>
|
|
330
|
+
|
|
331
|
+
Yes. The package ships a `testrail-cli` binary exposing every tool as a subcommand, reusing the same API client, retry logic, and validation schemas. JSON on stdout, diagnostics on stderr, exit code `0` or `1` β see the [CLI guide](https://uarlouski.github.io/testrail-mcp-server/guide/cli).
|
|
332
|
+
</details>
|
|
333
|
+
|
|
334
|
+
<details>
|
|
335
|
+
<summary><strong>How do I stop the AI from inventing custom fields that don't exist?</strong></summary>
|
|
336
|
+
|
|
337
|
+
It can't. Before `add_case` or `update_case` sends anything, the server validates every field key against your instance's real schema (fetched via `get_case_fields`) and rejects unknown keys. Templates, priorities, statuses, and configurations are all exposed as tools too, so the model looks up correct IDs instead of guessing them.
|
|
338
|
+
</details>
|
|
339
|
+
|
|
340
|
+
<details>
|
|
341
|
+
<summary><strong>How do I handle thousands of test cases without blowing the context window?</strong></summary>
|
|
342
|
+
|
|
343
|
+
Pass `output_file` to `get_cases` (or `output_dir` to `export_cases_for_rag`). The server paginates the full result set, writes raw JSON to disk, and returns only a short summary to the model.
|
|
344
|
+
</details>
|
|
345
|
+
|
|
346
|
+
More answers in the [full FAQ](https://uarlouski.github.io/testrail-mcp-server/guide/faq).
|
|
227
347
|
|
|
228
348
|
---
|
|
229
349
|
|
|
230
350
|
## π Documentation & Complete Tool Reference
|
|
231
351
|
|
|
232
|
-
For a comprehensive guide, detailed configuration options, and a complete breakdown of all available tools,
|
|
352
|
+
For a comprehensive guide, detailed configuration options, and a complete breakdown of all available tools, visit the official documentation site:
|
|
233
353
|
|
|
234
354
|
**π [TestRail MCP Server Documentation](https://uarlouski.github.io/testrail-mcp-server/)**
|
|
235
355
|
|
|
236
|
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
|
|
356
|
+
- π **[Getting Started](https://uarlouski.github.io/testrail-mcp-server/guide/getting-started)**: Per-client setup for Claude, Cursor, Windsurf, and VS Code.
|
|
357
|
+
- βοΈ **[Configuration](https://uarlouski.github.io/testrail-mcp-server/guide/configuration)**: Every environment variable, permission, and feature flag.
|
|
358
|
+
- π§° **[All Tools](https://uarlouski.github.io/testrail-mcp-server/reference/)**: All 34 tools with modes and feature flags in one table.
|
|
359
|
+
- π **[Discovery & Navigation](https://uarlouski.github.io/testrail-mcp-server/reference/discovery)**: Exploring projects, suites, and sections.
|
|
360
|
+
- π **[Test Case Management](https://uarlouski.github.io/testrail-mcp-server/reference/cases)**: Fetching, creating, and bulk-updating test cases.
|
|
361
|
+
- βΆοΈ **[Execution & Tracking](https://uarlouski.github.io/testrail-mcp-server/reference/execution)**: Managing test runs and submitting test results.
|
|
362
|
+
- π **[Attachments](https://uarlouski.github.io/testrail-mcp-server/reference/attachments)**: Automatically zipping and uploading files or directories.
|
|
363
|
+
- π **[Shared Steps](https://uarlouski.github.io/testrail-mcp-server/reference/shared-steps)**: Managing reusable step definitions.
|
|
364
|
+
- π₯οΈ **[CLI & CI/CD](https://uarlouski.github.io/testrail-mcp-server/guide/cli)**: Pipeline automation without an LLM.
|
|
243
365
|
|
|
244
366
|
---
|
|
245
367
|
|
|
246
368
|
## π€ Contributing
|
|
369
|
+
|
|
247
370
|
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.
|
|
248
371
|
|
|
249
372
|
## π License
|
|
250
|
-
|
|
373
|
+
|
|
374
|
+
This project is licensed under the [Apache License 2.0](LICENSE).
|
|
251
375
|
|
|
252
376
|
---
|
|
253
377
|
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { validateCaseFields } from "../../utils/validator.js";
|
|
3
3
|
import { CASE_FIELDS_PARAM_DESCRIPTION } from "./get_case_fields.js";
|
|
4
4
|
const parameters = {
|
|
5
|
-
section_id: z.number().describe("The ID of the section where the case should be created. Use
|
|
5
|
+
section_id: z.number().describe("The ID of the section where the case should be created. Use query_section (action: \"many\") to find available sections"),
|
|
6
6
|
title: z.string().describe("The title of the test case"),
|
|
7
7
|
fields: z.record(z.string(), z.any()).optional().describe(CASE_FIELDS_PARAM_DESCRIPTION),
|
|
8
8
|
};
|
|
@@ -2,13 +2,13 @@ import { z } from "zod";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import { validateCaseFields, validateSuiteId } from "../../utils/validator.js";
|
|
4
4
|
const parameters = {
|
|
5
|
-
project_id: z.number().describe("The ID of the project. Use
|
|
6
|
-
suite_id: z.number().optional().describe("The ID of the test suite (required for multi-suite projects, i.e. suite_mode=3). Use
|
|
5
|
+
project_id: z.number().describe("The ID of the project. Use query_project to find available projects"),
|
|
6
|
+
suite_id: z.number().optional().describe("The ID of the test suite (required for multi-suite projects, i.e. suite_mode=3). Use query_suite to find available suites"),
|
|
7
7
|
section: z.object({
|
|
8
8
|
id: z.number(),
|
|
9
9
|
recursive: z.boolean().optional().default(false).describe("If true, fetches cases from the section and all its child sections"),
|
|
10
10
|
excludes: z.array(z.string()).optional().describe("List of section names to exclude from the recursive search"),
|
|
11
|
-
}).optional().describe("Section filter configuration. Use
|
|
11
|
+
}).optional().describe("Section filter configuration. Use query_section to find available sections"),
|
|
12
12
|
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\"}"),
|
|
13
13
|
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}"),
|
|
14
14
|
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\"]"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { TemplateSchema } from "./types.js";
|
|
3
3
|
const parameters = {
|
|
4
|
-
project_id: z.number().describe("The ID of the project. Use
|
|
4
|
+
project_id: z.number().describe("The ID of the project. Use query_project to find available projects"),
|
|
5
5
|
};
|
|
6
6
|
export const getTemplatesTool = {
|
|
7
7
|
name: "get_templates",
|
package/dist/tools/runs/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { getSectionsTool } from "./get_sections.js";
|
|
2
1
|
import { querySectionTool } from "./query_section.js";
|
|
3
2
|
import { mutateSectionTool } from "./mutate_section.js";
|
|
4
3
|
export const sectionsTools = [
|
|
5
4
|
querySectionTool,
|
|
6
|
-
getSectionsTool,
|
|
7
5
|
mutateSectionTool,
|
|
8
6
|
];
|
|
9
|
-
export {
|
|
7
|
+
export { querySectionTool, mutateSectionTool };
|
|
@@ -13,7 +13,7 @@ export const BaseSectionFields = z.object({
|
|
|
13
13
|
export const CreateSectionSchema = BaseSectionFields.extend({
|
|
14
14
|
action: z.literal("create").describe("The operation to perform: create a new section"),
|
|
15
15
|
project_id: z.number().describe("The ID of the project the section should be added to"),
|
|
16
|
-
suite_id: z.number().optional().describe("The ID of the test suite (required for multi-suite projects, i.e. suite_mode=2 or 3). Use
|
|
16
|
+
suite_id: z.number().optional().describe("The ID of the test suite (required for multi-suite projects, i.e. suite_mode=2 or 3). Use query_suite to find available suites"),
|
|
17
17
|
parent_id: z.number().optional().describe("The ID of the parent section (to build section hierarchies)"),
|
|
18
18
|
});
|
|
19
19
|
export const UpdateSectionSchema = BaseSectionFields.partial().extend({
|
package/dist/utils/validator.js
CHANGED
|
@@ -12,7 +12,7 @@ export async function validateSuiteId(client, projectId, suiteId) {
|
|
|
12
12
|
const project = await client.getProject(projectId);
|
|
13
13
|
if (project.suite_mode === SUITE_MODE_MULTI || project.suite_mode === SUITE_MODE_SINGLE_WITH_BASELINES) {
|
|
14
14
|
throw new Error(`Project "${project.name}" (id: ${project.id}) uses multiple test suites/baselines (suite_mode=${project.suite_mode}). ` +
|
|
15
|
-
`The suite_id parameter is required. Use
|
|
15
|
+
`The suite_id parameter is required. Use query_suite to find available suites for this project.`);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
/**
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "
|
|
1
|
+
export const VERSION = "3.0.0";
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uarlouski/testrail-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"mcpName": "io.github.uarlouski/testrail-mcp-server",
|
|
5
|
-
"description": "Model Context Protocol (MCP) server for TestRail
|
|
5
|
+
"description": "Model Context Protocol (MCP) server for TestRail: let Claude, Cursor, and Windsurf manage test cases, runs, results, and attachments.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"testrail-mcp-server": "./dist/index.js",
|
|
@@ -17,19 +17,33 @@
|
|
|
17
17
|
"model-context-protocol",
|
|
18
18
|
"mcp-server",
|
|
19
19
|
"testrail",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
20
|
+
"testrail-api",
|
|
21
|
+
"testrail-mcp",
|
|
22
|
+
"testrail-integration",
|
|
23
|
+
"test-management",
|
|
24
|
+
"test-case-management",
|
|
25
|
+
"test-cases",
|
|
26
|
+
"test-runs",
|
|
27
|
+
"test-results",
|
|
25
28
|
"testing",
|
|
26
|
-
"
|
|
29
|
+
"qa",
|
|
30
|
+
"quality-assurance",
|
|
27
31
|
"qa-automation",
|
|
28
32
|
"qa-tools",
|
|
29
|
-
"test-
|
|
33
|
+
"test-automation",
|
|
34
|
+
"automation",
|
|
35
|
+
"ci-cd",
|
|
36
|
+
"ai",
|
|
37
|
+
"ai-agents",
|
|
38
|
+
"llm",
|
|
30
39
|
"claude",
|
|
31
40
|
"cursor",
|
|
32
|
-
"windsurf"
|
|
41
|
+
"windsurf",
|
|
42
|
+
"vscode",
|
|
43
|
+
"copilot",
|
|
44
|
+
"rag",
|
|
45
|
+
"typescript",
|
|
46
|
+
"cli"
|
|
33
47
|
],
|
|
34
48
|
"author": "Uladzislau Arlouski",
|
|
35
49
|
"repository": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AttachmentSchema } from "../attachments/types.js";
|
|
3
|
-
import { prepareUploadFile } from "../../utils/attachment_helper.js";
|
|
4
|
-
const parameters = {
|
|
5
|
-
run_id: z.number().describe("The ID of the test run to attach the file to"),
|
|
6
|
-
file_path: z.string().describe("The path to the file or directory to attach. Directories will be automatically zipped."),
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Use `add_attachment` tool from the attachments domain instead.
|
|
10
|
-
*/
|
|
11
|
-
export const addAttachmentToRunTool = {
|
|
12
|
-
name: "add_attachment_to_run",
|
|
13
|
-
mode: "write",
|
|
14
|
-
deprecated: true,
|
|
15
|
-
description: "Add an attachment to a test run in TestRail. (Deprecated: Prefer add_attachment tool). Maximum upload size is 256MB.",
|
|
16
|
-
parameters,
|
|
17
|
-
handler: async ({ run_id, file_path }, client) => {
|
|
18
|
-
return prepareUploadFile(file_path, async (uploadPath, filename) => {
|
|
19
|
-
const result = await client.addAttachment('run', run_id, uploadPath, filename);
|
|
20
|
-
return AttachmentSchema.parse(result);
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { SectionSchema } from "./types.js";
|
|
4
|
-
import { validateSuiteId } from "../../utils/validator.js";
|
|
5
|
-
const parameters = {
|
|
6
|
-
project_id: z.number().describe("The ID of the project. Use get_projects to find available projects"),
|
|
7
|
-
suite_id: z.number().optional().describe("The ID of the test suite (required for multi-suite projects, i.e. suite_mode=3). Use get_suites to find available suites"),
|
|
8
|
-
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."),
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use `query_section` with payload.action = 'many' instead.
|
|
12
|
-
*/
|
|
13
|
-
export const getSectionsTool = {
|
|
14
|
-
name: "get_sections",
|
|
15
|
-
mode: "read",
|
|
16
|
-
deprecated: true,
|
|
17
|
-
description: "Get all sections for a project. (Deprecated: Prefer query_section tool). Returns section IDs and names that can be used with add_case",
|
|
18
|
-
parameters,
|
|
19
|
-
handler: async ({ project_id, suite_id, output_file }, client) => {
|
|
20
|
-
await validateSuiteId(client, project_id, suite_id);
|
|
21
|
-
const sections = await client.getSections(project_id, suite_id);
|
|
22
|
-
const response = {
|
|
23
|
-
sections: sections.map(s => SectionSchema.parse(s)),
|
|
24
|
-
};
|
|
25
|
-
if (output_file) {
|
|
26
|
-
await fs.promises.writeFile(output_file, JSON.stringify(response), "utf-8");
|
|
27
|
-
return {
|
|
28
|
-
success: true,
|
|
29
|
-
message: `Successfully exported ${response.sections.length} sections to ${output_file}`,
|
|
30
|
-
file: output_file
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return response;
|
|
34
|
-
}
|
|
35
|
-
};
|