@smartbear/mcp 0.6.0 → 0.8.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 (41) hide show
  1. package/README.md +37 -3
  2. package/dist/api-hub/client/api.js +387 -0
  3. package/dist/api-hub/client/configuration.js +27 -0
  4. package/dist/api-hub/client/index.js +5 -0
  5. package/dist/api-hub/client/portal-types.js +131 -0
  6. package/dist/api-hub/client/registry-types.js +69 -0
  7. package/dist/api-hub/client/tools.js +98 -0
  8. package/dist/api-hub/client.js +70 -404
  9. package/dist/bugsnag/client/api/CurrentUser.js +19 -13
  10. package/dist/bugsnag/client/api/Error.js +45 -57
  11. package/dist/bugsnag/client/api/Project.js +35 -30
  12. package/dist/bugsnag/client/api/base.js +24 -9
  13. package/dist/bugsnag/client/api/filters.js +9 -9
  14. package/dist/bugsnag/client.js +281 -373
  15. package/dist/common/info.js +1 -1
  16. package/dist/common/server.js +39 -28
  17. package/dist/index.js +18 -4
  18. package/dist/pactflow/client/ai.js +20 -20
  19. package/dist/pactflow/client/base.js +48 -13
  20. package/dist/pactflow/client/prompts.js +10 -12
  21. package/dist/pactflow/client/tools.js +18 -18
  22. package/dist/pactflow/client/utils.js +1 -1
  23. package/dist/pactflow/client.js +23 -15
  24. package/dist/qmetry/client/api/client-api.js +39 -0
  25. package/dist/qmetry/client/handlers.js +11 -0
  26. package/dist/qmetry/client/project.js +27 -0
  27. package/dist/qmetry/client/testcase.js +104 -0
  28. package/dist/qmetry/client/tools.js +222 -0
  29. package/dist/qmetry/client.js +95 -0
  30. package/dist/qmetry/config/constants.js +12 -0
  31. package/dist/qmetry/config/rest-endpoints.js +11 -0
  32. package/dist/qmetry/types/common.js +174 -0
  33. package/dist/qmetry/types/testcase.js +19 -0
  34. package/dist/reflect/client.js +14 -14
  35. package/dist/zephyr/client.js +16 -0
  36. package/dist/zephyr/common/api-client.js +27 -0
  37. package/dist/zephyr/common/auth-service.js +14 -0
  38. package/dist/zephyr/common/types.js +35 -0
  39. package/dist/zephyr/tool/project/get-projects.js +54 -0
  40. package/dist/zephyr/tool/zephyr-tool.js +1 -0
  41. package/package.json +8 -6
@@ -1,5 +1,5 @@
1
- import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
2
1
  import { z } from "zod";
2
+ import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
3
3
  // ReflectClient class implementing the Client interface
4
4
  export class ReflectClient {
5
5
  headers;
@@ -61,7 +61,7 @@ export class ReflectClient {
61
61
  });
62
62
  return response.json();
63
63
  }
64
- async getReflectTestStatus(testId, executionId) {
64
+ async getReflectTestStatus(_testId, executionId) {
65
65
  const response = await fetch(`https://api.reflect.run/v1/executions/${executionId}`, {
66
66
  method: "GET",
67
67
  headers: this.headers,
@@ -87,7 +87,7 @@ export class ReflectClient {
87
87
  name: "suiteId",
88
88
  type: z.string(),
89
89
  description: "ID of the reflect suite to list executions for",
90
- required: true
90
+ required: true,
91
91
  },
92
92
  ],
93
93
  }, async (args, _extra) => {
@@ -106,13 +106,13 @@ export class ReflectClient {
106
106
  name: "suiteId",
107
107
  type: z.string(),
108
108
  description: "ID of the reflect suite to get execution status for",
109
- required: true
109
+ required: true,
110
110
  },
111
111
  {
112
112
  name: "executionId",
113
113
  type: z.string(),
114
114
  description: "ID of the reflect suite execution to get status for",
115
- required: true
115
+ required: true,
116
116
  },
117
117
  ],
118
118
  }, async (args, _extra) => {
@@ -131,9 +131,9 @@ export class ReflectClient {
131
131
  name: "suiteId",
132
132
  type: z.string(),
133
133
  description: "ID of the reflect suite to list executions for",
134
- required: true
135
- }
136
- ]
134
+ required: true,
135
+ },
136
+ ],
137
137
  }, async (args, _extra) => {
138
138
  if (!args.suiteId)
139
139
  throw new Error("suiteId argument is required");
@@ -150,13 +150,13 @@ export class ReflectClient {
150
150
  name: "suiteId",
151
151
  type: z.string(),
152
152
  description: "ID of the reflect suite to cancel execution for",
153
- required: true
153
+ required: true,
154
154
  },
155
155
  {
156
156
  name: "executionId",
157
157
  type: z.string(),
158
158
  description: "ID of the reflect suite execution to cancel",
159
- required: true
159
+ required: true,
160
160
  },
161
161
  ],
