@testomatio/mcp 2.1.1 → 2.2.0-beta

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
@@ -8,14 +8,16 @@ Model Context Protocol (MCP) server that enables AI assistants (Claude, Cursor,
8
8
  - Tests, Suites, Plans, Runs, TestRuns, RunGroups, Steps, Snippets, Labels
9
9
  - Tags and Milestones (read-only access)
10
10
  - Issues (global + scoped helpers for tests/suites/runs/testruns/plans)
11
+ - Attachments (scoped helpers for tests/suites/testruns)
11
12
  - Requirements (including file uploads from local file paths)
12
- - **Smart Search** - delegates to list endpoints with OpenAPI-aligned query/filter forwarding
13
+ - **Project Information** - fetch project configuration, metadata, features, and CI profiles
13
14
  - **Issue Linking** - link/unlink issues to any resource
14
15
  - **API Compatibility** - automatic handling of payload format differences (flat vs wrapped)
15
16
  - **Automatic API Sessions** - groups MCP changes in Testomat.io history using API sessions
16
17
  - **Run Management** - status transitions via `status_event` parameter
17
- - **TQL-Only Search** - `tests_list/tests_search` and `runs_list/runs_search` use `tql` as the single search/filter input
18
- - **Built-In TQL Reference** - MCP tool descriptions include exact TQL fields, syntax, and examples for agents
18
+ - **TQL-Only Search** - `tests_list` and `runs_list` use `tql` as the single search/filter input
19
+ - **Built-In TQL Reference** - TQL parameters include the exact field whitelist and examples; `tql_help` provides syntax details on demand
20
+ - **Tool Surface Profiles** - expose only the tools a session needs via `--tools full|core|read` (default `full`); cuts the per-call schema cost for long agentic sessions
19
21
 
20
22
  ## Quick Start
21
23
 
@@ -50,6 +52,22 @@ testomatio-mcp
50
52
  export TESTOMATIO_BASE_URL=https://beta.testomat.io
51
53
  ```
52
54
 
55
+ **Optional: tool surface profile**
56
+
57
+ By default the server exposes all tools. For long, token-sensitive sessions you can expose a smaller set with `--tools`:
58
+
59
+ ```bash
60
+ testomatio-mcp --token <PROJECT_TOKEN> --project <PROJECT_ID> --tools core
61
+ ```
62
+
63
+ | Profile | What's exposed |
64
+ |---------|----------------|
65
+ | `full` (default) | Everything |
66
+ | `core` | Core entities + CRUD (excludes steps, snippets, labels, rungroups, attachments) |
67
+ | `read` | Core entities, read-only (list/get) |
68
+
69
+ Values are case-insensitive; an unknown value prevents the server from starting. Set the profile at launch with the flag or the `TESTOMATIO_TOOLS` environment variable — it can't be changed mid-session. The CLI flag takes precedence when both are set.
70
+
53
71
  ## Usage with AI Assistants
54
72
 
55
73
  ### Cursor IDE
@@ -178,6 +196,17 @@ Add this config to `opencode.json` in your project root, or to `~/.config/openco
178
196
  }
179
197
  ```
180
198
 
199
+ **Upload attachment to a test:**
200
+ ```json
201
+ {
202
+ "name": "tests_attachments_upload",
203
+ "arguments": {
204
+ "test_id": "123",
205
+ "file_path": "/path/to/screenshot.png"
206
+ }
207
+ }
208
+ ```
209
+
181
210
  ## Documentation
182
211
 
183
212
  Complete tool reference: [docs/tools.md](./docs/tools.md)
@@ -204,6 +233,7 @@ src/
204
233
  | `TESTOMATIO_API_TOKEN` | Yes* | - | Alternative token |
205
234
  | `TESTOMATIO_PROJECT_ID` | Yes | - | Project ID |
206
235
  | `TESTOMATIO_BASE_URL` | No | `https://app.testomat.io` | API base URL |
236
+ | `TESTOMATIO_TOOLS` | No | `full` | Tool profile: `full`, `core`, or `read` |
207
237
 
