@smartbear/mcp 0.14.1 → 0.15.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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/bugsnag/client.js +5 -30
  3. package/dist/package.json.js +1 -1
  4. package/dist/qmetry/client/api/client-api.js +2 -1
  5. package/dist/qmetry/client/automation.js +2 -1
  6. package/dist/qmetry/client/tools/testcase-tools.js +269 -1
  7. package/dist/qmetry/client/tools/testsuite-tools.js +1 -1
  8. package/dist/reflect/client.js +25 -263
  9. package/dist/reflect/config/constants.js +6 -0
  10. package/dist/reflect/tool/suites/cancel-suite-execution.js +50 -0
  11. package/dist/reflect/tool/suites/execute-suite.js +40 -0
  12. package/dist/reflect/tool/suites/get-suite-execution-status.js +50 -0
  13. package/dist/reflect/tool/suites/list-suite-executions.js +40 -0
  14. package/dist/reflect/tool/suites/list-suites.js +27 -0
  15. package/dist/reflect/tool/tests/get-test-status.js +42 -0
  16. package/dist/reflect/tool/tests/list-tests.js +27 -0
  17. package/dist/reflect/tool/tests/run-test.js +40 -0
  18. package/dist/zephyr/client.js +35 -1
  19. package/dist/zephyr/common/rest-api-schemas.js +282 -237
  20. package/dist/zephyr/tool/folder/create-folder.js +55 -0
  21. package/dist/zephyr/tool/issue-link/get-test-cases.js +33 -0
  22. package/dist/zephyr/tool/issue-link/get-test-cycles.js +32 -0
  23. package/dist/zephyr/tool/issue-link/get-test-executions.js +32 -0
  24. package/dist/zephyr/tool/test-case/create-issue-link.js +36 -0
  25. package/dist/zephyr/tool/test-case/create-test-script.js +55 -0
  26. package/dist/zephyr/tool/test-case/create-test-steps.js +89 -0
  27. package/dist/zephyr/tool/test-case/get-links.js +32 -0
  28. package/dist/zephyr/tool/test-case/get-test-script.js +46 -0
  29. package/dist/zephyr/tool/test-case/get-test-steps.js +54 -0
  30. package/dist/zephyr/tool/test-cycle/create-issue-link.js +43 -0
  31. package/dist/zephyr/tool/test-cycle/create-web-link.js +54 -0
  32. package/dist/zephyr/tool/test-cycle/get-links.js +39 -0
  33. package/dist/zephyr/tool/test-execution/create-issue-link.js +43 -0
  34. package/dist/zephyr/tool/test-execution/get-test-execution-links.js +39 -0
  35. package/dist/zephyr/tool/test-execution/get-test-steps.js +73 -0
  36. package/dist/zephyr/tool/test-execution/update-test-execution.js +70 -0
  37. package/package.json +1 -1
@@ -1,6 +1,14 @@
1
1
  import { z } from "zod";
2
2
  import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
3
- import { ToolError } from "../common/tools.js";
3
+ import { API_KEY_HEADER } from "./config/constants.js";
4
+ import { CancelSuiteExecution } from "./tool/suites/cancel-suite-execution.js";
5
+ import { ExecuteSuite } from "./tool/suites/execute-suite.js";
6
+ import { GetSuiteExecutionStatus } from "./tool/suites/get-suite-execution-status.js";
7
+ import { ListSuiteExecutions } from "./tool/suites/list-suite-executions.js";
8
+ import { ListSuites } from "./tool/suites/list-suites.js";
9
+ import { GetTestStatus } from "./tool/tests/get-test-status.js";
10
+ import { ListTests } from "./tool/tests/list-tests.js";
11
+ import { RunTest } from "./tool/tests/run-test.js";
4
12
  const ConfigurationSchema = z.object({
5
13
  api_token: z.string().describe("Reflect API authentication token")
6
14
  });
