@testomatio/mcp 1.0.14 → 2.0.0-beta.8

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,449 +1,166 @@
1
1
  # Testomat.io MCP Server
2
2
 
3
- A Model Context Protocol (MCP) server for Testomat.io API integration with AI assistants like Cursor.
3
+ Model Context Protocol (MCP) server that enables AI assistants (Claude, Cursor, etc.) to interact with Testomat.io Public API v2.
4
4
 
5
- <img width="1920" height="1085" alt="image" src="https://github.com/user-attachments/assets/cf823e8b-1305-4ed2-a7c5-712efec12ceb" />
6
-
7
- ## Installation
5
+ ## Features
8
6
 
9
- ### Prerequisites
7
+ - **Full CRUD** for core entities:
8
+ - Tests, Suites, Plans, Runs, TestRuns, RunGroups, Steps, Snippets, Labels
9
+ - Tags (read-only access)
10
+ - Issues (global + scoped helpers for tests/suites/runs/testruns/plans)
11
+ - **Smart Search** - delegates to list endpoints with query/filter forwarding
12
+ - **Issue Linking** - link/unlink issues to any resource
13
+ - **API Compatibility** - automatic handling of payload format differences (flat vs wrapped)
14
+ - **Run Management** - status transitions via `status_event` parameter
10
15
 
11
- - Node.js 18 or higher (with built-in fetch support)
12
- - npm or yarn package manager
13
- - Testomat.io account with API access
16
+ ## Quick Start
14
17
 
15
- ### Run directly with npx
18
+ ### Installation
16
19
 
17
20
  ```bash
18
- npx @testomatio/mcp@latest --token <your-token> --project <project-id>
21
+ npm install -g @testomatio/mcp
19
22
  ```
20
23
 
21
- ## Usage
22
-
23
- ### Command Line Options
24
-
25
- The MCP server can be started using command line arguments or environment variables:
24
+ ### Configuration
26
25
 
27
- #### Using Command Line Arguments
26
+ **Required credentials:**
27
+ - `TESTOMATIO_PROJECT_TOKEN` - Your project API token
28
+ - `TESTOMATIO_PROJECT_ID` - Your project ID
28
29
 
30
+ **Run server:**
29
31
  ```bash
30
- # Using short flags
31
- npx @testomatio/mcp@latest -t testomat_YOUR_TOKEN_HERE -p your-project-id
32
-
33
- # Using long flags
34
- npx @testomatio/mcp@latest --token testomat_YOUR_TOKEN_HERE --project your-project-id
35
-
36
- # With custom base URL
37
- npx @testomatio/mcp@latest --token testomat_YOUR_TOKEN_HERE --project your-project-id --base-url https://your-instance.testomat.io
32
+ testomatio-mcp --token <PROJECT_TOKEN> --project <PROJECT_ID>
38
33
  ```
39
34
 
40
- #### Using Environment Variables
41
-
35
+ **Or with environment variables:**
42
36
  ```bash
43
- # Set environment variables
44
- export TESTOMATIO_API_TOKEN=testomat_YOUR_TOKEN_HERE
45
- export TESTOMATIO_BASE_URL=https://app.testomat.io # Optional, defaults to https://app.testomat.io
46
-
47
- # Run with project ID
48
- npx @testomatio/mcp@latest --project your-project-id
49
-
50
- # Or run directly with environment variables
51
- TESTOMATIO_API_TOKEN=testomat_YOUR_TOKEN_HERE npx @testomatio/mcp@latest --project your-project-id
37
+ export TESTOMATIO_PROJECT_TOKEN=<PROJECT_TOKEN>
38
+ export TESTOMATIO_PROJECT_ID=<PROJECT_ID>
39
+ testomatio-mcp
52
40
  ```
53
41
 