208
238
  *Either `TESTOMATIO_PROJECT_TOKEN` or `TESTOMATIO_API_TOKEN`
209
239
 
@@ -242,11 +272,12 @@ NODE_EXTRA_CA_CERTS=/path/to/company-root-ca.pem testomatio-mcp --token <TOKEN>
242
272
  ## Important Notes
243
273
 
244
274
  - **Run Status** - Use `runs_update` with `status_event` for transitions (finish, launch, rerun, etc.)
245
- - **Search** - No dedicated `/search` endpoints. MCP search tools delegate to list tools; for `tests` and `runs` the MCP interface is intentionally simplified to `tql`, while other entities stay closer to Public API v2 filters
246
- - **TQL** - Use `tql` as the single search/filter input for `tests_list/tests_search` and `runs_list/runs_search`
275
+ - **Search/Filter** - No dedicated `/search` endpoints; filtering is done via the `*_list` tools (`tql` for tests and runs, OpenAPI-aligned filters for other entities)
276
+ - **TQL** - Use `tql` as the single search/filter input for `tests_list` and `runs_list`
247
277
  - **TQL Syntax** - For user-facing syntax details and more examples, see the official TQL docs: https://docs.testomat.io/advanced/tql/
248
- - **TQL Scope** - The full agent-oriented whitelist of documented fields lives inside MCP tool descriptions for `tests` and `runs`
278
+ - **TQL Scope** - TQL parameter descriptions keep the documented field whitelist in-band; call `tql_help` for syntax details and additional examples
249
279
  - **Issue Linking** - Scoped helpers available: `{entity}_issues_link/unlink`
280
+ - **Attachments** - Scoped helpers available for tests, suites, and testruns: `{entity}_attachments_list/upload/delete`. Upload sends one local file path as multipart field `file`.
250
281
  - **Enterprise Package** - Analytics tools are intentionally exposed only by `@testomatio/mcp-enterprise`, not by the standard `@testomatio/mcp` package
251
282
  - **API Sessions** - The server automatically starts a Testomat.io session before the first `POST`, `PUT`, or `DELETE` request, sends the returned session hash as `X-Session-Hash` on later mutating requests, and stops the session when the MCP server shuts down. `GET` requests do not start or use sessions.
252
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/mcp",
3
- "version": "2.1.1",
3
+ "version": "2.2.0-beta",
4
4
  "description": "Model Context Protocol server for Testomatio API",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -31,8 +31,8 @@ export class TestomatioApiClient {
31
31
  return this.mutate('POST', this.buildPath(resource), { body });
32
32
  }
33
33
 
