@kubb/plugin-mcp 5.0.0-alpha.34 → 5.0.0-alpha.35
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/index.cjs +62 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -11
- package/dist/index.js +60 -103
- package/dist/index.js.map +1 -1
- package/package.json +7 -8
- package/src/components/McpHandler.tsx +4 -5
- package/src/components/Server.tsx +7 -8
- package/src/generators/mcpGenerator.tsx +8 -7
- package/src/generators/serverGenerator.tsx +8 -7
- package/src/generators/serverGeneratorLegacy.tsx +8 -7
- package/src/plugin.ts +70 -95
- package/src/types.ts +2 -2
- package/src/utils.ts +5 -5
- package/src/presets.ts +0 -25
package/dist/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "./chunk--u3MIqq1.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { ast, defineGenerator, definePlugin, defineResolver } from "@kubb/core";
|
|
4
4
|
import { functionPrinter, pluginTsName } from "@kubb/plugin-ts";
|
|
5
|
-
import { Const, File, Function as Function$1 } from "@kubb/renderer-jsx";
|
|
5
|
+
import { Const, File, Function as Function$1, jsxRenderer } from "@kubb/renderer-jsx";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "@kubb/renderer-jsx/jsx-runtime";
|
|
7
|
-
import { createPlugin, defineGenerator, definePresets, defineResolver, getPreset, mergeGenerators } from "@kubb/core";
|
|
8
7
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
9
8
|
import { pluginClientName } from "@kubb/plugin-client";
|
|
10
9
|
import { source } from "@kubb/plugin-client/templates/clients/axios.source";
|
|
@@ -309,7 +308,7 @@ function McpHandler({ name, node, resolver, baseURL, dataReturnType, paramsCasin
|
|
|
309
308
|
const urlPath = new URLPath(node.path);
|
|
310
309
|
const contentType = node.requestBody?.contentType;
|
|
311
310
|
const isFormData = contentType === "multipart/form-data";
|
|
312
|
-
const casedParams = caseParams(node.parameters, paramsCasing);
|
|
311
|
+
const casedParams = ast.caseParams(node.parameters, paramsCasing);
|
|
313
312
|
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
314
313
|
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
315
314
|
const originalPathParams = node.parameters.filter((p) => p.in === "path");
|
|
@@ -323,7 +322,7 @@ function McpHandler({ name, node, resolver, baseURL, dataReturnType, paramsCasin
|
|
|
323
322
|
`ResponseErrorConfig<${errorResponses.length > 0 ? errorResponses.join(" | ") : "Error"}>`,
|
|
324
323
|
requestName || "unknown"
|
|
325
324
|
].filter(Boolean);
|
|
326
|
-
const paramsNode = createOperationParams(node, {
|
|
325
|
+
const paramsNode = ast.createOperationParams(node, {
|
|
327
326
|
paramsType: "object",
|
|
328
327
|
pathParamsType: "inline",
|
|
329
328
|
resolver,
|
|
@@ -417,7 +416,7 @@ function Server({ name, serverName, serverVersion, paramsCasing, operations }) {
|
|
|
417
416
|
`
|
|
418
417
|
}),
|
|
419
418
|
operations.map(({ tool, mcp, zod, node }) => {
|
|
420
|
-
const pathParams = caseParams(node.parameters, paramsCasing).filter((p) => p.in === "path");
|
|
419
|
+
const pathParams = ast.caseParams(node.parameters, paramsCasing).filter((p) => p.in === "path");
|
|
421
420
|
const pathEntries = [];
|
|
422
421
|
const otherEntries = [];
|
|
423
422
|
for (const p of pathParams) {
|
|
@@ -441,7 +440,7 @@ function Server({ name, serverName, serverVersion, paramsCasing, operations }) {
|
|
|
441
440
|
});
|
|
442
441
|
otherEntries.sort((a, b) => a.key.localeCompare(b.key));
|
|
443
442
|
const entries = [...pathEntries, ...otherEntries];
|
|
444
|
-
const paramsNode = entries.length ? createFunctionParameters({ params: [createParameterGroup({ properties: entries.map((e) => createFunctionParameter({
|
|
443
|
+
const paramsNode = entries.length ? ast.createFunctionParameters({ params: [ast.createParameterGroup({ properties: entries.map((e) => ast.createFunctionParameter({
|
|
445
444
|
name: e.key,
|
|
446
445
|
optional: false
|
|
447
446
|
})) })] }) : void 0;
|
|
@@ -489,12 +488,13 @@ server.registerTool(${JSON.stringify(tool.name)}, {
|
|
|
489
488
|
//#region src/generators/mcpGenerator.tsx
|
|
490
489
|
const mcpGenerator = defineGenerator({
|
|
491
490
|
name: "mcp",
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
const {
|
|
491
|
+
renderer: jsxRenderer,
|
|
492
|
+
operation(node, ctx) {
|
|
493
|
+
const { resolver, driver, root } = ctx;
|
|
494
|
+
const { output, client, paramsCasing, group } = ctx.options;
|
|
495
495
|
const pluginTs = driver.getPlugin(pluginTsName);
|
|
496
496
|
if (!pluginTs?.resolver) return null;
|
|
497
|
-
const casedParams = caseParams(node.parameters, paramsCasing);
|
|
497
|
+
const casedParams = ast.caseParams(node.parameters, paramsCasing);
|
|
498
498
|
const pathParams = casedParams.filter((p) => p.in === "path");
|
|
499
499
|
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
500
500
|
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
@@ -615,9 +615,10 @@ const mcpGenerator = defineGenerator({
|
|
|
615
615
|
*/
|
|
616
616
|
const serverGenerator = defineGenerator({
|
|
617
617
|
name: "operations",
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
const {
|
|
618
|
+
renderer: jsxRenderer,
|
|
619
|
+
operations(nodes, ctx) {
|
|
620
|
+
const { adapter, config, resolver, plugin, driver, root } = ctx;
|
|
621
|
+
const { output, paramsCasing, group } = ctx.options;
|
|
621
622
|
const pluginZod = driver.getPlugin(pluginZodName);
|
|
622
623
|
if (!pluginZod?.resolver) return;
|
|
623
624
|
const name = "server";
|
|
@@ -632,7 +633,7 @@ const serverGenerator = defineGenerator({
|
|
|
632
633
|
meta: { pluginName: plugin.name }
|
|
633
634
|
};
|
|
634
635
|
const operationsMapped = nodes.map((node) => {
|
|
635
|
-
const casedParams = caseParams(node.parameters, paramsCasing);
|
|
636
|
+
const casedParams = ast.caseParams(node.parameters, paramsCasing);
|
|
636
637
|
const pathParams = casedParams.filter((p) => p.in === "path");
|
|
637
638
|
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
638
639
|
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
@@ -769,9 +770,10 @@ const serverGenerator = defineGenerator({
|
|
|
769
770
|
*/
|
|
770
771
|
const serverGeneratorLegacy = defineGenerator({
|
|
771
772
|
name: "operations",
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
const {
|
|
773
|
+
renderer: jsxRenderer,
|
|
774
|
+
operations(nodes, ctx) {
|
|
775
|
+
const { adapter, config, resolver, plugin, driver, root } = ctx;
|
|
776
|
+
const { output, paramsCasing, group } = ctx.options;
|
|
775
777
|
const pluginZod = driver.getPlugin(pluginZodName);
|
|
776
778
|
if (!pluginZod?.resolver) return;
|
|
777
779
|
const name = "server";
|
|
@@ -786,7 +788,7 @@ const serverGeneratorLegacy = defineGenerator({
|
|
|
786
788
|
meta: { pluginName: plugin.name }
|
|
787
789
|
};
|
|
788
790
|
const operationsMapped = nodes.map((node) => {
|
|
789
|
-
const casedParams = caseParams(node.parameters, paramsCasing);
|
|
791
|
+
const casedParams = ast.caseParams(node.parameters, paramsCasing);
|
|
790
792
|
const queryParams = casedParams.filter((p) => p.in === "query");
|
|
791
793
|
const headerParams = casedParams.filter((p) => p.in === "header");
|
|
792
794
|
const mcpFile = resolver.resolveFile({
|
|
@@ -907,9 +909,6 @@ const serverGeneratorLegacy = defineGenerator({
|
|
|
907
909
|
}
|
|
908
910
|
});
|
|
909
911
|
//#endregion
|
|
910
|
-
//#region package.json
|
|
911
|
-
var version = "5.0.0-alpha.34";
|
|
912
|
-
//#endregion
|
|
913
912
|
//#region src/resolvers/resolverMcp.ts
|
|
914
913
|
/**
|
|
915
914
|
* Resolver for `@kubb/plugin-mcp` that provides the default naming
|
|
@@ -935,65 +934,38 @@ const resolverMcp = defineResolver(() => ({
|
|
|
935
934
|
}
|
|
936
935
|
}));
|
|
937
936
|
//#endregion
|
|
938
|
-
//#region src/presets.ts
|
|
939
|
-
/**
|
|
940
|
-
* Built-in preset registry for `@kubb/plugin-mcp`.
|
|
941
|
-
*
|
|
942
|
-
* - `default` — v5 naming with individual zod schemas and per-status responses.
|
|
943
|
-
* - `kubbV4` — legacy naming with grouped zod schemas and combined responses.
|
|
944
|
-
*/
|
|
945
|
-
const presets = definePresets({
|
|
946
|
-
default: {
|
|
947
|
-
name: "default",
|
|
948
|
-
resolver: resolverMcp,
|
|
949
|
-
generators: [mcpGenerator, serverGenerator]
|
|
950
|
-
},
|
|
951
|
-
kubbV4: {
|
|
952
|
-
name: "kubbV4",
|
|
953
|
-
resolver: resolverMcp,
|
|
954
|
-
generators: [mcpGenerator, serverGeneratorLegacy]
|
|
955
|
-
}
|
|
956
|
-
});
|
|
957
|
-
//#endregion
|
|
958
937
|
//#region src/plugin.ts
|
|
959
938
|
const pluginMcpName = "plugin-mcp";
|
|
960
|
-
const pluginMcp =
|
|
939
|
+
const pluginMcp = definePlugin((options) => {
|
|
961
940
|
const { output = {
|
|
962
941
|
path: "mcp",
|
|
963
942
|
barrelType: "named"
|
|
964
|
-
}, group, exclude = [], include, override = [], paramsCasing, client,
|
|
943
|
+
}, group, exclude = [], include, override = [], paramsCasing, client, resolver: userResolver, transformer: userTransformer, generators: userGenerators = [], compatibilityPreset = "default" } = options;
|
|
944
|
+
const defaultServerGenerator = compatibilityPreset === "kubbV4" ? serverGeneratorLegacy : serverGenerator;
|
|
965
945
|
const clientName = client?.client ?? "axios";
|
|
966
946
|
const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : void 0);
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
}
|
|
974
|
-
const mergedGenerator = mergeGenerators(preset.generators ?? []);
|
|
947
|
+
const groupConfig = group ? {
|
|
948
|
+
...group,
|
|
949
|
+
name: group.name ? group.name : (ctx) => {
|
|
950
|
+
if (group.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
951
|
+
return `${camelCase(ctx.group)}Requests`;
|
|
952
|
+
}
|
|
953
|
+
} : void 0;
|
|
975
954
|
return {
|
|
976
955
|
name: pluginMcpName,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
return {
|
|
956
|
+
options,
|
|
957
|
+
dependencies: [pluginTsName, pluginZodName],
|
|
958
|
+
hooks: { "kubb:plugin:setup"(ctx) {
|
|
959
|
+
const resolver = userResolver ? {
|
|
960
|
+
...resolverMcp,
|
|
961
|
+
...userResolver
|
|
962
|
+
} : resolverMcp;
|
|
963
|
+
ctx.setOptions({
|
|
986
964
|
output,
|
|
987
965
|
exclude,
|
|
988
966
|
include,
|
|
989
967
|
override,
|
|
990
|
-
group:
|
|
991
|
-
...group,
|
|
992
|
-
name: group.name ? group.name : (ctx) => {
|
|
993
|
-
if (group.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
994
|
-
return `${camelCase(ctx.group)}Requests`;
|
|
995
|
-
}
|
|
996
|
-
} : void 0,
|
|
968
|
+
group: groupConfig,
|
|
997
969
|
paramsCasing,
|
|
998
970
|
client: {
|
|
999
971
|
client: clientName,
|
|
@@ -1004,51 +976,36 @@ const pluginMcp = createPlugin((options) => {
|
|
|
1004
976
|
baseURL: client?.baseURL,
|
|
1005
977
|
paramsCasing: client?.paramsCasing
|
|
1006
978
|
},
|
|
1007
|
-
resolver
|
|
1008
|
-
};
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
async operations(nodes, options) {
|
|
1018
|
-
return mergedGenerator.operations?.call(this, nodes, options);
|
|
1019
|
-
},
|
|
1020
|
-
async buildStart() {
|
|
1021
|
-
const { adapter, driver } = this;
|
|
1022
|
-
const root = this.root;
|
|
1023
|
-
const baseURL = adapter?.inputNode?.meta?.baseURL;
|
|
1024
|
-
if (baseURL) this.plugin.options.client.baseURL = this.plugin.options.client.baseURL || baseURL;
|
|
1025
|
-
const hasClientPlugin = !!driver.getPlugin(pluginClientName);
|
|
1026
|
-
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.addFile(createFile({
|
|
979
|
+
resolver
|
|
980
|
+
});
|
|
981
|
+
ctx.setResolver(resolver);
|
|
982
|
+
if (userTransformer) ctx.setTransformer(userTransformer);
|
|
983
|
+
ctx.addGenerator(mcpGenerator);
|
|
984
|
+
ctx.addGenerator(defaultServerGenerator);
|
|
985
|
+
for (const gen of userGenerators) ctx.addGenerator(gen);
|
|
986
|
+
const root = path.resolve(ctx.config.root, ctx.config.output.path);
|
|
987
|
+
const hasClientPlugin = ctx.config.plugins?.some((p) => p.name === pluginClientName);
|
|
988
|
+
if (client?.bundle && !hasClientPlugin && !clientImportPath) ctx.injectFile({
|
|
1027
989
|
baseName: "fetch.ts",
|
|
1028
990
|
path: path.resolve(root, ".kubb/fetch.ts"),
|
|
1029
|
-
sources: [createSource({
|
|
991
|
+
sources: [ast.createSource({
|
|
1030
992
|
name: "fetch",
|
|
1031
|
-
nodes: [createText(
|
|
993
|
+
nodes: [ast.createText(clientName === "fetch" ? source$1 : source)],
|
|
1032
994
|
isExportable: true,
|
|
1033
995
|
isIndexable: true
|
|
1034
|
-
})]
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
}));
|
|
1038
|
-
if (!hasClientPlugin) await this.addFile(createFile({
|
|
996
|
+
})]
|
|
997
|
+
});
|
|
998
|
+
if (!hasClientPlugin) ctx.injectFile({
|
|
1039
999
|
baseName: "config.ts",
|
|
1040
1000
|
path: path.resolve(root, ".kubb/config.ts"),
|
|
1041
|
-
sources: [createSource({
|
|
1001
|
+
sources: [ast.createSource({
|
|
1042
1002
|
name: "config",
|
|
1043
|
-
nodes: [createText(source$2)],
|
|
1003
|
+
nodes: [ast.createText(source$2)],
|
|
1044
1004
|
isExportable: false,
|
|
1045
1005
|
isIndexable: false
|
|
1046
|
-
})]
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}));
|
|
1050
|
-
await this.openInStudio({ ast: true });
|
|
1051
|
-
}
|
|
1006
|
+
})]
|
|
1007
|
+
});
|
|
1008
|
+
} }
|
|
1052
1009
|
};
|
|
1053
1010
|
});
|
|
1054
1011
|
//#endregion
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["#options","#transformParam","#eachParam","Function","Function","fetchClientSource","axiosClientSource","configSource"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../src/utils.ts","../src/components/McpHandler.tsx","../src/components/Server.tsx","../src/generators/mcpGenerator.tsx","../src/generators/serverGenerator.tsx","../src/generators/serverGeneratorLegacy.tsx","../package.json","../src/resolvers/resolverMcp.ts","../src/presets.ts","../src/plugin.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * JavaScript and Java reserved words.\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = new Set([\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n 'Array',\n 'Date',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n] as const)\n\n/**\n * Prefixes `word` with `_` when it is a reserved JavaScript/Java identifier or starts with a digit.\n *\n * @example\n * ```ts\n * transformReservedWord('class') // '_class'\n * transformReservedWord('42foo') // '_42foo'\n * transformReservedWord('status') // 'status'\n * ```\n */\nexport function transformReservedWord(word: string): string {\n const firstChar = word.charCodeAt(0)\n if (word && (reservedWords.has(word as 'valueOf') || (firstChar >= 48 && firstChar <= 57))) {\n return `_${word}`\n }\n return word\n}\n\n/**\n * Returns `true` when `name` is a syntactically valid JavaScript variable name.\n *\n * @example\n * ```ts\n * isValidVarName('status') // true\n * isValidVarName('class') // false (reserved word)\n * isValidVarName('42foo') // false (starts with digit)\n * ```\n */\nexport function isValidVarName(name: string): boolean {\n try {\n new Function(`var ${name}`)\n } catch {\n return false\n }\n return true\n}\n","import { camelCase } from './casing.ts'\nimport { isValidVarName } from './reserved.ts'\n\nexport type URLObject = {\n /**\n * The resolved URL string (Express-style or template literal, depending on context).\n */\n url: string\n /**\n * Extracted path parameters as a key-value map, or `undefined` when the path has none.\n */\n params?: Record<string, string>\n}\n\ntype ObjectOptions = {\n /**\n * Controls whether the `url` is rendered as an Express path or a template literal.\n * @default 'path'\n */\n type?: 'path' | 'template'\n /**\n * Optional transform applied to each extracted parameter name.\n */\n replacer?: (pathParam: string) => string\n /**\n * When `true`, the result is serialized to a string expression instead of a plain object.\n */\n stringify?: boolean\n}\n\n/**\n * Supported identifier casing strategies for path parameters.\n */\ntype PathCasing = 'camelcase'\n\ntype Options = {\n /**\n * Casing strategy applied to path parameter names.\n * @default undefined (original identifier preserved)\n */\n casing?: PathCasing\n}\n\n/**\n * Parses and transforms an OpenAPI/Swagger path string into various URL formats.\n *\n * @example\n * const p = new URLPath('/pet/{petId}')\n * p.URL // '/pet/:petId'\n * p.template // '`/pet/${petId}`'\n */\nexport class URLPath {\n /**\n * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.\n */\n path: string\n\n #options: Options\n\n constructor(path: string, options: Options = {}) {\n this.path = path\n this.#options = options\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').URL // '/pet/:petId'\n * ```\n */\n get URL(): string {\n return this.toURLPath()\n }\n\n /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).\n *\n * @example\n * ```ts\n * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true\n * new URLPath('/pet/{petId}').isURL // false\n * ```\n */\n get isURL(): boolean {\n try {\n return !!new URL(this.path).href\n } catch {\n return false\n }\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n *\n * @example\n * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'\n * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'\n */\n get template(): string {\n return this.toTemplateString()\n }\n\n /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').object\n * // { url: '/pet/:petId', params: { petId: 'petId' } }\n * ```\n */\n get object(): URLObject | string {\n return this.toObject()\n }\n\n /** Returns a map of path parameter names, or `undefined` when the path has no parameters.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').params // { petId: 'petId' }\n * new URLPath('/pet').params // undefined\n * ```\n */\n get params(): Record<string, string> | undefined {\n return this.getParams()\n }\n\n #transformParam(raw: string): string {\n const param = isValidVarName(raw) ? raw : camelCase(raw)\n return this.#options.casing === 'camelcase' ? camelCase(param) : param\n }\n\n /**\n * Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.\n */\n #eachParam(fn: (raw: string, param: string) => void): void {\n for (const match of this.path.matchAll(/\\{([^}]+)\\}/g)) {\n const raw = match[1]!\n fn(raw, this.#transformParam(raw))\n }\n }\n\n toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string {\n const object = {\n url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }),\n params: this.getParams(),\n }\n\n if (stringify) {\n if (type === 'template') {\n return JSON.stringify(object).replaceAll(\"'\", '').replaceAll(`\"`, '')\n }\n\n if (object.params) {\n return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll(\"'\", '').replaceAll(`\"`, '')} }`\n }\n\n return `{ url: '${object.url}' }`\n }\n\n return object\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n * An optional `replacer` can transform each extracted parameter name before interpolation.\n *\n * @example\n * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'\n */\n toTemplateString({ prefix = '', replacer }: { prefix?: string; replacer?: (pathParam: string) => string } = {}): string {\n const parts = this.path.split(/\\{([^}]+)\\}/)\n const result = parts\n .map((part, i) => {\n if (i % 2 === 0) return part\n const param = this.#transformParam(part)\n return `\\${${replacer ? replacer(param) : param}}`\n })\n .join('')\n\n return `\\`${prefix}${result}\\``\n }\n\n /**\n * Extracts all `{param}` segments from the path and returns them as a key-value map.\n * An optional `replacer` transforms each parameter name in both key and value positions.\n * Returns `undefined` when no path parameters are found.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}/tag/{tagId}').getParams()\n * // { petId: 'petId', tagId: 'tagId' }\n * ```\n */\n getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined {\n const params: Record<string, string> = {}\n\n this.#eachParam((_raw, param) => {\n const key = replacer ? replacer(param) : param\n params[key] = key\n })\n\n return Object.keys(params).length > 0 ? params : undefined\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'\n * ```\n */\n toURLPath(): string {\n return this.path.replace(/\\{([^}]+)\\}/g, ':$1')\n }\n}\n","import { camelCase } from '@internals/utils'\nimport type { OperationNode, SchemaNode, StatusCode } from '@kubb/ast/types'\n\n/**\n * Find the first 2xx response status code from an operation's responses.\n */\nexport function findSuccessStatusCode(responses: Array<{ statusCode: number | string }>): StatusCode | undefined {\n for (const res of responses) {\n const code = Number(res.statusCode)\n if (code >= 200 && code < 300) {\n return res.statusCode as StatusCode\n }\n }\n return undefined\n}\n\nexport type ZodParam = {\n name: string\n schemaName: string\n}\n\n/**\n * Render a group param value — either a group schema name directly (kubbV4),\n * or compose individual schemas into `z.object({ ... })` (v5).\n */\nexport function zodGroupExpr(entry: string | Array<ZodParam>): string {\n if (typeof entry === 'string') {\n return entry\n }\n const entries = entry.map((p) => `${JSON.stringify(p.name)}: ${p.schemaName}`)\n return `z.object({ ${entries.join(', ')} })`\n}\n\n/**\n * Build JSDoc comment lines from an OperationNode.\n */\nexport function getComments(node: OperationNode): Array<string> {\n return [\n node.description && `@description ${node.description}`,\n node.summary && `@summary ${node.summary}`,\n node.deprecated && '@deprecated',\n `{@link ${node.path.replaceAll('{', ':').replaceAll('}', '')}}`,\n ].filter((x): x is string => Boolean(x))\n}\n\n/**\n * Build a mapping of original param names → camelCase names.\n * Returns `undefined` when no names actually change (no remapping needed).\n */\nexport function getParamsMapping(params: Array<{ name: string }>): Record<string, string> | undefined {\n if (!params.length) {\n return undefined\n }\n\n const mapping: Record<string, string> = {}\n let hasDifference = false\n\n for (const p of params) {\n const camelName = camelCase(p.name)\n mapping[p.name] = camelName\n if (p.name !== camelName) {\n hasDifference = true\n }\n }\n\n return hasDifference ? mapping : undefined\n}\n\n/**\n * Convert a SchemaNode type to an inline Zod expression string.\n * Used as fallback when no named zod schema is available for a path parameter.\n */\nexport function zodExprFromSchemaNode(schema: SchemaNode): string {\n let expr: string\n switch (schema.type) {\n case 'enum': {\n // namedEnumValues takes priority over enumValues\n const rawValues: Array<string | number | boolean> = schema.namedEnumValues?.length\n ? schema.namedEnumValues.map((v) => v.value)\n : (schema.enumValues ?? []).filter((v): v is string | number | boolean => v !== null)\n\n if (rawValues.length > 0 && rawValues.every((v) => typeof v === 'string')) {\n expr = `z.enum([${rawValues.map((v) => JSON.stringify(v)).join(', ')}])`\n } else if (rawValues.length > 0) {\n const literals = rawValues.map((v) => `z.literal(${JSON.stringify(v)})`)\n expr = literals.length === 1 ? literals[0]! : `z.union([${literals.join(', ')}])`\n } else {\n expr = 'z.string()'\n }\n break\n }\n case 'integer':\n expr = 'z.coerce.number()'\n break\n case 'number':\n expr = 'z.number()'\n break\n case 'boolean':\n expr = 'z.boolean()'\n break\n case 'array':\n expr = 'z.array(z.unknown())'\n break\n default:\n expr = 'z.string()'\n }\n\n if (schema.nullable) {\n expr = `${expr}.nullable()`\n }\n\n return expr\n}\n","import { isValidVarName, URLPath } from '@internals/utils'\nimport { caseParams, createOperationParams } from '@kubb/ast'\nimport type { OperationNode } from '@kubb/ast/types'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PluginMcp } from '../types.ts'\nimport { getComments, getParamsMapping } from '../utils.ts'\n\ntype Props = {\n /**\n * Name of the handler function.\n */\n name: string\n /**\n * AST operation node.\n */\n node: OperationNode\n /**\n * TypeScript resolver for resolving param/data/response type names.\n */\n resolver: ResolverTs\n /**\n * Base URL prepended to every generated request URL.\n */\n baseURL: string | undefined\n /**\n * Return type when calling fetch.\n * - 'data' returns response data only.\n * - 'full' returns the full response object.\n * @default 'data'\n */\n dataReturnType: PluginMcp['resolvedOptions']['client']['dataReturnType']\n /**\n * How to style your params.\n */\n paramsCasing?: PluginMcp['resolvedOptions']['paramsCasing']\n}\n\n/**\n * Generate a remapping statement: `const mappedX = x ? { \"orig\": x.camel, ... } : undefined`\n */\nfunction buildRemappingCode(mapping: Record<string, string>, varName: string, sourceName: string): string {\n const pairs = Object.entries(mapping)\n .map(([orig, camel]) => `\"${orig}\": ${sourceName}.${camel}`)\n .join(', ')\n return `const ${varName} = ${sourceName} ? { ${pairs} } : undefined`\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nexport function McpHandler({ name, node, resolver, baseURL, dataReturnType, paramsCasing }: Props): KubbReactNode {\n const urlPath = new URLPath(node.path)\n const contentType = node.requestBody?.contentType\n const isFormData = contentType === 'multipart/form-data'\n\n const casedParams = caseParams(node.parameters, paramsCasing)\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n // Use original (uncased) parameters for mapping so original→camelCase difference is detected\n const originalPathParams = node.parameters.filter((p) => p.in === 'path')\n const originalQueryParams = node.parameters.filter((p) => p.in === 'query')\n const originalHeaderParams = node.parameters.filter((p) => p.in === 'header')\n\n const requestName = node.requestBody?.schema ? resolver.resolveDataName(node) : undefined\n const responseName = resolver.resolveResponseName(node)\n\n const errorResponses = node.responses.filter((r) => Number(r.statusCode) >= 400).map((r) => resolver.resolveResponseStatusName(node, r.statusCode))\n const errorType = errorResponses.length > 0 ? errorResponses.join(' | ') : 'Error'\n\n const TError = `ResponseErrorConfig<${errorType}>`\n const generics = [responseName, TError, requestName || 'unknown'].filter(Boolean)\n\n const paramsNode = createOperationParams(node, {\n paramsType: 'object',\n pathParamsType: 'inline',\n resolver,\n paramsCasing,\n })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n const pathParamsMapping = paramsCasing ? getParamsMapping(originalPathParams) : undefined\n const queryParamsMapping = paramsCasing ? getParamsMapping(originalQueryParams) : undefined\n const headerParamsMapping = paramsCasing ? getParamsMapping(originalHeaderParams) : undefined\n\n const contentTypeHeader =\n contentType && contentType !== 'application/json' && contentType !== 'multipart/form-data' ? `'Content-Type': '${contentType}'` : undefined\n const headers = [headerParams.length ? (headerParamsMapping ? '...mappedHeaders' : '...headers') : undefined, contentTypeHeader].filter(Boolean)\n\n const fetchConfig: string[] = []\n fetchConfig.push(`method: ${JSON.stringify(node.method.toUpperCase())}`)\n fetchConfig.push(`url: ${urlPath.template}`)\n if (baseURL) fetchConfig.push(`baseURL: \\`${baseURL}\\``)\n if (queryParams.length) fetchConfig.push(queryParamsMapping ? 'params: mappedParams' : 'params')\n if (requestName) fetchConfig.push(`data: ${isFormData ? 'formData as FormData' : 'requestData'}`)\n if (headers.length) fetchConfig.push(`headers: { ${headers.join(', ')} }`)\n\n const callToolResult =\n dataReturnType === 'data'\n ? `return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(res.data)\n }\n ],\n structuredContent: { data: res.data }\n }`\n : `return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(res)\n }\n ],\n structuredContent: { data: res.data }\n }`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n async\n export\n params={paramsSignature}\n JSDoc={{\n comments: getComments(node),\n }}\n returnType={'Promise<CallToolResult>'}\n >\n {''}\n <br />\n <br />\n {pathParamsMapping &&\n Object.entries(pathParamsMapping)\n .filter(([originalName, camelCaseName]) => originalName !== camelCaseName && isValidVarName(originalName))\n .map(([originalName, camelCaseName]) => `const ${originalName} = ${camelCaseName}`)\n .join('\\n')}\n {pathParamsMapping && (\n <>\n <br />\n <br />\n </>\n )}\n {queryParamsMapping && queryParams.length > 0 && (\n <>\n {buildRemappingCode(queryParamsMapping, 'mappedParams', 'params')}\n <br />\n <br />\n </>\n )}\n {headerParamsMapping && headerParams.length > 0 && (\n <>\n {buildRemappingCode(headerParamsMapping, 'mappedHeaders', 'headers')}\n <br />\n <br />\n </>\n )}\n {requestName && 'const requestData = data'}\n <br />\n {isFormData && requestName && 'const formData = buildFormData(requestData)'}\n <br />\n {`const res = await fetch<${generics.join(', ')}>({ ${fetchConfig.join(', ')} })`}\n <br />\n {callToolResult}\n </Function>\n </File.Source>\n )\n}\n","import { caseParams, createFunctionParameter, createFunctionParameters, createParameterGroup } from '@kubb/ast'\nimport type { FileNode, OperationNode } from '@kubb/ast/types'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { Const, File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PluginMcp } from '../types.ts'\nimport type { ZodParam } from '../utils.ts'\nimport { zodExprFromSchemaNode, zodGroupExpr } from '../utils.ts'\n\ntype Props = {\n /**\n * Variable name for the MCP server instance (e.g. 'server').\n */\n name: string\n /**\n * Human-readable server name passed to `new McpServer({ name })`.\n */\n serverName: string\n /**\n * Semantic version string passed to `new McpServer({ version })`.\n */\n serverVersion: string\n /**\n * How to style your params.\n */\n paramsCasing?: PluginMcp['resolvedOptions']['paramsCasing']\n /**\n * Operations to register as MCP tools, each carrying its handler,\n * zod schema, and AST node metadata.\n */\n operations: Array<{\n tool: {\n name: string\n title?: string\n description: string\n }\n mcp: {\n name: string\n file: FileNode\n }\n zod: {\n pathParams: Array<ZodParam>\n /**\n * Query params — either a group schema name (kubbV4) or individual schemas to compose (v5).\n */\n queryParams?: string | Array<ZodParam>\n /**\n * Header params — either a group schema name (kubbV4) or individual schemas to compose (v5).\n */\n headerParams?: string | Array<ZodParam>\n requestName?: string\n responseName?: string\n }\n node: OperationNode\n }>\n}\n\nconst keysPrinter = functionPrinter({ mode: 'keys' })\n\nexport function Server({ name, serverName, serverVersion, paramsCasing, operations }: Props): KubbReactNode {\n return (\n <File.Source name={name} isExportable isIndexable>\n <Const name={'server'} export>\n {`\n new McpServer({\n name: '${serverName}',\n version: '${serverVersion}',\n})\n `}\n </Const>\n\n {operations\n .map(({ tool, mcp, zod, node }) => {\n const casedParams = caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n\n const pathEntries: Array<{ key: string; value: string }> = []\n const otherEntries: Array<{ key: string; value: string }> = []\n\n for (const p of pathParams) {\n const zodParam = zod.pathParams.find((zp) => zp.name === p.name)\n pathEntries.push({ key: p.name, value: zodParam ? zodParam.schemaName : zodExprFromSchemaNode(p.schema) })\n }\n\n if (zod.requestName) {\n otherEntries.push({ key: 'data', value: zod.requestName })\n }\n\n if (zod.queryParams) {\n otherEntries.push({ key: 'params', value: zodGroupExpr(zod.queryParams) })\n }\n\n if (zod.headerParams) {\n otherEntries.push({ key: 'headers', value: zodGroupExpr(zod.headerParams) })\n }\n\n otherEntries.sort((a, b) => a.key.localeCompare(b.key))\n const entries = [...pathEntries, ...otherEntries]\n\n const paramsNode = entries.length\n ? createFunctionParameters({\n params: [\n createParameterGroup({\n properties: entries.map((e) => createFunctionParameter({ name: e.key, optional: false })),\n }),\n ],\n })\n : undefined\n\n const destructured = paramsNode ? (keysPrinter.print(paramsNode) ?? '') : ''\n const inputSchema = entries.length ? `{ ${entries.map((e) => `${e.key}: ${e.value}`).join(', ')} }` : undefined\n const outputSchema = zod.responseName\n\n const config = [\n tool.title ? `title: ${JSON.stringify(tool.title)}` : null,\n `description: ${JSON.stringify(tool.description)}`,\n outputSchema ? `outputSchema: { data: ${outputSchema} }` : null,\n ]\n .filter(Boolean)\n .join(',\\n ')\n\n if (inputSchema) {\n return `\nserver.registerTool(${JSON.stringify(tool.name)}, {\n ${config},\n inputSchema: ${inputSchema},\n}, async (${destructured}) => {\n return ${mcp.name}(${destructured})\n})\n `\n }\n\n return `\nserver.registerTool(${JSON.stringify(tool.name)}, {\n ${config},\n}, async () => {\n return ${mcp.name}()\n})\n `\n })\n .filter(Boolean)}\n\n <Function name=\"startServer\" async export>\n {`try {\n const transport = new StdioServerTransport()\n await server.connect(transport)\n\n } catch (error) {\n console.error('Failed to start server:', error)\n process.exit(1)\n }`}\n </Function>\n </File.Source>\n )\n}\n","import path from 'node:path'\nimport { caseParams } from '@kubb/ast'\nimport { defineGenerator } from '@kubb/core'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File } from '@kubb/renderer-jsx'\nimport { McpHandler } from '../components/McpHandler.tsx'\nimport type { PluginMcp } from '../types.ts'\n\nexport const mcpGenerator = defineGenerator<PluginMcp>({\n name: 'mcp',\n operation(node, options) {\n const { resolver, driver, root } = this\n const { output, client, paramsCasing, group } = options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n\n if (!pluginTs?.resolver) {\n return null\n }\n\n const casedParams = caseParams(node.parameters, paramsCasing)\n\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const importedTypeNames = [\n ...pathParams.map((p) => pluginTs.resolver.resolvePathParamsName(node, p)),\n ...queryParams.map((p) => pluginTs.resolver.resolveQueryParamsName(node, p)),\n ...headerParams.map((p) => pluginTs.resolver.resolveHeaderParamsName(node, p)),\n node.requestBody?.schema ? pluginTs.resolver.resolveDataName(node) : undefined,\n pluginTs.resolver.resolveResponseName(node),\n ...node.responses.filter((r) => Number(r.statusCode) >= 400).map((r) => pluginTs.resolver.resolveResponseStatusName(node, r.statusCode)),\n ].filter(Boolean)\n\n const meta = {\n name: resolver.resolveName(node.operationId),\n file: resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n fileTs: pluginTs.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginTs.options?.output ?? output,\n group: pluginTs.options?.group,\n },\n ),\n } as const\n\n return (\n <File baseName={meta.file.baseName} path={meta.file.path} meta={meta.file.meta}>\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames)).sort()} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n <File.Import name={['CallToolResult']} path={'@modelcontextprotocol/sdk/types'} isTypeOnly />\n <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />\n {client.importPath ? (\n <>\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={client.importPath} isTypeOnly />\n <File.Import name={'fetch'} path={client.importPath} />\n {client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/fetch.ts')}\n isTypeOnly\n />\n <File.Import name={['fetch']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} />\n {client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n\n <McpHandler\n name={meta.name}\n node={node}\n resolver={pluginTs.resolver}\n baseURL={client.baseURL}\n dataReturnType={client.dataReturnType || 'data'}\n paramsCasing={paramsCasing}\n />\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { caseParams } from '@kubb/ast'\nimport { defineGenerator } from '@kubb/core'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/renderer-jsx'\nimport { Server } from '../components/Server.tsx'\nimport type { PluginMcp } from '../types.ts'\nimport { findSuccessStatusCode } from '../utils.ts'\n\n/**\n * Default server generator for `compatibilityPreset: 'default'` (v5).\n *\n * Uses individual zod schemas for each param (e.g. `createPetsPathUuidSchema`, `createPetsQueryOffsetSchema`)\n * and `resolveResponseStatusName` for per-status response schemas.\n * Query and header params are composed into `z.object({ ... })` from individual schemas.\n */\nexport const serverGenerator = defineGenerator<PluginMcp>({\n name: 'operations',\n operations(nodes, options) {\n const { adapter, config, resolver, plugin, driver, root } = this\n const { output, paramsCasing, group } = options\n\n const pluginZod = driver.getPlugin(pluginZodName)\n\n if (!pluginZod?.resolver) {\n return\n }\n\n const name = 'server'\n const serverFilePath = path.resolve(root, output.path, 'server.ts')\n const serverFile = {\n baseName: 'server.ts' as const,\n path: serverFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const jsonFilePath = path.resolve(root, output.path, '.mcp.json')\n const jsonFile = {\n baseName: '.mcp.json' as const,\n path: jsonFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const operationsMapped = nodes.map((node) => {\n const casedParams = caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const mcpFile = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n\n const zodFile = pluginZod.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginZod.options?.output ?? output,\n group: pluginZod.options?.group,\n },\n )\n\n const requestName = node.requestBody?.schema ? pluginZod.resolver.resolveDataName(node) : undefined\n const successStatus = findSuccessStatusCode(node.responses)\n const responseName = successStatus ? pluginZod.resolver.resolveResponseStatusName(node, successStatus) : undefined\n\n const resolveParams = (params: typeof pathParams) => params.map((p) => ({ name: p.name, schemaName: pluginZod.resolver.resolveParamName(node, p) }))\n\n return {\n tool: {\n name: node.operationId,\n title: node.summary || undefined,\n description: node.description || `Make a ${node.method.toUpperCase()} request to ${node.path}`,\n },\n mcp: {\n name: resolver.resolveName(node.operationId),\n file: mcpFile,\n },\n zod: {\n pathParams: resolveParams(pathParams),\n queryParams: queryParams.length ? resolveParams(queryParams) : undefined,\n headerParams: headerParams.length ? resolveParams(headerParams) : undefined,\n requestName,\n responseName,\n file: zodFile,\n },\n node: node,\n }\n })\n\n const imports = operationsMapped.flatMap(({ mcp, zod }) => {\n const zodNames = [\n ...zod.pathParams.map((p) => p.schemaName),\n ...(zod.queryParams ?? []).map((p) => p.schemaName),\n ...(zod.headerParams ?? []).map((p) => p.schemaName),\n zod.requestName,\n zod.responseName,\n ].filter(Boolean)\n\n const uniqueNames = [...new Set(zodNames)].sort()\n\n return [\n <File.Import key={mcp.name} name={[mcp.name]} root={serverFile.path} path={mcp.file.path} />,\n uniqueNames.length > 0 && <File.Import key={`zod-${mcp.name}`} name={uniqueNames} root={serverFile.path} path={zod.file.path} />,\n ].filter(Boolean)\n })\n\n return (\n <>\n <File\n baseName={serverFile.baseName}\n path={serverFile.path}\n meta={serverFile.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n <File.Import name={['McpServer']} path={'@modelcontextprotocol/sdk/server/mcp'} />\n <File.Import name={['z']} path={'zod'} />\n <File.Import name={['StdioServerTransport']} path={'@modelcontextprotocol/sdk/server/stdio'} />\n\n {imports}\n <Server\n name={name}\n serverName={adapter.inputNode?.meta?.title ?? 'server'}\n serverVersion={adapter.inputNode?.meta?.version ?? '0.0.0'}\n paramsCasing={paramsCasing}\n operations={operationsMapped}\n />\n </File>\n\n <File baseName={jsonFile.baseName} path={jsonFile.path} meta={jsonFile.meta}>\n <File.Source name={name}>\n {`\n {\n \"mcpServers\": {\n \"${adapter.inputNode?.meta?.title || 'server'}\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"tsx\", \"${path.relative(path.dirname(jsonFile.path), serverFile.path)}\"]\n }\n }\n }\n `}\n </File.Source>\n </File>\n </>\n )\n },\n})\n","import path from 'node:path'\nimport { caseParams } from '@kubb/ast'\nimport { defineGenerator } from '@kubb/core'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/renderer-jsx'\nimport { Server } from '../components/Server.tsx'\nimport type { PluginMcp } from '../types.ts'\n\n/**\n * Legacy server generator for `compatibilityPreset: 'kubbV4'`.\n *\n * Uses grouped zod schemas for query/header params (e.g. `createPetsQueryParamsSchema`)\n * and `resolveResponseName` for the combined response schema.\n * Path params are always rendered inline (no named imports).\n */\nexport const serverGeneratorLegacy = defineGenerator<PluginMcp>({\n name: 'operations',\n operations(nodes, options) {\n const { adapter, config, resolver, plugin, driver, root } = this\n const { output, paramsCasing, group } = options\n\n const pluginZod = driver.getPlugin(pluginZodName)\n\n if (!pluginZod?.resolver) {\n return\n }\n\n const name = 'server'\n const serverFilePath = path.resolve(root, output.path, 'server.ts')\n const serverFile = {\n baseName: 'server.ts' as const,\n path: serverFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const jsonFilePath = path.resolve(root, output.path, '.mcp.json')\n const jsonFile = {\n baseName: '.mcp.json' as const,\n path: jsonFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const operationsMapped = nodes.map((node) => {\n const casedParams = caseParams(node.parameters, paramsCasing)\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const mcpFile = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n\n const zodFile = pluginZod?.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginZod?.options?.output ?? output,\n group: pluginZod?.options?.group,\n },\n )\n\n const requestName = node.requestBody?.schema ? pluginZod?.resolver.resolveDataName(node) : undefined\n const responseName = pluginZod?.resolver.resolveResponseName(node)\n\n const zodQueryParams = queryParams.length ? pluginZod?.resolver.resolveQueryParamsName(node, queryParams[0]!) : undefined\n\n const zodHeaderParams = headerParams.length ? pluginZod?.resolver.resolveHeaderParamsName(node, headerParams[0]!) : undefined\n\n return {\n tool: {\n name: node.operationId,\n title: node.summary || undefined,\n description: node.description || `Make a ${node.method.toUpperCase()} request to ${node.path}`,\n },\n mcp: {\n name: resolver.resolveName(node.operationId),\n file: mcpFile,\n },\n zod: {\n pathParams: [],\n queryParams: zodQueryParams,\n headerParams: zodHeaderParams,\n requestName,\n responseName,\n file: zodFile,\n },\n node: node,\n }\n })\n\n const imports = operationsMapped.flatMap(({ mcp, zod }) => {\n const zodNames = [zod.queryParams, zod.headerParams, zod.requestName, zod.responseName].filter(Boolean) as string[]\n\n return [\n <File.Import key={mcp.name} name={[mcp.name]} root={serverFile.path} path={mcp.file.path} />,\n zod.file && zodNames.length > 0 && <File.Import key={`zod-${mcp.name}`} name={zodNames.sort()} root={serverFile.path} path={zod.file.path} />,\n ].filter(Boolean)\n })\n\n return (\n <>\n <File\n baseName={serverFile.baseName}\n path={serverFile.path}\n meta={serverFile.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n <File.Import name={['McpServer']} path={'@modelcontextprotocol/sdk/server/mcp'} />\n <File.Import name={['z']} path={'zod'} />\n <File.Import name={['StdioServerTransport']} path={'@modelcontextprotocol/sdk/server/stdio'} />\n\n {imports}\n <Server\n name={name}\n serverName={adapter.inputNode?.meta?.title ?? 'server'}\n serverVersion={(adapter.document as { openapi?: string })?.openapi ?? adapter.inputNode?.meta?.version ?? '0.0.0'}\n paramsCasing={paramsCasing}\n operations={operationsMapped}\n />\n </File>\n\n <File baseName={jsonFile.baseName} path={jsonFile.path} meta={jsonFile.meta}>\n <File.Source name={name}>\n {`\n {\n \"mcpServers\": {\n \"${adapter.inputNode?.meta?.title || 'server'}\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"tsx\", \"${path.relative(path.dirname(jsonFile.path), serverFile.path)}\"]\n }\n }\n }\n `}\n </File.Source>\n </File>\n </>\n )\n },\n})\n","","import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginMcp } from '../types.ts'\n\n/**\n * Resolver for `@kubb/plugin-mcp` that provides the default naming\n * and path-resolution helpers used by the plugin.\n *\n * @example\n * ```ts\n * import { resolverMcp } from '@kubb/plugin-mcp'\n *\n * resolverMcp.default('addPet', 'function') // -> 'addPetHandler'\n * resolverMcp.resolveName('show pet by id') // -> 'showPetByIdHandler'\n * ```\n */\nexport const resolverMcp = defineResolver<PluginMcp>(() => ({\n name: 'default',\n pluginName: 'plugin-mcp',\n default(name, type) {\n if (type === 'file') {\n return camelCase(name, { isFile: true })\n }\n return camelCase(name, { suffix: 'handler' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n}))\n","import { definePresets } from '@kubb/core'\nimport { mcpGenerator } from './generators/mcpGenerator.tsx'\nimport { serverGenerator } from './generators/serverGenerator.tsx'\nimport { serverGeneratorLegacy } from './generators/serverGeneratorLegacy.tsx'\nimport { resolverMcp } from './resolvers/resolverMcp.ts'\nimport type { ResolverMcp } from './types.ts'\n\n/**\n * Built-in preset registry for `@kubb/plugin-mcp`.\n *\n * - `default` — v5 naming with individual zod schemas and per-status responses.\n * - `kubbV4` — legacy naming with grouped zod schemas and combined responses.\n */\nexport const presets = definePresets<ResolverMcp>({\n default: {\n name: 'default',\n resolver: resolverMcp,\n generators: [mcpGenerator, serverGenerator],\n },\n kubbV4: {\n name: 'kubbV4',\n resolver: resolverMcp,\n generators: [mcpGenerator, serverGeneratorLegacy],\n },\n})\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport { createFile, createSource, createText } from '@kubb/ast'\nimport { createPlugin, type Group, getPreset, mergeGenerators } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { version } from '../package.json'\nimport { presets } from './presets.ts'\nimport type { PluginMcp } from './types.ts'\n\nexport const pluginMcpName = 'plugin-mcp' satisfies PluginMcp['name']\n\nexport const pluginMcp = createPlugin<PluginMcp>((options) => {\n const {\n output = { path: 'mcp', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n paramsCasing,\n client,\n compatibilityPreset = 'default',\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n } = options\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const preset = getPreset({\n preset: compatibilityPreset,\n presets,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators,\n })\n\n const generators = preset.generators ?? []\n const mergedGenerator = mergeGenerators(generators)\n\n return {\n name: pluginMcpName,\n version,\n get resolver() {\n return preset.resolver\n },\n get transformer() {\n return preset.transformer\n },\n get options() {\n return {\n output,\n exclude,\n include,\n override,\n group: group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Requests`\n },\n } satisfies Group)\n : undefined,\n paramsCasing,\n client: {\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n paramsCasing: client?.paramsCasing,\n },\n resolver: preset.resolver,\n }\n },\n pre: [pluginTsName, pluginZodName].filter(Boolean),\n async schema(node, options) {\n return mergedGenerator.schema?.call(this, node, options)\n },\n async operation(node, options) {\n return mergedGenerator.operation?.call(this, node, options)\n },\n async operations(nodes, options) {\n return mergedGenerator.operations?.call(this, nodes, options)\n },\n async buildStart() {\n const { adapter, driver } = this\n const root = this.root\n\n const baseURL = adapter?.inputNode?.meta?.baseURL\n if (baseURL) {\n this.plugin.options.client.baseURL = this.plugin.options.client.baseURL || baseURL\n }\n\n const hasClientPlugin = !!driver.getPlugin(pluginClientName)\n\n if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) {\n await this.addFile(\n createFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n createSource({\n name: 'fetch',\n nodes: [createText(this.plugin.options.client.client === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n imports: [],\n exports: [],\n }),\n )\n }\n\n if (!hasClientPlugin) {\n await this.addFile(\n createFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n createSource({\n name: 'config',\n nodes: [createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n imports: [],\n exports: [],\n }),\n )\n }\n\n await this.openInStudio({ ast: true })\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KA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Z,CAAC,CACH;AAGH,OAAI,CAAC,gBACH,OAAM,KAAK,QACT,WAAW;IACT,UAAU;IACV,MAAM,KAAK,QAAQ,MAAM,kBAAkB;IAC3C,SAAS,CACP,aAAa;KACX,MAAM;KACN,OAAO,CAAC,WAAWC,SAAa,CAAC;KACjC,cAAc;KACd,aAAa;KACd,CAAC,CACH;IACD,SAAS,EAAE;IACX,SAAS,EAAE;IACZ,CAAC,CACH;AAGH,SAAM,KAAK,aAAa,EAAE,KAAK,MAAM,CAAC;;EAEzC;EACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["#options","#transformParam","#eachParam","Function","Function","fetchClientSource","axiosClientSource","configSource"],"sources":["../../../internals/utils/src/casing.ts","../../../internals/utils/src/reserved.ts","../../../internals/utils/src/urlPath.ts","../src/utils.ts","../src/components/McpHandler.tsx","../src/components/Server.tsx","../src/generators/mcpGenerator.tsx","../src/generators/serverGenerator.tsx","../src/generators/serverGeneratorLegacy.tsx","../src/resolvers/resolverMcp.ts","../src/plugin.ts"],"sourcesContent":["type Options = {\n /**\n * When `true`, dot-separated segments are split on `.` and joined with `/` after casing.\n */\n isFile?: boolean\n /**\n * Text prepended before casing is applied.\n */\n prefix?: string\n /**\n * Text appended before casing is applied.\n */\n suffix?: string\n}\n\n/**\n * Shared implementation for camelCase and PascalCase conversion.\n * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)\n * and capitalizes each word according to `pascal`.\n *\n * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.\n */\nfunction toCamelOrPascal(text: string, pascal: boolean): string {\n const normalized = text\n .trim()\n .replace(/([a-z\\d])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/(\\d)([a-z])/g, '$1 $2')\n\n const words = normalized.split(/[\\s\\-_./\\\\:]+/).filter(Boolean)\n\n return words\n .map((word, i) => {\n const allUpper = word.length > 1 && word === word.toUpperCase()\n if (allUpper) return word\n if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1)\n return word.charAt(0).toUpperCase() + word.slice(1)\n })\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '')\n}\n\n/**\n * Splits `text` on `.` and applies `transformPart` to each segment.\n * The last segment receives `isLast = true`, all earlier segments receive `false`.\n * Segments are joined with `/` to form a file path.\n *\n * Only splits on dots followed by a letter so that version numbers\n * embedded in operationIds (e.g. `v2025.0`) are kept intact.\n */\nfunction applyToFileParts(text: string, transformPart: (part: string, isLast: boolean) => string): string {\n const parts = text.split(/\\.(?=[a-zA-Z])/)\n return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join('/')\n}\n\n/**\n * Converts `text` to camelCase.\n * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.\n *\n * @example\n * camelCase('hello-world') // 'helloWorld'\n * camelCase('pet.petId', { isFile: true }) // 'pet/petId'\n */\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? { prefix, suffix } : {}))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false)\n}\n\n/**\n * Converts `text` to PascalCase.\n * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.\n *\n * @example\n * pascalCase('hello-world') // 'HelloWorld'\n * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'\n */\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n return applyToFileParts(text, (part, isLast) => (isLast ? pascalCase(part, { prefix, suffix }) : camelCase(part)))\n }\n\n return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true)\n}\n\n/**\n * Converts `text` to snake_case.\n *\n * @example\n * snakeCase('helloWorld') // 'hello_world'\n * snakeCase('Hello-World') // 'hello_world'\n */\nexport function snakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n const processed = `${prefix} ${text} ${suffix}`.trim()\n return processed\n .replace(/([a-z])([A-Z])/g, '$1_$2')\n .replace(/[\\s\\-.]+/g, '_')\n .replace(/[^a-zA-Z0-9_]/g, '')\n .toLowerCase()\n .split('_')\n .filter(Boolean)\n .join('_')\n}\n\n/**\n * Converts `text` to SCREAMING_SNAKE_CASE.\n *\n * @example\n * screamingSnakeCase('helloWorld') // 'HELLO_WORLD'\n */\nexport function screamingSnakeCase(text: string, { prefix = '', suffix = '' }: Omit<Options, 'isFile'> = {}): string {\n return snakeCase(text, { prefix, suffix }).toUpperCase()\n}\n","/**\n * JavaScript and Java reserved words.\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = new Set([\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n 'Array',\n 'Date',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n] as const)\n\n/**\n * Prefixes `word` with `_` when it is a reserved JavaScript/Java identifier or starts with a digit.\n *\n * @example\n * ```ts\n * transformReservedWord('class') // '_class'\n * transformReservedWord('42foo') // '_42foo'\n * transformReservedWord('status') // 'status'\n * ```\n */\nexport function transformReservedWord(word: string): string {\n const firstChar = word.charCodeAt(0)\n if (word && (reservedWords.has(word as 'valueOf') || (firstChar >= 48 && firstChar <= 57))) {\n return `_${word}`\n }\n return word\n}\n\n/**\n * Returns `true` when `name` is a syntactically valid JavaScript variable name.\n *\n * @example\n * ```ts\n * isValidVarName('status') // true\n * isValidVarName('class') // false (reserved word)\n * isValidVarName('42foo') // false (starts with digit)\n * ```\n */\nexport function isValidVarName(name: string): boolean {\n try {\n new Function(`var ${name}`)\n } catch {\n return false\n }\n return true\n}\n","import { camelCase } from './casing.ts'\nimport { isValidVarName } from './reserved.ts'\n\nexport type URLObject = {\n /**\n * The resolved URL string (Express-style or template literal, depending on context).\n */\n url: string\n /**\n * Extracted path parameters as a key-value map, or `undefined` when the path has none.\n */\n params?: Record<string, string>\n}\n\ntype ObjectOptions = {\n /**\n * Controls whether the `url` is rendered as an Express path or a template literal.\n * @default 'path'\n */\n type?: 'path' | 'template'\n /**\n * Optional transform applied to each extracted parameter name.\n */\n replacer?: (pathParam: string) => string\n /**\n * When `true`, the result is serialized to a string expression instead of a plain object.\n */\n stringify?: boolean\n}\n\n/**\n * Supported identifier casing strategies for path parameters.\n */\ntype PathCasing = 'camelcase'\n\ntype Options = {\n /**\n * Casing strategy applied to path parameter names.\n * @default undefined (original identifier preserved)\n */\n casing?: PathCasing\n}\n\n/**\n * Parses and transforms an OpenAPI/Swagger path string into various URL formats.\n *\n * @example\n * const p = new URLPath('/pet/{petId}')\n * p.URL // '/pet/:petId'\n * p.template // '`/pet/${petId}`'\n */\nexport class URLPath {\n /**\n * The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`.\n */\n path: string\n\n #options: Options\n\n constructor(path: string, options: Options = {}) {\n this.path = path\n this.#options = options\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').URL // '/pet/:petId'\n * ```\n */\n get URL(): string {\n return this.toURLPath()\n }\n\n /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`).\n *\n * @example\n * ```ts\n * new URLPath('https://petstore.swagger.io/v2/pet').isURL // true\n * new URLPath('/pet/{petId}').isURL // false\n * ```\n */\n get isURL(): boolean {\n try {\n return !!new URL(this.path).href\n } catch {\n return false\n }\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n *\n * @example\n * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'\n * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'\n */\n get template(): string {\n return this.toTemplateString()\n }\n\n /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').object\n * // { url: '/pet/:petId', params: { petId: 'petId' } }\n * ```\n */\n get object(): URLObject | string {\n return this.toObject()\n }\n\n /** Returns a map of path parameter names, or `undefined` when the path has no parameters.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').params // { petId: 'petId' }\n * new URLPath('/pet').params // undefined\n * ```\n */\n get params(): Record<string, string> | undefined {\n return this.getParams()\n }\n\n #transformParam(raw: string): string {\n const param = isValidVarName(raw) ? raw : camelCase(raw)\n return this.#options.casing === 'camelcase' ? camelCase(param) : param\n }\n\n /**\n * Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name.\n */\n #eachParam(fn: (raw: string, param: string) => void): void {\n for (const match of this.path.matchAll(/\\{([^}]+)\\}/g)) {\n const raw = match[1]!\n fn(raw, this.#transformParam(raw))\n }\n }\n\n toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string {\n const object = {\n url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }),\n params: this.getParams(),\n }\n\n if (stringify) {\n if (type === 'template') {\n return JSON.stringify(object).replaceAll(\"'\", '').replaceAll(`\"`, '')\n }\n\n if (object.params) {\n return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll(\"'\", '').replaceAll(`\"`, '')} }`\n }\n\n return `{ url: '${object.url}' }`\n }\n\n return object\n }\n\n /**\n * Converts the OpenAPI path to a TypeScript template literal string.\n * An optional `replacer` can transform each extracted parameter name before interpolation.\n *\n * @example\n * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'\n */\n toTemplateString({ prefix = '', replacer }: { prefix?: string; replacer?: (pathParam: string) => string } = {}): string {\n const parts = this.path.split(/\\{([^}]+)\\}/)\n const result = parts\n .map((part, i) => {\n if (i % 2 === 0) return part\n const param = this.#transformParam(part)\n return `\\${${replacer ? replacer(param) : param}}`\n })\n .join('')\n\n return `\\`${prefix}${result}\\``\n }\n\n /**\n * Extracts all `{param}` segments from the path and returns them as a key-value map.\n * An optional `replacer` transforms each parameter name in both key and value positions.\n * Returns `undefined` when no path parameters are found.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}/tag/{tagId}').getParams()\n * // { petId: 'petId', tagId: 'tagId' }\n * ```\n */\n getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined {\n const params: Record<string, string> = {}\n\n this.#eachParam((_raw, param) => {\n const key = replacer ? replacer(param) : param\n params[key] = key\n })\n\n return Object.keys(params).length > 0 ? params : undefined\n }\n\n /** Converts the OpenAPI path to Express-style colon syntax.\n *\n * @example\n * ```ts\n * new URLPath('/pet/{petId}').toURLPath() // '/pet/:petId'\n * ```\n */\n toURLPath(): string {\n return this.path.replace(/\\{([^}]+)\\}/g, ':$1')\n }\n}\n","import { camelCase } from '@internals/utils'\nimport type { ast } from '@kubb/core'\n\n/**\n * Find the first 2xx response status code from an operation's responses.\n */\nexport function findSuccessStatusCode(responses: Array<{ statusCode: number | string }>): ast.StatusCode | undefined {\n for (const res of responses) {\n const code = Number(res.statusCode)\n if (code >= 200 && code < 300) {\n return res.statusCode as ast.StatusCode\n }\n }\n return undefined\n}\n\nexport type ZodParam = {\n name: string\n schemaName: string\n}\n\n/**\n * Render a group param value — either a group schema name directly (kubbV4),\n * or compose individual schemas into `z.object({ ... })` (v5).\n */\nexport function zodGroupExpr(entry: string | Array<ZodParam>): string {\n if (typeof entry === 'string') {\n return entry\n }\n const entries = entry.map((p) => `${JSON.stringify(p.name)}: ${p.schemaName}`)\n return `z.object({ ${entries.join(', ')} })`\n}\n\n/**\n * Build JSDoc comment lines from an OperationNode.\n */\nexport function getComments(node: ast.OperationNode): Array<string> {\n return [\n node.description && `@description ${node.description}`,\n node.summary && `@summary ${node.summary}`,\n node.deprecated && '@deprecated',\n `{@link ${node.path.replaceAll('{', ':').replaceAll('}', '')}}`,\n ].filter((x): x is string => Boolean(x))\n}\n\n/**\n * Build a mapping of original param names → camelCase names.\n * Returns `undefined` when no names actually change (no remapping needed).\n */\nexport function getParamsMapping(params: Array<{ name: string }>): Record<string, string> | undefined {\n if (!params.length) {\n return undefined\n }\n\n const mapping: Record<string, string> = {}\n let hasDifference = false\n\n for (const p of params) {\n const camelName = camelCase(p.name)\n mapping[p.name] = camelName\n if (p.name !== camelName) {\n hasDifference = true\n }\n }\n\n return hasDifference ? mapping : undefined\n}\n\n/**\n * Convert a SchemaNode type to an inline Zod expression string.\n * Used as fallback when no named zod schema is available for a path parameter.\n */\nexport function zodExprFromSchemaNode(schema: ast.SchemaNode): string {\n let expr: string\n switch (schema.type) {\n case 'enum': {\n // namedEnumValues takes priority over enumValues\n const rawValues: Array<string | number | boolean> = schema.namedEnumValues?.length\n ? schema.namedEnumValues.map((v) => v.value)\n : (schema.enumValues ?? []).filter((v): v is string | number | boolean => v !== null)\n\n if (rawValues.length > 0 && rawValues.every((v) => typeof v === 'string')) {\n expr = `z.enum([${rawValues.map((v) => JSON.stringify(v)).join(', ')}])`\n } else if (rawValues.length > 0) {\n const literals = rawValues.map((v) => `z.literal(${JSON.stringify(v)})`)\n expr = literals.length === 1 ? literals[0]! : `z.union([${literals.join(', ')}])`\n } else {\n expr = 'z.string()'\n }\n break\n }\n case 'integer':\n expr = 'z.coerce.number()'\n break\n case 'number':\n expr = 'z.number()'\n break\n case 'boolean':\n expr = 'z.boolean()'\n break\n case 'array':\n expr = 'z.array(z.unknown())'\n break\n default:\n expr = 'z.string()'\n }\n\n if (schema.nullable) {\n expr = `${expr}.nullable()`\n }\n\n return expr\n}\n","import { isValidVarName, URLPath } from '@internals/utils'\nimport { ast } from '@kubb/core'\nimport type { ResolverTs } from '@kubb/plugin-ts'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PluginMcp } from '../types.ts'\nimport { getComments, getParamsMapping } from '../utils.ts'\n\ntype Props = {\n /**\n * Name of the handler function.\n */\n name: string\n /**\n * AST operation node.\n */\n node: ast.OperationNode\n /**\n * TypeScript resolver for resolving param/data/response type names.\n */\n resolver: ResolverTs\n /**\n * Base URL prepended to every generated request URL.\n */\n baseURL: string | undefined\n /**\n * Return type when calling fetch.\n * - 'data' returns response data only.\n * - 'full' returns the full response object.\n * @default 'data'\n */\n dataReturnType: PluginMcp['resolvedOptions']['client']['dataReturnType']\n /**\n * How to style your params.\n */\n paramsCasing?: PluginMcp['resolvedOptions']['paramsCasing']\n}\n\n/**\n * Generate a remapping statement: `const mappedX = x ? { \"orig\": x.camel, ... } : undefined`\n */\nfunction buildRemappingCode(mapping: Record<string, string>, varName: string, sourceName: string): string {\n const pairs = Object.entries(mapping)\n .map(([orig, camel]) => `\"${orig}\": ${sourceName}.${camel}`)\n .join(', ')\n return `const ${varName} = ${sourceName} ? { ${pairs} } : undefined`\n}\n\nconst declarationPrinter = functionPrinter({ mode: 'declaration' })\n\nexport function McpHandler({ name, node, resolver, baseURL, dataReturnType, paramsCasing }: Props): KubbReactNode {\n const urlPath = new URLPath(node.path)\n const contentType = node.requestBody?.contentType\n const isFormData = contentType === 'multipart/form-data'\n\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n // Use original (uncased) parameters for mapping so original→camelCase difference is detected\n const originalPathParams = node.parameters.filter((p) => p.in === 'path')\n const originalQueryParams = node.parameters.filter((p) => p.in === 'query')\n const originalHeaderParams = node.parameters.filter((p) => p.in === 'header')\n\n const requestName = node.requestBody?.schema ? resolver.resolveDataName(node) : undefined\n const responseName = resolver.resolveResponseName(node)\n\n const errorResponses = node.responses.filter((r) => Number(r.statusCode) >= 400).map((r) => resolver.resolveResponseStatusName(node, r.statusCode))\n const errorType = errorResponses.length > 0 ? errorResponses.join(' | ') : 'Error'\n\n const TError = `ResponseErrorConfig<${errorType}>`\n const generics = [responseName, TError, requestName || 'unknown'].filter(Boolean)\n\n const paramsNode = ast.createOperationParams(node, {\n paramsType: 'object',\n pathParamsType: 'inline',\n resolver,\n paramsCasing,\n })\n const paramsSignature = declarationPrinter.print(paramsNode) ?? ''\n\n const pathParamsMapping = paramsCasing ? getParamsMapping(originalPathParams) : undefined\n const queryParamsMapping = paramsCasing ? getParamsMapping(originalQueryParams) : undefined\n const headerParamsMapping = paramsCasing ? getParamsMapping(originalHeaderParams) : undefined\n\n const contentTypeHeader =\n contentType && contentType !== 'application/json' && contentType !== 'multipart/form-data' ? `'Content-Type': '${contentType}'` : undefined\n const headers = [headerParams.length ? (headerParamsMapping ? '...mappedHeaders' : '...headers') : undefined, contentTypeHeader].filter(Boolean)\n\n const fetchConfig: string[] = []\n fetchConfig.push(`method: ${JSON.stringify(node.method.toUpperCase())}`)\n fetchConfig.push(`url: ${urlPath.template}`)\n if (baseURL) fetchConfig.push(`baseURL: \\`${baseURL}\\``)\n if (queryParams.length) fetchConfig.push(queryParamsMapping ? 'params: mappedParams' : 'params')\n if (requestName) fetchConfig.push(`data: ${isFormData ? 'formData as FormData' : 'requestData'}`)\n if (headers.length) fetchConfig.push(`headers: { ${headers.join(', ')} }`)\n\n const callToolResult =\n dataReturnType === 'data'\n ? `return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(res.data)\n }\n ],\n structuredContent: { data: res.data }\n }`\n : `return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(res)\n }\n ],\n structuredContent: { data: res.data }\n }`\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n async\n export\n params={paramsSignature}\n JSDoc={{\n comments: getComments(node),\n }}\n returnType={'Promise<CallToolResult>'}\n >\n {''}\n <br />\n <br />\n {pathParamsMapping &&\n Object.entries(pathParamsMapping)\n .filter(([originalName, camelCaseName]) => originalName !== camelCaseName && isValidVarName(originalName))\n .map(([originalName, camelCaseName]) => `const ${originalName} = ${camelCaseName}`)\n .join('\\n')}\n {pathParamsMapping && (\n <>\n <br />\n <br />\n </>\n )}\n {queryParamsMapping && queryParams.length > 0 && (\n <>\n {buildRemappingCode(queryParamsMapping, 'mappedParams', 'params')}\n <br />\n <br />\n </>\n )}\n {headerParamsMapping && headerParams.length > 0 && (\n <>\n {buildRemappingCode(headerParamsMapping, 'mappedHeaders', 'headers')}\n <br />\n <br />\n </>\n )}\n {requestName && 'const requestData = data'}\n <br />\n {isFormData && requestName && 'const formData = buildFormData(requestData)'}\n <br />\n {`const res = await fetch<${generics.join(', ')}>({ ${fetchConfig.join(', ')} })`}\n <br />\n {callToolResult}\n </Function>\n </File.Source>\n )\n}\n","import { ast } from '@kubb/core'\nimport { functionPrinter } from '@kubb/plugin-ts'\nimport { Const, File, Function } from '@kubb/renderer-jsx'\nimport type { KubbReactNode } from '@kubb/renderer-jsx/types'\nimport type { PluginMcp } from '../types.ts'\nimport type { ZodParam } from '../utils.ts'\nimport { zodExprFromSchemaNode, zodGroupExpr } from '../utils.ts'\n\ntype Props = {\n /**\n * Variable name for the MCP server instance (e.g. 'server').\n */\n name: string\n /**\n * Human-readable server name passed to `new McpServer({ name })`.\n */\n serverName: string\n /**\n * Semantic version string passed to `new McpServer({ version })`.\n */\n serverVersion: string\n /**\n * How to style your params.\n */\n paramsCasing?: PluginMcp['resolvedOptions']['paramsCasing']\n /**\n * Operations to register as MCP tools, each carrying its handler,\n * zod schema, and AST node metadata.\n */\n operations: Array<{\n tool: {\n name: string\n title?: string\n description: string\n }\n mcp: {\n name: string\n file: ast.FileNode\n }\n zod: {\n pathParams: Array<ZodParam>\n /**\n * Query params — either a group schema name (kubbV4) or individual schemas to compose (v5).\n */\n queryParams?: string | Array<ZodParam>\n /**\n * Header params — either a group schema name (kubbV4) or individual schemas to compose (v5).\n */\n headerParams?: string | Array<ZodParam>\n requestName?: string\n responseName?: string\n }\n node: ast.OperationNode\n }>\n}\n\nconst keysPrinter = functionPrinter({ mode: 'keys' })\n\nexport function Server({ name, serverName, serverVersion, paramsCasing, operations }: Props): KubbReactNode {\n return (\n <File.Source name={name} isExportable isIndexable>\n <Const name={'server'} export>\n {`\n new McpServer({\n name: '${serverName}',\n version: '${serverVersion}',\n})\n `}\n </Const>\n\n {operations\n .map(({ tool, mcp, zod, node }) => {\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n\n const pathEntries: Array<{ key: string; value: string }> = []\n const otherEntries: Array<{ key: string; value: string }> = []\n\n for (const p of pathParams) {\n const zodParam = zod.pathParams.find((zp) => zp.name === p.name)\n pathEntries.push({ key: p.name, value: zodParam ? zodParam.schemaName : zodExprFromSchemaNode(p.schema) })\n }\n\n if (zod.requestName) {\n otherEntries.push({ key: 'data', value: zod.requestName })\n }\n\n if (zod.queryParams) {\n otherEntries.push({ key: 'params', value: zodGroupExpr(zod.queryParams) })\n }\n\n if (zod.headerParams) {\n otherEntries.push({ key: 'headers', value: zodGroupExpr(zod.headerParams) })\n }\n\n otherEntries.sort((a, b) => a.key.localeCompare(b.key))\n const entries = [...pathEntries, ...otherEntries]\n\n const paramsNode = entries.length\n ? ast.createFunctionParameters({\n params: [\n ast.createParameterGroup({\n properties: entries.map((e) => ast.createFunctionParameter({ name: e.key, optional: false })),\n }),\n ],\n })\n : undefined\n\n const destructured = paramsNode ? (keysPrinter.print(paramsNode) ?? '') : ''\n const inputSchema = entries.length ? `{ ${entries.map((e) => `${e.key}: ${e.value}`).join(', ')} }` : undefined\n const outputSchema = zod.responseName\n\n const config = [\n tool.title ? `title: ${JSON.stringify(tool.title)}` : null,\n `description: ${JSON.stringify(tool.description)}`,\n outputSchema ? `outputSchema: { data: ${outputSchema} }` : null,\n ]\n .filter(Boolean)\n .join(',\\n ')\n\n if (inputSchema) {\n return `\nserver.registerTool(${JSON.stringify(tool.name)}, {\n ${config},\n inputSchema: ${inputSchema},\n}, async (${destructured}) => {\n return ${mcp.name}(${destructured})\n})\n `\n }\n\n return `\nserver.registerTool(${JSON.stringify(tool.name)}, {\n ${config},\n}, async () => {\n return ${mcp.name}()\n})\n `\n })\n .filter(Boolean)}\n\n <Function name=\"startServer\" async export>\n {`try {\n const transport = new StdioServerTransport()\n await server.connect(transport)\n\n } catch (error) {\n console.error('Failed to start server:', error)\n process.exit(1)\n }`}\n </Function>\n </File.Source>\n )\n}\n","import path from 'node:path'\n\nimport { ast, defineGenerator } from '@kubb/core'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { McpHandler } from '../components/McpHandler.tsx'\nimport type { PluginMcp } from '../types.ts'\n\nexport const mcpGenerator = defineGenerator<PluginMcp>({\n name: 'mcp',\n renderer: jsxRenderer,\n operation(node, ctx) {\n const { resolver, driver, root } = ctx\n const { output, client, paramsCasing, group } = ctx.options\n\n const pluginTs = driver.getPlugin(pluginTsName)\n\n if (!pluginTs?.resolver) {\n return null\n }\n\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const importedTypeNames = [\n ...pathParams.map((p) => pluginTs.resolver.resolvePathParamsName(node, p)),\n ...queryParams.map((p) => pluginTs.resolver.resolveQueryParamsName(node, p)),\n ...headerParams.map((p) => pluginTs.resolver.resolveHeaderParamsName(node, p)),\n node.requestBody?.schema ? pluginTs.resolver.resolveDataName(node) : undefined,\n pluginTs.resolver.resolveResponseName(node),\n ...node.responses.filter((r) => Number(r.statusCode) >= 400).map((r) => pluginTs.resolver.resolveResponseStatusName(node, r.statusCode)),\n ].filter(Boolean)\n\n const meta = {\n name: resolver.resolveName(node.operationId),\n file: resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group }),\n fileTs: pluginTs.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginTs.options?.output ?? output,\n group: pluginTs.options?.group,\n },\n ),\n } as const\n\n return (\n <File baseName={meta.file.baseName} path={meta.file.path} meta={meta.file.meta}>\n {meta.fileTs && importedTypeNames.length > 0 && (\n <File.Import name={Array.from(new Set(importedTypeNames)).sort()} root={meta.file.path} path={meta.fileTs.path} isTypeOnly />\n )}\n <File.Import name={['CallToolResult']} path={'@modelcontextprotocol/sdk/types'} isTypeOnly />\n <File.Import name={['buildFormData']} root={meta.file.path} path={path.resolve(root, '.kubb/config.ts')} />\n {client.importPath ? (\n <>\n <File.Import name={['Client', 'RequestConfig', 'ResponseErrorConfig']} path={client.importPath} isTypeOnly />\n <File.Import name={'fetch'} path={client.importPath} />\n {client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import\n name={['Client', 'RequestConfig', 'ResponseErrorConfig']}\n root={meta.file.path}\n path={path.resolve(root, '.kubb/fetch.ts')}\n isTypeOnly\n />\n <File.Import name={['fetch']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} />\n {client.dataReturnType === 'full' && (\n <File.Import name={['ResponseConfig']} root={meta.file.path} path={path.resolve(root, '.kubb/fetch.ts')} isTypeOnly />\n )}\n </>\n )}\n\n <McpHandler\n name={meta.name}\n node={node}\n resolver={pluginTs.resolver}\n baseURL={client.baseURL}\n dataReturnType={client.dataReturnType || 'data'}\n paramsCasing={paramsCasing}\n />\n </File>\n )\n },\n})\n","import path from 'node:path'\n\nimport { ast, defineGenerator } from '@kubb/core'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Server } from '../components/Server.tsx'\nimport type { PluginMcp } from '../types.ts'\nimport { findSuccessStatusCode } from '../utils.ts'\n\n/**\n * Default server generator for `compatibilityPreset: 'default'` (v5).\n *\n * Uses individual zod schemas for each param (e.g. `createPetsPathUuidSchema`, `createPetsQueryOffsetSchema`)\n * and `resolveResponseStatusName` for per-status response schemas.\n * Query and header params are composed into `z.object({ ... })` from individual schemas.\n */\nexport const serverGenerator = defineGenerator<PluginMcp>({\n name: 'operations',\n renderer: jsxRenderer,\n operations(nodes, ctx) {\n const { adapter, config, resolver, plugin, driver, root } = ctx\n const { output, paramsCasing, group } = ctx.options\n\n const pluginZod = driver.getPlugin(pluginZodName)\n\n if (!pluginZod?.resolver) {\n return\n }\n\n const name = 'server'\n const serverFilePath = path.resolve(root, output.path, 'server.ts')\n const serverFile = {\n baseName: 'server.ts' as const,\n path: serverFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const jsonFilePath = path.resolve(root, output.path, '.mcp.json')\n const jsonFile = {\n baseName: '.mcp.json' as const,\n path: jsonFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const operationsMapped = nodes.map((node) => {\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const pathParams = casedParams.filter((p) => p.in === 'path')\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const mcpFile = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n\n const zodFile = pluginZod.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginZod.options?.output ?? output,\n group: pluginZod.options?.group,\n },\n )\n\n const requestName = node.requestBody?.schema ? pluginZod.resolver.resolveDataName(node) : undefined\n const successStatus = findSuccessStatusCode(node.responses)\n const responseName = successStatus ? pluginZod.resolver.resolveResponseStatusName(node, successStatus) : undefined\n\n const resolveParams = (params: typeof pathParams) => params.map((p) => ({ name: p.name, schemaName: pluginZod.resolver.resolveParamName(node, p) }))\n\n return {\n tool: {\n name: node.operationId,\n title: node.summary || undefined,\n description: node.description || `Make a ${node.method.toUpperCase()} request to ${node.path}`,\n },\n mcp: {\n name: resolver.resolveName(node.operationId),\n file: mcpFile,\n },\n zod: {\n pathParams: resolveParams(pathParams),\n queryParams: queryParams.length ? resolveParams(queryParams) : undefined,\n headerParams: headerParams.length ? resolveParams(headerParams) : undefined,\n requestName,\n responseName,\n file: zodFile,\n },\n node: node,\n }\n })\n\n const imports = operationsMapped.flatMap(({ mcp, zod }) => {\n const zodNames = [\n ...zod.pathParams.map((p) => p.schemaName),\n ...(zod.queryParams ?? []).map((p) => p.schemaName),\n ...(zod.headerParams ?? []).map((p) => p.schemaName),\n zod.requestName,\n zod.responseName,\n ].filter(Boolean)\n\n const uniqueNames = [...new Set(zodNames)].sort()\n\n return [\n <File.Import key={mcp.name} name={[mcp.name]} root={serverFile.path} path={mcp.file.path} />,\n uniqueNames.length > 0 && <File.Import key={`zod-${mcp.name}`} name={uniqueNames} root={serverFile.path} path={zod.file.path} />,\n ].filter(Boolean)\n })\n\n return (\n <>\n <File\n baseName={serverFile.baseName}\n path={serverFile.path}\n meta={serverFile.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n <File.Import name={['McpServer']} path={'@modelcontextprotocol/sdk/server/mcp'} />\n <File.Import name={['z']} path={'zod'} />\n <File.Import name={['StdioServerTransport']} path={'@modelcontextprotocol/sdk/server/stdio'} />\n\n {imports}\n <Server\n name={name}\n serverName={adapter.inputNode?.meta?.title ?? 'server'}\n serverVersion={adapter.inputNode?.meta?.version ?? '0.0.0'}\n paramsCasing={paramsCasing}\n operations={operationsMapped}\n />\n </File>\n\n <File baseName={jsonFile.baseName} path={jsonFile.path} meta={jsonFile.meta}>\n <File.Source name={name}>\n {`\n {\n \"mcpServers\": {\n \"${adapter.inputNode?.meta?.title || 'server'}\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"tsx\", \"${path.relative(path.dirname(jsonFile.path), serverFile.path)}\"]\n }\n }\n }\n `}\n </File.Source>\n </File>\n </>\n )\n },\n})\n","import path from 'node:path'\n\nimport { ast, defineGenerator } from '@kubb/core'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, jsxRenderer } from '@kubb/renderer-jsx'\nimport { Server } from '../components/Server.tsx'\nimport type { PluginMcp } from '../types.ts'\n\n/**\n * Legacy server generator for `compatibilityPreset: 'kubbV4'`.\n *\n * Uses grouped zod schemas for query/header params (e.g. `createPetsQueryParamsSchema`)\n * and `resolveResponseName` for the combined response schema.\n * Path params are always rendered inline (no named imports).\n */\nexport const serverGeneratorLegacy = defineGenerator<PluginMcp>({\n name: 'operations',\n renderer: jsxRenderer,\n operations(nodes, ctx) {\n const { adapter, config, resolver, plugin, driver, root } = ctx\n const { output, paramsCasing, group } = ctx.options\n\n const pluginZod = driver.getPlugin(pluginZodName)\n\n if (!pluginZod?.resolver) {\n return\n }\n\n const name = 'server'\n const serverFilePath = path.resolve(root, output.path, 'server.ts')\n const serverFile = {\n baseName: 'server.ts' as const,\n path: serverFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const jsonFilePath = path.resolve(root, output.path, '.mcp.json')\n const jsonFile = {\n baseName: '.mcp.json' as const,\n path: jsonFilePath,\n meta: { pluginName: plugin.name },\n }\n\n const operationsMapped = nodes.map((node) => {\n const casedParams = ast.caseParams(node.parameters, paramsCasing)\n const queryParams = casedParams.filter((p) => p.in === 'query')\n const headerParams = casedParams.filter((p) => p.in === 'header')\n\n const mcpFile = resolver.resolveFile({ name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path }, { root, output, group })\n\n const zodFile = pluginZod?.resolver.resolveFile(\n { name: node.operationId, extname: '.ts', tag: node.tags[0] ?? 'default', path: node.path },\n {\n root,\n output: pluginZod?.options?.output ?? output,\n group: pluginZod?.options?.group,\n },\n )\n\n const requestName = node.requestBody?.schema ? pluginZod?.resolver.resolveDataName(node) : undefined\n const responseName = pluginZod?.resolver.resolveResponseName(node)\n\n const zodQueryParams = queryParams.length ? pluginZod?.resolver.resolveQueryParamsName(node, queryParams[0]!) : undefined\n\n const zodHeaderParams = headerParams.length ? pluginZod?.resolver.resolveHeaderParamsName(node, headerParams[0]!) : undefined\n\n return {\n tool: {\n name: node.operationId,\n title: node.summary || undefined,\n description: node.description || `Make a ${node.method.toUpperCase()} request to ${node.path}`,\n },\n mcp: {\n name: resolver.resolveName(node.operationId),\n file: mcpFile,\n },\n zod: {\n pathParams: [],\n queryParams: zodQueryParams,\n headerParams: zodHeaderParams,\n requestName,\n responseName,\n file: zodFile,\n },\n node: node,\n }\n })\n\n const imports = operationsMapped.flatMap(({ mcp, zod }) => {\n const zodNames = [zod.queryParams, zod.headerParams, zod.requestName, zod.responseName].filter(Boolean) as string[]\n\n return [\n <File.Import key={mcp.name} name={[mcp.name]} root={serverFile.path} path={mcp.file.path} />,\n zod.file && zodNames.length > 0 && <File.Import key={`zod-${mcp.name}`} name={zodNames.sort()} root={serverFile.path} path={zod.file.path} />,\n ].filter(Boolean)\n })\n\n return (\n <>\n <File\n baseName={serverFile.baseName}\n path={serverFile.path}\n meta={serverFile.meta}\n banner={resolver.resolveBanner(adapter.inputNode, { output, config })}\n footer={resolver.resolveFooter(adapter.inputNode, { output, config })}\n >\n <File.Import name={['McpServer']} path={'@modelcontextprotocol/sdk/server/mcp'} />\n <File.Import name={['z']} path={'zod'} />\n <File.Import name={['StdioServerTransport']} path={'@modelcontextprotocol/sdk/server/stdio'} />\n\n {imports}\n <Server\n name={name}\n serverName={adapter.inputNode?.meta?.title ?? 'server'}\n serverVersion={(adapter.document as { openapi?: string })?.openapi ?? adapter.inputNode?.meta?.version ?? '0.0.0'}\n paramsCasing={paramsCasing}\n operations={operationsMapped}\n />\n </File>\n\n <File baseName={jsonFile.baseName} path={jsonFile.path} meta={jsonFile.meta}>\n <File.Source name={name}>\n {`\n {\n \"mcpServers\": {\n \"${adapter.inputNode?.meta?.title || 'server'}\": {\n \"type\": \"stdio\",\n \"command\": \"npx\",\n \"args\": [\"tsx\", \"${path.relative(path.dirname(jsonFile.path), serverFile.path)}\"]\n }\n }\n }\n `}\n </File.Source>\n </File>\n </>\n )\n },\n})\n","import { camelCase } from '@internals/utils'\nimport { defineResolver } from '@kubb/core'\nimport type { PluginMcp } from '../types.ts'\n\n/**\n * Resolver for `@kubb/plugin-mcp` that provides the default naming\n * and path-resolution helpers used by the plugin.\n *\n * @example\n * ```ts\n * import { resolverMcp } from '@kubb/plugin-mcp'\n *\n * resolverMcp.default('addPet', 'function') // -> 'addPetHandler'\n * resolverMcp.resolveName('show pet by id') // -> 'showPetByIdHandler'\n * ```\n */\nexport const resolverMcp = defineResolver<PluginMcp>(() => ({\n name: 'default',\n pluginName: 'plugin-mcp',\n default(name, type) {\n if (type === 'file') {\n return camelCase(name, { isFile: true })\n }\n return camelCase(name, { suffix: 'handler' })\n },\n resolveName(name) {\n return this.default(name, 'function')\n },\n}))\n","import path from 'node:path'\nimport { camelCase } from '@internals/utils'\n\nimport { ast, definePlugin, type Group } from '@kubb/core'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { source as axiosClientSource } from '@kubb/plugin-client/templates/clients/axios.source'\nimport { source as fetchClientSource } from '@kubb/plugin-client/templates/clients/fetch.source'\nimport { source as configSource } from '@kubb/plugin-client/templates/config.source'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { mcpGenerator } from './generators/mcpGenerator.tsx'\nimport { serverGenerator } from './generators/serverGenerator.tsx'\nimport { serverGeneratorLegacy } from './generators/serverGeneratorLegacy.tsx'\nimport { resolverMcp } from './resolvers/resolverMcp.ts'\nimport type { PluginMcp } from './types.ts'\n\nexport const pluginMcpName = 'plugin-mcp' satisfies PluginMcp['name']\n\nexport const pluginMcp = definePlugin<PluginMcp>((options) => {\n const {\n output = { path: 'mcp', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n paramsCasing,\n client,\n resolver: userResolver,\n transformer: userTransformer,\n generators: userGenerators = [],\n compatibilityPreset = 'default',\n } = options\n\n const defaultServerGenerator = compatibilityPreset === 'kubbV4' ? serverGeneratorLegacy : serverGenerator\n\n const clientName = client?.client ?? 'axios'\n const clientImportPath = client?.importPath ?? (!client?.bundle ? `@kubb/plugin-client/clients/${clientName}` : undefined)\n\n const groupConfig = group\n ? ({\n ...group,\n name: group.name\n ? group.name\n : (ctx: { group: string }) => {\n if (group.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Requests`\n },\n } satisfies Group)\n : undefined\n\n return {\n name: pluginMcpName,\n options,\n dependencies: [pluginTsName, pluginZodName],\n hooks: {\n 'kubb:plugin:setup'(ctx) {\n const resolver = userResolver ? { ...resolverMcp, ...userResolver } : resolverMcp\n\n ctx.setOptions({\n output,\n exclude,\n include,\n override,\n group: groupConfig,\n paramsCasing,\n client: {\n client: clientName,\n clientType: client?.clientType ?? 'function',\n importPath: clientImportPath,\n dataReturnType: client?.dataReturnType ?? 'data',\n bundle: client?.bundle,\n baseURL: client?.baseURL,\n paramsCasing: client?.paramsCasing,\n },\n resolver,\n })\n ctx.setResolver(resolver)\n if (userTransformer) {\n ctx.setTransformer(userTransformer)\n }\n ctx.addGenerator(mcpGenerator)\n ctx.addGenerator(defaultServerGenerator)\n for (const gen of userGenerators) {\n ctx.addGenerator(gen)\n }\n\n const root = path.resolve(ctx.config.root, ctx.config.output.path)\n const hasClientPlugin = ctx.config.plugins?.some((p) => p.name === pluginClientName)\n\n if (client?.bundle && !hasClientPlugin && !clientImportPath) {\n ctx.injectFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n ast.createSource({\n name: 'fetch',\n nodes: [ast.createText(clientName === 'fetch' ? fetchClientSource : axiosClientSource)],\n isExportable: true,\n isIndexable: true,\n }),\n ],\n })\n }\n\n if (!hasClientPlugin) {\n ctx.injectFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n ast.createSource({\n name: 'config',\n nodes: [ast.createText(configSource)],\n isExportable: false,\n isIndexable: false,\n }),\n ],\n })\n }\n },\n },\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,SAAS,gBAAgB,MAAc,QAAyB;AAS9D,QARmB,KAChB,MAAM,CACN,QAAQ,qBAAqB,QAAQ,CACrC,QAAQ,yBAAyB,QAAQ,CACzC,QAAQ,gBAAgB,QAAQ,CAEV,MAAM,gBAAgB,CAAC,OAAO,QAAQ,CAG5D,KAAK,MAAM,MAAM;AAEhB,MADiB,KAAK,SAAS,KAAK,SAAS,KAAK,aAAa,CACjD,QAAO;AACrB,MAAI,MAAM,KAAK,CAAC,OAAQ,QAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;AAC3E,SAAO,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE;GACnD,CACD,KAAK,GAAG,CACR,QAAQ,iBAAiB,GAAG;;;;;;;;;;AAWjC,SAAS,iBAAiB,MAAc,eAAkE;CACxG,MAAM,QAAQ,KAAK,MAAM,iBAAiB;AAC1C,QAAO,MAAM,KAAK,MAAM,MAAM,cAAc,MAAM,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC,KAAK,IAAI;;;;;;;;;;AAWtF,SAAgB,UAAU,MAAc,EAAE,QAAQ,SAAS,IAAI,SAAS,OAAgB,EAAE,EAAU;AAClG,KAAI,OACF,QAAO,iBAAiB,OAAO,MAAM,WAAW,UAAU,MAAM,SAA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