54
- ### Getting Your API Token
55
-
56
- 1. Go to [Testomat.io](https://app.testomat.io)
57
- 2. Navigate to user tokens https://app.testomat.io/account/access_tokens
58
- 3. Create and copy **General API token** (starts with `testomat_`)
59
-
60
- ### Getting Your Project ID
61
-
62
- Your project ID can be found in the URL when you're viewing your project:
63
- ```
64
- https://app.testomat.io/projects/YOUR_PROJECT_ID
42
+ **Optional: custom base URL**
43
+ ```bash
44
+ export TESTOMATIO_BASE_URL=https://beta.testomat.io
65
45
  ```
66
46
 
67
- ### ID Formats
68
-
69
- Testomatio uses specific ID formats for different resources:
47
+ ## Usage with AI Assistants
70
48
 
71
- - **Test IDs**: Start with `T` prefix followed by 7 alphanumeric characters (e.g., `Ta1b2c3d4`)
72
- - **Suite IDs**: Start with `S` prefix followed by 7 alphanumeric characters (e.g., `Sx9y8z7w6`)
73
- - **Total length**: 8 characters including the prefix
74
- - **Format**: `[Prefix][7 alphanumeric characters]`
49
+ ### Cursor IDE
75
50
 
76
- When working with tools that require specific IDs, ensure you use the correct format with the appropriate prefix.
77
-
78
- ## Integration with Cursor
79
-
80
- To use this MCP server with Cursor, add the following configuration to your Cursor settings:
81
-
82
- ### Option 1: Using npx (Recommended)
83
-
84
- Add this to your Cursor MCP settings (`cursor-settings.json` or through the Cursor settings UI):
51
+ Add to `.cursorrules` or settings.json:
85
52
 
86
53
  ```json
87
54
  {
88
55
  "mcpServers": {
89
56
  "testomatio": {
90
- "command": "npx",
91
- "args": ["-y", "@testomatio/mcp@latest", "--token", "testomat_YOUR_TOKEN_HERE", "--project", "YOUR_PROJECT_ID"]
57
+ "command": "testomatio-mcp",
58
+ "args": ["--token", "<TOKEN>", "--project", "<PROJECT_ID>"],
59
+ "env": {
60
+ "TESTOMATIO_PROJECT_TOKEN": "<TOKEN>",
61
+ "TESTOMATIO_PROJECT_ID": "<PROJECT_ID>"
62
+ }
92
63
  }
93
64
  }
94
65
  }
95
66
  ```
96
67
 
97
- ### Option 2: Using Environment Variables
98
-
99
- First, set your environment variables in your shell profile (`.bashrc`, `.zshrc`, etc.):
100
-
101
- ```bash
102
- export TESTOMATIO_API_TOKEN=testomat_YOUR_TOKEN_HERE
103
- ```
104
-
105
- Then add this to your Cursor MCP settings:
68
+ ### Claude Desktop
106
69
 
107
70
  ```json
108
71
  {
109
72
  "mcpServers": {
110
73
  "testomatio": {
111
- "command": "npx",
112
- "args": ["-y", "@testomatio/mcp@latest", "--project", "YOUR_PROJECT_ID"],
113
- "env": {
114
- "TESTOMATIO_API_TOKEN": "testomat_YOUR_TOKEN_HERE"
115
- }
74
+ "command": "node",
75
+ "args": ["/path/to/mcp/index.js", "--token", "<TOKEN>", "--project", "<PROJECT_ID>"]
116
76
  }
117
77
  }
118
78
  }
119
79
  ```
120
80
 
121
- ## Features
122
-
123
- ### Tools
81
+ ## Quick Examples
124
82
 
125
- #### Tests
126
- * `get_tests` – Get all tests (params: `plan`, `query`, `state`, `suite_id`, `tag`, `labels`) — api: GET `/tests`
127
- * `get_test` – Get a specific test by ID with all information including labels, tags, and metadata (params: `test_id`) — api: GET `/tests/{test_id}`
128
- * `search_tests` – Search tests (params: `query`, `tql`, `labels`, `state`, `priority`, `filter`, `page`) — api: GET `/tests`
129
- * `create_test` – Create a new test (params: `suite_id`, `title`, `description`, `code`, `file`, `state`, `tags`, `jira_issues`, `assigned_to`, `labels_ids`, `fields`) — api: POST `/tests`
130
- * `update_test` – Update an existing test (params: `test_id`, `suite_id`, `title`, `description`, `code`, `file`, `state`, `tags`, `jira_issues`, `assigned_to`, `labels_ids`, `fields`) — api: PUT `/tests/{test_id}`
131
-
132
- #### Test Suites
133
- * `search_suites` – Search suites (params: `query`, `labels`, `state`, `priority`, `page`) — api: GET `/suites`
134
- * `get_root_suites` – List root-level suites (no params) — api: GET `/suites`
135
- * `get_suite` – Get one suite (params: `suite_id`) — api: GET `/suites/{suite_id}`
136
- * `create_suite` – Create a new suite (params: `title`, `description`, `parent_id`, `fields`) — api: POST `/suites`
137
- * `create_folder` – Create a new folder (params: `title`, `description`, `parent_id`, `fields`) — api: POST `/suites`
138
-
139
- #### Labels
140
- * `get_labels` – Get all available labels with their IDs and configurations
141
- * `create_label` – Create a new label with optional custom field
142
- * `unlink_label` – Remove a label from a test or suite
143
-
144
- ### Custom Fields and Labels
145
-
146
- The MCP server provides two distinct ways to assign values to tests, suites, and folders:
147
-
148
- #### 1. Using `labels_ids` with label:value syntax
149
- ```javascript
83
+ **List tests:**
84
+ ```json
150
85
  {
151
- "labels_ids": ["priority:high", "severity:critical", "type:regression"]
86
+ "name": "tests_list",
87
+ "arguments": { "page": 1, "per_page": 50 }
152
88
  }
153
89
  ```
154
- - Direct label assignment with values using `label:value` format
155
- - Good for simple label assignments
156
- - Works with existing Testomatio labels
157
90
 
158
- #### 2. Using `fields` parameter (structured custom fields)
159
- ```javascript
91
+ **Create test:**
92
+ ```json
160
93
  {
161
- "fields": {
162
- "priority": "high",
163
- "severity": "critical",
164
- "risk_score": "8.5",
165
- "team": "backend"
94
+ "name": "tests_create",
95
+ "arguments": {
96
+ "title": "User login test",
97
+ "suite_id": "123",
98
+ "priority": "high"
166
99
  }
167
100
  }
168
101
  ```
169
- - Structured way to set custom fields
170
- - Cleaner syntax for AI assistants
171
- - Supports any custom field defined in your Testomatio project
172
- - Maps to Testomatio's custom-fields API
173
-
174
- **Available for:**
175
- - `create_test` and `update_test` - Test custom fields
176
- - `create_suite` - Suite custom fields
177
- - `create_folder` - Folder custom fields
178
-
179
- #### Example Usage
180
- ```javascript
181
- // Create a test with custom fields
102
+
103
+ **Create run:**
104
+ ```json
182
105
  {
183
- "tool": "create_test",
106
+ "name": "runs_create",
184
107
  "arguments": {
185
- "suite_id": "123",
186
- "title": "Login Test",
187
- "fields": {
188
- "priority": "high",
189
- "severity": "critical",
190
- "team": "backend"
191
- }
108
+ "title": "Smoke tests",
109
+ "kind": "automated",
110
+ "env": "production"
192
111
  }
193
112
  }
113
+ ```
194
114
 
195
- // Update a test with label:value syntax
115
+ **Finish run:**
116
+ ```json
196
117
  {
197
- "tool": "update_test",
118
+ "name": "runs_update",
198
119
  "arguments": {
199
- "test_id": "456",
200
- "labels_ids": ["priority:high", "severity:critical"]
120
+ "run_id": "456",
121
+ "status_event": "finish"
201
122
  }
202
123
  }
203
124
  ```
204
125
 
205
- #### Test Runs
206
- * `get_runs` – List all runs (no params) — api: GET `/runs`
207
- * `get_run` – Get one run (params: `run_id`, `tree`) — api: GET `/runs/{run_id}`
208
- * `get_testruns` – Runs for a test (params: `test_id`, `finished_at_date_range`) — api: GET `/testruns`
209
-
210
- #### Test Plans
211
- * `get_plans` – List all plans (params: `detail`, `labels`, `page`) — api: GET `/plans`
212
- * `get_plan` – Get one plan (params: `plan_id`) — api: GET `/plans/{plan_id}`
213
-
214
- ## Example Usage in Cursor
215
-
216
- Once configured, you can ask your AI assistant questions like:
217
-
218
- - "Show me all the tests in the project"
219
- - "Get details for test ID Ta1b2c3d4"
220
- - "Get the test runs for test ID Ta1b2c3d4"
221
- - "What are the root suites in this project?"
222
- - "Show me details for test run xyz789"
223
- - "List all automated tests with the @smoke tag"
224
- - "Get all test plans for this project"
225
- - "Create a new test called 'Login validation' in suite Sx9y8z7w6"
226
- - "Update test Ta1b2c3d4 to change its description and add @regression tag"
227
- - "Create a test with custom fields: priority='high', severity='critical', team='backend'"
228
- - "Update test Tb2c3d4e5 to set custom fields for risk score and assigned team"
229
- - "Create a new suite called 'Authentication Tests' with description 'All login and signup related tests'"
230
- - "Create a suite with custom fields for team ownership and priority level"
231
- - "Create a folder called 'API Tests' to organize API-related test suites with custom fields"
232
- - "Create a label called 'Severity' with color '#ffe9ad' and predefined values like 'Blocker', 'Critical', 'Major', 'Minor', 'Normal', 'Trivial'"
233
-
234
- ## Query Patterns
235
-
236
- ### Basic Information Queries
237
-
238
- These queries retrieve general information without specific filtering:
239
-
240
- - **"Show me all the tests in the project"** → `get_tests` tool
241
- - **"What are the root suites in this project?"** → `get_root_suites` tool
242
- - **"Get all test runs"** → `get_runs` tool
243
- - **"Get all test plans for this project"** → `get_plans` tool
244
-
245
- ### Test Management Queries
246
-
247
- These queries allow creating and updating tests:
248
-
249
- - **"Create a new test called 'Login validation' in suite Sx9y8z7w6"** → `create_test` tool with `title: "Login validation"`, `suite_id: "Sx9y8z7w6"`
250
- - **"Update test Ta1b2c3d4 to change its description"** → `update_test` tool with `test_id: "Ta1b2c3d4"`, `description: "new description"`
251
- - **"Create an automated test with @smoke tag"** → `create_test` tool with `state: "automated"`, `tags: ["smoke"]`
252
- - **"Create a test with custom fields: priority='high', severity='critical'"** → `create_test` tool with `title: "Test Title"`, `suite_id: "Sx9y8z7w6"`, `fields: { "priority": "high", "severity": "critical" }`
253
- - **"Update test Tb2c3d4e5 to set custom fields for risk score and team"** → `update_test` tool with `test_id: "Tb2c3d4e5"`, `fields: { "risk_score": "8.5", "team": "backend" }`
254
-
255
- ### Suite and Folder Management Queries
256
-
257
- These queries help organize your test structure:
258
-
259
- - **"Create a new suite called 'Authentication Tests'"** → `create_suite` tool with `title: "Authentication Tests"`
260
- - **"Create a suite for login tests with description"** → `create_suite` tool with `title: "Login Tests"`, `description: "All login related test cases"`
261
- - **"Create a suite with custom fields for team ownership and priority level"** → `create_suite` tool with `title: "Backend Tests"`, `fields: { "team": "backend", "priority": "high" }`
262
- - **"Create a folder called 'API Tests' under parent suite Sx9y8z7w6"** → `create_folder` tool with `title: "API Tests"`, `parent_id: "Sx9y8z7w6"`
263
- - **"Create a folder with custom fields for team and project"** → `create_folder` tool with `title: "Integration Tests"`, `fields: { "team": "qa", "project": "mobile-app" }`
264
- - **"Create a test suite for payment features"** → `create_suite` tool with `title: "Payment Features", description: "Tests covering payment processing"`
265
- - **"Create a folder to organize integration tests"** → `create_folder` tool with `title: "Integration Tests"`
266
-
267
- **Note**: Suites can only contain other suites, while folders can contain both suites and folders (but no tests).
268
-
269
- ### Label Creation Queries
270
-
271
- These queries help create custom labels for better test categorization:
272
-
273
- - **"Create a label called 'Severity' with red color"** → `create_label` tool with `title: "Severity"`, `color: "#ff6b6b"`
274
- - **"Create a severity label with predefined values"** → `create_label` tool with `title: "Severity"`, `color: "#ffe9ad"`, `field: { "type": "list", "short": true, "value": "Blocker\nCritical\nMajor\nNormal\nMinor\nTrivial" }`
275
- - **"Create a simple label for test types"** → `create_label` tool with `title: "Test Type"`, `scope: ["tests", "suites"]`
276
- - **"Create a label visible in test lists"** → `create_label` tool with `title: "Category"`, `visibility: ["list"]`
277
-
278
- ### Specific Item Queries
279
-
280
- These queries target specific entities by ID:
281
-
282
- - **"Get details for test ID Ta1b2c3d4"** → `get_test` tool with `test_id: "Ta1b2c3d4"`
283
- - **"Get test runs for test ID Ta1b2c3d4"** → `get_testruns` tool with `test_id: "Ta1b2c3d4"`
284
- - **"Show me details for test run xyz789"** → `get_run` tool with `run_id: "xyz789"`
285
- - **"Get suite details for suite Sx9y8z7w6"** → `get_suite` tool with `suite_id: "Sx9y8z7w6"`
286
-
287
- ### Search and Filter Queries
288
-
289
- These queries use advanced filtering capabilities:
290
-
291
- - **"List all automated tests with the @smoke tag"** → `search_tests` tool with `query: "@smoke"`, `state: "automated"`
292
- - **"Search for tests containing 'login'"** → `search_tests` tool with `query: "login"`
293
- - **"List tests tagged @critical or labelled 'ux' with critical severity"** → `search_tests` tool with `tql: "tag == 'critical' or label == 'ux' and severity == 'critical'"`
294
- - **"Find tests linked to JIRA-123"** → `search_tests` tool with `tql: jira == 'BDCP-2'`
295
-
296
- ### Advanced Query Syntax
297
-
298
- #### Test Query Language (TQL)
299
-
300
- The `search_tests` tool supports TQL for complex filtering:
301
-
302
- ```
303
- "tag == 'smoke' and state == 'manual'"
304
- "severity == 'critical' or label == 'ux'"
305
- ```
306
-
307
- #### Tag-Based Searches
308
-
309
- Tags can be searched using the `@` prefix:
310
-
311
- ```
312
- @smoke # Tests tagged with 'smoke'
313
- @regression # Tests tagged with 'regression'
314
- @critical # Tests tagged with 'critical'
315
- ```
126
+ ## Documentation
316
127
 
317
- #### Jira Integration
128
+ Complete tool reference: [docs/tools.md](./docs/tools.md)
318
129
 
319
- Tests linked to Jira issues can be found using issue keys:
130
+ ## Project Structure
320
131
 
321
132
  ```
322
- JIRA-123 # Tests linked to JIRA-123
323
- PROJ-456 # Tests linked to PROJ-456
133
+ src/
134
+ ├── config/ # Config loading, defaults
135
+ ├── core/ # Errors, logger
136
+ ├── api/ # HTTP client, Testomat.io API client
137
+ ├── mcp/ # MCP server, tools, registry
138
+ │ ├── definitions/ # Tool definitions by entity
139
+ │ ├── configs/ # Registry generation configs
140
+ │ └── registry/ # Tool handlers
141
+ └── cli/ # CLI bootstrap
324
142
  ```
325
143
 
326
- ## Troubleshooting
327
-
328
- ### Common Issues
329
-
330
- 1. **"API token is required" error**
331
- - Make sure your token starts with `testomat_`
332
- - Verify the token is correct in your Testomat.io project settings
333
-
334
- 2. **"Project ID is required" error**
335
- - Check that you're passing the correct project ID
336
- - Verify the project ID exists and you have access to it
337
-
338
- 3. **Connection errors**
339
- - Ensure you have internet connectivity
340
- - Check if your firewall allows connections to `app.testomat.io`
341
- - Verify your API token has the necessary permissions
342
-
343
- 4. **MCP server not starting in Cursor**
344
- - Check Cursor's MCP logs for error messages
345
- - Ensure Node.js 18+ is installed and accessible
346
- - Try running the command manually first to test
347
-
348
- ### Debug Mode
349
-
350
- To see detailed logs when running the server:
351
-
352
- ```bash
353
- DEBUG=* npx @testomatio/mcp --token <token> --project <project-id>
354
- ```
144
+ ## Environment Variables
355
145
 
356
- ## API Reference
146
+ | Variable | Required | Default | Description |
147
+ |----------|----------|---------|-------------|
148
+ | `TESTOMATIO_PROJECT_TOKEN` | Yes* | - | Project token (preferred) |
149
+ | `TESTOMATIO_API_TOKEN` | Yes* | - | Alternative token |
150
+ | `TESTOMATIO_PROJECT_ID` | Yes | - | Project ID |
151
+ | `TESTOMATIO_BASE_URL` | No | `https://app.testomat.io` | API base URL |
357
152
 
358
- For detailed information about the underlying Testomat.io API, refer to the [Testomat.io API Documentation](https://app.testomat.io/docs/api/).
153
+ *Either `TESTOMATIO_PROJECT_TOKEN` or `TESTOMATIO_API_TOKEN`
359
154
 
360
- ## Contributing
155
+ ## Important Notes
361
156
 
362
- Contributions are welcome! Please feel free to submit a Pull Request.
157
+ - **Run Status** - Use `runs_update` with `status_event` for transitions (finish, launch, rerun, etc.)
158
+ - **Search** - No dedicated `/search` endpoints; search uses list with filters
159
+ - **Issue Linking** - Scoped helpers available: `{entity}_issues_link/unlink`
363
160
 
364
- ### Development Setup
161
+ ## Development
365
162
 
366
163
  ```bash
367
- # Clone the repository
368
- git clone https://github.com/testomatio/mcp.git
369
- cd mcp
370
-
371
- # Install dependencies
372
164
  npm install
373
-
374
- # Run unit tests
375
- npm test
376
-
377
- # Run integration tests (requires environment variables)
378
- npm run test:integration
379
-
380
- # Run all tests
381
- npm run test:all
382
- ```
383
-
384
- ### Testing
385
-
386
- The project includes comprehensive test coverage:
387
-
388
- - **Unit Tests**: Fast tests with mocked dependencies
389
- - **Integration Tests**: Real API tests against Testomat.io
390
-
391
- #### Running Tests Locally
392
-
393
- ```bash
394
- # Unit tests only
395
- npm run test:unit
396
-
397
- # Integration tests (requires .env file)
398
- npm run test:integration
399
-
400
- # With coverage
401
- npm run test:coverage
402
- npm run test:coverage:integration
403
- ```
404
-
405
- #### Environment Setup for Integration Tests
406
-
407
- Create a `.env` file:
408
-
409
- ```bash
410
- TESTOMATIO_API_TOKEN=testomat_your_token_here
411
- TESTOMATIO_PROJECT_ID=your_project_id
412
- TESTOMATIO_BASE_URL=https://app.testomat.io # optional
165
+ npm run start -- --token <TOKEN> --project <PROJECT_ID>
413
166
  ```
414
-
415
- ### CI/CD
416
-
417
- This project uses GitHub Actions for continuous integration:
418
-
419
- - ✅ **Unit Tests**: Run on every push/PR across Node.js 18, 20, 22
420
- - ✅ **Integration Tests**: Run daily and on main branch merges
421
- - ✅ **Coverage Reports**: Automatic upload to Codecov
422
- - ✅ **Security**: Secrets management for API credentials
423
-
424
-
425
- ### Code Quality
426
-
427
- - Follow existing code style patterns
428
- - Add tests for new functionality
429
- - Update documentation when needed
430
- - Ensure all tests pass before submitting PRs
431
-
432
- ## License
433
-
434
- This project is licensed under the MIT License - see the LICENSE file for details.
435
-
436
- ## Support
437
-
438
- For support, please:
439
- 1. Check the [Testomat.io Documentation](https://docs.testomat.io)
440
- 2. Open an issue on GitHub
441
- 3. Contact Testomat.io support
442
-
443
- ## Changelog
444
-
445
- ### v1.0.0
446
- - Initial release
447
- - Support for all major Testomat.io API endpoints
448
- - MCP-compatible tool interface
449
- - Semantic XML formatting for LLM processing