@@ -12,7 +20,7 @@ class ReflectClient {
12
20
  config = ConfigurationSchema;
13
21
  async configure(_server, config, _cache) {
14
22
  this.headers = {
15
- "X-API-KEY": `${config.api_token}`,
23
+ [API_KEY_HEADER]: `${config.api_token}`,
16
24
  "Content-Type": "application/json",
17
25
  "User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`
18
26
  };
@@ -20,269 +28,23 @@ class ReflectClient {
20
28
  isConfigured() {
21
29
  return Object.keys(this.headers).length !== 0;
22
30
  }
23
- async listReflectSuites() {
24
- const response = await fetch("https://api.reflect.run/v1/suites", {
25
- method: "GET",
26
- headers: this.headers
27
- });
28
- return response.json();
29
- }
30
- async listSuiteExecutions(suiteId) {
31
- const response = await fetch(
32
- `https://api.reflect.run/v1/suites/${suiteId}/executions`,
33
- {
34
- method: "GET",
35
- headers: this.headers
36
- }
37
- );
38
- return response.json();
39
- }
40
- async getSuiteExecutionStatus(suiteId, executionId) {
41
- const response = await fetch(
42
- `https://api.reflect.run/v1/suites/${suiteId}/executions/${executionId}`,
43
- {
44
- method: "GET",
45
- headers: this.headers
46
- }
47
- );
48
- return response.json();
49
- }
50
- async executeSuite(suiteId) {
51
- const response = await fetch(
52
- `https://api.reflect.run/v1/suites/${suiteId}/executions`,
53
- {
54
- method: "POST",
55
- headers: this.headers
56
- }
57
- );
58
- return response.json();
59
- }
60
- async cancelSuiteExecution(suiteId, executionId) {
61
- const response = await fetch(
62
- `https://api.reflect.run/v1/suites/${suiteId}/executions/${executionId}/cancel`,
63
- {
64
- method: "PATCH",
65
- headers: this.headers
66
- }
67
- );
68
- return response.json();
69
- }
70
- async listReflectTests() {
71
- const response = await fetch("https://api.reflect.run/v1/tests", {
72
- method: "GET",
73
- headers: this.headers
74
- });
75
- return response.json();
76
- }
77
- async runReflectTest(testId) {
78
- const response = await fetch(
79
- `https://api.reflect.run/v1/tests/${testId}/executions`,
80
- {
81
- method: "POST",
82
- headers: this.headers
83
- }
84
- );
85
- return response.json();
86
- }
87
- async getReflectTestStatus(_testId, executionId) {
88
- const response = await fetch(
89
- `https://api.reflect.run/v1/executions/${executionId}`,
90
- {
91
- method: "GET",
92
- headers: this.headers
93
- }
94
- );
95
- return response.json();
31
+ getHeaders() {
32
+ return this.headers;
96
33
  }
97
34
  async registerTools(register, _getInput) {
98
- register(
99
- {
100
- title: "List Suites",
101
- summary: "Retrieve a list of all reflect suites available",
102
- parameters: []
103
- },
104
- async (_args, _extra) => {
105
- const response = await this.listReflectSuites();
106
- return {
107
- content: [{ type: "text", text: JSON.stringify(response) }]
108
- };
109
- }
110
- );
111
- register(
112
- {
113
- title: "List Suite Executions",
114
- summary: "List all executions for a given suite",
115
- parameters: [
116
- {
117
- name: "suiteId",
118
- type: z.string(),
119
- description: "ID of the reflect suite to list executions for",
120
- required: true
121
- }
122
- ]
123
- },
124
- async (args, _extra) => {
125
- if (!args.suiteId) throw new ToolError("suiteId argument is required");
126
- const response = await this.listSuiteExecutions(args.suiteId);
127
- return {
128
- content: [{ type: "text", text: JSON.stringify(response) }]
129
- };
130
- }
131
- );
132
- register(
133
- {
134
- title: "Get Suite Execution Status",
135
- summary: "Get the status of a reflect suite execution",
136
- parameters: [
137
- {
138
- name: "suiteId",
139
- type: z.string(),
140
- description: "ID of the reflect suite to get execution status for",
141
- required: true
142
- },
143
- {
144
- name: "executionId",
145
- type: z.string(),
146
- description: "ID of the reflect suite execution to get status for",
147
- required: true
148
- }
149
- ]
150
- },
151
- async (args, _extra) => {
152
- if (!args.suiteId || !args.executionId)
153
- throw new ToolError(
154
- "Both suiteId and executionId arguments are required"
155
- );
156
- const response = await this.getSuiteExecutionStatus(
157
- args.suiteId,
158
- args.executionId
159
- );
160
- return {
161
- content: [{ type: "text", text: JSON.stringify(response) }]
162
- };
163
- }
164
- );
165
- register(
166
- {
167
- title: "Execute Suite",
168
- summary: "Execute a reflect suite",
169
- parameters: [
170
- {
171
- name: "suiteId",
172
- type: z.string(),
173
- description: "ID of the reflect suite to list executions for",
174
- required: true
175
- }
176
- ]
177
- },
178
- async (args, _extra) => {
179
- if (!args.suiteId) throw new ToolError("suiteId argument is required");
180
- const response = await this.executeSuite(args.suiteId);
181
- return {
182
- content: [{ type: "text", text: JSON.stringify(response) }]
183
- };
184
- }
185
- );
186
- register(
187
- {
188
- title: "Cancel Suite Execution",
189
- summary: "Cancel a reflect suite execution",
190
- parameters: [
191
- {
192
- name: "suiteId",
193
- type: z.string(),
194
- description: "ID of the reflect suite to cancel execution for",
195
- required: true
196
- },
197
- {
198
- name: "executionId",
199
- type: z.string(),
200
- description: "ID of the reflect suite execution to cancel",
201
- required: true
202
- }
203
- ]
204
- },
205
- async (args, _extra) => {
206
- if (!args.suiteId || !args.executionId)
207
- throw new ToolError(
208
- "Both suiteId and executionId arguments are required"
209
- );
210
- const response = await this.cancelSuiteExecution(
211
- args.suiteId,
212
- args.executionId
213
- );
214
- return {
215
- content: [{ type: "text", text: JSON.stringify(response) }]
216
- };
217
- }
218
- );
219
- register(
220
- {
221
- title: "List Tests",
222
- summary: "List all reflect tests",
223
- parameters: []
224
- },
225
- async (_args, _extra) => {
226
- const response = await this.listReflectTests();
227
- return {
228
- content: [{ type: "text", text: JSON.stringify(response) }]
229
- };
230
- }
231
- );
232
- register(
233
- {
234
- title: "Run Test",
235
- summary: "Run a reflect test",
236
- parameters: [
237
- {
238
- name: "testId",
239
- type: z.string(),
240
- description: "ID of the reflect test to run",
241
- required: true
242
- }
243
- ]
244
- },
245
- async (args, _extra) => {
246
- if (!args.testId) throw new ToolError("testId argument is required");
247
- const response = await this.runReflectTest(args.testId);
248
- return {
249
- content: [{ type: "text", text: JSON.stringify(response) }]
250
- };
251
- }
252
- );
253
- register(
254
- {
255
- title: "Get Test Status",
256
- summary: "Get the status of a reflect test execution",
257
- parameters: [
258
- {
259
- name: "testId",
260
- type: z.string(),
261
- description: "ID of the reflect test to run",
262
- required: true
263
- },
264
- {
265
- name: "executionId",
266
- type: z.string(),
267
- description: "ID of the reflect test execution to get status for",
268
- required: true
269
- }
270
- ]
271
- },
272
- async (args, _extra) => {
273
- if (!args.testId || !args.executionId)
274
- throw new ToolError(
275
- "Both testId and executionId arguments are required"
276
- );
277
- const response = await this.getReflectTestStatus(
278
- args.testId,
279
- args.executionId
280
- );
281
- return {
282
- content: [{ type: "text", text: JSON.stringify(response) }]
283
- };
284
- }
285
- );
35
+ const tools = [
36
+ new ListSuites(this),
37
+ new ListSuiteExecutions(this),
38
+ new GetSuiteExecutionStatus(this),
39
+ new ExecuteSuite(this),
40
+ new CancelSuiteExecution(this),
41
+ new ListTests(this),
42
+ new RunTest(this),
43
+ new GetTestStatus(this)
44
+ ];
45
+ for (const tool of tools) {
46
+ register(tool.specification, tool.handle);
47
+ }
286
48
  }
287
49
  }
288
50
  export {
@@ -0,0 +1,6 @@
1
+ const API_KEY_HEADER = "X-API-KEY";
2
+ const API_HOSTNAME = "api.reflect.run";
3
+ export {
4
+ API_HOSTNAME,
5
+ API_KEY_HEADER
6
+ };
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ import { Tool, ToolError } from "../../../common/tools.js";
3
+ import { API_HOSTNAME } from "../../config/constants.js";
4
+ class CancelSuiteExecution extends Tool {
5
+ specification = {
6
+ title: "Cancel Suite Execution",
7
+ summary: "Cancel a reflect suite execution",
8
+ parameters: [
9
+ {
10
+ name: "suiteId",
11
+ type: z.string(),
12
+ description: "ID of the reflect suite to cancel execution for",
13
+ required: true
14
+ },
15
+ {
16
+ name: "executionId",
17
+ type: z.string(),
18
+ description: "ID of the reflect suite execution to cancel",
19
+ required: true
20
+ }
21
+ ]
22
+ };
23
+ handle = async (args) => {
24
+ const { suiteId, executionId } = args;
25
+ if (!suiteId || !executionId) {
26
+ throw new ToolError(
27
+ "Both suiteId and executionId arguments are required"
28
+ );
29
+ }
30
+ const response = await fetch(
31
+ `https://${API_HOSTNAME}/v1/suites/${suiteId}/executions/${executionId}/cancel`,
32
+ {
33
+ method: "PATCH",
34
+ headers: this.client.getHeaders()
35
+ }
36
+ );
37
+ if (!response.ok) {
38
+ throw new ToolError(
39
+ `Failed to cancel suite execution: ${response.status} ${response.statusText}`
40
+ );
41
+ }
42
+ const data = await response.json();
43
+ return {
44
+ content: [{ type: "text", text: JSON.stringify(data) }]
45
+ };
46
+ };
47
+ }
48
+ export {
49
+ CancelSuiteExecution
50
+ };
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import { Tool, ToolError } from "../../../common/tools.js";
3
+ import { API_HOSTNAME } from "../../config/constants.js";
4
+ class ExecuteSuite extends Tool {
5
+ specification = {
6
+ title: "Execute Suite",
7
+ summary: "Execute a reflect suite",
8
+ parameters: [
9
+ {
10
+ name: "suiteId",
11
+ type: z.string(),
12
+ description: "ID of the reflect suite to execute",
13
+ required: true
14
+ }
15
+ ]
16
+ };
17
+ handle = async (args) => {
18
+ const { suiteId } = args;
19
+ if (!suiteId) throw new ToolError("suiteId argument is required");
20
+ const response = await fetch(
21
+ `https://${API_HOSTNAME}/v1/suites/${suiteId}/executions`,
22
+ {
23
+ method: "POST",
24
+ headers: this.client.getHeaders()
25
+ }
26
+ );
27
+ if (!response.ok) {
28
+ throw new ToolError(
29
+ `Failed to execute suite: ${response.status} ${response.statusText}`
30
+ );
31
+ }
32
+ const data = await response.json();
33
+ return {
34
+ content: [{ type: "text", text: JSON.stringify(data) }]
35
+ };
36
+ };
37
+ }
38
+ export {
39
+ ExecuteSuite
40
+ };
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ import { Tool, ToolError } from "../../../common/tools.js";
3
+ import { API_HOSTNAME } from "../../config/constants.js";
4
+ class GetSuiteExecutionStatus extends Tool {
5
+ specification = {
6
+ title: "Get Suite Execution Status",
7
+ summary: "Get the status of a reflect suite execution",
8
+ parameters: [
9
+ {
10
+ name: "suiteId",
11
+ type: z.string(),
12
+ description: "ID of the reflect suite to get execution status for",
13
+ required: true
14
+ },
15
+ {
16
+ name: "executionId",
17
+ type: z.string(),
18
+ description: "ID of the reflect suite execution to get status for",
19
+ required: true
20
+ }
21
+ ]
22
+ };
23
+ handle = async (args) => {
24
+ const { suiteId, executionId } = args;
25
+ if (!suiteId || !executionId) {
26
+ throw new ToolError(
27
+ "Both suiteId and executionId arguments are required"
28
+ );
29
+ }
30
+ const response = await fetch(
31
+ `https://${API_HOSTNAME}/v1/suites/${suiteId}/executions/${executionId}`,
32
+ {
33
+ method: "GET",
34
+ headers: this.client.getHeaders()
35
+ }
36
+ );
37
+ if (!response.ok) {
38
+ throw new ToolError(
39
+ `Failed to get suite execution status: ${response.status} ${response.statusText}`
40
+ );
41
+ }
42
+ const data = await response.json();
43
+ return {
44
+ content: [{ type: "text", text: JSON.stringify(data) }]
45
+ };
46
+ };
47
+ }
48
+ export {
49
+ GetSuiteExecutionStatus
50
+ };
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import { Tool, ToolError } from "../../../common/tools.js";
3
+ import { API_HOSTNAME } from "../../config/constants.js";
4
+ class ListSuiteExecutions extends Tool {
5
+ specification = {
6
+ title: "List Suite Executions",
7
+ summary: "List all executions for a given suite",
8
+ parameters: [
9
+ {
10
+ name: "suiteId",
11
+ type: z.string(),
12
+ description: "ID of the reflect suite to list executions for",
13
+ required: true
14
+ }
15
+ ]
16
+ };
17
+ handle = async (args) => {
18
+ const { suiteId } = args;
19
+ if (!suiteId) throw new ToolError("suiteId argument is required");
20
+ const response = await fetch(
21
+ `https://${API_HOSTNAME}/v1/suites/${suiteId}/executions`,
22
+ {
23
+ method: "GET",
24
+ headers: this.client.getHeaders()
25
+ }
26
+ );
27
+ if (!response.ok) {
28
+ throw new ToolError(
29
+ `Failed to list suite executions: ${response.status} ${response.statusText}`
30
+ );
31
+ }
32
+ const data = await response.json();
33
+ return {
34
+ content: [{ type: "text", text: JSON.stringify(data) }]
35
+ };
36
+ };
37
+ }
38
+ export {
39
+ ListSuiteExecutions
40
+ };
@@ -0,0 +1,27 @@
1
+ import { Tool, ToolError } from "../../../common/tools.js";
2
+ import { API_HOSTNAME } from "../../config/constants.js";
3
+ class ListSuites extends Tool {
4
+ specification = {
5
+ title: "List Suites",
6
+ summary: "Retrieve a list of all reflect suites available",
7
+ parameters: []
8
+ };
9
+ handle = async (_args) => {
10
+ const response = await fetch(`https://${API_HOSTNAME}/v1/suites`, {
11
+ method: "GET",
12
+ headers: this.client.getHeaders()
13
+ });
14
+ if (!response.ok) {
15
+ throw new ToolError(
16
+ `Failed to list suites: ${response.status} ${response.statusText}`
17
+ );
18
+ }
19
+ const data = await response.json();
20
+ return {
21
+ content: [{ type: "text", text: JSON.stringify(data) }]
22
+ };
23
+ };
24
+ }
25
+ export {
26
+ ListSuites
27
+ };
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ import { Tool, ToolError } from "../../../common/tools.js";
3
+ import { API_HOSTNAME } from "../../config/constants.js";
4
+ class GetTestStatus extends Tool {
5
+ specification = {
6
+ title: "Get Test Status",
7
+ summary: "Get the status of a reflect test execution",
8
+ parameters: [
9
+ {
10
+ name: "executionId",
11
+ type: z.string(),
12
+ description: "ID of the reflect test execution to get status for",
13
+ required: true
14
+ }
15
+ ]
16
+ };
17
+ handle = async (args) => {
18
+ const { executionId } = args;
19
+ if (!executionId) {
20
+ throw new ToolError("executionId argument is required");
21
+ }
22
+ const response = await fetch(
23
+ `https://${API_HOSTNAME}/v1/executions/${executionId}`,
24
+ {
25
+ method: "GET",
26
+ headers: this.client.getHeaders()
27
+ }
28
+ );
29
+ if (!response.ok) {
30
+ throw new ToolError(
31
+ `Failed to get test status: ${response.status} ${response.statusText}`
32
+ );
33
+ }
34
+ const data = await response.json();
35
+ return {
36
+ content: [{ type: "text", text: JSON.stringify(data) }]
37
+ };
38
+ };
39
+ }
40
+ export {
41
+ GetTestStatus
42
+ };
@@ -0,0 +1,27 @@
1
+ import { Tool, ToolError } from "../../../common/tools.js";
2
+ import { API_HOSTNAME } from "../../config/constants.js";
3
+ class ListTests extends Tool {
4
+ specification = {
5
+ title: "List Tests",
6
+ summary: "List all reflect tests",
7
+ parameters: []
8
+ };
9
+ handle = async (_args) => {
10
+ const response = await fetch(`https://${API_HOSTNAME}/v1/tests`, {
11
+ method: "GET",
12
+ headers: this.client.getHeaders()
13
+ });
14
+ if (!response.ok) {
15
+ throw new ToolError(
16
+ `Failed to list tests: ${response.status} ${response.statusText}`
17
+ );
18
+ }
19
+ const data = await response.json();
20
+ return {
21
+ content: [{ type: "text", text: JSON.stringify(data) }]
22
+ };
23
+ };
24
+ }
25
+ export {
26
+ ListTests
27
+ };
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import { Tool, ToolError } from "../../../common/tools.js";
3
+ import { API_HOSTNAME } from "../../config/constants.js";
4
+ class RunTest extends Tool {
5
+ specification = {
6
+ title: "Run Test",
7
+ summary: "Run a reflect test",
8
+ parameters: [
9
+ {
10
+ name: "testId",
11
+ type: z.string(),
12
+ description: "ID of the reflect test to run",
13
+ required: true
14
+ }
15
+ ]
16
+ };
17
+ handle = async (args) => {
18
+ const { testId } = args;
19
+ if (!testId) throw new ToolError("testId argument is required");
20
+ const response = await fetch(
21
+ `https://${API_HOSTNAME}/v1/tests/${testId}/executions`,
22
+ {
23
+ method: "POST",
24
+ headers: this.client.getHeaders()
25
+ }
26
+ );
27
+ if (!response.ok) {
28
+ throw new ToolError(
29
+ `Failed to run test: ${response.status} ${response.statusText}`
30
+ );
31
+ }
32
+ const data = await response.json();
33
+ return {
34
+ content: [{ type: "text", text: JSON.stringify(data) }]
35
+ };
36
+ };
37
+ }
38
+ export {
39
+ RunTest
40
+ };