34
- async createMultipart(resource, formData) {
35
- return this.mutate('POST', this.buildPath(resource), { body: formData });
34
+ async createMultipart(resource, formData, query = {}) {
35
+ return this.mutate('POST', this.buildPath(resource), { query, body: formData });
36
36
  }
37
37
 
38
38
  async createWithQuery(resource, { query = {}, body = {} } = {}) {
@@ -55,10 +55,6 @@ export class TestomatioApiClient {
55
55
  return this.mutate('DELETE', this.buildPath(resource, id), { query });
56
56
  }
57
57
 
58
- search(resource, query = {}) {
59
- return this.list(resource, query);
60
- }
61
-
62
58
  async mutate(method, path, options = {}) {
63
59
  const runRequest = async () => {
64
60
  const sessionHash = await this.ensureSession();
package/src/cli/main.js CHANGED
@@ -15,6 +15,10 @@ export function parseArgs(argv = process.argv) {
15
15
  .option('-t, --token <token>', 'Testomatio Project token')
16
16
  .option('-p, --project <project>', 'Project ID')
17
17
  .option('--base-url <url>', 'Base URL for Testomatio API')
18
+ .option(
19
+ '--tools <profile>',
20
+ 'Tool surface: full (default, all tools), core (common entities only), read (read-only)'
21
+ )
18
22
  .parse(argv);
19
23
 
20
24
  return command.opts();
@@ -1,3 +1,7 @@
1
1
  export const DEFAULT_BASE_URL = 'https://app.testomat.io';
2
2
 
3
3
  export const DEFAULT_TOOL_RESPONSE = 'Tool is declared but has no handler implementation.';
4
+
5
+ export const TOOL_PROFILES = ['full', 'core', 'read'];
6
+
7
+ export const DEFAULT_PROFILE = 'full';
@@ -1,4 +1,4 @@
1
- import { DEFAULT_BASE_URL } from './constants.js';
1
+ import { DEFAULT_BASE_URL, DEFAULT_PROFILE, TOOL_PROFILES } from './constants.js';
2
2
  import { ConfigurationError } from '../core/errors.js';
3
3
 
4
4
  function normalizeString(value) {
@@ -16,6 +16,8 @@ export function loadConfig(argvOptions = {}) {
16
16
  );
17
17
  const projectId = normalizeString(argvOptions.project || process.env.TESTOMATIO_PROJECT_ID);
18
18
  const baseUrl = normalizeBaseUrl(argvOptions.baseUrl || process.env.TESTOMATIO_BASE_URL || DEFAULT_BASE_URL);
19
+ const rawToolsProfile = normalizeString(argvOptions.tools || process.env.TESTOMATIO_TOOLS).toLowerCase();
20
+ const toolsProfile = rawToolsProfile || DEFAULT_PROFILE;
19
21
 
20
22
  if (!token) {
21
23
  throw new ConfigurationError(
@@ -29,9 +31,16 @@ export function loadConfig(argvOptions = {}) {
29
31
  );
30
32
  }
31
33
 
34
+ if (!TOOL_PROFILES.includes(toolsProfile)) {
35
+ throw new ConfigurationError(
36
+ `Unknown tools profile "${toolsProfile}". Use one of: ${TOOL_PROFILES.join(', ')}.`
37
+ );
38
+ }
39
+
32
40
  return {
33
41
  token,
34
42
  projectId,
35
43
  baseUrl,
44
+ toolsProfile,
36
45
  };
37
46
  }
package/src/index.js CHANGED
@@ -4,6 +4,8 @@ import { ConfigurationError } from './core/errors.js';
4
4
  import { createLogger } from './core/logger.js';
5
5
  import { TestomatioMCPServer } from './mcp/server.js';
6
6
  import { TOOL_DEFINITIONS } from './mcp/tool-definitions.js';
7
+ import { slimList, withListOptions } from './mcp/list-projection.js';
8
+ import { selectTools } from './mcp/tool-profiles.js';
7
9
  import {
8
10
  ANALYTICS_STATS_TQL_INPUT_DESCRIPTION,
9
11
  ANALYTICS_STATS_TQL_REFERENCE,
@@ -19,17 +21,22 @@ export {
19
21
  ANALYTICS_TESTS_TQL_REFERENCE,
20
22
  ConfigurationError,
21
23
  TOOL_DEFINITIONS,
24
+ slimList,
25
+ withListOptions,
26
+ selectTools,
22
27
  };
23
28
 
24
29
  export function createApplication(argvOptions = {}, serverOptions = {}) {
25
30
  const config = loadConfig(argvOptions);
26
31
  const logger = createLogger();
27
32
  const apiClient = new TestomatioApiClient({ ...config, logger });
33
+ const { tools: overrideTools, ...restServerOptions } = serverOptions;
28
34
  const mcpServer = new TestomatioMCPServer({
29
35
  config,
30
36
  apiClient,
31
37
  logger,
32
- ...serverOptions,
38
+ tools: selectTools(overrideTools ?? TOOL_DEFINITIONS, config.toolsProfile),
39
+ ...restServerOptions,
33
40
  });
34
41
 
35
42
  return {
@@ -0,0 +1,7 @@
1
+ export const ATTACHMENT_RESOURCE_KEYS = ['test_id', 'suite_id', 'testrun_id'];
2
+
3
+ export const ATTACHMENT_SCOPED_TOOL_CONFIGS = [
4
+ { toolPrefix: 'tests', resourceKey: 'test_id' },
5
+ { toolPrefix: 'suites', resourceKey: 'suite_id' },
6
+ { toolPrefix: 'testruns', resourceKey: 'testrun_id' },
7
+ ];
@@ -4,7 +4,6 @@ export const ENTITY_CRUD_CONFIGS = [
4
4
  resource: 'tests',
5
5
  idArg: 'test_id',
6
6
  listMethod: 'listTests',
7
- searchMethod: 'searchTests',
8
7
  payloadBuilder: 'buildTestPayload',
9
8
  wrapperKey: 'test',
10
9
  createMode: 'wrapped',
@@ -15,7 +14,6 @@ export const ENTITY_CRUD_CONFIGS = [
15
14
  resource: 'suites',
16
15
  idArg: 'suite_id',
17
16
  listMethod: 'listSuites',
18
- searchMethod: 'searchSuites',
19
17
  payloadBuilder: 'buildSuitePayload',
20
18
  wrapperKey: 'suite',
21
19
  createMode: 'wrapped',
@@ -26,7 +24,6 @@ export const ENTITY_CRUD_CONFIGS = [
26
24
  resource: 'runs',
27
25
  idArg: 'run_id',
28
26
  listMethod: 'listRuns',
29
- searchMethod: 'searchRuns',
30
27
  createMode: 'run',
31
28
  updateMode: 'run',
32
29
  },
@@ -35,7 +32,6 @@ export const ENTITY_CRUD_CONFIGS = [
35
32
  resource: 'testruns',
36
33
  idArg: 'testrun_id',
37
34
  listMethod: 'listTestruns',
38
- searchMethod: 'searchTestruns',
39
35
  payloadBuilder: 'buildTestrunPayload',
40
36
  wrapperKey: 'testrun',
41
37
  createMode: 'wrapped',
@@ -86,7 +82,6 @@ export const ENTITY_CRUD_CONFIGS = [
86
82
  resource: 'plans',
87
83
  idArg: 'plan_id',
88
84
  listMethod: 'listPlans',
89
- searchMethod: 'searchPlans',
90
85
  payloadBuilder: 'buildPlanPayload',
91
86
  wrapperKey: 'plan',
92
87
  createMode: 'wrapped',
@@ -97,7 +92,6 @@ export const ENTITY_CRUD_CONFIGS = [
97
92
  resource: 'requirements',
98
93
  idArg: 'requirement_id',
99
94
  listMethod: 'listRequirements',
100
- searchMethod: 'searchRequirements',
101
95
  payloadBuilder: 'buildRequirementPayload',
102
96
  wrapperKey: 'requirement',
103
97
  createMode: 'requirement',
@@ -0,0 +1,70 @@
1
+ function buildAttachmentTools({ toolPrefix, entityName, idKey, idType = 'string' }) {
2
+ const entityId = {
3
+ type: idType,
4
+ };
5
+
6
+ return [
7
+ {
8
+ name: `${toolPrefix}_attachments_list`,
9
+ description: `List attachments for a ${entityName} (/api/v2/{project_id}/attachments?${idKey}=...)`,
10
+ inputSchema: {
11
+ type: 'object',
12
+ properties: {
13
+ [idKey]: entityId,
14
+ },
15
+ required: [idKey],
16
+ additionalProperties: false,
17
+ },
18
+ },
19
+ {
20
+ name: `${toolPrefix}_attachments_upload`,
21
+ description: `Upload one attachment to a ${entityName} (/api/v2/{project_id}/attachments?${idKey}=...)`,
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ [idKey]: entityId,
26
+ file_path: {
27
+ type: 'string',
28
+ description: 'Local path to the file that will be sent as multipart/form-data field "file".',
29
+ },
30
+ },
31
+ required: [idKey, 'file_path'],
32
+ additionalProperties: false,
33
+ },
34
+ },
35
+ {
36
+ name: `${toolPrefix}_attachments_delete`,
37
+ description: `Delete attachment from a ${entityName} (/api/v2/{project_id}/attachments/{id}?${idKey}=...)`,
38
+ inputSchema: {
39
+ type: 'object',
40
+ properties: {
41
+ [idKey]: entityId,
42
+ attachment_id: {
43
+ type: 'string',
44
+ },
45
+ },
46
+ required: [idKey, 'attachment_id'],
47
+ additionalProperties: false,
48
+ },
49
+ },
50
+ ];
51
+ }
52
+
53
+ export const ATTACHMENT_TOOLS = [
54
+ ...buildAttachmentTools({
55
+ toolPrefix: 'tests',
56
+ entityName: 'test',
57
+ idKey: 'test_id',
58
+ }),
59
+ ...buildAttachmentTools({
60
+ toolPrefix: 'suites',
61
+ entityName: 'suite',
62
+ idKey: 'suite_id',
63
+ }),
64
+ ...buildAttachmentTools({
65
+ toolPrefix: 'testruns',
66
+ entityName: 'testrun',
67
+ idKey: 'testrun_id',
68
+ idType: 'integer',
69
+ }),
70
+ ];
@@ -91,41 +91,4 @@ export const ISSUES_TOOLS = [
91
91
  "additionalProperties": false
92
92
  }
93
93
  },
94
- {
95
- "name": "issues_search",
96
- "description": "Search issues (delegates to issues_list filters)",
97
- "inputSchema": {
98
- "type": "object",
99
- "properties": {
100
- "page": {
101
- "type": "integer",
102
- "minimum": 1
103
- },
104
- "per_page": {
105
- "type": "integer",
106
- "minimum": 1,
107
- "maximum": 100
108
- },
109
- "test_id": {
110
- "type": "string"
111
- },
112
- "suite_id": {
113
- "type": "string"
114
- },
115
- "run_id": {
116
- "type": "string"
117
- },
118
- "testrun_id": {
119
- "type": "integer"
120
- },
121
- "plan_id": {
122
- "type": "string"
123
- },
124
- "source": {
125
- "type": "string"
126
- }
127
- },
128
- "additionalProperties": false
129
- }
130
- }
131
94
  ];
@@ -247,45 +247,6 @@ export const PLANS_TOOLS = [
247
247
  "additionalProperties": false
248
248
  }
249
249
  },
250
- {
251
- "name": "plans_search",
252
- "description": "Search plans (delegates to plans list; docs has no dedicated search parameter)",
253
- "inputSchema": {
254
- "type": "object",
255
- "properties": {
256
- "search_text": {
257
- "type": "string"
258
- },
259
- "page": {
260
- "type": "integer",
261
- "minimum": 1
262
- },
263
- "per_page": {
264
- "type": "integer",
265
- "minimum": 1,
266
- "maximum": 100
267
- },
268
- "kind": {
269
- "type": "string",
270
- "enum": [
271
- "manual",
272
- "automated",
273
- "mixed"
274
- ]
275
- },
276
- "hidden": {
277
- "type": "boolean"
278
- },
279
- "labels": {
280
- "type": "array",
281
- "items": {
282
- "type": "string"
283
- }
284
- }
285
- },
286
- "additionalProperties": false
287
- }
288
- },
289
250
  {
290
251
  "name": "plans_issues_list",
291
252
  "description": "List linked issues for a plan (/api/v2/{project_id}/issues?plan_id=...)",
@@ -0,0 +1,12 @@
1
+ export const PROJECT_TOOLS = [
2
+ {
3
+ name: 'project_info',
4
+ description:
5
+ 'Get configuration and metadata for the current project (/api/v2/{project_id}/info), including framework, language, environments, labels, tags, subscription features, artifact storage status, and CI profiles.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {},
9
+ additionalProperties: false,
10
+ },
11
+ },
12
+ ];
@@ -133,31 +133,4 @@ export const REQUIREMENTS_TOOLS = [
133
133
  additionalProperties: false,
134
134
  },
135
135
  },
136
- {
137
- name: 'requirements_search',
138
- description: 'Search requirements (delegates to requirements list with filters)',
139
- inputSchema: {
140
- type: 'object',
141
- properties: {
142
- page: {
143
- type: 'integer',
144
- minimum: 1,
145
- },
146
- per_page: {
147
- type: 'integer',
148
- minimum: 1,
149
- maximum: 100,
150
- },
151
- source: {
152
- type: 'string',
153
- enum: ['jira', 'confluence', 'file', 'text'],
154
- },
155
- scope: {
156
- type: 'string',
157
- enum: ['global', 'attached', 'detached', 'without_suites'],
158
- },
159
- },
160
- additionalProperties: false,
161
- },
162
- },
163
136
  ];
@@ -264,29 +264,6 @@ export const RUNS_TOOLS = [
264
264
  "additionalProperties": false
265
265
  }
266
266
  },
267
- {
268
- "name": "runs_search",
269
- "description": `Search runs using TQL (delegates to runs_list). ${RUNS_TQL_REFERENCE}`,
270
- "inputSchema": {
271
- "type": "object",
272
- "properties": {
273
- "page": {
274
- "type": "integer",
275
- "minimum": 1
276
- },
277
- "per_page": {
278
- "type": "integer",
279
- "minimum": 1,
280
- "maximum": 100
281
- },
282
- "tql": {
283
- "type": "string",
284
- "description": RUNS_TQL_INPUT_DESCRIPTION
285
- }
286
- },
287
- "additionalProperties": false
288
- }
289
- },
290
267
  {
291
268
  "name": "runs_issues_list",
292
269
  "description": "List linked issues for a run (/api/v2/{project_id}/issues?run_id=...)",
@@ -69,7 +69,11 @@ export const SUITES_TOOLS = [
69
69
  "type": "string"
70
70
  },
71
71
  "file_type": {
72
- "type": "string"
72
+ "type": "string",
73
+ "enum": [
74
+ "file",
75
+ "folder"
76
+ ]
73
77
  },
74
78
  "assigned_to": {
75
79
  "type": "string"
@@ -146,7 +150,11 @@ export const SUITES_TOOLS = [
146
150
  "type": "string"
147
151
  },
148
152
  "file_type": {
149
- "type": "string"
153
+ "type": "string",
154
+ "enum": [
155
+ "file",
156
+ "folder"
157
+ ]
150
158
  },
151
159
  "assigned_to": {
152
160
  "type": "string"
@@ -217,41 +225,6 @@ export const SUITES_TOOLS = [
217
225
  "additionalProperties": false
218
226
  }
219
227
  },
220
- {
221
- "name": "suites_search",
222
- "description": "Search suites by title (delegates to suites list with search_text)",
223
- "inputSchema": {
224
- "type": "object",
225
- "properties": {
226
- "search_text": {
227
- "type": "string"
228
- },
229
- "page": {
230
- "type": "integer",
231
- "minimum": 1
232
- },
233
- "per_page": {
234
- "type": "integer",
235
- "minimum": 1,
236
- "maximum": 100
237
- },
238
- "file_type": {
239
- "type": "string",
240
- "enum": [
241
- "file",
242
- "folder"
243
- ]
244
- },
245
- "tag": {
246
- "type": "string"
247
- },
248
- "labels": {
249
- "type": "string"
250
- }
251
- },
252
- "additionalProperties": false
253
- }
254
- },
255
228
  {
256
229
  "name": "suites_issues_list",
257
230
  "description": "List linked issues for a suite (/api/v2/{project_id}/issues?suite_id=...)",
@@ -6,5 +6,13 @@ export const SYSTEM_TOOLS = [
6
6
  "type": "object",
7
7
  "properties": {}
8
8
  }
9
+ },
10
+ {
11
+ "name": "tql_help",
12
+ "description": "Full TQL (Testomat.io Query Language) reference — syntax, filter variables (tests + runs), and examples. Call this before writing a `tql` or `q` filter.",
13
+ "inputSchema": {
14
+ "type": "object",
15
+ "properties": {}
16
+ }
9
17
  }
10
18
  ];