@smartbear/mcp 0.24.0 → 0.25.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.
- package/dist/bearq/client.js +12 -13
- package/dist/bearq/tool/tasks/chat-with-qa-lead.js +1 -0
- package/dist/bearq/tool/tasks/expand-application-model.js +1 -0
- package/dist/bearq/tool/tasks/get-task-status.js +1 -0
- package/dist/bearq/tool/tasks/get-task.js +1 -0
- package/dist/bearq/tool/tasks/refine-all-draft-tests.js +1 -0
- package/dist/bearq/tool/tasks/refine-test-cases.js +1 -0
- package/dist/bearq/tool/tasks/refine-tests-in-functional-areas.js +1 -0
- package/dist/bearq/tool/tasks/run-regression-tests.js +1 -0
- package/dist/bearq/tool/tasks/run-test-cases.js +1 -0
- package/dist/bearq/tool/tasks/run-tests-in-functional-areas.js +1 -0
- package/dist/bearq/tool/tasks/stop-task.js +1 -0
- package/dist/bearq/tool/tasks/wait-for-task.js +1 -0
- package/dist/bugsnag/client.js +24 -44
- package/dist/bugsnag/tool/error/get-error.js +1 -0
- package/dist/bugsnag/tool/error/list-project-errors.js +1 -0
- package/dist/bugsnag/tool/error/update-error.js +1 -0
- package/dist/bugsnag/tool/event/get-event-details-from-dashboard-url.js +1 -0
- package/dist/bugsnag/tool/event/get-event.js +1 -0
- package/dist/bugsnag/tool/event/list-error-events.js +1 -0
- package/dist/bugsnag/tool/performance/get-network-endpoint-groupings.js +1 -0
- package/dist/bugsnag/tool/performance/get-span-group.js +1 -0
- package/dist/bugsnag/tool/performance/get-trace.js +1 -0
- package/dist/bugsnag/tool/performance/list-span-groups.js +1 -0
- package/dist/bugsnag/tool/performance/list-spans.js +1 -0
- package/dist/bugsnag/tool/performance/list-trace-fields.js +1 -0
- package/dist/bugsnag/tool/performance/set-network-endpoint-groupings.js +1 -0
- package/dist/bugsnag/tool/project/get-current-project.js +1 -0
- package/dist/bugsnag/tool/project/list-project-event-filters.js +1 -0
- package/dist/bugsnag/tool/project/list-projects.js +1 -0
- package/dist/bugsnag/tool/release/get-build.js +1 -0
- package/dist/bugsnag/tool/release/get-release.js +1 -0
- package/dist/bugsnag/tool/release/list-releases.js +1 -0
- package/dist/collaborator/client.js +24 -19
- package/dist/common/client-registry.js +63 -29
- package/dist/common/server.js +57 -1
- package/dist/common/transport-http.js +90 -69
- package/dist/common/transport-stdio.js +29 -24
- package/dist/package.json.js +1 -1
- package/dist/pactflow/client/tools.js +102 -0
- package/dist/pactflow/client.js +30 -43
- package/dist/qmetry/client/tools/automation-tools.js +2 -0
- package/dist/qmetry/client/tools/issue-tools.js +6 -0
- package/dist/qmetry/client/tools/project-tools.js +9 -0
- package/dist/qmetry/client/tools/requirement-tools.js +5 -0
- package/dist/qmetry/client/tools/testcase-tools.js +7 -0
- package/dist/qmetry/client/tools/testsuite-tools.js +11 -0
- package/dist/qmetry/client.js +20 -18
- package/dist/qtm4j/client.js +42 -32
- package/dist/qtm4j/config/constants.js +101 -1
- package/dist/qtm4j/config/field-resolution.types.js +3 -1
- package/dist/qtm4j/http/api-client.js +20 -2
- package/dist/qtm4j/resolver/resolver-registry.js +7 -1
- package/dist/qtm4j/resolver/resolvers/requirement-id-resolver.js +28 -0
- package/dist/qtm4j/resolver/resolvers/test-cycle-uid-resolver.js +28 -0
- package/dist/qtm4j/schema/linked-items.schema.js +95 -0
- package/dist/qtm4j/schema/requirements.schema.js +109 -0
- package/dist/qtm4j/schema/test-cycle.link.schema.js +260 -0
- package/dist/qtm4j/tool/project/get-projects.js +2 -1
- package/dist/qtm4j/tool/project/set-project-context.js +2 -1
- package/dist/qtm4j/tool/requirement/get-linked-testcases.js +93 -0
- package/dist/qtm4j/tool/requirement/link-testcases.js +107 -0
- package/dist/qtm4j/tool/requirement/unlink-testcases.js +97 -0
- package/dist/qtm4j/tool/test-automation/get-automation-history.js +2 -1
- package/dist/qtm4j/tool/test-automation/upload-automation-result.js +2 -1
- package/dist/qtm4j/tool/test-case/create-test-case.js +2 -1
- package/dist/qtm4j/tool/test-case/get-linked-requirements.js +67 -0
- package/dist/qtm4j/tool/test-case/get-test-cases.js +2 -1
- package/dist/qtm4j/tool/test-case/get-test-steps.js +2 -1
- package/dist/qtm4j/tool/test-case/link-requirements.js +124 -0
- package/dist/qtm4j/tool/test-case/unlink-requirements.js +116 -0
- package/dist/qtm4j/tool/test-case/update-test-case.js +2 -1
- package/dist/qtm4j/tool/test-cycle/create-test-cycle.js +2 -1
- package/dist/qtm4j/tool/test-cycle/get-linked-requirements.js +71 -0
- package/dist/qtm4j/tool/test-cycle/link-requirements.js +91 -0
- package/dist/qtm4j/tool/test-cycle/link-testcases.js +118 -0
- package/dist/qtm4j/tool/test-cycle/search-linked-testcases.js +114 -0
- package/dist/qtm4j/tool/test-cycle/search-test-cycle.js +2 -1
- package/dist/qtm4j/tool/test-cycle/unlink-requirements.js +87 -0
- package/dist/qtm4j/tool/test-cycle/unlink-testcases.js +103 -0
- package/dist/qtm4j/tool/test-cycle/update-test-cycle.js +2 -1
- package/dist/reflect/client.js +15 -24
- package/dist/reflect/config/constants.js +0 -2
- package/dist/reflect/tool/recording/add-prompt-step.js +1 -0
- package/dist/reflect/tool/recording/add-segment.js +1 -0
- package/dist/reflect/tool/recording/connect-to-session.js +1 -0
- package/dist/reflect/tool/recording/delete-previous-step.js +1 -0
- package/dist/reflect/tool/recording/get-screenshot.js +1 -0
- package/dist/reflect/tool/suites/cancel-suite-execution.js +1 -0
- package/dist/reflect/tool/suites/execute-suite.js +1 -0
- package/dist/reflect/tool/suites/get-suite-execution-status.js +1 -0
- package/dist/reflect/tool/suites/list-suite-executions.js +1 -0
- package/dist/reflect/tool/suites/list-suites.js +1 -0
- package/dist/reflect/tool/tests/get-test-status.js +1 -0
- package/dist/reflect/tool/tests/list-segments.js +1 -0
- package/dist/reflect/tool/tests/list-tests.js +1 -0
- package/dist/reflect/tool/tests/run-test.js +1 -0
- package/dist/swagger/client/tools.js +23 -0
- package/dist/swagger/client.js +25 -28
- package/dist/zephyr/client.js +14 -21
- package/dist/zephyr/tool/environment/get-environments.js +1 -0
- package/dist/zephyr/tool/folder/create-folder.js +1 -0
- package/dist/zephyr/tool/issue-link/get-test-cases.js +1 -0
- package/dist/zephyr/tool/issue-link/get-test-cycles.js +1 -0
- package/dist/zephyr/tool/issue-link/get-test-executions.js +1 -0
- package/dist/zephyr/tool/priority/get-priorities.js +1 -0
- package/dist/zephyr/tool/project/get-project.js +1 -0
- package/dist/zephyr/tool/project/get-projects.js +1 -0
- package/dist/zephyr/tool/status/get-statuses.js +1 -0
- package/dist/zephyr/tool/test-case/create-issue-link.js +1 -0
- package/dist/zephyr/tool/test-case/create-test-case.js +1 -0
- package/dist/zephyr/tool/test-case/create-test-script.js +1 -0
- package/dist/zephyr/tool/test-case/create-test-steps.js +1 -0
- package/dist/zephyr/tool/test-case/create-web-link.js +1 -0
- package/dist/zephyr/tool/test-case/get-links.js +1 -0
- package/dist/zephyr/tool/test-case/get-test-case.js +1 -0
- package/dist/zephyr/tool/test-case/get-test-cases.js +1 -0
- package/dist/zephyr/tool/test-case/get-test-script.js +1 -0
- package/dist/zephyr/tool/test-case/get-test-steps.js +1 -0
- package/dist/zephyr/tool/test-case/update-test-case.js +1 -0
- package/dist/zephyr/tool/test-cycle/create-issue-link.js +1 -0
- package/dist/zephyr/tool/test-cycle/create-test-cycle.js +1 -0
- package/dist/zephyr/tool/test-cycle/create-web-link.js +1 -0
- package/dist/zephyr/tool/test-cycle/get-links.js +1 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycle.js +1 -0
- package/dist/zephyr/tool/test-cycle/get-test-cycles.js +1 -0
- package/dist/zephyr/tool/test-cycle/update-test-cycle.js +1 -0
- package/dist/zephyr/tool/test-execution/create-issue-link.js +1 -0
- package/dist/zephyr/tool/test-execution/create-test-execution.js +1 -0
- package/dist/zephyr/tool/test-execution/get-test-execution-links.js +1 -0
- package/dist/zephyr/tool/test-execution/get-test-execution.js +1 -0
- package/dist/zephyr/tool/test-execution/get-test-executions.js +1 -0
- package/dist/zephyr/tool/test-execution/get-test-steps.js +1 -0
- package/dist/zephyr/tool/test-execution/update-test-execution.js +1 -0
- package/dist/zephyr/tool/test-execution/update-test-steps.js +1 -0
- package/package.json +1 -1
- package/dist/common/request-context.js +0 -20
|
@@ -4,47 +4,55 @@ import { OrganizationsQuerySchema } from "./user-management-types.js";
|
|
|
4
4
|
const TOOLS = [
|
|
5
5
|
{
|
|
6
6
|
title: "List Portals",
|
|
7
|
+
toolset: "Portals",
|
|
7
8
|
summary: "Search for available portals within Swagger. Only portals where you have at least a designer role, either at the product level or organization level, are returned.",
|
|
8
9
|
handler: "getPortals"
|
|
9
10
|
},
|
|
10
11
|
{
|
|
11
12
|
title: "Create Portal",
|
|
13
|
+
toolset: "Portals",
|
|
12
14
|
summary: "Create a new portal within Swagger.",
|
|
13
15
|
inputSchema: CreatePortalArgsSchema,
|
|
14
16
|
handler: "createPortal"
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
title: "Get Portal",
|
|
20
|
+
toolset: "Portals",
|
|
18
21
|
summary: "Retrieve information about a specific portal.",
|
|
19
22
|
inputSchema: PortalArgsSchema,
|
|
20
23
|
handler: "getPortal"
|
|
21
24
|
},
|
|
22
25
|
{
|
|
23
26
|
title: "Update Portal",
|
|
27
|
+
toolset: "Portals",
|
|
24
28
|
summary: "Update a specific portal's configuration.",
|
|
25
29
|
inputSchema: UpdatePortalArgsSchema,
|
|
26
30
|
handler: "updatePortal"
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
33
|
title: "List Portal Products",
|
|
34
|
+
toolset: "Products",
|
|
30
35
|
summary: "Get products for a specific portal that match your criteria.",
|
|
31
36
|
inputSchema: PortalArgsSchema,
|
|
32
37
|
handler: "getPortalProducts"
|
|
33
38
|
},
|
|
34
39
|
{
|
|
35
40
|
title: "Create Portal Product",
|
|
41
|
+
toolset: "Products",
|
|
36
42
|
summary: "Create a new product for a specific portal.",
|
|
37
43
|
inputSchema: CreateProductArgsSchema,
|
|
38
44
|
handler: "createPortalProduct"
|
|
39
45
|
},
|
|
40
46
|
{
|
|
41
47
|
title: "Get Portal Product",
|
|
48
|
+
toolset: "Products",
|
|
42
49
|
summary: "Retrieve information about a specific product resource.",
|
|
43
50
|
inputSchema: ProductArgsSchema,
|
|
44
51
|
handler: "getPortalProduct"
|
|
45
52
|
},
|
|
46
53
|
{
|
|
47
54
|
title: "Delete Portal Product",
|
|
55
|
+
toolset: "Products",
|
|
48
56
|
summary: "Delete a product from a specific portal",
|
|
49
57
|
inputSchema: ProductArgsSchema,
|
|
50
58
|
handler: "deletePortalProduct",
|
|
@@ -52,36 +60,42 @@ const TOOLS = [
|
|
|
52
60
|
},
|
|
53
61
|
{
|
|
54
62
|
title: "Update Portal Product",
|
|
63
|
+
toolset: "Products",
|
|
55
64
|
summary: "Update a product's settings within a specific portal.",
|
|
56
65
|
inputSchema: UpdateProductArgsSchema,
|
|
57
66
|
handler: "updatePortalProduct"
|
|
58
67
|
},
|
|
59
68
|
{
|
|
60
69
|
title: "Publish Portal Product",
|
|
70
|
+
toolset: "Products",
|
|
61
71
|
summary: "Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live.",
|
|
62
72
|
inputSchema: PublishProductArgsSchema,
|
|
63
73
|
handler: "publishPortalProduct"
|
|
64
74
|
},
|
|
65
75
|
{
|
|
66
76
|
title: "List Portal Product Sections",
|
|
77
|
+
toolset: "Sections",
|
|
67
78
|
summary: "Get sections for a specific product within a portal.",
|
|
68
79
|
inputSchema: GetProductSectionsArgsSchema,
|
|
69
80
|
handler: "getPortalProductSections"
|
|
70
81
|
},
|
|
71
82
|
{
|
|
72
83
|
title: "Create Table Of Contents",
|
|
84
|
+
toolset: "Table Of Contents",
|
|
73
85
|
summary: "Create a new table of contents item in a portal product section. Supports API references, HTML content, and Markdown content types.",
|
|
74
86
|
inputSchema: CreateTableOfContentsArgsSchema,
|
|
75
87
|
handler: "createTableOfContents"
|
|
76
88
|
},
|
|
77
89
|
{
|
|
78
90
|
title: "List Table Of Contents",
|
|
91
|
+
toolset: "Table Of Contents",
|
|
79
92
|
summary: "Get table of contents for a section of a product within a portal.",
|
|
80
93
|
inputSchema: GetTableOfContentsArgsSchema,
|
|
81
94
|
handler: "getTableOfContents"
|
|
82
95
|
},
|
|
83
96
|
{
|
|
84
97
|
title: "Delete Table Of Contents",
|
|
98
|
+
toolset: "Table Of Contents",
|
|
85
99
|
summary: "Delete table of contents entry. Performs a soft-delete of an entry from the table of contents. Supports recursive deletion of nested items.",
|
|
86
100
|
inputSchema: DeleteTableOfContentsArgsSchema,
|
|
87
101
|
handler: "deleteTableOfContents"
|
|
@@ -89,12 +103,14 @@ const TOOLS = [
|
|
|
89
103
|
// Document management tools
|
|
90
104
|
{
|
|
91
105
|
title: "Get Document",
|
|
106
|
+
toolset: "Documents",
|
|
92
107
|
summary: "Get document content and metadata by document ID. Useful for retrieving HTML or Markdown content from table of contents items.",
|
|
93
108
|
inputSchema: GetDocumentArgsSchema,
|
|
94
109
|
handler: "getDocument"
|
|
95
110
|
},
|
|
96
111
|
{
|
|
97
112
|
title: "Update Document",
|
|
113
|
+
toolset: "Documents",
|
|
98
114
|
summary: "Update the content or source of an existing document. Supports both HTML and Markdown content types.",
|
|
99
115
|
inputSchema: UpdateDocumentArgsSchema,
|
|
100
116
|
handler: "updateDocument"
|
|
@@ -102,18 +118,21 @@ const TOOLS = [
|
|
|
102
118
|
// Registry API tools for SwaggerHub Design functionality
|
|
103
119
|
{
|
|
104
120
|
title: "Search APIs and Domains",
|
|
121
|
+
toolset: "Registry API",
|
|
105
122
|
summary: "Search for APIs and Domains in SwaggerHub Registry using the comprehensive /specs endpoint and retrieve metadata including owner, name, description, summary, version, and specification.",
|
|
106
123
|
inputSchema: ApiSearchParamsSchema,
|
|
107
124
|
handler: "searchApis"
|
|
108
125
|
},
|
|
109
126
|
{
|
|
110
127
|
title: "Get API Definition",
|
|
128
|
+
toolset: "Registry API",
|
|
111
129
|
summary: "Fetch resolved API definition from SwaggerHub Registry based on owner, API name, and version.",
|
|
112
130
|
inputSchema: ApiDefinitionParamsSchema,
|
|
113
131
|
handler: "getApiDefinition"
|
|
114
132
|
},
|
|
115
133
|
{
|
|
116
134
|
title: "Create or Update API",
|
|
135
|
+
toolset: "Registry API",
|
|
117
136
|
summary: "Create a new API or update an existing API in SwaggerHub Registry for Swagger Studio. The API specification type (OpenAPI, AsyncAPI) is automatically detected from the definition content. APIs are always created with fixed values: version 1.0.0, private visibility, and automock disabled (these values cannot be changed). Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field indicating whether it was a 'create' or 'update' operation along with API details and SwaggerHub URL.",
|
|
118
137
|
inputSchema: CreateApiParamsSchema,
|
|
119
138
|
handler: "createOrUpdateApi"
|
|
@@ -121,24 +140,28 @@ const TOOLS = [
|
|
|
121
140
|
// User Management API tools for organization management functionality
|
|
122
141
|
{
|
|
123
142
|
title: "List Organizations",
|
|
143
|
+
toolset: "Registry API",
|
|
124
144
|
summary: "Get organizations for a user. Returns a list of organizations that the authenticating user is a member of. On-Premise admin gets a list of all organizations in the system.",
|
|
125
145
|
inputSchema: OrganizationsQuerySchema,
|
|
126
146
|
handler: "getOrganizations"
|
|
127
147
|
},
|
|
128
148
|
{
|
|
129
149
|
title: "Scan API Standardization",
|
|
150
|
+
toolset: "Registry API",
|
|
130
151
|
summary: "Run a standardization scan against an API definition using the organization's governance and standardization rules. Accepts a YAML or JSON OpenAPI/AsyncAPI definition and returns a list of standardization errors and validation issues. Use this tool when users ask to validate, scan, or check API governance or standardization.",
|
|
131
152
|
inputSchema: ScanStandardizationParamsSchema,
|
|
132
153
|
handler: "scanStandardization"
|
|
133
154
|
},
|
|
134
155
|
{
|
|
135
156
|
title: "Create API from Prompt",
|
|
157
|
+
toolset: "Registry API",
|
|
136
158
|
summary: "Generate and save an API definition based on a prompt using SmartBear AI. This tool automatically applies organization governance and standardization rules during API generation. The specType parameter determines the format of the generated definition. Use: 'openapi20' for OpenAPI 2.0, 'openapi30x' for OpenAPI 3.0.x, 'openapi31x' for OpenAPI 3.1.x, 'asyncapi2xx' for AsyncAPI 2.x, 'asyncapi30x' for AsyncAPI 3.0.x. Use this tool when creating APIs that comply with governance policies or when generating APIs from natural language descriptions. Use this tool when users ask to create, generate, or design APIs with governance or standardization requirements. Returns HTTP 201 for creation, HTTP 200 for update. Response includes 'operation' field indicating whether it was a 'create' or 'update' operation along with API details and SwaggerHub URL.",
|
|
137
159
|
inputSchema: CreateApiFromPromptParamsSchema,
|
|
138
160
|
handler: "createApiFromPrompt"
|
|
139
161
|
},
|
|
140
162
|
{
|
|
141
163
|
title: "Standardize API",
|
|
164
|
+
toolset: "Registry API",
|
|
142
165
|
summary: "Standardize and fix an API definition using AI to ensure compliance with governance policies. Scans the API definition for standardization errors and automatically fixes them using SmartBear AI. Optionally provide 'newVersion' (e.g. patch bump '1.0.0' → '1.0.1') to save the fixed definition as a new version — omitting it will overwrite the current version. Returns the number of errors found and the fixed definition if successful. Use this tool when users ask to standardize, fix, govern, or ensure governance compliance of APIs.",
|
|
143
166
|
inputSchema: StandardizeApiParamsSchema,
|
|
144
167
|
handler: "standardizeApi"
|
package/dist/swagger/client.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from "../common/info.js";
|
|
3
|
-
import { getRequestHeader } from "../common/request-context.js";
|
|
4
3
|
import "./config-utils.js";
|
|
5
4
|
import { SwaggerAPI } from "./client/api.js";
|
|
6
5
|
import { SwaggerConfiguration } from "./client/configuration.js";
|
|
@@ -9,47 +8,45 @@ import "./client/registry-types.js";
|
|
|
9
8
|
import { TOOLS } from "./client/tools.js";
|
|
10
9
|
import "./client/user-management-types.js";
|
|
11
10
|
const ConfigurationSchema = z.object({
|
|
12
|
-
api_key: z.string().describe("Swagger API key for authentication"),
|
|
13
11
|
portal_base_path: z.string().optional().describe("Base path for Portal API requests (optional)"),
|
|
14
12
|
registry_base_path: z.string().optional().describe("Base path for Registry API requests (optional)"),
|
|
15
13
|
ui_base_path: z.string().optional().describe("Base URL for the SwaggerHub UI (optional)")
|
|
16
14
|
});
|
|
15
|
+
const AuthenticationSchema = z.object({
|
|
16
|
+
api_key: z.string().describe("Swagger API key for authentication").optional()
|
|
17
|
+
});
|
|
17
18
|
class SwaggerClient {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
apiConfig;
|
|
20
|
+
server;
|
|
20
21
|
name = "Swagger";
|
|
21
22
|
capabilityPrefix = "swagger";
|
|
22
23
|
configPrefix = "Swagger";
|
|
23
24
|
config = ConfigurationSchema;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
authenticationFields = AuthenticationSchema;
|
|
26
|
+
async configure(server, config) {
|
|
27
|
+
this.server = server;
|
|
28
|
+
this.apiConfig = new SwaggerConfiguration({
|
|
29
|
+
token: () => this.getAuthToken(),
|
|
30
|
+
portalBasePath: config.portal_base_path,
|
|
31
|
+
registryBasePath: config.registry_base_path,
|
|
32
|
+
uiBasePath: config.ui_base_path
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
isConfigured() {
|
|
36
|
+
return this.apiConfig !== void 0;
|
|
35
37
|
}
|
|
36
38
|
getAuthToken() {
|
|
37
|
-
|
|
38
|
-
if (contextHeader) {
|
|
39
|
-
let token = Array.isArray(contextHeader) ? contextHeader[0] : contextHeader;
|
|
40
|
-
if (token.startsWith("Bearer ")) {
|
|
41
|
-
token = token.substring(7);
|
|
42
|
-
}
|
|
43
|
-
return token;
|
|
44
|
-
}
|
|
45
|
-
return this._apiKey || null;
|
|
39
|
+
return this.server?.getEnv("api_key", this) || this.server?.getEnv("Authorization") || null;
|
|
46
40
|
}
|
|
47
|
-
|
|
48
|
-
return this.
|
|
41
|
+
hasAuth() {
|
|
42
|
+
return this.isConfigured() && !!this.getAuthToken();
|
|
49
43
|
}
|
|
50
44
|
getApi() {
|
|
51
|
-
if (!this.
|
|
52
|
-
return
|
|
45
|
+
if (!this.apiConfig) throw new Error("Client not configured");
|
|
46
|
+
return new SwaggerAPI(
|
|
47
|
+
this.apiConfig,
|
|
48
|
+
`${MCP_SERVER_NAME}/${MCP_SERVER_VERSION}`
|
|
49
|
+
);
|
|
53
50
|
}
|
|
54
51
|
// Delegate API methods to the SwaggerAPI instance
|
|
55
52
|
async getPortals() {
|
package/dist/zephyr/client.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import zod__default from "zod";
|
|
2
|
-
import { getRequestHeader } from "../common/request-context.js";
|
|
3
2
|
import { ApiClient } from "./common/api-client.js";
|
|
4
3
|
import { GetEnvironments } from "./tool/environment/get-environments.js";
|
|
5
4
|
import { CreateFolder } from "./tool/folder/create-folder.js";
|
|
@@ -36,38 +35,32 @@ import { GetTestExecutions } from "./tool/test-execution/get-test-executions.js"
|
|
|
36
35
|
import { GetTestExecutionSteps } from "./tool/test-execution/get-test-steps.js";
|
|
37
36
|
import { UpdateTestExecution } from "./tool/test-execution/update-test-execution.js";
|
|
38
37
|
import { UpdateTestExecutionSteps } from "./tool/test-execution/update-test-steps.js";
|
|
39
|
-
const BASE_URL_DEFAULT = "https://api.zephyrscale.smartbear.com/v2";
|
|
40
38
|
const ConfigurationSchema = zod__default.object({
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
base_url: zod__default.url().optional().describe("Zephyr Scale API base URL").default("https://api.zephyrscale.smartbear.com/v2")
|
|
40
|
+
});
|
|
41
|
+
const AuthenticationSchema = zod__default.object({
|
|
42
|
+
api_token: zod__default.string().describe("Zephyr Scale API token for authentication").optional()
|
|
43
43
|
});
|
|
44
44
|
class ZephyrClient {
|
|
45
45
|
apiClient;
|
|
46
|
-
|
|
46
|
+
server;
|
|
47
47
|
name = "Zephyr";
|
|
48
48
|
capabilityPrefix = "zephyr";
|
|
49
49
|
configPrefix = "Zephyr";
|
|
50
50
|
config = ConfigurationSchema;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
config.base_url || process.env.ZEPHYR_CUSTOM_BASE_URL || BASE_URL_DEFAULT
|
|
56
|
-
);
|
|
51
|
+
authenticationFields = AuthenticationSchema;
|
|
52
|
+
async configure(server, config) {
|
|
53
|
+
this.server = server;
|
|
54
|
+
this.apiClient = new ApiClient(() => this.getAuthToken(), config.base_url);
|
|
57
55
|
}
|
|
58
56
|
getAuthToken() {
|
|
59
|
-
|
|
60
|
-
if (contextHeader) {
|
|
61
|
-
let token = Array.isArray(contextHeader) ? contextHeader[0] : contextHeader;
|
|
62
|
-
if (token.startsWith("Bearer ")) {
|
|
63
|
-
token = token.substring(7);
|
|
64
|
-
}
|
|
65
|
-
return token;
|
|
66
|
-
}
|
|
67
|
-
return this._apiToken || null;
|
|
57
|
+
return this.server?.getEnv("api_token", this) || this.server?.getEnv("Authorization") || null;
|
|
68
58
|
}
|
|
69
59
|
isConfigured() {
|
|
70
|
-
return this.apiClient
|
|
60
|
+
return !!this.apiClient;
|
|
61
|
+
}
|
|
62
|
+
hasAuth() {
|
|
63
|
+
return this.isConfigured() && !!this.getAuthToken();
|
|
71
64
|
}
|
|
72
65
|
getApiClient() {
|
|
73
66
|
if (!this.apiClient) throw new Error("Client not configured");
|
|
@@ -3,6 +3,7 @@ import { ListEnvironments200Response, ListEnvironmentsQueryParams } from "../../
|
|
|
3
3
|
class GetEnvironments extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Environments",
|
|
6
|
+
toolset: "Environment",
|
|
6
7
|
summary: "Get environments in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { CreateFolder201Response, CreateFolderBody } from "../../common/rest-api
|
|
|
3
3
|
class CreateFolder extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Folder",
|
|
6
|
+
toolset: "Folders",
|
|
6
7
|
summary: "Create a folder called 'Axial Pump Tests' in the project SA for organizing test cases",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { GetIssueLinkTestCases200Response, GetIssueLinkTestCasesParams } from ".
|
|
|
3
3
|
class GetTestCases extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Issue Link Test Cases",
|
|
6
|
+
toolset: "Issue Links",
|
|
6
7
|
summary: "Get test cases linked to a Jira issue in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetIssueLinkTestCycles200Response, GetIssueLinkTestCyclesParams } from
|
|
|
3
3
|
class GetTestCycles extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cycles linked to a Jira issue",
|
|
6
|
+
toolset: "Issue Links",
|
|
6
7
|
summary: "Get test cycles linked to a Jira issue in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetIssueLinkTestExecutions200Response, GetIssueLinkTestExecutionsParams
|
|
|
3
3
|
class GetTestExecutions extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get test executions linked to a Jira issue",
|
|
6
|
+
toolset: "Issue Links",
|
|
6
7
|
summary: "Get test executions linked to a Jira issue in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { ListPriorities200Response, ListPrioritiesQueryParams } from "../../comm
|
|
|
3
3
|
class GetPriorities extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get priorities",
|
|
6
|
+
toolset: "Priorities",
|
|
6
7
|
summary: "Get Zephyr Test Case priorities with optional filters",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetProject200Response, GetProjectParams } from "../../common/rest-api-s
|
|
|
3
3
|
class GetProject extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Project",
|
|
6
|
+
toolset: "Projects",
|
|
6
7
|
summary: "Get details of project specified by id or key in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { ListStatuses200Response, ListStatusesQueryParams } from "../../common/r
|
|
|
3
3
|
class GetStatuses extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Statuses",
|
|
6
|
+
toolset: "Statuses",
|
|
6
7
|
summary: "Get statuses of different types of test artifacts in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCaseIssueLink201Response, CreateTestCaseIssueLinkParams, Crea
|
|
|
3
3
|
class CreateTestCaseIssueLink extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Case Issue Link",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Create a new link between an issue in Jira and a Test Case in Zephyr",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCase201Response, CreateTestCaseBody } from "../../common/rest
|
|
|
3
3
|
class CreateTestCase extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Case",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Create a new Test Case in Zephyr specified project",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCaseTestScript201Response, CreateTestCaseTestScriptParams, Cr
|
|
|
3
3
|
class CreateTestScript extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Script",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Create a new Test Script of the types Plain Text or BDD in a Zephyr Test Case.",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCaseTestSteps201Response, CreateTestCaseTestStepsParams, Crea
|
|
|
3
3
|
class CreateTestSteps extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Case Steps",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Create steps for a Test Case in Zephyr. Supports inline step definitions or delegating execution to another test case (also known as 'call to test' via UI). Requires a mode: `APPEND` adds steps to the end of the existing list, `OVERWRITE` deletes all existing steps and replaces them with the provided ones. Always ask the user to choose between OVERWRITE or APPEND before calling this tool.",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
destructive: true,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCaseWebLink201Response, CreateTestCaseWebLinkBody, CreateTest
|
|
|
3
3
|
class CreateTestCaseWebLink extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Case Web Link",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Create a new Web Link for a Test Case in Zephyr",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { GetTestCaseLinks200Response, GetTestCaseLinksParams } from "../../commo
|
|
|
3
3
|
class GetTestCaseLinks extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Case Links",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Get all links (issue links and web links) associated with a test case in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetTestCase200Response, GetTestCaseParams } from "../../common/rest-api
|
|
|
3
3
|
class GetTestCase extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Case",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Get details of test case specified by key in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { ListTestCasesCursorPaginated200Response, ListTestCasesCursorPaginatedQu
|
|
|
3
3
|
class GetTestCases extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cases",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Get details of test cases in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetTestCaseTestScript200Response, GetTestCaseTestScriptParams } from ".
|
|
|
3
3
|
class GetTestScript extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Script",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Get the Test Script (Plain Text or BDD) for a given Test Case in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetTestCaseTestSteps200Response, GetTestCaseTestStepsParams, GetTestCas
|
|
|
3
3
|
class GetTestCaseSteps extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Case Steps",
|
|
6
|
+
toolset: "Test Cases",
|
|
6
7
|
summary: "Get details of test case steps in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -4,6 +4,7 @@ import { deepMerge } from "../../common/utils.js";
|
|
|
4
4
|
class UpdateTestCase extends Tool {
|
|
5
5
|
specification = {
|
|
6
6
|
title: "Update Test Case",
|
|
7
|
+
toolset: "Test Cases",
|
|
7
8
|
summary: 'Update an existing Test Case in Zephyr. This operation fetches the current test case and merges your updates with it to prevent accidental property deletion. Properties which are not included in the tool call will be left unchanged. To remove a property, set it to null explicitly. For fields that accept multiple values, such as `labels`, if the field is provided, it will override the previous values. For example, if `labels` is provided with the values `["label1", "label2"]`, the Test Case will now only have those two labels, and any previous labels will be removed. If you want to add a label, you would need to specify in the prompt the intention to add a label.',
|
|
8
9
|
readOnly: false,
|
|
9
10
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCycleIssueLinkParams, CreateTestCycleIssueLinkBody } from "..
|
|
|
3
3
|
class CreateTestCycleIssueLink extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Cycle Issue Link",
|
|
6
|
+
toolset: "Test Cycles",
|
|
6
7
|
summary: "Create a new link between an issue in Jira and a Test Cycle in Zephyr",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCycle201Response, CreateTestCycleBody } from "../../common/re
|
|
|
3
3
|
class CreateTestCycle extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Cycle",
|
|
6
|
+
toolset: "Test Cycles",
|
|
6
7
|
summary: "Create a new Test Cycle in Zephyr specified project",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { CreateTestCycleWebLinkParams, CreateTestCycleWebLinkBody } from "../../
|
|
|
3
3
|
class CreateTestCycleWebLink extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Cycle Web Link",
|
|
6
|
+
toolset: "Test Cycles",
|
|
6
7
|
summary: "Create a new Web Link for a Test Cycle in Zephyr",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { GetTestCycleLinks200Response, GetTestCycleLinksParams } from "../../com
|
|
|
3
3
|
class GetTestCycleLinks extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cycle Links",
|
|
6
|
+
toolset: "Test Cycles",
|
|
6
7
|
summary: "Get all links (issues, web links, and test plans) associated with a test cycle in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetTestCycle200Response, GetTestCycleParams } from "../../common/rest-a
|
|
|
3
3
|
class GetTestCycle extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cycle",
|
|
6
|
+
toolset: "Test Cycles",
|
|
6
7
|
summary: "Get details of test cycle specified by id or key in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { ListTestCycles200Response, ListTestCyclesQueryParams } from "../../comm
|
|
|
3
3
|
class GetTestCycles extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Cycles",
|
|
6
|
+
toolset: "Test Cycles",
|
|
6
7
|
summary: "Get details of Test Cycles in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -4,6 +4,7 @@ import { deepMerge } from "../../common/utils.js";
|
|
|
4
4
|
class UpdateTestCycle extends Tool {
|
|
5
5
|
specification = {
|
|
6
6
|
title: "Update Test Cycle",
|
|
7
|
+
toolset: "Test Cycles",
|
|
7
8
|
summary: "Update an existing Test Cycle in Zephyr. This operation fetches the current test cycle and merges your updates with it to prevent accidental property deletion. To remove a property, set it to null explicitly. The plannedStartDate and plannedEndDate fields cannot be cleared",
|
|
8
9
|
readOnly: false,
|
|
9
10
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { CreateTestExecutionIssueLinkParams, CreateTestExecutionIssueLinkBody }
|
|
|
3
3
|
class CreateTestExecutionIssueLink extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Execution Issue Link",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Create a new link between a Jira issue and a Test Execution in Zephyr",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { CreateTestExecution201Response, CreateTestExecutionBody } from "../../c
|
|
|
3
3
|
class CreateTestExecution extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Create Test Execution",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Create a new Test Execution for a Test Case within a specific Test Cycle",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: false,
|
|
@@ -3,6 +3,7 @@ import { ListTestExecutionLinks200Response, ListTestExecutionLinksParams } from
|
|
|
3
3
|
class GetTestExecutionLinks extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Execution Links",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Get links for a specific test execution in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetTestExecution200Response, GetTestExecutionParams } from "../../commo
|
|
|
3
3
|
class GetTestExecution extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Execution",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Get details of test execution specified by id or key in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { ListTestExecutionsNextgen200Response, ListTestExecutionsNextgenQueryPar
|
|
|
3
3
|
class GetTestExecutions extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Executions",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Get test executions with optional filters",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { GetTestExecutionTestSteps200Response, GetTestExecutionTestStepsParams,
|
|
|
3
3
|
class GetTestExecutionSteps extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Get Test Execution Steps",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Get details of test execution steps in Zephyr",
|
|
7
8
|
readOnly: true,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { UpdateTestExecutionParams, UpdateTestExecutionBody } from "../../common
|
|
|
3
3
|
class UpdateTestExecution extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Update Test Execution",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Update an existing Test Execution in Zephyr. This operation only updates specified fields in the payload and ignores `null` or `undefined` values.",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: true,
|
|
@@ -3,6 +3,7 @@ import { PutTestExecutionTestStepsParams, PutTestExecutionTestStepsBody } from "
|
|
|
3
3
|
class UpdateTestExecutionSteps extends Tool {
|
|
4
4
|
specification = {
|
|
5
5
|
title: "Update Test Execution Steps",
|
|
6
|
+
toolset: "Test Executions",
|
|
6
7
|
summary: "Update test steps for a given Test Execution in Zephyr. This operation updates the provided steps with their execution status and actual results. Only the fields included in the request will be modified.",
|
|
7
8
|
readOnly: false,
|
|
8
9
|
idempotent: true,
|