@smartbear/mcp 0.35.0 → 0.36.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/README.md +1 -1
- package/dist/bearq/tool/tasks/wait-for-task.js +3 -3
- package/dist/bugsnag/client.js +1 -1
- package/dist/bugsnag/tool/error/get-error.js +1 -1
- package/dist/bugsnag/tool/error/list-project-errors.js +1 -1
- package/dist/bugsnag/tool/error/update-error.js +1 -1
- package/dist/bugsnag/tool/event/get-event-details-from-dashboard-url.js +1 -1
- package/dist/bugsnag/tool/event/get-event.js +1 -1
- package/dist/bugsnag/tool/event/list-error-events.js +1 -1
- package/dist/bugsnag/tool/performance/get-network-endpoint-groupings.js +1 -1
- package/dist/bugsnag/tool/performance/get-span-group.js +1 -1
- package/dist/bugsnag/tool/performance/get-trace.js +1 -1
- package/dist/bugsnag/tool/performance/list-span-groups.js +1 -1
- package/dist/bugsnag/tool/performance/list-spans.js +1 -1
- package/dist/bugsnag/tool/performance/list-trace-fields.js +1 -1
- package/dist/bugsnag/tool/performance/set-network-endpoint-groupings.js +1 -1
- package/dist/bugsnag/tool/project/get-current-project.js +1 -1
- package/dist/bugsnag/tool/project/list-project-event-filters.js +1 -1
- package/dist/bugsnag/tool/project/list-projects.js +1 -1
- package/dist/bugsnag/tool/release/get-build.js +1 -1
- package/dist/bugsnag/tool/release/get-release.js +1 -1
- package/dist/bugsnag/tool/release/list-releases.js +1 -1
- package/dist/collaborator/client.js +10 -10
- package/dist/common/server.js +11 -32
- package/dist/common/transport-http.js +5 -5
- package/dist/common/transport-stdio.js +1 -1
- package/dist/common/zod-utils.js +2 -1
- package/dist/package.json.js +1 -1
- package/dist/pactflow/client/base.js +8 -4
- package/dist/pactflow/client/tools.js +2 -2
- package/dist/pactflow/client.js +4 -4
- package/dist/reflect/tool/recording/connect-to-session.js +2 -2
- package/dist/swagger/client/portal-types.js +1 -1
- package/dist/swagger/client.js +1 -1
- package/dist/zephyr/common/rest-api-schemas.js +3748 -3698
- package/dist/zephyr/tool/test-case/create-issue-link.js +4 -2
- package/dist/zephyr/tool/test-case/create-test-script.js +4 -2
- package/dist/zephyr/tool/test-case/create-test-steps.js +5 -1
- package/dist/zephyr/tool/test-case/get-test-steps.js +4 -2
- package/dist/zephyr/tool/test-case/update-test-case.js +3 -1
- package/dist/zephyr/tool/test-cycle/create-issue-link.js +4 -2
- package/dist/zephyr/tool/test-cycle/create-web-link.js +4 -2
- package/dist/zephyr/tool/test-cycle/update-test-cycle.js +5 -1
- package/dist/zephyr/tool/test-execution/create-issue-link.js +4 -2
- package/dist/zephyr/tool/test-execution/get-test-steps.js +4 -2
- package/dist/zephyr/tool/test-execution/update-test-execution.js +4 -2
- package/dist/zephyr/tool/test-execution/update-test-steps.js +4 -2
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ See the [Remote MCP Servers guide](https://developer.smartbear.com/smartbear-mcp
|
|
|
57
57
|
|
|
58
58
|
## Prerequisites
|
|
59
59
|
|
|
60
|
-
- Node.js
|
|
60
|
+
- Node.js 22+ and npm
|
|
61
61
|
- Access to SmartBear products (BugSnag, Reflect, Swagger, QMetry, QTM4J or Zephyr)
|
|
62
62
|
- Valid API tokens for the products you want to integrate
|
|
63
63
|
|
|
@@ -21,7 +21,7 @@ class WaitForTask extends Tool {
|
|
|
21
21
|
summary: "Blocks until a BearQ task reaches a terminal state (completed / failed / cancelled) or the stream times out, then returns the full ordered sequence of SSE events from the public API (metadata, activityLogEntries, and a terminal done or timeout event) verbatim. Blocks for the lifetime of the task — for a quick check use bearq_get_task_status instead.",
|
|
22
22
|
inputSchema
|
|
23
23
|
};
|
|
24
|
-
handle = async (args,
|
|
24
|
+
handle = async (args, ctx) => {
|
|
25
25
|
const { taskId } = inputSchema.parse(args);
|
|
26
26
|
const url = `${this.client.getBaseUrl()}/tasks/${taskId}/stream`;
|
|
27
27
|
const res = await fetch(url, {
|
|
@@ -33,11 +33,11 @@ class WaitForTask extends Tool {
|
|
|
33
33
|
);
|
|
34
34
|
if (!res.body)
|
|
35
35
|
throw new ToolError(`GET /tasks/${taskId}/stream: no response body`);
|
|
36
|
-
const progressToken =
|
|
36
|
+
const progressToken = ctx?.mcpReq?._meta?.progressToken;
|
|
37
37
|
let progress = 0;
|
|
38
38
|
const notify = async (event, data) => {
|
|
39
39
|
if (progressToken === void 0) return;
|
|
40
|
-
await
|
|
40
|
+
await ctx.mcpReq?.notify({
|
|
41
41
|
method: "notifications/progress",
|
|
42
42
|
params: {
|
|
43
43
|
progressToken,
|
package/dist/bugsnag/client.js
CHANGED
|
@@ -42,7 +42,7 @@ class GetError extends Tool {
|
|
|
42
42
|
"The URL provided in the response points should be shown to the user in all cases as it allows them to view the error in the dashboard and perform further analysis"
|
|
43
43
|
]
|
|
44
44
|
};
|
|
45
|
-
handle = async (args,
|
|
45
|
+
handle = async (args, _ctx) => {
|
|
46
46
|
const params = inputSchema.parse(args);
|
|
47
47
|
const project = await this.client.getInputProject(params.projectId);
|
|
48
48
|
const errorDetails = (await this.client.errorsApi.viewErrorOnProject(project.id, params.errorId)).body;
|
|
@@ -69,7 +69,7 @@ class ListProjectErrors extends Tool {
|
|
|
69
69
|
"Do not modify the next URL as this can cause incorrect results. The only other parameter that can be used with 'next' is 'per_page' to control the page size."
|
|
70
70
|
]
|
|
71
71
|
};
|
|
72
|
-
handle = async (args,
|
|
72
|
+
handle = async (args, _ctx) => {
|
|
73
73
|
const params = inputSchema.parse(args);
|
|
74
74
|
const project = await this.client.getInputProject(params.projectId);
|
|
75
75
|
const filters = {
|
|
@@ -143,7 +143,7 @@ class UpdateError extends Tool {
|
|
|
143
143
|
super(client);
|
|
144
144
|
this.getInput = getInput;
|
|
145
145
|
}
|
|
146
|
-
handle = async (args,
|
|
146
|
+
handle = async (args, _ctx) => {
|
|
147
147
|
const params = inputSchema.parse(args);
|
|
148
148
|
const project = await this.client.getInputProject(params.projectId);
|
|
149
149
|
if (params.operation === "snooze" && !params.reopenRules) {
|
|
@@ -31,7 +31,7 @@ class GetEventDetailsFromDashboardUrl extends Tool {
|
|
|
31
31
|
"This is useful when users share BugSnag dashboard URLs and you need to extract the event data"
|
|
32
32
|
]
|
|
33
33
|
};
|
|
34
|
-
handle = async (args,
|
|
34
|
+
handle = async (args, _ctx) => {
|
|
35
35
|
const params = inputSchema.parse(args);
|
|
36
36
|
const url = new URL(params.link);
|
|
37
37
|
const eventId = url.searchParams.get("event_id");
|
|
@@ -25,7 +25,7 @@ class GetEvent extends Tool {
|
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
};
|
|
28
|
-
handle = async (args,
|
|
28
|
+
handle = async (args, _ctx) => {
|
|
29
29
|
const params = inputSchema.parse(args);
|
|
30
30
|
const project = await this.client.getInputProject(params.projectId);
|
|
31
31
|
const response = await this.client.getEvent(params.eventId, project.id);
|
|
@@ -32,7 +32,7 @@ class ListErrorEvents extends Tool {
|
|
|
32
32
|
}
|
|
33
33
|
]
|
|
34
34
|
};
|
|
35
|
-
handle = async (args,
|
|
35
|
+
handle = async (args, _ctx) => {
|
|
36
36
|
const params = inputSchema.parse(args);
|
|
37
37
|
const project = await this.client.getInputProject(params.projectId);
|
|
38
38
|
const response = await this.client.errorsApi.listErrorEvents(
|
|
@@ -31,7 +31,7 @@ class GetNetworkEndpointGroupings extends Tool {
|
|
|
31
31
|
readOnly: true,
|
|
32
32
|
idempotent: true
|
|
33
33
|
};
|
|
34
|
-
handle = async (args,
|
|
34
|
+
handle = async (args, _ctx) => {
|
|
35
35
|
const params = inputSchema.parse(args);
|
|
36
36
|
const project = await this.client.getInputProject(params.projectId);
|
|
37
37
|
const result = await this.client.projectApi.getProjectNetworkGroupingRuleset(project.id);
|
|
@@ -41,7 +41,7 @@ class GetSpanGroup extends Tool {
|
|
|
41
41
|
"Statistics include p50, p75, p90, p95, p99 percentiles"
|
|
42
42
|
]
|
|
43
43
|
};
|
|
44
|
-
handle = async (args,
|
|
44
|
+
handle = async (args, _ctx) => {
|
|
45
45
|
const params = inputSchema.parse(args);
|
|
46
46
|
const project = await this.client.getInputProject(params.projectId);
|
|
47
47
|
const spanGroupResults = await this.client.projectApi.getProjectSpanGroup(
|
|
@@ -50,7 +50,7 @@ class GetTrace extends Tool {
|
|
|
50
50
|
"targetSpanId can be used to focus on a specific span in the trace"
|
|
51
51
|
]
|
|
52
52
|
};
|
|
53
|
-
handle = async (args,
|
|
53
|
+
handle = async (args, _ctx) => {
|
|
54
54
|
const params = inputSchema.parse(args);
|
|
55
55
|
const project = await this.client.getInputProject(params.projectId);
|
|
56
56
|
if (!params.traceId || !params.from || !params.to) {
|
|
@@ -80,7 +80,7 @@ class ListSpanGroups extends Tool {
|
|
|
80
80
|
"Use nextUrl for pagination"
|
|
81
81
|
]
|
|
82
82
|
};
|
|
83
|
-
handle = async (args,
|
|
83
|
+
handle = async (args, _ctx) => {
|
|
84
84
|
const params = inputSchema.parse(args);
|
|
85
85
|
const project = await this.client.getInputProject(params.projectId);
|
|
86
86
|
const result = await this.client.projectApi.listProjectSpanGroups(
|
|
@@ -67,7 +67,7 @@ class ListSpans extends Tool {
|
|
|
67
67
|
"Each span includes trace ID for further investigation"
|
|
68
68
|
]
|
|
69
69
|
};
|
|
70
|
-
handle = async (args,
|
|
70
|
+
handle = async (args, _ctx) => {
|
|
71
71
|
const params = inputSchema.parse(args);
|
|
72
72
|
const project = await this.client.getInputProject(params.projectId);
|
|
73
73
|
const result = await this.client.projectApi.listSpansBySpanGroupId(
|
|
@@ -28,7 +28,7 @@ class ListTraceFields extends Tool {
|
|
|
28
28
|
"Use these fields for filtering other performance queries"
|
|
29
29
|
]
|
|
30
30
|
};
|
|
31
|
-
handle = async (args,
|
|
31
|
+
handle = async (args, _ctx) => {
|
|
32
32
|
const params = inputSchema.parse(args);
|
|
33
33
|
const project = await this.client.getInputProject(params.projectId);
|
|
34
34
|
const traceFields = await this.client.getProjectTraceFields(project);
|
|
@@ -65,7 +65,7 @@ class SetNetworkEndpointGroupings extends Tool {
|
|
|
65
65
|
readOnly: false,
|
|
66
66
|
idempotent: true
|
|
67
67
|
};
|
|
68
|
-
handle = async (args,
|
|
68
|
+
handle = async (args, _ctx) => {
|
|
69
69
|
const params = inputSchema.parse(args);
|
|
70
70
|
const project = await this.client.getInputProject(params.projectId);
|
|
71
71
|
const result = await this.client.projectApi.updateProjectNetworkGroupingRuleset(
|
|
@@ -15,7 +15,7 @@ class GetCurrentProject extends Tool {
|
|
|
15
15
|
"You might find a BugSnag API key in the user's code where they configure the BugSnag SDK that can be matched to a project 'apiKey' field from the project list"
|
|
16
16
|
]
|
|
17
17
|
};
|
|
18
|
-
handle = async (_args,
|
|
18
|
+
handle = async (_args, _ctx) => {
|
|
19
19
|
const project = await this.client.getCurrentProject();
|
|
20
20
|
if (!project) {
|
|
21
21
|
throw new ToolError(
|
|
@@ -28,7 +28,7 @@ class ListProjectEventFilters extends Tool {
|
|
|
28
28
|
"Look for display_id field in the response - these are the field names to use in filters"
|
|
29
29
|
]
|
|
30
30
|
};
|
|
31
|
-
handle = async (args,
|
|
31
|
+
handle = async (args, _ctx) => {
|
|
32
32
|
const params = inputSchema.parse(args);
|
|
33
33
|
const eventFilters = await this.client.getProjectEventFields(
|
|
34
34
|
await this.client.getInputProject(params.projectId)
|
|
@@ -18,7 +18,7 @@ class ListProjects extends Tool {
|
|
|
18
18
|
"Project IDs from this list can be used with other tools when no project API key is configured"
|
|
19
19
|
]
|
|
20
20
|
};
|
|
21
|
-
handle = async (args,
|
|
21
|
+
handle = async (args, _ctx) => {
|
|
22
22
|
const params = inputSchema.parse(args);
|
|
23
23
|
let projects = await this.client.getProjects();
|
|
24
24
|
if (!projects || projects.length === 0) {
|
|
@@ -31,7 +31,7 @@ class GetBuild extends Tool {
|
|
|
31
31
|
idempotent: true,
|
|
32
32
|
outputDescription: "JSON object containing build details along with stability metrics such as user and session stability, and whether it meets project targets"
|
|
33
33
|
};
|
|
34
|
-
handle = async (args,
|
|
34
|
+
handle = async (args, _ctx) => {
|
|
35
35
|
const params = inputSchema.parse(args);
|
|
36
36
|
const project = await this.client.getInputProject(params.projectId);
|
|
37
37
|
const response = await this.client.projectApi.getProjectReleaseById(
|
|
@@ -31,7 +31,7 @@ class GetRelease extends Tool {
|
|
|
31
31
|
idempotent: true,
|
|
32
32
|
outputDescription: "JSON object containing release details along with stability metrics such as user and session stability, and whether it meets project targets"
|
|
33
33
|
};
|
|
34
|
-
handle = async (args,
|
|
34
|
+
handle = async (args, _ctx) => {
|
|
35
35
|
const params = inputSchema.parse(args);
|
|
36
36
|
const project = await this.client.getInputProject(params.projectId);
|
|
37
37
|
const releaseResponse = await this.client.projectApi.getReleaseGroup(
|
|
@@ -51,7 +51,7 @@ class ListReleases extends Tool {
|
|
|
51
51
|
idempotent: true,
|
|
52
52
|
outputDescription: "JSON array of release summary objects with metadata, with a URL to the next page if more results are available"
|
|
53
53
|
};
|
|
54
|
-
handle = async (args,
|
|
54
|
+
handle = async (args, _ctx) => {
|
|
55
55
|
const params = inputSchema.parse(args);
|
|
56
56
|
const project = await this.client.getInputProject(params.projectId);
|
|
57
57
|
const response = await this.client.projectApi.listProjectReleaseGroups(
|
|
@@ -74,7 +74,7 @@ class CollaboratorClient {
|
|
|
74
74
|
reviewId: z.string().describe("The Collaborator review ID to find.")
|
|
75
75
|
})
|
|
76
76
|
},
|
|
77
|
-
async (args,
|
|
77
|
+
async (args, _ctx) => {
|
|
78
78
|
const { reviewId } = args;
|
|
79
79
|
const commands = [
|
|
80
80
|
{
|
|
@@ -106,7 +106,7 @@ class CollaboratorClient {
|
|
|
106
106
|
)
|
|
107
107
|
})
|
|
108
108
|
},
|
|
109
|
-
async (args,
|
|
109
|
+
async (args, _ctx) => {
|
|
110
110
|
const commandArgs = {};
|
|
111
111
|
if (args.creator !== void 0) commandArgs.creator = args.creator;
|
|
112
112
|
if (args.title !== void 0) commandArgs.title = args.title;
|
|
@@ -136,7 +136,7 @@ class CollaboratorClient {
|
|
|
136
136
|
reason: z.string().describe("Reason for rejecting the review.")
|
|
137
137
|
})
|
|
138
138
|
},
|
|
139
|
-
async (args,
|
|
139
|
+
async (args, _ctx) => {
|
|
140
140
|
const { reviewId, reason } = args;
|
|
141
141
|
const commands = [
|
|
142
142
|
{
|
|
@@ -168,7 +168,7 @@ class CollaboratorClient {
|
|
|
168
168
|
args: z.record(z.string(), z.any())
|
|
169
169
|
})
|
|
170
170
|
},
|
|
171
|
-
async (params,
|
|
171
|
+
async (params, _ctx) => {
|
|
172
172
|
const { action, args } = params;
|
|
173
173
|
const commands = [{ command: `ReviewService.${action}`, args }];
|
|
174
174
|
const result = await this.call(commands);
|
|
@@ -192,7 +192,7 @@ class CollaboratorClient {
|
|
|
192
192
|
toDate: z.string().optional().describe('Maximal creation date in format "yyyy-MM-dd"')
|
|
193
193
|
})
|
|
194
194
|
},
|
|
195
|
-
async (args,
|
|
195
|
+
async (args, _ctx) => {
|
|
196
196
|
const reviewArgs = {};
|
|
197
197
|
if (args.login !== void 0) reviewArgs.login = args.login;
|
|
198
198
|
if (args.role !== void 0) reviewArgs.role = args.role;
|
|
@@ -230,7 +230,7 @@ class CollaboratorClient {
|
|
|
230
230
|
)
|
|
231
231
|
})
|
|
232
232
|
},
|
|
233
|
-
async (args,
|
|
233
|
+
async (args, _ctx) => {
|
|
234
234
|
const { token, title, config, reviewTemplateId } = args;
|
|
235
235
|
const commandArgs = { token, title, config };
|
|
236
236
|
if (reviewTemplateId) commandArgs.reviewTemplateId = reviewTemplateId;
|
|
@@ -262,7 +262,7 @@ class CollaboratorClient {
|
|
|
262
262
|
)
|
|
263
263
|
})
|
|
264
264
|
},
|
|
265
|
-
async (args,
|
|
265
|
+
async (args, _ctx) => {
|
|
266
266
|
const { id, title, config, reviewTemplateId } = args;
|
|
267
267
|
const commandArgs = { id };
|
|
268
268
|
if (title) commandArgs.title = title;
|
|
@@ -289,7 +289,7 @@ class CollaboratorClient {
|
|
|
289
289
|
id: z.union([z.string(), z.number()]).describe("ID of the remote system Configuration to delete.")
|
|
290
290
|
})
|
|
291
291
|
},
|
|
292
|
-
async (args,
|
|
292
|
+
async (args, _ctx) => {
|
|
293
293
|
const commandArgs = {};
|
|
294
294
|
if (args.id !== void 0)
|
|
295
295
|
commandArgs.id = typeof args.id === "string" && !Number.isNaN(Number(args.id)) ? Number(args.id) : args.id;
|
|
@@ -316,7 +316,7 @@ class CollaboratorClient {
|
|
|
316
316
|
)
|
|
317
317
|
})
|
|
318
318
|
},
|
|
319
|
-
async (args,
|
|
319
|
+
async (args, _ctx) => {
|
|
320
320
|
const commandArgs = {};
|
|
321
321
|
if (args.id !== void 0)
|
|
322
322
|
commandArgs.id = typeof args.id === "string" && !Number.isNaN(Number(args.id)) ? Number(args.id) : args.id;
|
|
@@ -343,7 +343,7 @@ class CollaboratorClient {
|
|
|
343
343
|
)
|
|
344
344
|
})
|
|
345
345
|
},
|
|
346
|
-
async (args,
|
|
346
|
+
async (args, _ctx) => {
|
|
347
347
|
const commandArgs = {};
|
|
348
348
|
if (args.id !== void 0)
|
|
349
349
|
commandArgs.id = typeof args.id === "string" && !Number.isNaN(Number(args.id)) ? Number(args.id) : args.id;
|
package/dist/common/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/
|
|
2
|
-
import {
|
|
1
|
+
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/server";
|
|
2
|
+
import { z, ZodObject } from "zod";
|
|
3
3
|
import Bugsnag from "./bugsnag.js";
|
|
4
4
|
import { CacheService } from "./cache.js";
|
|
5
5
|
import { toClientIdentity } from "./client-identity.js";
|
|
@@ -111,22 +111,18 @@ class SmartBearMcpServer extends McpServer {
|
|
|
111
111
|
{
|
|
112
112
|
title: toolTitle,
|
|
113
113
|
description: this.getDescription(params),
|
|
114
|
-
inputSchema: params.inputSchema
|
|
115
|
-
|
|
116
|
-
// so that z.looseObject()'s additionalProperties:true is preserved in the JSON
|
|
117
|
-
// schema sent to clients — extracting `.shape` would rebuild a strict object and
|
|
118
|
-
// cause "additional properties" validation errors on real API responses.
|
|
119
|
-
outputSchema: params.outputSchema instanceof ZodObject ? params.outputSchema : this.schemaToRawShape(params.outputSchema),
|
|
114
|
+
inputSchema: params.inputSchema ?? z.object({}),
|
|
115
|
+
outputSchema: params.outputSchema,
|
|
120
116
|
annotations: this.getAnnotations(toolTitle, params)
|
|
121
117
|
},
|
|
122
|
-
async (args,
|
|
118
|
+
async (args, ctx) => {
|
|
123
119
|
try {
|
|
124
120
|
if (!client.isConfigured()) {
|
|
125
121
|
throw new ToolError(
|
|
126
122
|
`The tool is not configured - configuration options for ${client.name} are missing or invalid.`
|
|
127
123
|
);
|
|
128
124
|
}
|
|
129
|
-
const result = await cb(args,
|
|
125
|
+
const result = await cb(args, ctx);
|
|
130
126
|
if (result) {
|
|
131
127
|
this.validateCallbackResult(result, params);
|
|
132
128
|
this.addStructuredContentAsText(result);
|
|
@@ -188,9 +184,9 @@ ${result.instructions}`
|
|
|
188
184
|
title: this.getCapabilityTitle(client, params.title),
|
|
189
185
|
description: params.description
|
|
190
186
|
},
|
|
191
|
-
async (url2, variables,
|
|
187
|
+
async (url2, variables, ctx) => {
|
|
192
188
|
try {
|
|
193
|
-
return await cb(url2, variables,
|
|
189
|
+
return await cb(url2, variables, ctx);
|
|
194
190
|
} catch (e) {
|
|
195
191
|
Bugsnag.notify(e, (event) => {
|
|
196
192
|
event.addMetadata("app", {
|
|
@@ -213,11 +209,11 @@ ${result.instructions}`
|
|
|
213
209
|
{
|
|
214
210
|
title: this.getCapabilityTitle(client, params.title),
|
|
215
211
|
description: params.description,
|
|
216
|
-
argsSchema:
|
|
212
|
+
argsSchema: params.argsSchema
|
|
217
213
|
},
|
|
218
|
-
async (args,
|
|
214
|
+
async (args, ctx) => {
|
|
219
215
|
try {
|
|
220
|
-
return await cb(args,
|
|
216
|
+
return await cb(args, ctx);
|
|
221
217
|
} catch (e) {
|
|
222
218
|
Bugsnag.notify(e, (event) => {
|
|
223
219
|
event.addMetadata("app", {
|
|
@@ -263,23 +259,6 @@ ${result.instructions}`
|
|
|
263
259
|
};
|
|
264
260
|
return annotations;
|
|
265
261
|
}
|
|
266
|
-
schemaToRawShape(schema) {
|
|
267
|
-
if (schema) {
|
|
268
|
-
if (schema instanceof ZodObject) {
|
|
269
|
-
return schema.shape;
|
|
270
|
-
}
|
|
271
|
-
if (schema instanceof ZodIntersection) {
|
|
272
|
-
const leftShape = this.schemaToRawShape(
|
|
273
|
-
schema.def.left
|
|
274
|
-
);
|
|
275
|
-
const rightShape = this.schemaToRawShape(
|
|
276
|
-
schema.def.right
|
|
277
|
-
);
|
|
278
|
-
return { ...leftShape, ...rightShape };
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return void 0;
|
|
282
|
-
}
|
|
283
262
|
getCapabilityTitle(client, title) {
|
|
284
263
|
return `${client.name}: ${title}`;
|
|
285
264
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { createServer } from "node:http";
|
|
3
3
|
import querystring from "node:querystring";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { NodeStreamableHTTPServerTransport } from "@modelcontextprotocol/node";
|
|
5
|
+
import { isInitializeRequest } from "@modelcontextprotocol/server";
|
|
6
|
+
import { SSEServerTransport } from "@modelcontextprotocol/server-legacy/sse";
|
|
7
7
|
import { clientRegistry } from "./client-registry.js";
|
|
8
8
|
import { handleInitializeMessage } from "./initialize.js";
|
|
9
9
|
import { withRequestContext, setRequestMcpClient } from "./request-context.js";
|
|
@@ -184,7 +184,7 @@ async function parseRequestBody(req) {
|
|
|
184
184
|
}
|
|
185
185
|
function getExistingTransport(sessionId, transports, res) {
|
|
186
186
|
const existing = transports.get(sessionId);
|
|
187
|
-
if (existing && existing.transport instanceof
|
|
187
|
+
if (existing && existing.transport instanceof NodeStreamableHTTPServerTransport) {
|
|
188
188
|
return existing.transport;
|
|
189
189
|
}
|
|
190
190
|
res.writeHead(400, { "Content-Type": "application/json" });
|
|
@@ -205,7 +205,7 @@ async function createNewTransport(req, res, transports) {
|
|
|
205
205
|
if (!server) {
|
|
206
206
|
return null;
|
|
207
207
|
}
|
|
208
|
-
const transport = new
|
|
208
|
+
const transport = new NodeStreamableHTTPServerTransport({
|
|
209
209
|
sessionIdGenerator: () => randomUUID(),
|
|
210
210
|
onsessioninitialized: (newSessionId) => {
|
|
211
211
|
console.log(`[MCP] New session initialized: ${newSessionId}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { enableCompileCache } from "node:module";
|
|
2
|
-
import { StdioServerTransport } from "@modelcontextprotocol/
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
|
|
3
3
|
import { clientRegistry } from "./client-registry.js";
|
|
4
4
|
import { USER_AGENT } from "./info.js";
|
|
5
5
|
import { handleInitializeMessage } from "./initialize.js";
|
package/dist/common/zod-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZodOptional, ZodDefault, ZodNullable, ZodRecord, ZodString, ZodNumber, ZodBoolean, ZodArray, ZodObject, ZodEnum, ZodLiteral, ZodUnion, ZodAny } from "zod";
|
|
1
|
+
import { ZodOptional, ZodDefault, ZodNullable, ZodRecord, ZodString, ZodStringFormat, ZodNumber, ZodBoolean, ZodArray, ZodObject, ZodEnum, ZodLiteral, ZodUnion, ZodAny } from "zod";
|
|
2
2
|
function unwrapZodType(zodType) {
|
|
3
3
|
if (zodType instanceof ZodOptional) {
|
|
4
4
|
return zodType.unwrap();
|
|
@@ -55,6 +55,7 @@ function getReadableTypeName(zodType) {
|
|
|
55
55
|
return `record<${getReadableTypeName(record.def.keyType)}, ${getReadableTypeName(record.def.valueType)}>`;
|
|
56
56
|
}
|
|
57
57
|
if (zodType instanceof ZodString) return "string";
|
|
58
|
+
if (zodType instanceof ZodStringFormat) return "string";
|
|
58
59
|
if (zodType instanceof ZodNumber) return "number";
|
|
59
60
|
if (zodType instanceof ZodBoolean) return "boolean";
|
|
60
61
|
if (zodType instanceof ZodArray) return "array";
|
package/dist/package.json.js
CHANGED
|
@@ -107,9 +107,11 @@ const PublishProviderContractSchema = z.object({
|
|
|
107
107
|
providerName: z.string().describe("Name of the provider application"),
|
|
108
108
|
pacticipantVersionNumber: z.string().min(1).describe("Version number of the provider"),
|
|
109
109
|
contract: z.object({
|
|
110
|
-
content: z.string().describe("Base64-encoded OpenAPI specification content"),
|
|
111
|
-
contentType: z.enum(["application/json", "application/yaml", "application/yml"]).describe("Content type of the
|
|
112
|
-
specification: z.
|
|
110
|
+
content: z.string().describe("Base64-encoded OpenAPI or AsyncAPI specification content"),
|
|
111
|
+
contentType: z.enum(["application/json", "application/yaml", "application/yml"]).describe("Content type of the spec"),
|
|
112
|
+
specification: z.enum(["oas", "asyncapi"]).describe(
|
|
113
|
+
"Specification type: 'oas' for OpenAPI or 'asyncapi' for AsyncAPI"
|
|
114
|
+
),
|
|
113
115
|
selfVerificationResults: z.object({
|
|
114
116
|
success: z.boolean().describe("Whether self-verification passed"),
|
|
115
117
|
content: z.string().optional().describe("Verification results content (e.g. test output)"),
|
|
@@ -122,7 +124,9 @@ const PublishProviderContractSchema = z.object({
|
|
|
122
124
|
}).describe(
|
|
123
125
|
"Results of self-verifying the provider against its own contract"
|
|
124
126
|
)
|
|
125
|
-
}).describe(
|
|
127
|
+
}).describe(
|
|
128
|
+
"Provider contract (OpenAPI or AsyncAPI spec) and verification details"
|
|
129
|
+
),
|
|
126
130
|
tags: z.array(z.string()).optional().describe("Version tags"),
|
|
127
131
|
branch: z.string().optional().describe("Branch name of the provider"),
|
|
128
132
|
buildUrl: z.string().optional().describe("URL of the CI build")
|
|
@@ -308,8 +308,8 @@ const TOOLS = [
|
|
|
308
308
|
{
|
|
309
309
|
title: "Publish Provider Contract",
|
|
310
310
|
toolset: "Contracts",
|
|
311
|
-
summary: "Publish a provider OpenAPI contract and self-verification results to PactFlow (Bi-Directional Contract Testing).",
|
|
312
|
-
purpose: "Upload an OpenAPI specification as a provider contract along with the results of running a tool (e.g. Dredd, Schemathesis) that verifies the provider implementation against the spec. This enables PactFlow to perform automated cross-contract verification without requiring the provider to run the consumer Pact tests.",
|
|
311
|
+
summary: "Publish a provider OpenAPI or AsyncAPI contract and self-verification results to PactFlow (Bi-Directional Contract Testing).",
|
|
312
|
+
purpose: "Upload an OpenAPI or AsyncAPI specification as a provider contract along with the results of running a tool (e.g. Dredd, Schemathesis) that verifies the provider implementation against the spec. This enables PactFlow to perform automated cross-contract verification without requiring the provider to run the consumer Pact tests.",
|
|
313
313
|
inputSchema: PublishProviderContractSchema,
|
|
314
314
|
handler: "publishProviderContract",
|
|
315
315
|
readOnly: false,
|
package/dist/pactflow/client.js
CHANGED
|
@@ -672,10 +672,10 @@ class PactflowClient {
|
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
674
|
/**
|
|
675
|
-
* Publishes a provider OpenAPI contract and its self-verification results
|
|
676
|
-
* for use in Bi-Directional Contract Testing.
|
|
675
|
+
* Publishes a provider OpenAPI or AsyncAPI contract and its self-verification results
|
|
676
|
+
* to PactFlow for use in Bi-Directional Contract Testing.
|
|
677
677
|
*
|
|
678
|
-
* @param params - `providerName`, version number, base64-encoded OpenAPI spec,
|
|
678
|
+
* @param params - `providerName`, version number, base64-encoded OpenAPI/AsyncAPI spec,
|
|
679
679
|
* content type, and self-verification results.
|
|
680
680
|
* @returns Publication result.
|
|
681
681
|
* @throws ToolError if the request fails.
|
|
@@ -2085,7 +2085,7 @@ class PactflowClient {
|
|
|
2085
2085
|
continue;
|
|
2086
2086
|
}
|
|
2087
2087
|
const { handler, clients: _, formatResponse, ...toolParams } = tool;
|
|
2088
|
-
register(toolParams, async (args,
|
|
2088
|
+
register(toolParams, async (args, _ctx) => {
|
|
2089
2089
|
const handler_fn = this[handler];
|
|
2090
2090
|
if (typeof handler_fn !== "function") {
|
|
2091
2091
|
throw new Error(`Handler '${handler}' not found on PactClient`);
|
|
@@ -21,7 +21,7 @@ class ConnectToSession extends Tool {
|
|
|
21
21
|
sessionId: z.string().describe("The ID of the Reflect recording session to connect to")
|
|
22
22
|
})
|
|
23
23
|
};
|
|
24
|
-
handle = async (args,
|
|
24
|
+
handle = async (args, ctx) => {
|
|
25
25
|
const { sessionId } = args;
|
|
26
26
|
if (!sessionId) throw new ToolError("sessionId argument is required");
|
|
27
27
|
if (this.client.isSessionConnected(sessionId)) {
|
|
@@ -63,7 +63,7 @@ class ConnectToSession extends Tool {
|
|
|
63
63
|
`MCP connect-to-session failed: ${connectError instanceof Error ? connectError.message : String(connectError)}`
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
|
-
const mcpSessionId =
|
|
66
|
+
const mcpSessionId = ctx.sessionId;
|
|
67
67
|
const { platform, test } = connectResponse;
|
|
68
68
|
this.client.registerConnection(
|
|
69
69
|
sessionId,
|
|
@@ -306,7 +306,7 @@ const CreateTocOutputSchema = z.object({
|
|
|
306
306
|
id: z.string().optional(),
|
|
307
307
|
documentId: z.string().optional()
|
|
308
308
|
});
|
|
309
|
-
const DocumentOutputSchema = z.
|
|
309
|
+
const DocumentOutputSchema = z.looseObject({
|
|
310
310
|
id: z.string().optional(),
|
|
311
311
|
type: z.enum(["html", "markdown"]).optional(),
|
|
312
312
|
source: z.enum(["internal", "external"]).optional(),
|
package/dist/swagger/client.js
CHANGED
|
@@ -228,7 +228,7 @@ class SwaggerClient {
|
|
|
228
228
|
return;
|
|
229
229
|
}
|
|
230
230
|
const { handler, formatResponse, ...toolParams } = tool;
|
|
231
|
-
register(toolParams, async (args,
|
|
231
|
+
register(toolParams, async (args, _ctx) => {
|
|
232
232
|
try {
|
|
233
233
|
const handlerFn = this[handler];
|
|
234
234
|
if (typeof handlerFn !== "function") {
|