162
162
  }, async (args, _extra) => {
@@ -185,8 +185,8 @@ export class ReflectClient {
185
185
  name: "testId",
186
186
  type: z.string(),
187
187
  description: "ID of the reflect test to run",
188
- required: true
189
- }
188
+ required: true,
189
+ },
190
190
  ],
191
191
  }, async (args, _extra) => {
192
192
  if (!args.testId)
@@ -204,13 +204,13 @@ export class ReflectClient {
204
204
  name: "testId",
205
205
  type: z.string(),
206
206
  description: "ID of the reflect test to run",
207
- required: true
207
+ required: true,
208
208
  },
209
209
  {
210
210
  name: "executionId",
211
211
  type: z.string(),
212
212
  description: "ID of the reflect test execution to get status for",
213
- required: true
213
+ required: true,
214
214
  },
215
215
  ],
216
216
  }, async (args, _extra) => {
@@ -0,0 +1,16 @@
1
+ import { ApiClient } from "./common/api-client.js";
2
+ import { GetProjects } from "./tool/project/get-projects.js";
3
+ export class ZephyrClient {
4
+ apiClient;
5
+ name = "Zephyr";
6
+ prefix = "zephyr";
7
+ constructor(bearerToken, baseUrl = "https://api.zephyrscale.smartbear.com/v2") {
8
+ this.apiClient = new ApiClient(bearerToken, baseUrl);
9
+ }
10
+ registerTools(register, _getInput) {
11
+ const tools = [new GetProjects(this.apiClient)];
12
+ tools.forEach((tool) => {
13
+ register(tool.specification, tool.handle);
14
+ });
15
+ }
16
+ }
@@ -0,0 +1,27 @@
1
+ import { AuthService } from "./auth-service.js";
2
+ export class ApiClient {
3
+ baseUrl;
4
+ defaultHeaders;
5
+ constructor(bearerToken, baseUrl) {
6
+ this.baseUrl = baseUrl.trim().replace(/\/$/, "");
7
+ this.defaultHeaders = new AuthService(bearerToken).getAuthHeaders();
8
+ }
9
+ getUrl(endpoint, params) {
10
+ const url = new URL(this.baseUrl + endpoint);
11
+ if (params) {
12
+ Object.entries(params).forEach(([key, value]) => {
13
+ if (value !== undefined) {
14
+ url.searchParams.append(key, String(value));
15
+ }
16
+ });
17
+ }
18
+ return url.toString();
19
+ }
20
+ async get(endpoint, params) {
21
+ const response = await fetch(this.getUrl(endpoint, params), {
22
+ method: "GET",
23
+ headers: this.defaultHeaders,
24
+ });
25
+ return response.json();
26
+ }
27
+ }
@@ -0,0 +1,14 @@
1
+ import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../../common/info.js";
2
+ export class AuthService {
3
+ bearerToken;
4
+ constructor(accessToken) {
5
+ this.bearerToken = accessToken.trim();
6
+ }
7
+ getAuthHeaders() {
8
+ return {
9
+ Authorization: `Bearer ${this.bearerToken}`,
10
+ "Content-Type": "application/json",
11
+ "User-Agent": `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`,
12
+ };
13
+ }
14
+ }
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export const MaxResultsSchema = z
3
+ .number()
4
+ .min(1)
5
+ .max(1000)
6
+ .describe(`
7
+ Specifies the maximum number of results to return in a single call. The default value is 10, and the maximum value that can be requested is 1000.
8
+
9
+ Note that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints.
10
+ If this happens, the result set may be truncated. Always check the maxResults value in the response to confirm how many results were actually returned.
11
+ `);
12
+ export const StartAtSchema = z
13
+ .number()
14
+ .min(0)
15
+ .max(1000000)
16
+ .describe(`
17
+ Zero-indexed starting position used to paginate through results. Defaults to 0.
18
+ `);
19
+ export const ZephyrProjectSchema = z.object({
20
+ id: z.number(),
21
+ jiraProjectId: z.number(),
22
+ key: z.string(),
23
+ enabled: z.boolean(),
24
+ });
25
+ export function createListSchema(itemSchema) {
26
+ return z.object({
27
+ next: z.string().nullable(),
28
+ startAt: StartAtSchema,
29
+ maxResults: MaxResultsSchema,
30
+ total: z.number(),
31
+ isLast: z.boolean(),
32
+ values: z.array(itemSchema),
33
+ });
34
+ }
35
+ export const ZephyrProjectListSchema = createListSchema(ZephyrProjectSchema);
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ import { MaxResultsSchema, StartAtSchema } from "../../common/types.js";
3
+ export const GetProjectsInputSchema = z.object({
4
+ startAt: StartAtSchema.optional(),
5
+ maxResults: MaxResultsSchema.optional(),
6
+ });
7
+ export class GetProjects {
8
+ apiClient;
9
+ constructor(apiClient) {
10
+ this.apiClient = apiClient;
11
+ }
12
+ specification = {
13
+ title: "Get Projects",
14
+ summary: "Get details of projects in Zephyr",
15
+ readOnly: true,
16
+ idempotent: true,
17
+ zodSchema: GetProjectsInputSchema,
18
+ examples: [
19
+ {
20
+ description: "Get the first 10 projects",
21
+ parameters: {
22
+ maxResults: 10,
23
+ startAt: 0,
24
+ },
25
+ expectedOutput: "The first 10 projects with their details",
26
+ },
27
+ {
28
+ description: "Get any project",
29
+ parameters: {
30
+ maxResults: 1,
31
+ },
32
+ expectedOutput: "One project with its details",
33
+ },
34
+ {
35
+ description: "Get five projects starting from the 7th project of the list",
36
+ parameters: {
37
+ maxResults: 5,
38
+ startAt: 6,
39
+ },
40
+ expectedOutput: "The 7th to the 11th projects with their details",
41
+ },
42
+ ],
43
+ };
44
+ handle = async (args) => {
45
+ const { maxResults, startAt } = args;
46
+ const response = await this.apiClient.get("/projects", {
47
+ maxResults,
48
+ startAt,
49
+ });
50
+ return {
51
+ content: [{ type: "text", text: JSON.stringify(response) }],
52
+ };
53
+ };
54
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartbear/mcp",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "MCP server for interacting SmartBear Products",
5
5
  "keywords": [
6
6
  "smartbear",
@@ -8,7 +8,8 @@
8
8
  "bugsnag",
9
9
  "reflect",
10
10
  "api-hub",
11
- "pactflow"
11
+ "pactflow",
12
+ "zephyr"
12
13
  ],
13
14
  "homepage": "https://developer.smartbear.com/smartbear-mcp",
14
15
  "mcpName": "com.smartbear/smartbear-mcp",
@@ -31,7 +32,10 @@
31
32
  },
32
33
  "scripts": {
33
34
  "build": "tsc && shx chmod +x dist/*.js",
34
- "lint": "eslint . --ext .ts",
35
+ "lint": "biome lint .",
36
+ "lint:fix": "biome lint . --fix",
37
+ "format": "biome format . --write",
38
+ "format:check": "biome format .",
35
39
  "prepare": "npm run build",
36
40
  "watch": "tsc --watch",
37
41
  "test": "vitest",
@@ -50,15 +54,13 @@
50
54
  "zod-to-json-schema": "^3.24.6"
51
55
  },
52
56
  "devDependencies": {
53
- "@eslint/js": "^9.29.0",
57
+ "@biomejs/biome": "^2.2.4",
54
58
  "@types/js-yaml": "^4.0.9",
55
59
  "@types/node": "^22",
56
60
  "@vitest/coverage-v8": "^3.2.4",
57
- "eslint": "^9.29.0",
58
61
  "globals": "^16.2.0",
59
62
  "shx": "^0.3.4",
60
63
  "typescript": "^5.6.2",
61
- "typescript-eslint": "^8.34.1",
62
64
  "vitest": "^3.2.4",
63
65
  "vitest-fetch-mock": "^0.4.5"
64
66
  }