@mastra/mcp 2.5.0 → 2.6.0-alpha.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/cli/generate-K-rW1Wck.js +219 -0
- package/dist/cli/generate-K-rW1Wck.js.map +1 -0
- package/dist/cli/generate.d.ts +18 -0
- package/dist/cli/generate.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +33 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/json-schema-dialect-B5B7l9Po.js +133 -0
- package/dist/cli/json-schema-dialect-B5B7l9Po.js.map +1 -0
- package/dist/cli/typegen-CLDjVF16.js +364 -0
- package/dist/cli/typegen-CLDjVF16.js.map +1 -0
- package/dist/cli/typegen.d.ts +14 -0
- package/dist/cli/typegen.d.ts.map +1 -0
- package/dist/client/client.d.ts +2 -1
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/configuration.d.ts +30 -10
- package/dist/client/configuration.d.ts.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/types.d.ts +38 -1
- package/dist/client/types.d.ts.map +1 -1
- package/dist/docs/SKILL.md +2 -3
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-connections-mcp.md +159 -50
- package/dist/docs/references/docs-connections-overview.md +1 -1
- package/dist/docs/references/docs-guides-mcp-authentication-authorization.md +2 -2
- package/dist/docs/references/reference-migrations-mcp-v2.md +1 -1
- package/dist/docs/references/reference-tools-mcp-client.md +202 -11
- package/dist/docs/references/reference-tools-mcp-server.md +5 -3
- package/dist/index.cjs +116 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +116 -121
- package/dist/index.js.map +1 -1
- package/dist/server/server.d.ts +13 -1
- package/dist/server/server.d.ts.map +1 -1
- package/dist/shared/json-schema-dialect.d.ts +34 -0
- package/dist/shared/json-schema-dialect.d.ts.map +1 -1
- package/package.json +18 -13
- package/dist/docs/references/docs-guides-mcp-events.md +0 -306
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { i as jsonSchemaComplexity, n as MAX_SCHEMA_VALUES, r as countJsonValues, t as MAX_CATALOG_VALUES } from "./json-schema-dialect-B5B7l9Po.js";
|
|
2
|
+
import { compile } from "json-schema-to-typescript";
|
|
3
|
+
//#region src/cli/typegen.ts
|
|
4
|
+
const maps = /* @__PURE__ */ new Set([
|
|
5
|
+
"properties",
|
|
6
|
+
"patternProperties",
|
|
7
|
+
"definitions",
|
|
8
|
+
"$defs",
|
|
9
|
+
"dependentSchemas"
|
|
10
|
+
]);
|
|
11
|
+
const singles = /* @__PURE__ */ new Set([
|
|
12
|
+
"additionalProperties",
|
|
13
|
+
"additionalItems",
|
|
14
|
+
"contains",
|
|
15
|
+
"not",
|
|
16
|
+
"if",
|
|
17
|
+
"then",
|
|
18
|
+
"else",
|
|
19
|
+
"propertyNames",
|
|
20
|
+
"unevaluatedProperties",
|
|
21
|
+
"unevaluatedItems"
|
|
22
|
+
]);
|
|
23
|
+
const lists = /* @__PURE__ */ new Set([
|
|
24
|
+
"allOf",
|
|
25
|
+
"anyOf",
|
|
26
|
+
"oneOf",
|
|
27
|
+
"prefixItems"
|
|
28
|
+
]);
|
|
29
|
+
const annotations = /* @__PURE__ */ new Set([
|
|
30
|
+
"title",
|
|
31
|
+
"description",
|
|
32
|
+
"$comment",
|
|
33
|
+
"default",
|
|
34
|
+
"examples",
|
|
35
|
+
"deprecated",
|
|
36
|
+
"readOnly",
|
|
37
|
+
"writeOnly",
|
|
38
|
+
"$schema"
|
|
39
|
+
]);
|
|
40
|
+
/** Keywords whose value must be a string. */
|
|
41
|
+
const strings = /* @__PURE__ */ new Set([
|
|
42
|
+
"title",
|
|
43
|
+
"description",
|
|
44
|
+
"$comment",
|
|
45
|
+
"$schema",
|
|
46
|
+
"$id",
|
|
47
|
+
"$anchor",
|
|
48
|
+
"$dynamicRef",
|
|
49
|
+
"format",
|
|
50
|
+
"pattern"
|
|
51
|
+
]);
|
|
52
|
+
/** Keywords whose value must be a boolean. */
|
|
53
|
+
const booleans = /* @__PURE__ */ new Set([
|
|
54
|
+
"deprecated",
|
|
55
|
+
"readOnly",
|
|
56
|
+
"writeOnly",
|
|
57
|
+
"uniqueItems"
|
|
58
|
+
]);
|
|
59
|
+
/** Keywords whose value must be a number, with `multipleOf` additionally positive. */
|
|
60
|
+
const bounds = /* @__PURE__ */ new Set([
|
|
61
|
+
"minimum",
|
|
62
|
+
"maximum",
|
|
63
|
+
"exclusiveMinimum",
|
|
64
|
+
"exclusiveMaximum",
|
|
65
|
+
"multipleOf"
|
|
66
|
+
]);
|
|
67
|
+
/** Keywords whose value must be a non-negative integer. */
|
|
68
|
+
const counts = /* @__PURE__ */ new Set([
|
|
69
|
+
"minLength",
|
|
70
|
+
"maxLength",
|
|
71
|
+
"minProperties",
|
|
72
|
+
"maxProperties",
|
|
73
|
+
"minContains",
|
|
74
|
+
"maxContains"
|
|
75
|
+
]);
|
|
76
|
+
const supported = /* @__PURE__ */ new Set([
|
|
77
|
+
"type",
|
|
78
|
+
"properties",
|
|
79
|
+
"definitions",
|
|
80
|
+
"$defs",
|
|
81
|
+
"required",
|
|
82
|
+
"items",
|
|
83
|
+
"additionalItems",
|
|
84
|
+
"additionalProperties",
|
|
85
|
+
"enum",
|
|
86
|
+
"const",
|
|
87
|
+
"allOf",
|
|
88
|
+
"anyOf",
|
|
89
|
+
"oneOf",
|
|
90
|
+
"$ref",
|
|
91
|
+
"minItems",
|
|
92
|
+
"maxItems",
|
|
93
|
+
"format",
|
|
94
|
+
"pattern",
|
|
95
|
+
"minLength",
|
|
96
|
+
"maxLength",
|
|
97
|
+
"minimum",
|
|
98
|
+
"maximum",
|
|
99
|
+
"exclusiveMinimum",
|
|
100
|
+
"exclusiveMaximum",
|
|
101
|
+
"multipleOf",
|
|
102
|
+
"uniqueItems",
|
|
103
|
+
"minProperties",
|
|
104
|
+
"maxProperties"
|
|
105
|
+
]);
|
|
106
|
+
const types = /* @__PURE__ */ new Set([
|
|
107
|
+
"object",
|
|
108
|
+
"array",
|
|
109
|
+
"string",
|
|
110
|
+
"number",
|
|
111
|
+
"integer",
|
|
112
|
+
"boolean",
|
|
113
|
+
"null"
|
|
114
|
+
]);
|
|
115
|
+
function object(value) {
|
|
116
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
117
|
+
}
|
|
118
|
+
function count(value) {
|
|
119
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Generation failure whose message is safe to surface: it is built from server and tool names,
|
|
123
|
+
* keyword names, and positions, so it never carries schema values or transport details.
|
|
124
|
+
*/
|
|
125
|
+
var TypegenError = class extends Error {
|
|
126
|
+
constructor(message) {
|
|
127
|
+
super(message);
|
|
128
|
+
this.name = "TypegenError";
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function fail(reason, position) {
|
|
132
|
+
throw new TypegenError(`${reason} at ${position}`);
|
|
133
|
+
}
|
|
134
|
+
function canonical(value, position, ancestors = /* @__PURE__ */ new Set(), depth = 0) {
|
|
135
|
+
if (depth > 128) fail(`Schema exceeds the maximum depth of 128`, position);
|
|
136
|
+
if (value === null || typeof value === "string" || typeof value === "boolean") return value;
|
|
137
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
138
|
+
if (typeof value !== "object") fail("Schema contains a value that is not JSON", position);
|
|
139
|
+
if (ancestors.has(value)) fail("Schema contains a circular reference", position);
|
|
140
|
+
ancestors.add(value);
|
|
141
|
+
const result = Array.isArray(value) ? value.map((item) => canonical(item, position, ancestors, depth + 1)) : Object.fromEntries(Object.keys(value).sort().map((key) => [key, canonical(Reflect.get(value, key), position, ancestors, depth + 1)]));
|
|
142
|
+
ancestors.delete(value);
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
function prepare(raw, position, warnings) {
|
|
146
|
+
const root = canonical(raw, position);
|
|
147
|
+
const locations = /* @__PURE__ */ new Map();
|
|
148
|
+
const references = [];
|
|
149
|
+
const pointer = (part) => part.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
150
|
+
function visit(value, path) {
|
|
151
|
+
if (typeof value === "boolean") {
|
|
152
|
+
locations.set(path, value);
|
|
153
|
+
return value;
|
|
154
|
+
}
|
|
155
|
+
const schema = object(value) ? value : void 0;
|
|
156
|
+
locations.set(path, schema ?? true);
|
|
157
|
+
const nodePosition = `${position}/schema[${locations.size - 1}]`;
|
|
158
|
+
if (!schema) {
|
|
159
|
+
warnings.push(`Schema is not an object at ${nodePosition}; widened to unknown`);
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
const output = Object.create(null);
|
|
163
|
+
const reasons = [];
|
|
164
|
+
const invalid = (key) => reasons.push(`invalid ${JSON.stringify(key)} value`);
|
|
165
|
+
for (const [key, entry] of Object.entries(schema)) {
|
|
166
|
+
const here = `${path}/${pointer(key)}`;
|
|
167
|
+
if (annotations.has(key)) continue;
|
|
168
|
+
if (!supported.has(key)) reasons.push(`unsupported keyword ${JSON.stringify(key)}`);
|
|
169
|
+
if (strings.has(key) && typeof entry !== "string") {
|
|
170
|
+
invalid(key);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (booleans.has(key) && typeof entry !== "boolean") {
|
|
174
|
+
invalid(key);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (bounds.has(key) && (typeof entry !== "number" || key === "multipleOf" && entry <= 0)) {
|
|
178
|
+
invalid(key);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (counts.has(key) && !count(entry)) {
|
|
182
|
+
invalid(key);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (maps.has(key)) {
|
|
186
|
+
if (!object(entry)) {
|
|
187
|
+
invalid(key);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
output[key] = Object.fromEntries(Object.entries(entry).map(([name, child]) => [name, visit(child, `${here}/${pointer(name)}`)]));
|
|
191
|
+
} else if (singles.has(key)) output[key] = visit(entry, here);
|
|
192
|
+
else if (lists.has(key) || key === "items" && Array.isArray(entry)) {
|
|
193
|
+
if (!Array.isArray(entry) || entry.length === 0) {
|
|
194
|
+
invalid(key);
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
output[key] = entry.map((child, index) => visit(child, `${here}/${index}`));
|
|
198
|
+
} else if (key === "items") output[key] = visit(entry, here);
|
|
199
|
+
else if (key === "$ref") {
|
|
200
|
+
if (typeof entry !== "string") {
|
|
201
|
+
invalid(key);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (entry === "#" || entry.startsWith("#/")) {
|
|
205
|
+
references.push(entry);
|
|
206
|
+
output[key] = entry;
|
|
207
|
+
} else reasons.push("external reference");
|
|
208
|
+
} else if (key === "type") {
|
|
209
|
+
const entries = Array.isArray(entry) ? entry : [entry];
|
|
210
|
+
if (!entries.length || entries.some((type) => typeof type !== "string" || !types.has(type))) {
|
|
211
|
+
invalid(key);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
output[key] = entry;
|
|
215
|
+
} else if (key === "required") {
|
|
216
|
+
if (!Array.isArray(entry) || entry.some((name) => typeof name !== "string") || new Set(entry).size !== entry.length) {
|
|
217
|
+
invalid(key);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
output[key] = entry;
|
|
221
|
+
} else if (key === "enum") {
|
|
222
|
+
if (!Array.isArray(entry) || entry.length === 0) {
|
|
223
|
+
invalid(key);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
output[key] = entry;
|
|
227
|
+
} else if (key === "minItems" || key === "maxItems") {
|
|
228
|
+
if (!count(entry)) {
|
|
229
|
+
invalid(key);
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (entry > 100) reasons.push(`${JSON.stringify(key)} bound above 100`);
|
|
233
|
+
output[key] = entry;
|
|
234
|
+
} else if (key === "const") output[key] = entry;
|
|
235
|
+
}
|
|
236
|
+
if (reasons.length) {
|
|
237
|
+
const reason = reasons.join("; ");
|
|
238
|
+
warnings.push(`${reason.charAt(0).toUpperCase()}${reason.slice(1)} at ${nodePosition}; widened to unknown`);
|
|
239
|
+
return {
|
|
240
|
+
...output,
|
|
241
|
+
tsType: "unknown"
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
return output;
|
|
245
|
+
}
|
|
246
|
+
const result = visit(root, "");
|
|
247
|
+
for (const ref of references) {
|
|
248
|
+
let target;
|
|
249
|
+
try {
|
|
250
|
+
target = decodeURIComponent(ref.slice(1));
|
|
251
|
+
} catch {
|
|
252
|
+
fail("Local reference is not a valid URI fragment", position);
|
|
253
|
+
}
|
|
254
|
+
if (!locations.has(target) || /~(?![01])/u.test(target)) fail(`Unresolved local reference ${JSON.stringify(ref)}`, position);
|
|
255
|
+
}
|
|
256
|
+
const active = /* @__PURE__ */ new Set();
|
|
257
|
+
const complete = /* @__PURE__ */ new Set();
|
|
258
|
+
function checkCycle(path, depth = 0) {
|
|
259
|
+
if (depth > 128) fail(`Schema exceeds the maximum depth of 128`, position);
|
|
260
|
+
if (active.has(path)) fail("Unresolvable recursive schema", position);
|
|
261
|
+
if (complete.has(path)) return;
|
|
262
|
+
active.add(path);
|
|
263
|
+
const schema = locations.get(path);
|
|
264
|
+
if (object(schema)) {
|
|
265
|
+
if (typeof schema.$ref === "string" && (schema.$ref === "#" || schema.$ref.startsWith("#/"))) checkCycle(decodeURIComponent(schema.$ref.slice(1)), depth + 1);
|
|
266
|
+
for (const key of [
|
|
267
|
+
"allOf",
|
|
268
|
+
"anyOf",
|
|
269
|
+
"oneOf"
|
|
270
|
+
]) {
|
|
271
|
+
const children = schema[key];
|
|
272
|
+
if (Array.isArray(children)) children.forEach((_, index) => checkCycle(`${path}/${key}/${index}`, depth + 1));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
active.delete(path);
|
|
276
|
+
complete.add(path);
|
|
277
|
+
}
|
|
278
|
+
for (const path of locations.keys()) checkCycle(path);
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
281
|
+
function identifier(name) {
|
|
282
|
+
return `Server${name.replace(/[^a-zA-Z0-9]+/g, " ").trim().split(/ +/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("") || "Unnamed"}`;
|
|
283
|
+
}
|
|
284
|
+
/** Internal catalog-to-source boundary. No connections, loading, or filesystem writes. */
|
|
285
|
+
async function generateToolTypes(catalog) {
|
|
286
|
+
const declarations = [];
|
|
287
|
+
const servers = [];
|
|
288
|
+
const warnings = [];
|
|
289
|
+
const serverNames = /* @__PURE__ */ new Map();
|
|
290
|
+
const flatNames = /* @__PURE__ */ new Set();
|
|
291
|
+
let schemaIndex = 0;
|
|
292
|
+
const budget = { values: 0 };
|
|
293
|
+
function widen(name, position, reason) {
|
|
294
|
+
warnings.push(`${reason} at ${position}; widened to unknown`);
|
|
295
|
+
declarations.push(`export type ${name} = unknown;\n`);
|
|
296
|
+
return name;
|
|
297
|
+
}
|
|
298
|
+
async function convert(raw, position) {
|
|
299
|
+
const name = `ToolSchema${++schemaIndex}`;
|
|
300
|
+
const values = countJsonValues(raw, MAX_SCHEMA_VALUES);
|
|
301
|
+
budget.values += values;
|
|
302
|
+
if (values > 1e5) return widen(name, position, `Schema exceeds the maximum value count of ${MAX_SCHEMA_VALUES}`);
|
|
303
|
+
if (budget.values > 1e6) return widen(name, position, `Catalogue exceeds the maximum value count of ${MAX_CATALOG_VALUES}`);
|
|
304
|
+
const { error, limit } = jsonSchemaComplexity(raw);
|
|
305
|
+
if (limit === "depth") fail(`Schema exceeds the maximum depth of 128`, position);
|
|
306
|
+
if (error) return widen(name, position, error);
|
|
307
|
+
const schema = prepare(raw, position, warnings);
|
|
308
|
+
if (typeof schema === "boolean") declarations.push(`export type ${name} = ${schema ? "unknown" : "never"};\n`);
|
|
309
|
+
else {
|
|
310
|
+
const names = /* @__PURE__ */ new WeakMap();
|
|
311
|
+
let nested = 0;
|
|
312
|
+
try {
|
|
313
|
+
declarations.push(await compile({
|
|
314
|
+
...schema,
|
|
315
|
+
title: name
|
|
316
|
+
}, name, {
|
|
317
|
+
bannerComment: "",
|
|
318
|
+
unknownAny: true,
|
|
319
|
+
enableConstEnums: false,
|
|
320
|
+
$refOptions: { resolve: {
|
|
321
|
+
external: false,
|
|
322
|
+
file: false,
|
|
323
|
+
http: false
|
|
324
|
+
} },
|
|
325
|
+
customName: (value) => {
|
|
326
|
+
if (value.title === name) return name;
|
|
327
|
+
if (!names.has(value)) names.set(value, `${name}Value${++nested}`);
|
|
328
|
+
return names.get(value);
|
|
329
|
+
}
|
|
330
|
+
}));
|
|
331
|
+
} catch {
|
|
332
|
+
return widen(name, position, "Schema conversion failed");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return name;
|
|
336
|
+
}
|
|
337
|
+
for (const server of Object.keys(catalog).sort()) {
|
|
338
|
+
const serverName = identifier(server);
|
|
339
|
+
const collision = serverNames.get(serverName);
|
|
340
|
+
if (collision !== void 0) throw new TypegenError(`Server interface name collision between ${JSON.stringify(collision)} and ${JSON.stringify(server)}`);
|
|
341
|
+
serverNames.set(serverName, server);
|
|
342
|
+
const tools = [];
|
|
343
|
+
for (const tool of Object.keys(catalog[server]).sort()) {
|
|
344
|
+
const flat = `${server}_${tool}`;
|
|
345
|
+
if (flatNames.has(flat)) throw new TypegenError(`Flattened tool name collision for ${JSON.stringify(flat)}`);
|
|
346
|
+
flatNames.add(flat);
|
|
347
|
+
const definition = catalog[server][tool];
|
|
348
|
+
const position = `server ${JSON.stringify(server)} tool ${JSON.stringify(tool)}`;
|
|
349
|
+
const input = await convert(definition.inputSchema, `${position} input`);
|
|
350
|
+
const output = definition.outputSchema === void 0 ? "unknown" : await convert(definition.outputSchema, `${position} output`);
|
|
351
|
+
tools.push(` ${JSON.stringify(tool)}: { input: ${input}; output: ${output} };`);
|
|
352
|
+
}
|
|
353
|
+
declarations.push(`export interface ${serverName} {\n tools: {\n${tools.join("\n")}\n };\n}\n`);
|
|
354
|
+
servers.push(` ${JSON.stringify(server)}: ${serverName};`);
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
source: `// Generated MCP tool contracts. Regenerate when server schemas change.\n\n${declarations.join("\n")}\nexport interface MCPServers {\n${servers.join("\n")}\n}\n`,
|
|
358
|
+
warnings
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
export { TypegenError, generateToolTypes };
|
|
363
|
+
|
|
364
|
+
//# sourceMappingURL=typegen-CLDjVF16.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typegen-CLDjVF16.js","names":[],"sources":["../../src/cli/typegen.ts"],"sourcesContent":["import { compile } from 'json-schema-to-typescript';\nimport type { SerializableMCPToolCatalog } from '../client/types';\nimport {\n countJsonValues,\n jsonSchemaComplexity,\n MAX_CATALOG_VALUES,\n MAX_JSON_SCHEMA_DEPTH,\n MAX_SCHEMA_VALUES,\n} from '../shared/json-schema-dialect';\n\ntype Schema = boolean | Record<string, unknown>;\n\nconst maps = new Set(['properties', 'patternProperties', 'definitions', '$defs', 'dependentSchemas']);\nconst singles = new Set([\n 'additionalProperties',\n 'additionalItems',\n 'contains',\n 'not',\n 'if',\n 'then',\n 'else',\n 'propertyNames',\n 'unevaluatedProperties',\n 'unevaluatedItems',\n]);\nconst lists = new Set(['allOf', 'anyOf', 'oneOf', 'prefixItems']);\nconst annotations = new Set([\n 'title',\n 'description',\n '$comment',\n 'default',\n 'examples',\n 'deprecated',\n 'readOnly',\n 'writeOnly',\n '$schema',\n]);\n/** Keywords whose value must be a string. */\nconst strings = new Set([\n 'title',\n 'description',\n '$comment',\n '$schema',\n '$id',\n '$anchor',\n '$dynamicRef',\n 'format',\n 'pattern',\n]);\n/** Keywords whose value must be a boolean. */\nconst booleans = new Set(['deprecated', 'readOnly', 'writeOnly', 'uniqueItems']);\n/** Keywords whose value must be a number, with `multipleOf` additionally positive. */\nconst bounds = new Set(['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf']);\n/** Keywords whose value must be a non-negative integer. */\nconst counts = new Set(['minLength', 'maxLength', 'minProperties', 'maxProperties', 'minContains', 'maxContains']);\nconst supported = new Set([\n 'type',\n 'properties',\n 'definitions',\n '$defs',\n 'required',\n 'items',\n 'additionalItems',\n 'additionalProperties',\n 'enum',\n 'const',\n 'allOf',\n 'anyOf',\n 'oneOf',\n '$ref',\n 'minItems',\n 'maxItems',\n 'format',\n 'pattern',\n 'minLength',\n 'maxLength',\n 'minimum',\n 'maximum',\n 'exclusiveMinimum',\n 'exclusiveMaximum',\n 'multipleOf',\n 'uniqueItems',\n 'minProperties',\n 'maxProperties',\n]);\nconst types = new Set(['object', 'array', 'string', 'number', 'integer', 'boolean', 'null']);\n\nfunction object(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction count(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0;\n}\n\n/**\n * Generation failure whose message is safe to surface: it is built from server and tool names,\n * keyword names, and positions, so it never carries schema values or transport details.\n */\nexport class TypegenError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'TypegenError';\n }\n}\n\nfunction fail(reason: string, position: string): never {\n throw new TypegenError(`${reason} at ${position}`);\n}\n\n// JSON roundtripping is not enough: schema object insertion order affects declaration order.\nfunction canonical(value: unknown, position: string, ancestors = new Set<object>(), depth = 0): unknown {\n if (depth > MAX_JSON_SCHEMA_DEPTH) fail(`Schema exceeds the maximum depth of ${MAX_JSON_SCHEMA_DEPTH}`, position);\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (typeof value !== 'object') fail('Schema contains a value that is not JSON', position);\n if (ancestors.has(value)) fail('Schema contains a circular reference', position);\n ancestors.add(value);\n const result = Array.isArray(value)\n ? value.map(item => canonical(item, position, ancestors, depth + 1))\n : Object.fromEntries(\n Object.keys(value)\n .sort()\n .map(key => [key, canonical(Reflect.get(value, key), position, ancestors, depth + 1)]),\n );\n ancestors.delete(value);\n return result;\n}\n\nfunction prepare(raw: unknown, position: string, warnings: string[]): Schema {\n const root = canonical(raw, position);\n const locations = new Map<string, Schema>();\n const references: string[] = [];\n const pointer = (part: string) => part.replace(/~/g, '~0').replace(/\\//g, '~1');\n\n function visit(value: unknown, path: string): Schema {\n if (typeof value === 'boolean') {\n locations.set(path, value);\n return value;\n }\n const schema = object(value) ? value : undefined;\n locations.set(path, schema ?? true);\n const nodePosition = `${position}/schema[${locations.size - 1}]`;\n if (!schema) {\n warnings.push(`Schema is not an object at ${nodePosition}; widened to unknown`);\n return true;\n }\n const output: Record<string, unknown> = Object.create(null);\n const reasons: string[] = [];\n const invalid = (key: string) => reasons.push(`invalid ${JSON.stringify(key)} value`);\n for (const [key, entry] of Object.entries(schema)) {\n const here = `${path}/${pointer(key)}`;\n // Annotations never reach the emitted type, so a malformed one cannot widen or fail it.\n if (annotations.has(key)) continue;\n if (!supported.has(key)) reasons.push(`unsupported keyword ${JSON.stringify(key)}`);\n // A keyword with a value outside its allowed shape widens this schema rather than failing\n // the run: one sloppy tool must not stop generation for every other server.\n if (strings.has(key) && typeof entry !== 'string') {\n invalid(key);\n continue;\n }\n if (booleans.has(key) && typeof entry !== 'boolean') {\n invalid(key);\n continue;\n }\n if (bounds.has(key) && (typeof entry !== 'number' || (key === 'multipleOf' && entry <= 0))) {\n invalid(key);\n continue;\n }\n if (counts.has(key) && !count(entry)) {\n invalid(key);\n continue;\n }\n if (maps.has(key)) {\n if (!object(entry)) {\n invalid(key);\n continue;\n }\n output[key] = Object.fromEntries(\n Object.entries(entry).map(([name, child]) => [name, visit(child, `${here}/${pointer(name)}`)]),\n );\n } else if (singles.has(key)) {\n output[key] = visit(entry, here);\n } else if (lists.has(key) || (key === 'items' && Array.isArray(entry))) {\n if (!Array.isArray(entry) || entry.length === 0) {\n invalid(key);\n continue;\n }\n output[key] = entry.map((child, index) => visit(child, `${here}/${index}`));\n } else if (key === 'items') {\n output[key] = visit(entry, here);\n } else if (key === '$ref') {\n if (typeof entry !== 'string') {\n invalid(key);\n continue;\n }\n if (entry === '#' || entry.startsWith('#/')) {\n references.push(entry);\n output[key] = entry;\n } else {\n reasons.push('external reference');\n }\n } else if (key === 'type') {\n const entries = Array.isArray(entry) ? entry : [entry];\n if (!entries.length || entries.some(type => typeof type !== 'string' || !types.has(type))) {\n invalid(key);\n continue;\n }\n output[key] = entry;\n } else if (key === 'required') {\n if (\n !Array.isArray(entry) ||\n entry.some(name => typeof name !== 'string') ||\n new Set(entry).size !== entry.length\n ) {\n invalid(key);\n continue;\n }\n output[key] = entry;\n } else if (key === 'enum') {\n if (!Array.isArray(entry) || entry.length === 0) {\n invalid(key);\n continue;\n }\n output[key] = entry;\n } else if (key === 'minItems' || key === 'maxItems') {\n if (!count(entry)) {\n invalid(key);\n continue;\n }\n if (entry > 100) reasons.push(`${JSON.stringify(key)} bound above 100`);\n output[key] = entry;\n } else if (key === 'const') {\n output[key] = entry;\n }\n }\n if (reasons.length) {\n const reason = reasons.join('; ');\n warnings.push(`${reason.charAt(0).toUpperCase()}${reason.slice(1)} at ${nodePosition}; widened to unknown`);\n // Keep reference targets even when their containing schema cannot be represented.\n return { ...output, tsType: 'unknown' };\n }\n return output;\n }\n\n const result = visit(root, '');\n for (const ref of references) {\n let target: string;\n try {\n target = decodeURIComponent(ref.slice(1));\n } catch {\n fail('Local reference is not a valid URI fragment', position);\n }\n if (!locations.has(target) || /~(?![01])/u.test(target))\n fail(`Unresolved local reference ${JSON.stringify(ref)}`, position);\n }\n // Reference/combinator-only cycles emit illegal aliases such as type X = X.\n // Properties and array items guard recursion and may refer back to their container.\n const active = new Set<string>();\n const complete = new Set<string>();\n function checkCycle(path: string, depth = 0): void {\n if (depth > MAX_JSON_SCHEMA_DEPTH) fail(`Schema exceeds the maximum depth of ${MAX_JSON_SCHEMA_DEPTH}`, position);\n if (active.has(path)) fail('Unresolvable recursive schema', position);\n if (complete.has(path)) return;\n active.add(path);\n const schema = locations.get(path);\n if (object(schema)) {\n if (typeof schema.$ref === 'string' && (schema.$ref === '#' || schema.$ref.startsWith('#/'))) {\n checkCycle(decodeURIComponent(schema.$ref.slice(1)), depth + 1);\n }\n for (const key of ['allOf', 'anyOf', 'oneOf']) {\n const children = schema[key];\n if (Array.isArray(children)) children.forEach((_, index) => checkCycle(`${path}/${key}/${index}`, depth + 1));\n }\n }\n active.delete(path);\n complete.add(path);\n }\n for (const path of locations.keys()) checkCycle(path);\n return result;\n}\n\nfunction identifier(name: string): string {\n const normalized = name\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/ +/)\n .map(part => part.charAt(0).toUpperCase() + part.slice(1))\n .join('');\n return `Server${normalized || 'Unnamed'}`;\n}\n\n/** Internal catalog-to-source boundary. No connections, loading, or filesystem writes. */\nexport async function generateToolTypes(\n catalog: SerializableMCPToolCatalog,\n): Promise<{ source: string; warnings: string[] }> {\n const declarations: string[] = [];\n const servers: string[] = [];\n const warnings: string[] = [];\n const serverNames = new Map<string, string>();\n const flatNames = new Set<string>();\n let schemaIndex = 0;\n const budget = { values: 0 };\n\n function widen(name: string, position: string, reason: string): string {\n warnings.push(`${reason} at ${position}; widened to unknown`);\n declarations.push(`export type ${name} = unknown;\\n`);\n return name;\n }\n\n async function convert(raw: unknown, position: string): Promise<string> {\n const name = `ToolSchema${++schemaIndex}`;\n // The value count comes first and gates the walk below: `jsonSchemaComplexity` expands the\n // schema-bearing containers it visits, so it must only ever see a schema already bounded by\n // value. An over-budget schema is then widened without being copied, walked, or converted.\n const values = countJsonValues(raw, MAX_SCHEMA_VALUES);\n budget.values += values;\n if (values > MAX_SCHEMA_VALUES) {\n return widen(name, position, `Schema exceeds the maximum value count of ${MAX_SCHEMA_VALUES}`);\n }\n if (budget.values > MAX_CATALOG_VALUES) {\n return widen(name, position, `Catalogue exceeds the maximum value count of ${MAX_CATALOG_VALUES}`);\n }\n const { error, limit } = jsonSchemaComplexity(raw);\n // Depth is a structural violation, not merely an expensive schema: keep failing it.\n if (limit === 'depth') fail(`Schema exceeds the maximum depth of ${MAX_JSON_SCHEMA_DEPTH}`, position);\n if (error) return widen(name, position, error);\n const schema = prepare(raw, position, warnings);\n if (typeof schema === 'boolean') {\n declarations.push(`export type ${name} = ${schema ? 'unknown' : 'never'};\\n`);\n } else {\n const names = new WeakMap<object, string>();\n let nested = 0;\n try {\n declarations.push(\n await compile({ ...schema, title: name }, name, {\n bannerComment: '',\n unknownAny: true,\n enableConstEnums: false,\n $refOptions: { resolve: { external: false, file: false, http: false } },\n customName: value => {\n if (value.title === name) return name;\n if (!names.has(value)) names.set(value, `${name}Value${++nested}`);\n return names.get(value);\n },\n }),\n );\n } catch {\n // The converter is a black box: anything it refuses is a portion we cannot represent, and\n // one such tool must not stop generation for every other server.\n return widen(name, position, 'Schema conversion failed');\n }\n }\n return name;\n }\n\n for (const server of Object.keys(catalog).sort()) {\n const serverName = identifier(server);\n const collision = serverNames.get(serverName);\n if (collision !== undefined)\n throw new TypegenError(\n `Server interface name collision between ${JSON.stringify(collision)} and ${JSON.stringify(server)}`,\n );\n serverNames.set(serverName, server);\n const tools: string[] = [];\n for (const tool of Object.keys(catalog[server]!).sort()) {\n const flat = `${server}_${tool}`;\n if (flatNames.has(flat)) throw new TypegenError(`Flattened tool name collision for ${JSON.stringify(flat)}`);\n flatNames.add(flat);\n const definition = catalog[server]![tool]!;\n const position = `server ${JSON.stringify(server)} tool ${JSON.stringify(tool)}`;\n const input = await convert(definition.inputSchema, `${position} input`);\n const output =\n definition.outputSchema === undefined\n ? 'unknown'\n : await convert(definition.outputSchema, `${position} output`);\n tools.push(` ${JSON.stringify(tool)}: { input: ${input}; output: ${output} };`);\n }\n declarations.push(`export interface ${serverName} {\\n tools: {\\n${tools.join('\\n')}\\n };\\n}\\n`);\n servers.push(` ${JSON.stringify(server)}: ${serverName};`);\n }\n return {\n source: `// Generated MCP tool contracts. Regenerate when server schemas change.\\n\\n${declarations.join('\\n')}\\nexport interface MCPServers {\\n${servers.join('\\n')}\\n}\\n`,\n warnings,\n };\n}\n"],"mappings":";;;AAYA,MAAM,uBAAO,IAAI,IAAI;CAAC;CAAc;CAAqB;CAAe;CAAS;AAAkB,CAAC;AACpG,MAAM,0BAAU,IAAI,IAAI;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,wBAAQ,IAAI,IAAI;CAAC;CAAS;CAAS;CAAS;AAAa,CAAC;AAChE,MAAM,8BAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAED,MAAM,0BAAU,IAAI,IAAI;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAED,MAAM,2BAAW,IAAI,IAAI;CAAC;CAAc;CAAY;CAAa;AAAa,CAAC;;AAE/E,MAAM,yBAAS,IAAI,IAAI;CAAC;CAAW;CAAW;CAAoB;CAAoB;AAAY,CAAC;;AAEnG,MAAM,yBAAS,IAAI,IAAI;CAAC;CAAa;CAAa;CAAiB;CAAiB;CAAe;AAAa,CAAC;AACjH,MAAM,4BAAY,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,wBAAQ,IAAI,IAAI;CAAC;CAAU;CAAS;CAAU;CAAU;CAAW;CAAW;AAAM,CAAC;AAE3F,SAAS,OAAO,OAAkD;CAChE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,MAAM,OAAiC;CAC9C,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU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,MAAM,IAAI,aAAa,qCAAqC,KAAK,UAAU,IAAI,GAAG;GAC3G,UAAU,IAAI,IAAI;GAClB,MAAM,aAAa,QAAQ,OAAO,CAAE;GACpC,MAAM,WAAW,UAAU,KAAK,UAAU,MAAM,EAAE,QAAQ,KAAK,UAAU,IAAI;GAC7E,MAAM,QAAQ,MAAM,QAAQ,WAAW,aAAa,GAAG,SAAS,OAAO;GACvE,MAAM,SACJ,WAAW,iBAAiB,KAAA,IACxB,YACA,MAAM,QAAQ,WAAW,cAAc,GAAG,SAAS,QAAQ;GACjE,MAAM,KAAK,OAAO,KAAK,UAAU,IAAI,EAAE,aAAa,MAAM,YAAY,OAAO,IAAI;EACnF;EACA,aAAa,KAAK,oBAAoB,WAAW,kBAAkB,MAAM,KAAK,IAAI,EAAE,YAAY;EAChG,QAAQ,KAAK,KAAK,KAAK,UAAU,MAAM,EAAE,IAAI,WAAW,EAAE;CAC5D;CACA,OAAO;EACL,QAAQ,8EAA8E,aAAa,KAAK,IAAI,EAAE,mCAAmC,QAAQ,KAAK,IAAI,EAAE;EACpK;CACF;AACF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SerializableMCPToolCatalog } from '../client/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generation failure whose message is safe to surface: it is built from server and tool names,
|
|
4
|
+
* keyword names, and positions, so it never carries schema values or transport details.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TypegenError extends Error {
|
|
7
|
+
constructor(message: string);
|
|
8
|
+
}
|
|
9
|
+
/** Internal catalog-to-source boundary. No connections, loading, or filesystem writes. */
|
|
10
|
+
export declare function generateToolTypes(catalog: SerializableMCPToolCatalog): Promise<{
|
|
11
|
+
source: string;
|
|
12
|
+
warnings: string[];
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=typegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typegen.d.ts","sourceRoot":"","sources":["../../src/cli/typegen.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AA8FlE;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AA4LD,0FAA0F;AAC1F,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA0FjD"}
|
package/dist/client/client.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ export declare class InternalMastraMCPClient extends MastraBase {
|
|
|
67
67
|
name: string;
|
|
68
68
|
private client;
|
|
69
69
|
private readonly timeout;
|
|
70
|
+
private readonly processHooks;
|
|
70
71
|
private logHandler?;
|
|
71
72
|
private readonly serverLogLevel?;
|
|
72
73
|
private enableProgressTracking;
|
|
@@ -103,7 +104,7 @@ export declare class InternalMastraMCPClient extends MastraBase {
|
|
|
103
104
|
/**
|
|
104
105
|
* @internal
|
|
105
106
|
*/
|
|
106
|
-
constructor({ name, version, clientInfo, server, timeout, webhook, }: InternalMastraMCPClientOptions);
|
|
107
|
+
constructor({ name, version, clientInfo, server, timeout, registerProcessHooks, webhook, }: InternalMastraMCPClientOptions);
|
|
107
108
|
/**
|
|
108
109
|
* Log a message at the specified level
|
|
109
110
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAA8B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG7E,OAAO,KAAK,EAAmB,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAShE,OAAO,KAAK,EAEV,eAAe,EACf,iBAAiB,EAC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AGG;IACH,OAAO,CAAC,sBAAsB;IAyQ9B,OAAO,CAAC,mBAAmB;CAQ5B"}
|
|
@@ -6,7 +6,7 @@ import type { ProgressNotification, Prompt, Resource, ResourceTemplateType } fro
|
|
|
6
6
|
import type { MastraMCPServerDefinition, MCPServerAuthState } from './client.js';
|
|
7
7
|
import type { MCPDiscoveryErrorDetails } from './error-utils.js';
|
|
8
8
|
import type { MCPClientWebhookOptions, MCPEventDescriptor, MCPEventSubscribeOptions, MCPEventSubscription } from './events/index.js';
|
|
9
|
-
import type { MCPClientInfo, MCPServerImplementation, SerializableMCPToolCatalog, SerializableMCPToolDefinition } from './types.js';
|
|
9
|
+
import type { MCPClientInfo, MCPClientServers, MCPClientTools, MCPClientToolsets, MCPServerImplementation, MCPServerMap, SerializableMCPToolCatalog, SerializableMCPToolDefinition } from './types.js';
|
|
10
10
|
/** Options for aggregate discovery across configured MCP servers. */
|
|
11
11
|
export interface MCPDiscoveryOptions {
|
|
12
12
|
/** Maximum time to wait for each server's discovery operation, in milliseconds. */
|
|
@@ -15,18 +15,34 @@ export interface MCPDiscoveryOptions {
|
|
|
15
15
|
/**
|
|
16
16
|
* Configuration options for creating an MCPClient instance.
|
|
17
17
|
*/
|
|
18
|
-
export interface MCPClientOptions {
|
|
18
|
+
export interface MCPClientOptions<TServers extends MCPClientServers<TServers> = MCPServerMap> {
|
|
19
19
|
/** Optional unique identifier to prevent memory leaks when creating multiple instances with identical configurations */
|
|
20
20
|
id?: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Map of server names to their connection configurations (stdio or HTTP-based).
|
|
23
|
+
*
|
|
24
|
+
* Broad when no snapshot generic is supplied, so ordinary object literals stay contextually
|
|
25
|
+
* typed (a mapped type over an unresolved type parameter suppresses that); exact keys once the
|
|
26
|
+
* caller supplies a generated server map.
|
|
27
|
+
*/
|
|
28
|
+
servers: string extends keyof TServers ? Record<string, MastraMCPServerDefinition> : Record<keyof NoInfer<TServers> & string, MastraMCPServerDefinition>;
|
|
23
29
|
/** Optional global timeout in milliseconds for all servers (default: 60000ms) */
|
|
24
30
|
timeout?: number;
|
|
31
|
+
/** Optional output path for the package's generate command, relative to its working directory. */
|
|
32
|
+
typegen?: {
|
|
33
|
+
outFile: string;
|
|
34
|
+
};
|
|
25
35
|
/**
|
|
26
36
|
* Default `clientInfo` every server receives on connect and with each request.
|
|
27
37
|
* Per-server `clientInfo` overrides it field-wise. Defaults to the server key and `'1.0.0'`.
|
|
28
38
|
*/
|
|
29
39
|
clientInfo?: MCPClientInfo;
|
|
40
|
+
/**
|
|
41
|
+
* Install process exit and signal hooks that disconnect servers and end the process (default: true).
|
|
42
|
+
* Set to false when the host handles shutdown, and call disconnect() from its shutdown handler.
|
|
43
|
+
* Set this on every client: exit-hook's global signal listeners persist after disconnect().
|
|
44
|
+
*/
|
|
45
|
+
registerProcessHooks?: boolean;
|
|
30
46
|
/**
|
|
31
47
|
* Webhook delivery for MCP Events. Servers that offer webhook delivery POST occurrences to
|
|
32
48
|
* `webhook.url`, which must route to {@link MCPClient.events}`.handleWebhook()`.
|
|
@@ -61,11 +77,15 @@ export interface MCPClientOptions {
|
|
|
61
77
|
* @see [MCP client documentation](https://mastra.ai/reference/tools/mcp-client)
|
|
62
78
|
* if packaged docs are unavailable.
|
|
63
79
|
*/
|
|
64
|
-
export declare class MCPClient extends MastraBase {
|
|
80
|
+
export declare class MCPClient<TServers extends MCPClientServers<TServers> = MCPServerMap> extends MastraBase {
|
|
81
|
+
readonly typegen?: Readonly<{
|
|
82
|
+
outFile: string;
|
|
83
|
+
}>;
|
|
65
84
|
private serverConfigs;
|
|
66
85
|
private id;
|
|
67
86
|
private defaultTimeout;
|
|
68
87
|
private defaultClientInfo?;
|
|
88
|
+
private readonly registerProcessHooks;
|
|
69
89
|
private webhook?;
|
|
70
90
|
private mcpClientsById;
|
|
71
91
|
private disconnectPromise;
|
|
@@ -106,7 +126,7 @@ export declare class MCPClient extends MastraBase {
|
|
|
106
126
|
* });
|
|
107
127
|
* ```
|
|
108
128
|
*/
|
|
109
|
-
constructor(args: MCPClientOptions);
|
|
129
|
+
constructor(args: MCPClientOptions<NoInfer<TServers>>);
|
|
110
130
|
/**
|
|
111
131
|
* Provides access to progress-related operations for tracking long-running operations.
|
|
112
132
|
*
|
|
@@ -720,7 +740,7 @@ export declare class MCPClient extends MastraBase {
|
|
|
720
740
|
* });
|
|
721
741
|
* ```
|
|
722
742
|
*/
|
|
723
|
-
listTools(): Promise<
|
|
743
|
+
listTools(): Promise<MCPClientTools<TServers>>;
|
|
724
744
|
/**
|
|
725
745
|
* Retrieves all tools from all configured servers with namespaced names,
|
|
726
746
|
* along with any per-server errors.
|
|
@@ -740,7 +760,7 @@ export declare class MCPClient extends MastraBase {
|
|
|
740
760
|
* ```
|
|
741
761
|
*/
|
|
742
762
|
listToolsWithErrors(options?: MCPDiscoveryOptions): Promise<{
|
|
743
|
-
tools:
|
|
763
|
+
tools: MCPClientTools<TServers>;
|
|
744
764
|
errors: Record<string, string>;
|
|
745
765
|
errorDetails: Record<string, MCPDiscoveryErrorDetails>;
|
|
746
766
|
durations?: Record<string, number>;
|
|
@@ -768,7 +788,7 @@ export declare class MCPClient extends MastraBase {
|
|
|
768
788
|
* });
|
|
769
789
|
* ```
|
|
770
790
|
*/
|
|
771
|
-
listToolsets(): Promise<
|
|
791
|
+
listToolsets(): Promise<MCPClientToolsets<TServers>>;
|
|
772
792
|
/**
|
|
773
793
|
* Returns toolsets organized by server name, along with any per-server errors.
|
|
774
794
|
*
|
|
@@ -787,7 +807,7 @@ export declare class MCPClient extends MastraBase {
|
|
|
787
807
|
* ```
|
|
788
808
|
*/
|
|
789
809
|
listToolsetsWithErrors(options?: MCPDiscoveryOptions): Promise<{
|
|
790
|
-
toolsets:
|
|
810
|
+
toolsets: MCPClientToolsets<TServers>;
|
|
791
811
|
errors: Record<string, string>;
|
|
792
812
|
errorDetails: Record<string, MCPDiscoveryErrorDetails>;
|
|
793
813
|
durations?: Record<string, number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/client/configuration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIjH,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAQlB,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/client/configuration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIjH,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC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,MAAM,GAAG,IAAI,CAIxD;IAED,OAAO,CAAC,eAAe;YAQT,iBAAiB;YAsCjB,kBAAkB;IAchC,OAAO,CAAC,kBAAkB;YAyBZ,2BAA2B;YAI3B,kBAAkB;YAIlB,iBAAiB;CAuBhC"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { LoggingLevel, LogMessage, LogHandler, MastraMCPServerDefinition, MCPClientCapabilities, MCPClientInfo, MCPClientProtocolVersion, MCPInputRequest, MCPInputRequestHandler, MCPServerImplementation, ProgressHandler, InternalMastraMCPClientOptions, RequireToolApproval, RequireToolApprovalFn, RequireToolApprovalContext, ToolAnnotations, SerializableMCPToolDefinition, SerializableMCPToolCatalog, } from './types.js';
|
|
1
|
+
export type { LoggingLevel, LogMessage, LogHandler, MastraMCPServerDefinition, MCPClientCapabilities, MCPClientInfo, MCPClientProtocolVersion, MCPInputRequest, MCPInputRequestHandler, MCPServerImplementation, ProgressHandler, InternalMastraMCPClientOptions, RequireToolApproval, RequireToolApprovalFn, RequireToolApprovalContext, ToolAnnotations, SerializableMCPToolDefinition, SerializableMCPToolCatalog, MCPServerMap, MCPClientServers, MCPClientTools, MCPClientToolsets, } from './types.js';
|
|
2
2
|
export { MCP_CLIENT_PROTOCOL_VERSION } from './types.js';
|
|
3
3
|
export * from './client.js';
|
|
4
4
|
export type * from './events/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,yBAAyB,EACzB,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,8BAA8B,EAC9B,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,yBAAyB,EACzB,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,8BAA8B,EAC9B,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AACtD,cAAc,UAAU,CAAC;AACzB,mBAAmB,UAAU,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,YAAY,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
|