@smartbear/mcp 0.12.1 → 0.13.1

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 (89) hide show
  1. package/README.md +30 -6
  2. package/dist/bugsnag/client/api/CurrentUser.js +50 -26
  3. package/dist/bugsnag/client/api/Error.js +156 -93
  4. package/dist/bugsnag/client/api/Project.js +398 -276
  5. package/dist/bugsnag/client/api/api.js +4087 -3837
  6. package/dist/bugsnag/client/api/base.js +155 -173
  7. package/dist/bugsnag/client/api/configuration.js +28 -25
  8. package/dist/bugsnag/client/filters.js +11 -20
  9. package/dist/bugsnag/client.js +1398 -1281
  10. package/dist/bugsnag/input-schemas.js +39 -57
  11. package/dist/collaborator/client.js +335 -371
  12. package/dist/common/bugsnag.js +5 -3
  13. package/dist/common/cache.js +50 -57
  14. package/dist/common/client-registry.js +106 -119
  15. package/dist/common/info.js +7 -3
  16. package/dist/common/register-clients.js +0 -16
  17. package/dist/common/server.js +270 -228
  18. package/dist/common/tools.js +19 -0
  19. package/dist/common/transport-http.js +252 -343
  20. package/dist/common/transport-stdio.js +40 -37
  21. package/dist/common/zod-utils.js +20 -0
  22. package/dist/index.js +18 -23
  23. package/dist/package.json.js +11 -0
  24. package/dist/pactflow/client/ai.js +142 -169
  25. package/dist/pactflow/client/base.js +41 -51
  26. package/dist/pactflow/client/prompt-utils.js +93 -84
  27. package/dist/pactflow/client/prompts.js +95 -92
  28. package/dist/pactflow/client/tools.js +94 -83
  29. package/dist/pactflow/client/utils.js +60 -64
  30. package/dist/pactflow/client.js +399 -320
  31. package/dist/qmetry/client/api/client-api.js +43 -41
  32. package/dist/qmetry/client/api/error-handler.js +264 -310
  33. package/dist/qmetry/client/auto-resolve.js +78 -99
  34. package/dist/qmetry/client/automation.js +139 -162
  35. package/dist/qmetry/client/handlers.js +49 -46
  36. package/dist/qmetry/client/issues.js +133 -115
  37. package/dist/qmetry/client/project.js +153 -174
  38. package/dist/qmetry/client/requirement.js +82 -70
  39. package/dist/qmetry/client/testcase.js +240 -208
  40. package/dist/qmetry/client/testsuite.js +332 -293
  41. package/dist/qmetry/client/tools/automation-tools.js +291 -288
  42. package/dist/qmetry/client/tools/index.js +16 -13
  43. package/dist/qmetry/client/tools/issue-tools.js +534 -543
  44. package/dist/qmetry/client/tools/project-tools.js +635 -656
  45. package/dist/qmetry/client/tools/requirement-tools.js +525 -528
  46. package/dist/qmetry/client/tools/testcase-tools.js +773 -786
  47. package/dist/qmetry/client/tools/testsuite-tools.js +1069 -1083
  48. package/dist/qmetry/client/utils.js +8 -14
  49. package/dist/qmetry/client.js +111 -109
  50. package/dist/qmetry/config/constants.js +48 -44
  51. package/dist/qmetry/config/rest-endpoints.js +51 -48
  52. package/dist/qmetry/types/automation.js +7 -7
  53. package/dist/qmetry/types/common.js +763 -1049
  54. package/dist/qmetry/types/issues.js +26 -19
  55. package/dist/qmetry/types/project.js +32 -25
  56. package/dist/qmetry/types/requirements.js +26 -21
  57. package/dist/qmetry/types/testcase.js +55 -44
  58. package/dist/qmetry/types/testsuite.js +66 -52
  59. package/dist/reflect/client.js +284 -226
  60. package/dist/swagger/client/api.js +645 -662
  61. package/dist/swagger/client/configuration.js +31 -33
  62. package/dist/swagger/client/portal-types.js +204 -244
  63. package/dist/swagger/client/registry-types.js +62 -96
  64. package/dist/swagger/client/tools.js +148 -158
  65. package/dist/swagger/client/user-management-types.js +11 -22
  66. package/dist/swagger/client.js +143 -135
  67. package/dist/swagger/config-utils.js +10 -16
  68. package/dist/zephyr/client.js +43 -42
  69. package/dist/zephyr/common/api-client.js +35 -30
  70. package/dist/zephyr/common/auth-service.js +16 -13
  71. package/dist/zephyr/common/rest-api-schemas.js +3173 -5146
  72. package/dist/zephyr/tool/environment/get-environments.js +66 -66
  73. package/dist/zephyr/tool/priority/get-priorities.js +41 -41
  74. package/dist/zephyr/tool/project/get-project.js +37 -37
  75. package/dist/zephyr/tool/project/get-projects.js +46 -46
  76. package/dist/zephyr/tool/status/get-statuses.js +47 -47
  77. package/dist/zephyr/tool/test-case/get-test-case.js +37 -37
  78. package/dist/zephyr/tool/test-case/get-test-cases.js +62 -62
  79. package/dist/zephyr/tool/test-cycle/get-test-cycle.js +37 -37
  80. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +70 -70
  81. package/dist/zephyr/tool/test-execution/get-test-execution.js +37 -37
  82. package/dist/zephyr/tool/test-execution/get-test-executions.js +43 -43
  83. package/package.json +5 -5
  84. package/dist/bugsnag/client/api/index.js +0 -6
  85. package/dist/common/types.js +0 -6
  86. package/dist/qmetry/client/tools/types.js +0 -1
  87. package/dist/swagger/client/index.js +0 -6
  88. package/dist/tests/unit/bugsnag/utils/factories.js +0 -86
  89. package/dist/zephyr/tool/zephyr-tool.js +0 -1
@@ -1,141 +1,149 @@
1
1
  import { z } from "zod";
2
2
  import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
3
- // Apply backward compatibility for API_HUB_API_KEY
4
3
  import "./config-utils.js";
5
- import { SwaggerAPI, SwaggerConfiguration, TOOLS, } from "./client/index.js";
4
+ import { SwaggerAPI } from "./client/api.js";
5
+ import { SwaggerConfiguration } from "./client/configuration.js";
6
+ import "./client/portal-types.js";
7
+ import "./client/registry-types.js";
8
+ import { TOOLS } from "./client/tools.js";
9
+ import "./client/user-management-types.js";
6
10
  const ConfigurationSchema = z.object({
7
- api_key: z.string().describe("Swagger API key for authentication"),
11
+ api_key: z.string().describe("Swagger API key for authentication"),
12
+ portal_base_path: z.string().optional().describe("Base path for Portal API requests (optional)"),
13
+ registry_base_path: z.string().optional().describe("Base path for Registry API requests (optional)"),
14
+ ui_base_path: z.string().optional().describe("Base URL for the SwaggerHub UI (optional)")
8
15
  });
9
- // Tool definitions for API Hub API client
10
- export class SwaggerClient {
11
- api;
12
- name = "Swagger";
13
- toolPrefix = "swagger";
14
- configPrefix = "Swagger";
15
- config = ConfigurationSchema;
16
- async configure(_server, config, _cache) {
17
- this.api = new SwaggerAPI(new SwaggerConfiguration({ token: config.api_key }), `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`);
18
- return true;
19
- }
20
- getApi() {
21
- if (!this.api)
22
- throw new Error("Client not configured");
23
- return this.api;
24
- }
25
- // Delegate API methods to the SwaggerAPI instance
26
- async getPortals() {
27
- return this.getApi().getPortals();
28
- }
29
- async createPortal(body) {
30
- return this.getApi().createPortal(body);
31
- }
32
- async getPortal(args) {
33
- return this.getApi().getPortal(args.portalId);
34
- }
35
- async updatePortal(args) {
36
- const { portalId, ...body } = args;
37
- return this.getApi().updatePortal(portalId, body);
38
- }
39
- async getPortalProducts(args) {
40
- return this.getApi().getPortalProducts(args.portalId);
41
- }
42
- async createPortalProduct(args) {
43
- const { portalId, ...body } = args;
44
- return this.getApi().createPortalProduct(portalId, body);
45
- }
46
- async getPortalProduct(args) {
47
- return this.getApi().getPortalProduct(args.productId);
48
- }
49
- async deletePortalProduct(args) {
50
- return this.getApi().deletePortalProduct(args.productId);
51
- }
52
- async updatePortalProduct(args) {
53
- const { productId, ...body } = args;
54
- return this.getApi().updatePortalProduct(productId, body);
55
- }
56
- async publishPortalProduct(args) {
57
- const { productId, preview } = args;
58
- return this.getApi().publishPortalProduct(productId, preview);
59
- }
60
- async getPortalProductSections(args) {
61
- const { productId, ...params } = args;
62
- return this.getApi().getPortalProductSections(productId, params);
63
- }
64
- async createTableOfContents(args) {
65
- const { sectionId, ...body } = args;
66
- return this.getApi().createTableOfContents(sectionId, body);
67
- }
68
- async getTableOfContents(args) {
69
- return this.getApi().getTableOfContents(args);
70
- }
71
- async getDocument(args) {
72
- return this.getApi().getDocument(args);
73
- }
74
- async updateDocument(args) {
75
- return this.getApi().updateDocument(args);
76
- }
77
- async deleteTableOfContents(args) {
78
- return this.getApi().deleteTableOfContents(args);
79
- }
80
- // Registry API methods for SwaggerHub Design functionality
81
- async searchApis(args = {}) {
82
- return this.getApi().searchApis(args);
83
- }
84
- async getApiDefinition(args) {
85
- return this.getApi().getApiDefinition(args);
86
- }
87
- async createOrUpdateApi(args) {
88
- return this.getApi().createOrUpdateApi(args);
89
- }
90
- async createApiFromTemplate(args) {
91
- return this.getApi().createApiFromTemplate(args);
92
- }
93
- // User Management API methods
94
- async getOrganizations(args) {
95
- return this.getApi().getOrganizations(args);
96
- }
97
- async createApiFromPrompt(args) {
98
- return this.getApi().createApiFromPrompt(args);
99
- }
100
- async scanStandardization(args) {
101
- return this.getApi().scanStandardization(args);
102
- }
103
- async standardizeApi(args) {
104
- return this.getApi().standardizeApi(args);
105
- }
106
- registerTools(register, _getInput) {
107
- TOOLS.forEach((tool) => {
108
- const { handler, formatResponse, ...toolParams } = tool;
109
- register(toolParams, async (args, _extra) => {
110
- try {
111
- // Dynamic method invocation
112
- const handlerFn = this[handler];
113
- if (typeof handlerFn !== "function") {
114
- throw new Error(`Handler '${handler}' not found on SwaggerClient`);
115
- }
116
- const result = await handlerFn.call(this, args);
117
- // Use custom formatter if available, otherwise return JSON
118
- const formattedResult = formatResponse
119
- ? formatResponse(result)
120
- : result;
121
- const responseText = typeof formattedResult === "string"
122
- ? formattedResult
123
- : JSON.stringify(formattedResult);
124
- return {
125
- content: [{ type: "text", text: responseText }],
126
- };
127
- }
128
- catch (error) {
129
- return {
130
- content: [
131
- {
132
- type: "text",
133
- text: `Error: ${error instanceof Error ? error.message : String(error)}`,
134
- },
135
- ],
136
- };
137
- }
138
- });
139
- });
140
- }
16
+ class SwaggerClient {
17
+ api;
18
+ name = "Swagger";
19
+ toolPrefix = "swagger";
20
+ configPrefix = "Swagger";
21
+ config = ConfigurationSchema;
22
+ async configure(_server, config, _cache) {
23
+ this.api = new SwaggerAPI(
24
+ new SwaggerConfiguration({
25
+ token: config.api_key,
26
+ portalBasePath: config.portal_base_path,
27
+ registryBasePath: config.registry_base_path,
28
+ uiBasePath: config.ui_base_path
29
+ }),
30
+ `${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`
31
+ );
32
+ }
33
+ isConfigured() {
34
+ return this.api !== void 0;
35
+ }
36
+ getApi() {
37
+ if (!this.api) throw new Error("Client not configured");
38
+ return this.api;
39
+ }
40
+ // Delegate API methods to the SwaggerAPI instance
41
+ async getPortals() {
42
+ return this.getApi().getPortals();
43
+ }
44
+ async createPortal(body) {
45
+ return this.getApi().createPortal(body);
46
+ }
47
+ async getPortal(args) {
48
+ return this.getApi().getPortal(args.portalId);
49
+ }
50
+ async updatePortal(args) {
51
+ const { portalId, ...body } = args;
52
+ return this.getApi().updatePortal(portalId, body);
53
+ }
54
+ async getPortalProducts(args) {
55
+ return this.getApi().getPortalProducts(args.portalId);
56
+ }
57
+ async createPortalProduct(args) {
58
+ const { portalId, ...body } = args;
59
+ return this.getApi().createPortalProduct(portalId, body);
60
+ }
61
+ async getPortalProduct(args) {
62
+ return this.getApi().getPortalProduct(args.productId);
63
+ }
64
+ async deletePortalProduct(args) {
65
+ return this.getApi().deletePortalProduct(args.productId);
66
+ }
67
+ async updatePortalProduct(args) {
68
+ const { productId, ...body } = args;
69
+ return this.getApi().updatePortalProduct(productId, body);
70
+ }
71
+ async publishPortalProduct(args) {
72
+ const { productId, preview } = args;
73
+ return this.getApi().publishPortalProduct(productId, preview);
74
+ }
75
+ async getPortalProductSections(args) {
76
+ const { productId, ...params } = args;
77
+ return this.getApi().getPortalProductSections(productId, params);
78
+ }
79
+ async createTableOfContents(args) {
80
+ const { sectionId, ...body } = args;
81
+ return this.getApi().createTableOfContents(sectionId, body);
82
+ }
83
+ async getTableOfContents(args) {
84
+ return this.getApi().getTableOfContents(args);
85
+ }
86
+ async getDocument(args) {
87
+ return this.getApi().getDocument(args);
88
+ }
89
+ async updateDocument(args) {
90
+ return this.getApi().updateDocument(args);
91
+ }
92
+ async deleteTableOfContents(args) {
93
+ return this.getApi().deleteTableOfContents(args);
94
+ }
95
+ // Registry API methods for SwaggerHub Design functionality
96
+ async searchApis(args = {}) {
97
+ return this.getApi().searchApis(args);
98
+ }
99
+ async getApiDefinition(args) {
100
+ return this.getApi().getApiDefinition(args);
101
+ }
102
+ async createOrUpdateApi(args) {
103
+ return this.getApi().createOrUpdateApi(args);
104
+ }
105
+ // User Management API methods
106
+ async getOrganizations(args) {
107
+ return this.getApi().getOrganizations(args);
108
+ }
109
+ async createApiFromPrompt(args) {
110
+ return this.getApi().createApiFromPrompt(args);
111
+ }
112
+ async scanStandardization(args) {
113
+ return this.getApi().scanStandardization(args);
114
+ }
115
+ async standardizeApi(args) {
116
+ return this.getApi().standardizeApi(args);
117
+ }
118
+ async registerTools(register, _getInput) {
119
+ TOOLS.forEach((tool) => {
120
+ const { handler, formatResponse, ...toolParams } = tool;
121
+ register(toolParams, async (args, _extra) => {
122
+ try {
123
+ const handlerFn = this[handler];
124
+ if (typeof handlerFn !== "function") {
125
+ throw new Error(`Handler '${handler}' not found on SwaggerClient`);
126
+ }
127
+ const result = await handlerFn.call(this, args);
128
+ const formattedResult = formatResponse ? formatResponse(result) : result;
129
+ const responseText = typeof formattedResult === "string" ? formattedResult : JSON.stringify(formattedResult);
130
+ return {
131
+ content: [{ type: "text", text: responseText }]
132
+ };
133
+ } catch (error) {
134
+ return {
135
+ content: [
136
+ {
137
+ type: "text",
138
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
139
+ }
140
+ ]
141
+ };
142
+ }
143
+ });
144
+ });
145
+ }
141
146
  }
147
+ export {
148
+ SwaggerClient
149
+ };
@@ -1,18 +1,12 @@
1
- /**
2
- * Configuration utilities for Swagger client
3
- * Handles backward compatibility with legacy environment variables
4
- */
5
- /**
6
- * Apply API_HUB_API_KEY fallback to SWAGGER_API_KEY if needed
7
- * This modifies process.env to enable backward compatibility
8
- * @deprecated API_HUB_API_KEY support - TODO: Remove after migration period (May 2026)
9
- */
10
- export function applySwaggerApiKeyFallback() {
11
- // If SWAGGER_API_KEY is not set but API_HUB_API_KEY is, use the legacy variable
12
- if (!process.env.SWAGGER_API_KEY && process.env.API_HUB_API_KEY) {
13
- console.warn("[Swagger] API_HUB_API_KEY is deprecated. Please use SWAGGER_API_KEY instead.");
14
- process.env.SWAGGER_API_KEY = process.env.API_HUB_API_KEY;
15
- }
1
+ function applySwaggerApiKeyFallback() {
2
+ if (!process.env.SWAGGER_API_KEY && process.env.API_HUB_API_KEY) {
3
+ console.warn(
4
+ "[Swagger] API_HUB_API_KEY is deprecated. Please use SWAGGER_API_KEY instead."
5
+ );
6
+ process.env.SWAGGER_API_KEY = process.env.API_HUB_API_KEY;
7
+ }
16
8
  }
17
- // Apply the fallback immediately when this module is imported
18
9
  applySwaggerApiKeyFallback();
10
+ export {
11
+ applySwaggerApiKeyFallback
12
+ };
@@ -1,4 +1,4 @@
1
- import z from "zod";
1
+ import zod__default from "zod";
2
2
  import { ApiClient } from "./common/api-client.js";
3
3
  import { GetEnvironments } from "./tool/environment/get-environments.js";
4
4
  import { GetPriorities } from "./tool/priority/get-priorities.js";
@@ -12,47 +12,48 @@ import { GetTestCycles } from "./tool/test-cycle/get-test-cycles.js";
12
12
  import { GetTestExecution } from "./tool/test-execution/get-test-execution.js";
13
13
  import { GetTestExecutions } from "./tool/test-execution/get-test-executions.js";
14
14
  const BASE_URL_DEFAULT = "https://api.zephyrscale.smartbear.com/v2";
15
- const ConfigurationSchema = z.object({
16
- api_token: z.string().describe("Zephyr Scale API token for authentication"),
17
- base_url: z
18
- .string()
19
- .url()
20
- .optional()
21
- .describe("Zephyr Scale API base URL")
22
- .default(BASE_URL_DEFAULT),
15
+ const ConfigurationSchema = zod__default.object({
16
+ api_token: zod__default.string().describe("Zephyr Scale API token for authentication"),
17
+ base_url: zod__default.string().url().optional().describe("Zephyr Scale API base URL").default(BASE_URL_DEFAULT)
23
18
  });
24
- export class ZephyrClient {
25
- apiClient;
26
- name = "Zephyr";
27
- toolPrefix = "zephyr";
28
- configPrefix = "Zephyr";
29
- config = ConfigurationSchema;
30
- async configure(_server, config, _cache) {
31
- this.apiClient = new ApiClient(config.api_token, config.base_url || BASE_URL_DEFAULT);
32
- return true;
33
- }
34
- getApiClient() {
35
- if (!this.apiClient)
36
- throw new Error("Client not configured");
37
- return this.apiClient;
38
- }
39
- registerTools(register, _getInput) {
40
- const apiClient = this.getApiClient();
41
- const tools = [
42
- new GetProjects(apiClient),
43
- new GetProject(apiClient),
44
- new GetTestCycles(apiClient),
45
- new GetTestCycle(apiClient),
46
- new GetPriorities(apiClient),
47
- new GetStatuses(apiClient),
48
- new GetTestCases(apiClient),
49
- new GetEnvironments(apiClient),
50
- new GetTestCase(apiClient),
51
- new GetTestExecution(apiClient),
52
- new GetTestExecutions(apiClient),
53
- ];
54
- for (const tool of tools) {
55
- register(tool.specification, tool.handle);
56
- }
19
+ class ZephyrClient {
20
+ apiClient;
21
+ name = "Zephyr";
22
+ toolPrefix = "zephyr";
23
+ configPrefix = "Zephyr";
24
+ config = ConfigurationSchema;
25
+ async configure(_server, config, _cache) {
26
+ this.apiClient = new ApiClient(
27
+ config.api_token,
28
+ config.base_url || BASE_URL_DEFAULT
29
+ );
30
+ }
31
+ isConfigured() {
32
+ return this.apiClient !== void 0;
33
+ }
34
+ getApiClient() {
35
+ if (!this.apiClient) throw new Error("Client not configured");
36
+ return this.apiClient;
37
+ }
38
+ async registerTools(register, _getInput) {
39
+ const tools = [
40
+ new GetProjects(this),
41
+ new GetProject(this),
42
+ new GetTestCycles(this),
43
+ new GetTestCycle(this),
44
+ new GetPriorities(this),
45
+ new GetStatuses(this),
46
+ new GetTestCases(this),
47
+ new GetEnvironments(this),
48
+ new GetTestCase(this),
49
+ new GetTestExecution(this),
50
+ new GetTestExecutions(this)
51
+ ];
52
+ for (const tool of tools) {
53
+ register(tool.specification, tool.handle);
57
54
  }
55
+ }
58
56
  }
57
+ export {
58
+ ZephyrClient
59
+ };
@@ -1,35 +1,40 @@
1
- import { ToolError } from "../../common/types.js";
1
+ import { ToolError } from "../../common/tools.js";
2
2
  import { AuthService } from "./auth-service.js";
3
- export class ApiClient {
4
- baseUrl;
5
- defaultHeaders;
6
- constructor(bearerToken, baseUrl) {
7
- this.baseUrl = baseUrl.trim().replace(/\/$/, "");
8
- this.defaultHeaders = new AuthService(bearerToken).getAuthHeaders();
9
- }
10
- getUrl(endpoint, params) {
11
- const url = new URL(this.baseUrl + endpoint);
12
- if (params) {
13
- Object.entries(params).forEach(([key, value]) => {
14
- if (value !== undefined) {
15
- url.searchParams.append(key, String(value));
16
- }
17
- });
3
+ class ApiClient {
4
+ baseUrl;
5
+ defaultHeaders;
6
+ constructor(bearerToken, baseUrl) {
7
+ this.baseUrl = baseUrl.trim().replace(/\/$/, "");
8
+ this.defaultHeaders = new AuthService(bearerToken).getAuthHeaders();
9
+ }
10
+ getUrl(endpoint, params) {
11
+ const url = new URL(this.baseUrl + endpoint);
12
+ if (params) {
13
+ Object.entries(params).forEach(([key, value]) => {
14
+ if (value !== void 0) {
15
+ url.searchParams.append(key, String(value));
18
16
  }
19
- return url.toString();
20
- }
21
- async get(endpoint, params) {
22
- const response = await fetch(this.getUrl(endpoint, params), {
23
- method: "GET",
24
- headers: this.defaultHeaders,
25
- });
26
- return await this.validateAndGetResponseBody(response);
17
+ });
27
18
  }
28
- async validateAndGetResponseBody(response) {
29
- if (!response.ok) {
30
- const errorText = await response.text();
31
- throw new ToolError(`Request failed with status ${response.status}: ${errorText}`);
32
- }
33
- return response.json();
19
+ return url.toString();
20
+ }
21
+ async get(endpoint, params) {
22
+ const response = await fetch(this.getUrl(endpoint, params), {
23
+ method: "GET",
24
+ headers: this.defaultHeaders
25
+ });
26
+ return await this.validateAndGetResponseBody(response);
27
+ }
28
+ async validateAndGetResponseBody(response) {
29
+ if (!response.ok) {
30
+ const errorText = await response.text();
31
+ throw new ToolError(
32
+ `Request failed with status ${response.status}: ${errorText}`
33
+ );
34
34
  }
35
+ return response.json();
36
+ }
35
37
  }
38
+ export {
39
+ ApiClient
40
+ };
@@ -1,15 +1,18 @@
1
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
- "zscale-source": "smartbear-mcp",
13
- };
14
- }
2
+ 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
+ "zscale-source": "smartbear-mcp"
13
+ };
14
+ }
15
15
  }
16
+ export {
17
+ AuthService
18
+ };