@orval/mcp 8.12.3 → 8.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +15 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -78,17 +78,17 @@ const generateServer = (verbOptions, output, context) => {
|
|
|
78
78
|
const toolImplementations = Object.values(verbOptions).map((verbOption) => {
|
|
79
79
|
const pascalOperationName = pascal(verbOption.operationName);
|
|
80
80
|
const inputSchemaTypes = [];
|
|
81
|
-
if (verbOption.params.length > 0) inputSchemaTypes.push(`
|
|
82
|
-
if (verbOption.queryParams) inputSchemaTypes.push(`
|
|
83
|
-
if (verbOption.body.definition) inputSchemaTypes.push(`
|
|
84
|
-
const inputSchemaImplementation = inputSchemaTypes.length > 0 ?
|
|
85
|
-
|
|
86
|
-
},` : "";
|
|
87
|
-
const handlerCallImplementation = inputSchemaImplementation ? `(args) => ${verbOption.operationName}Handler(args, options)` : `() => ${verbOption.operationName}Handler(options)`;
|
|
81
|
+
if (verbOption.params.length > 0) inputSchemaTypes.push(`pathParams: ${pascalOperationName}Params`);
|
|
82
|
+
if (verbOption.queryParams) inputSchemaTypes.push(`queryParams: ${pascalOperationName}QueryParams`);
|
|
83
|
+
if (verbOption.body.definition) inputSchemaTypes.push(`bodyParams: ${pascalOperationName}Body`);
|
|
84
|
+
const inputSchemaImplementation = inputSchemaTypes.length > 0 ? `\n inputSchema: {\n ${inputSchemaTypes.join(",\n ")}\n },` : "";
|
|
85
|
+
const handlerCallImplementation = inputSchemaTypes.length > 0 ? `(args) => ${verbOption.operationName}Handler(args, options)` : `() => ${verbOption.operationName}Handler(options)`;
|
|
88
86
|
return `
|
|
89
|
-
server.
|
|
87
|
+
tools.${verbOption.operationName} = server.registerTool(
|
|
90
88
|
'${jsStringEscape(verbOption.operationName)}',
|
|
91
|
-
|
|
89
|
+
{
|
|
90
|
+
description: '${jsStringEscape(verbOption.summary ?? "")}',${inputSchemaImplementation}
|
|
91
|
+
},
|
|
92
92
|
${handlerCallImplementation}
|
|
93
93
|
);`;
|
|
94
94
|
}).join("\n");
|
|
@@ -103,21 +103,23 @@ server.tool(
|
|
|
103
103
|
}).join(",\n")}\n} from './tool-schemas.zod';`;
|
|
104
104
|
const importHandlersImplementation = `import {\n${Object.values(verbOptions).filter((verbOption) => toolImplementations.includes(`${verbOption.operationName}Handler`)).map((verbOption) => ` ${verbOption.operationName}Handler`).join(`,\n`)}\n} from './handlers';`;
|
|
105
105
|
const createMcpServerImplementation = `
|
|
106
|
-
const createMcpServer = (options?: RequestInit) => {
|
|
106
|
+
const createMcpServer = (options?: RequestInit): { server: McpServer; tools: Record<string, RegisteredTool> } => {
|
|
107
107
|
const server = new McpServer({
|
|
108
108
|
name: '${camel(info.title)}Server',
|
|
109
109
|
version: '1.0.0',
|
|
110
110
|
});
|
|
111
|
+
const tools: Record<string, RegisteredTool> = {};
|
|
111
112
|
${toolImplementations}
|
|
112
113
|
|
|
113
|
-
return server;
|
|
114
|
+
return { server, tools };
|
|
114
115
|
};
|
|
115
116
|
`;
|
|
116
117
|
const serverFunctionName = mcpServerOptions?.name ?? "customServer";
|
|
117
118
|
const relativeServerPath = mcpServerOptions ? upath.getRelativeImportPath(serverPath, mcpServerOptions.path) : "";
|
|
118
119
|
const importSpecifier = mcpServerOptions?.default ? serverFunctionName : `{ ${serverFunctionName} }`;
|
|
119
120
|
const importDependenciesImplementation = `import {
|
|
120
|
-
McpServer
|
|
121
|
+
McpServer,
|
|
122
|
+
type RegisteredTool,
|
|
121
123
|
} from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
122
124
|
|
|
123
125
|
${mcpServerOptions ? `import ${importSpecifier} from '${relativeServerPath}';` : `import {
|
|
@@ -133,7 +135,7 @@ ${mcpServerOptions ? `import ${importSpecifier} from '${relativeServerPath}';` :
|
|
|
133
135
|
importToolSchemasImplementation,
|
|
134
136
|
createMcpServerImplementation,
|
|
135
137
|
mcpServerOptions ? customServerConnectImplementation : `
|
|
136
|
-
const server = createMcpServer();
|
|
138
|
+
const { server } = createMcpServer();
|
|
137
139
|
const transport = new StdioServerTransport();
|
|
138
140
|
|
|
139
141
|
server.connect(transport).then(() => {
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport {\n camel,\n type ClientBuilder,\n type ClientExtraFilesBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n generateMutatorImports,\n type GeneratorVerbOptions,\n getFileInfo,\n getFullRoute,\n getParamsInPath,\n isObject,\n isString,\n jsDoc,\n jsStringEscape,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n pascal,\n upath,\n} from '@orval/core';\nimport { generateClient, generateFetchHeader } from '@orval/fetch';\nimport { generateZod } from '@orval/zod';\n\nconst getHeader = (\n option: false | ((info: OpenApiInfoObject) => string | string[]),\n info: OpenApiInfoObject,\n): string => {\n if (!option) {\n return '';\n }\n\n const header = option(info);\n\n return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\nconst getSpecInfo = (context: ContextSpec): OpenApiInfoObject =>\n context.spec.info ?? {\n title: 'API',\n version: '1.0.0',\n };\n\nexport const getMcpHeader: ClientHeaderBuilder = ({ verbOptions, output }) => {\n const targetInfo = getFileInfo(output.target);\n const schemasPath = (\n isObject(output.schemas)\n ? output.schemas.path\n : isString(output.schemas)\n ? output.schemas\n : undefined\n ) as string | undefined;\n const schemaInfo = schemasPath ? getFileInfo(schemasPath) : undefined;\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const basePath = schemaInfo?.dirname;\n const relativeSchemaImportPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.getRelativeImportPath(targetInfo.path, basePath, true)\n : upath.getRelativeImportPath(targetInfo.path, basePath)\n : './' + targetInfo.filename + '.schemas';\n\n const importSchemaNames = new Set(\n Object.values(verbOptions).flatMap((verbOption) => {\n const imports = [];\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.queryParams) {\n imports.push(`${pascalOperationName}Params`);\n }\n\n if (verbOption.body.imports[0]?.name) {\n imports.push(verbOption.body.imports[0]?.name);\n }\n\n return imports;\n }),\n )\n .values()\n .toArray();\n\n const importSchemasImplementation = `import {\\n ${importSchemaNames.join(\n ',\\n ',\n )}\\n} from '${relativeSchemaImportPath}';\n`;\n\n const relativeFetchClientPath = './http-client';\n const importFetchClientNames = new Set(\n Object.values(verbOptions).flatMap(\n (verbOption) => verbOption.operationName,\n ),\n )\n .values()\n .toArray();\n\n const importFetchClientImplementation = `import {\\n ${importFetchClientNames.join(\n ',\\n ',\n )}\\n} from '${relativeFetchClientPath}';\n `;\n\n const content = [\n importSchemasImplementation,\n importFetchClientImplementation,\n ].join('\\n');\n\n return content + '\\n';\n};\n\nexport const generateMcp: ClientBuilder = (verbOptions) => {\n const handlerArgsTypes = [];\n const originalParamNames = getParamsInPath(verbOptions.pathRoute);\n const pathParamsType = verbOptions.params\n .map((param, index) => {\n const paramName = originalParamNames[index];\n const paramType = param.implementation.split(': ')[1];\n return ` ${paramName}: ${paramType}`;\n })\n .join(',\\n');\n if (pathParamsType) {\n handlerArgsTypes.push(` pathParams: {\\n${pathParamsType}\\n };`);\n }\n if (verbOptions.queryParams) {\n handlerArgsTypes.push(\n ` queryParams: ${verbOptions.queryParams.schema.name};`,\n );\n }\n if (verbOptions.body.definition) {\n handlerArgsTypes.push(` bodyParams: ${verbOptions.body.definition};`);\n }\n\n const handlerArgsName = `${verbOptions.operationName}Args`;\n const handlerArgsImplementation =\n handlerArgsTypes.length > 0\n ? `\nexport type ${handlerArgsName} = {\n${handlerArgsTypes.join('\\n')}\n}\n`\n : '';\n\n const fetchParams = [];\n if (verbOptions.params.length > 0) {\n const pathParamsArgs = originalParamNames\n .map((paramName) => `args.pathParams.${paramName}`)\n .join(', ');\n\n fetchParams.push(pathParamsArgs);\n }\n if (verbOptions.body.definition) fetchParams.push(`args.bodyParams`);\n if (verbOptions.queryParams) fetchParams.push(`args.queryParams`);\n\n const handlerName = `${verbOptions.operationName}Handler`;\n const handlerImplementation = `\nexport const ${handlerName} = async (${handlerArgsTypes.length > 0 ? `args: ${handlerArgsName}, ` : ''}options?: RequestInit) => {\n const res = await ${verbOptions.operationName}(${fetchParams.length > 0 ? `${fetchParams.join(', ')}, ` : ''}options);\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(res),\n },\n ],\n };\n};`;\n\n const handlersImplementation = [\n handlerArgsImplementation,\n handlerImplementation,\n ].join('');\n\n return {\n implementation: handlersImplementation ? `${handlersImplementation}\\n` : '',\n imports: [],\n };\n};\n\nexport const generateServer = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const info = getSpecInfo(context);\n const { extension, dirname } = getFileInfo(output.target);\n const serverPath = path.join(dirname, `server${extension}`);\n const header = getHeader(output.override.header, info);\n\n const mcpServerOptions = output.override.mcp.server;\n\n const toolImplementations = Object.values(verbOptions)\n .map((verbOption) => {\n const pascalOperationName = pascal(verbOption.operationName);\n const inputSchemaTypes = [];\n if (verbOption.params.length > 0)\n inputSchemaTypes.push(` pathParams: ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n inputSchemaTypes.push(\n ` queryParams: ${pascalOperationName}QueryParams`,\n );\n if (verbOption.body.definition)\n inputSchemaTypes.push(` bodyParams: ${pascalOperationName}Body`);\n\n const inputSchemaImplementation =\n inputSchemaTypes.length > 0\n ? ` {\n ${inputSchemaTypes.join(',\\n ')}\n },`\n : '';\n\n const handlerCallImplementation = inputSchemaImplementation\n ? `(args) => ${verbOption.operationName}Handler(args, options)`\n : `() => ${verbOption.operationName}Handler(options)`;\n\n const toolImplementation = `\nserver.tool(\n '${jsStringEscape(verbOption.operationName)}',\n '${jsStringEscape(verbOption.summary ?? '')}',${inputSchemaImplementation ? `\\n${inputSchemaImplementation}` : ''}\n ${handlerCallImplementation}\n);`;\n\n return toolImplementation;\n })\n .join('\\n');\n\n const importToolSchemas = Object.values(verbOptions)\n .flatMap((verbOption) => {\n const imports = [];\n\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.headers) imports.push(` ${pascalOperationName}Header`);\n if (verbOption.params.length > 0)\n imports.push(` ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n imports.push(` ${pascalOperationName}QueryParams`);\n if (verbOption.body.definition)\n imports.push(` ${pascalOperationName}Body`);\n\n return imports;\n })\n .join(',\\n');\n const importToolSchemasImplementation = `import {\\n${importToolSchemas}\\n} from './tool-schemas.zod';`;\n\n const importHandlers = Object.values(verbOptions)\n .filter((verbOption) =>\n toolImplementations.includes(`${verbOption.operationName}Handler`),\n )\n .map((verbOption) => ` ${verbOption.operationName}Handler`)\n .join(`,\\n`);\n const importHandlersImplementation = `import {\\n${importHandlers}\\n} from './handlers';`;\n\n const createMcpServerImplementation = `\nconst createMcpServer = (options?: RequestInit) => {\n const server = new McpServer({\n name: '${camel(info.title)}Server',\n version: '1.0.0',\n });\n${toolImplementations}\n\n return server;\n};\n`;\n\n const serverFunctionName = mcpServerOptions?.name ?? 'customServer';\n const relativeServerPath = mcpServerOptions\n ? upath.getRelativeImportPath(serverPath, mcpServerOptions.path)\n : '';\n const importSpecifier = mcpServerOptions?.default\n ? serverFunctionName\n : `{ ${serverFunctionName} }`;\n\n const importMcpServer = `import {\n McpServer\n} from '@modelcontextprotocol/sdk/server/mcp.js';\n`;\n\n const importTransport = mcpServerOptions\n ? `import ${importSpecifier} from '${relativeServerPath}';`\n : `import {\n StdioServerTransport\n} from '@modelcontextprotocol/sdk/server/stdio.js';`;\n\n const importDependenciesImplementation = `${importMcpServer}\n${importTransport}\n`;\n\n const customServerConnectImplementation = `\\n${serverFunctionName}(createMcpServer);\\n`;\n const stdioServerConnectImplementation = `\nconst server = createMcpServer();\nconst transport = new StdioServerTransport();\n\nserver.connect(transport).then(() => {\n console.error('MCP server running on stdio');\n}).catch(console.error);\n`;\n\n const serverConnectImplementation = mcpServerOptions\n ? customServerConnectImplementation\n : stdioServerConnectImplementation;\n\n const content = [\n header,\n importDependenciesImplementation,\n importHandlersImplementation,\n importToolSchemasImplementation,\n createMcpServerImplementation,\n serverConnectImplementation,\n ].join('\\n');\n\n return [\n {\n content,\n path: serverPath,\n },\n ];\n};\n\nconst generateZodFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const { extension, dirname } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, getSpecInfo(context));\n\n const zods = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) =>\n generateZod(\n verbOption,\n {\n route: verbOption.route,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n output: output.target,\n },\n output.client,\n ),\n ),\n );\n\n const allMutators = new Map(\n zods.flatMap((z) => z.mutators ?? []).map((m) => [m.name, m]),\n )\n .values()\n .toArray();\n\n const mutatorsImports = generateMutatorImports({\n mutators: allMutators,\n });\n\n let content = `${header}import { z as zod } from 'zod';\\n${mutatorsImports}\\n`;\n\n const zodPath = path.join(dirname, `tool-schemas.zod${extension}`);\n\n content += zods.map((zod) => zod.implementation).join('\\n');\n\n return [\n {\n content,\n path: zodPath,\n },\n ];\n};\n\nconst generateHttpClientFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const {\n path: targetPath,\n extension,\n dirname,\n filename,\n } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, getSpecInfo(context));\n\n const clients = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) => {\n const fullRoute = getFullRoute(\n verbOption.route,\n context.spec.servers,\n output.baseUrl,\n );\n\n const options = {\n route: fullRoute,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n output: output.target,\n };\n\n return generateClient(verbOption, options, output.client, output);\n }),\n );\n\n const clientImplementation = clients\n .map((client) => client.implementation)\n .join('\\n');\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const schemasPath = (\n isObject(output.schemas)\n ? output.schemas.path\n : isString(output.schemas)\n ? output.schemas\n : undefined\n ) as string | undefined;\n const basePath = schemasPath ? getFileInfo(schemasPath).dirname : undefined;\n const relativeSchemasPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.getRelativeImportPath(targetPath, basePath, true)\n : upath.getRelativeImportPath(targetPath, basePath)\n : './' + filename + '.schemas';\n\n const importNames = clients\n .flatMap((client) => client.imports)\n .map((imp) => imp.name);\n const uniqueImportNames = new Set(importNames).values().toArray();\n\n const importImplementation = `import { ${uniqueImportNames.join(\n ',\\n',\n )} } from '${relativeSchemasPath}';`;\n\n const fetchHeader = generateFetchHeader({\n title: '',\n isRequestOptions: false,\n isMutator: false,\n noFunction: false,\n isGlobalMutator: false,\n provideIn: false,\n hasAwaitedType: false,\n output,\n verbOptions,\n clientImplementation,\n });\n\n const content = [\n header,\n importImplementation,\n fetchHeader,\n clientImplementation,\n ].join('\\n');\n const outputPath = path.join(dirname, `http-client${extension}`);\n\n return [\n {\n content,\n path: outputPath,\n },\n ];\n};\n\nexport const generateExtraFiles: ClientExtraFilesBuilder = async (\n verbOptions,\n output,\n context,\n) => {\n const server = generateServer(verbOptions, output, context);\n const [zods, httpClients] = await Promise.all([\n generateZodFiles(verbOptions, output, context),\n generateHttpClientFiles(verbOptions, output, context),\n ]);\n\n return [...server, ...zods, ...httpClients];\n};\n\nconst mcpClientBuilder: ClientGeneratorsBuilder = {\n client: generateMcp,\n header: getMcpHeader,\n extraFiles: generateExtraFiles,\n};\n\nexport const builder = () => () => mcpClientBuilder;\n\nexport default builder;\n"],"mappings":";;;;;AA0BA,MAAM,aACJ,QACA,SACW;AACX,KAAI,CAAC,OACH,QAAO;CAGT,MAAM,SAAS,OAAO,KAAK;AAE3B,QAAO,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IACA;IACD,CAAC;GAMA;GACD,CAAC,KAAK,KAAK;EAMR,MALe,KAAK,KAAK,SAAS,cAAc,YAAY;EAM7D,CACF;;AAGH,MAAa,qBAA8C,OACzD,aACA,QACA,YACG;CACH,MAAM,SAAS,eAAe,aAAa,QAAQ,QAAQ;CAC3D,MAAM,CAAC,MAAM,eAAe,MAAM,QAAQ,IAAI,CAC5C,iBAAiB,aAAa,QAAQ,QAAQ,EAC9C,wBAAwB,aAAa,QAAQ,QAAQ,CACtD,CAAC;AAEF,QAAO;EAAC,GAAG;EAAQ,GAAG;EAAM,GAAG;EAAY;;AAG7C,MAAM,mBAA4C;CAChD,QAAQ;CACR,QAAQ;CACR,YAAY;CACb;AAED,MAAa,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport {\n camel,\n type ClientBuilder,\n type ClientExtraFilesBuilder,\n type ClientGeneratorsBuilder,\n type ClientHeaderBuilder,\n type ContextSpec,\n generateMutatorImports,\n type GeneratorVerbOptions,\n getFileInfo,\n getFullRoute,\n getParamsInPath,\n isObject,\n isString,\n jsDoc,\n jsStringEscape,\n type NormalizedOutputOptions,\n type OpenApiInfoObject,\n pascal,\n upath,\n} from '@orval/core';\nimport { generateClient, generateFetchHeader } from '@orval/fetch';\nimport { generateZod } from '@orval/zod';\n\nconst getHeader = (\n option: false | ((info: OpenApiInfoObject) => string | string[]),\n info: OpenApiInfoObject,\n): string => {\n if (!option) {\n return '';\n }\n\n const header = option(info);\n\n return Array.isArray(header) ? jsDoc({ description: header }) : header;\n};\n\nconst getSpecInfo = (context: ContextSpec): OpenApiInfoObject =>\n context.spec.info ?? {\n title: 'API',\n version: '1.0.0',\n };\n\nexport const getMcpHeader: ClientHeaderBuilder = ({ verbOptions, output }) => {\n const targetInfo = getFileInfo(output.target);\n const schemasPath = (\n isObject(output.schemas)\n ? output.schemas.path\n : isString(output.schemas)\n ? output.schemas\n : undefined\n ) as string | undefined;\n const schemaInfo = schemasPath ? getFileInfo(schemasPath) : undefined;\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const basePath = schemaInfo?.dirname;\n const relativeSchemaImportPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.getRelativeImportPath(targetInfo.path, basePath, true)\n : upath.getRelativeImportPath(targetInfo.path, basePath)\n : './' + targetInfo.filename + '.schemas';\n\n const importSchemaNames = new Set(\n Object.values(verbOptions).flatMap((verbOption) => {\n const imports = [];\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.queryParams) {\n imports.push(`${pascalOperationName}Params`);\n }\n\n if (verbOption.body.imports[0]?.name) {\n imports.push(verbOption.body.imports[0]?.name);\n }\n\n return imports;\n }),\n )\n .values()\n .toArray();\n\n const importSchemasImplementation = `import {\\n ${importSchemaNames.join(\n ',\\n ',\n )}\\n} from '${relativeSchemaImportPath}';\n`;\n\n const relativeFetchClientPath = './http-client';\n const importFetchClientNames = new Set(\n Object.values(verbOptions).flatMap(\n (verbOption) => verbOption.operationName,\n ),\n )\n .values()\n .toArray();\n\n const importFetchClientImplementation = `import {\\n ${importFetchClientNames.join(\n ',\\n ',\n )}\\n} from '${relativeFetchClientPath}';\n `;\n\n const content = [\n importSchemasImplementation,\n importFetchClientImplementation,\n ].join('\\n');\n\n return content + '\\n';\n};\n\nexport const generateMcp: ClientBuilder = (verbOptions) => {\n const handlerArgsTypes = [];\n const originalParamNames = getParamsInPath(verbOptions.pathRoute);\n const pathParamsType = verbOptions.params\n .map((param, index) => {\n const paramName = originalParamNames[index];\n const paramType = param.implementation.split(': ')[1];\n return ` ${paramName}: ${paramType}`;\n })\n .join(',\\n');\n if (pathParamsType) {\n handlerArgsTypes.push(` pathParams: {\\n${pathParamsType}\\n };`);\n }\n if (verbOptions.queryParams) {\n handlerArgsTypes.push(\n ` queryParams: ${verbOptions.queryParams.schema.name};`,\n );\n }\n if (verbOptions.body.definition) {\n handlerArgsTypes.push(` bodyParams: ${verbOptions.body.definition};`);\n }\n\n const handlerArgsName = `${verbOptions.operationName}Args`;\n const handlerArgsImplementation =\n handlerArgsTypes.length > 0\n ? `\nexport type ${handlerArgsName} = {\n${handlerArgsTypes.join('\\n')}\n}\n`\n : '';\n\n const fetchParams = [];\n if (verbOptions.params.length > 0) {\n const pathParamsArgs = originalParamNames\n .map((paramName) => `args.pathParams.${paramName}`)\n .join(', ');\n\n fetchParams.push(pathParamsArgs);\n }\n if (verbOptions.body.definition) fetchParams.push(`args.bodyParams`);\n if (verbOptions.queryParams) fetchParams.push(`args.queryParams`);\n\n const handlerName = `${verbOptions.operationName}Handler`;\n const handlerImplementation = `\nexport const ${handlerName} = async (${handlerArgsTypes.length > 0 ? `args: ${handlerArgsName}, ` : ''}options?: RequestInit) => {\n const res = await ${verbOptions.operationName}(${fetchParams.length > 0 ? `${fetchParams.join(', ')}, ` : ''}options);\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(res),\n },\n ],\n };\n};`;\n\n const handlersImplementation = [\n handlerArgsImplementation,\n handlerImplementation,\n ].join('');\n\n return {\n implementation: handlersImplementation ? `${handlersImplementation}\\n` : '',\n imports: [],\n };\n};\n\nexport const generateServer = (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const info = getSpecInfo(context);\n const { extension, dirname } = getFileInfo(output.target);\n const serverPath = path.join(dirname, `server${extension}`);\n const header = getHeader(output.override.header, info);\n\n const mcpServerOptions = output.override.mcp.server;\n\n const toolImplementations = Object.values(verbOptions)\n .map((verbOption) => {\n const pascalOperationName = pascal(verbOption.operationName);\n const inputSchemaTypes = [];\n if (verbOption.params.length > 0)\n inputSchemaTypes.push(`pathParams: ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n inputSchemaTypes.push(`queryParams: ${pascalOperationName}QueryParams`);\n if (verbOption.body.definition)\n inputSchemaTypes.push(`bodyParams: ${pascalOperationName}Body`);\n\n const inputSchemaImplementation =\n inputSchemaTypes.length > 0\n ? `\\n inputSchema: {\\n ${inputSchemaTypes.join(',\\n ')}\\n },`\n : '';\n\n const handlerCallImplementation =\n inputSchemaTypes.length > 0\n ? `(args) => ${verbOption.operationName}Handler(args, options)`\n : `() => ${verbOption.operationName}Handler(options)`;\n\n const toolImplementation = `\ntools.${verbOption.operationName} = server.registerTool(\n '${jsStringEscape(verbOption.operationName)}',\n {\n description: '${jsStringEscape(verbOption.summary ?? '')}',${inputSchemaImplementation}\n },\n ${handlerCallImplementation}\n);`;\n\n return toolImplementation;\n })\n .join('\\n');\n\n const importToolSchemas = Object.values(verbOptions)\n .flatMap((verbOption) => {\n const imports = [];\n\n const pascalOperationName = pascal(verbOption.operationName);\n\n if (verbOption.headers) imports.push(` ${pascalOperationName}Header`);\n if (verbOption.params.length > 0)\n imports.push(` ${pascalOperationName}Params`);\n if (verbOption.queryParams)\n imports.push(` ${pascalOperationName}QueryParams`);\n if (verbOption.body.definition)\n imports.push(` ${pascalOperationName}Body`);\n\n return imports;\n })\n .join(',\\n');\n const importToolSchemasImplementation = `import {\\n${importToolSchemas}\\n} from './tool-schemas.zod';`;\n\n const importHandlers = Object.values(verbOptions)\n .filter((verbOption) =>\n toolImplementations.includes(`${verbOption.operationName}Handler`),\n )\n .map((verbOption) => ` ${verbOption.operationName}Handler`)\n .join(`,\\n`);\n const importHandlersImplementation = `import {\\n${importHandlers}\\n} from './handlers';`;\n\n const createMcpServerImplementation = `\nconst createMcpServer = (options?: RequestInit): { server: McpServer; tools: Record<string, RegisteredTool> } => {\n const server = new McpServer({\n name: '${camel(info.title)}Server',\n version: '1.0.0',\n });\n const tools: Record<string, RegisteredTool> = {};\n${toolImplementations}\n\n return { server, tools };\n};\n`;\n\n const serverFunctionName = mcpServerOptions?.name ?? 'customServer';\n const relativeServerPath = mcpServerOptions\n ? upath.getRelativeImportPath(serverPath, mcpServerOptions.path)\n : '';\n const importSpecifier = mcpServerOptions?.default\n ? serverFunctionName\n : `{ ${serverFunctionName} }`;\n\n const importMcpServer = `import {\n McpServer,\n type RegisteredTool,\n} from '@modelcontextprotocol/sdk/server/mcp.js';\n`;\n\n const importTransport = mcpServerOptions\n ? `import ${importSpecifier} from '${relativeServerPath}';`\n : `import {\n StdioServerTransport\n} from '@modelcontextprotocol/sdk/server/stdio.js';`;\n\n const importDependenciesImplementation = `${importMcpServer}\n${importTransport}\n`;\n\n const customServerConnectImplementation = `\\n${serverFunctionName}(createMcpServer);\\n`;\n const stdioServerConnectImplementation = `\nconst { server } = createMcpServer();\nconst transport = new StdioServerTransport();\n\nserver.connect(transport).then(() => {\n console.error('MCP server running on stdio');\n}).catch(console.error);\n`;\n\n const serverConnectImplementation = mcpServerOptions\n ? customServerConnectImplementation\n : stdioServerConnectImplementation;\n\n const content = [\n header,\n importDependenciesImplementation,\n importHandlersImplementation,\n importToolSchemasImplementation,\n createMcpServerImplementation,\n serverConnectImplementation,\n ].join('\\n');\n\n return [\n {\n content,\n path: serverPath,\n },\n ];\n};\n\nconst generateZodFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const { extension, dirname } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, getSpecInfo(context));\n\n const zods = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) =>\n generateZod(\n verbOption,\n {\n route: verbOption.route,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n output: output.target,\n },\n output.client,\n ),\n ),\n );\n\n const allMutators = new Map(\n zods.flatMap((z) => z.mutators ?? []).map((m) => [m.name, m]),\n )\n .values()\n .toArray();\n\n const mutatorsImports = generateMutatorImports({\n mutators: allMutators,\n });\n\n let content = `${header}import { z as zod } from 'zod';\\n${mutatorsImports}\\n`;\n\n const zodPath = path.join(dirname, `tool-schemas.zod${extension}`);\n\n content += zods.map((zod) => zod.implementation).join('\\n');\n\n return [\n {\n content,\n path: zodPath,\n },\n ];\n};\n\nconst generateHttpClientFiles = async (\n verbOptions: Record<string, GeneratorVerbOptions>,\n output: NormalizedOutputOptions,\n context: ContextSpec,\n) => {\n const {\n path: targetPath,\n extension,\n dirname,\n filename,\n } = getFileInfo(output.target);\n\n const header = getHeader(output.override.header, getSpecInfo(context));\n\n const clients = await Promise.all(\n Object.values(verbOptions).map(async (verbOption) => {\n const fullRoute = getFullRoute(\n verbOption.route,\n context.spec.servers,\n output.baseUrl,\n );\n\n const options = {\n route: fullRoute,\n pathRoute: verbOption.pathRoute,\n override: output.override,\n context,\n output: output.target,\n };\n\n return generateClient(verbOption, options, output.client, output);\n }),\n );\n\n const clientImplementation = clients\n .map((client) => client.implementation)\n .join('\\n');\n\n const isZodSchemaOutput =\n isObject(output.schemas) && output.schemas.type === 'zod';\n const schemasPath = (\n isObject(output.schemas)\n ? output.schemas.path\n : isString(output.schemas)\n ? output.schemas\n : undefined\n ) as string | undefined;\n const basePath = schemasPath ? getFileInfo(schemasPath).dirname : undefined;\n const relativeSchemasPath = basePath\n ? isZodSchemaOutput && output.indexFiles\n ? upath.getRelativeImportPath(targetPath, basePath, true)\n : upath.getRelativeImportPath(targetPath, basePath)\n : './' + filename + '.schemas';\n\n const importNames = clients\n .flatMap((client) => client.imports)\n .map((imp) => imp.name);\n const uniqueImportNames = new Set(importNames).values().toArray();\n\n const importImplementation = `import { ${uniqueImportNames.join(\n ',\\n',\n )} } from '${relativeSchemasPath}';`;\n\n const fetchHeader = generateFetchHeader({\n title: '',\n isRequestOptions: false,\n isMutator: false,\n noFunction: false,\n isGlobalMutator: false,\n provideIn: false,\n hasAwaitedType: false,\n output,\n verbOptions,\n clientImplementation,\n });\n\n const content = [\n header,\n importImplementation,\n fetchHeader,\n clientImplementation,\n ].join('\\n');\n const outputPath = path.join(dirname, `http-client${extension}`);\n\n return [\n {\n content,\n path: outputPath,\n },\n ];\n};\n\nexport const generateExtraFiles: ClientExtraFilesBuilder = async (\n verbOptions,\n output,\n context,\n) => {\n const server = generateServer(verbOptions, output, context);\n const [zods, httpClients] = await Promise.all([\n generateZodFiles(verbOptions, output, context),\n generateHttpClientFiles(verbOptions, output, context),\n ]);\n\n return [...server, ...zods, ...httpClients];\n};\n\nconst mcpClientBuilder: ClientGeneratorsBuilder = {\n client: generateMcp,\n header: getMcpHeader,\n extraFiles: generateExtraFiles,\n};\n\nexport const builder = () => () => mcpClientBuilder;\n\nexport default builder;\n"],"mappings":";;;;;AA0BA,MAAM,aACJ,QACA,SACW;AACX,KAAI,CAAC,OACH,QAAO;CAGT,MAAM,SAAS,OAAO,KAAK;AAE3B,QAAO,MAAM,QAAQ,OAAO,GAAG,MAAM,EAAE,aAAa,QAAQ,CAAC,GAAG;;AAGlE,MAAM,eAAe,YACnB,QAAQ,KAAK,QAAQ;CACnB,OAAO;CACP,SAAS;CACV;AAEH,MAAa,gBAAqC,EAAE,aAAa,aAAa;CAC5E,MAAM,aAAa,YAAY,OAAO,OAAO;CAC7C,MAAM,cACJ,SAAS,OAAO,QAAQ,GACpB,OAAO,QAAQ,OACf,SAAS,OAAO,QAAQ,GACtB,OAAO,UACP,KAAA;CAER,MAAM,aAAa,cAAc,YAAY,YAAY,GAAG,KAAA;CAE5D,MAAM,oBACJ,SAAS,OAAO,QAAQ,IAAI,OAAO,QAAQ,SAAS;CACtD,MAAM,WAAW,YAAY;CAC7B,MAAM,2BAA2B,WAC7B,qBAAqB,OAAO,aAC1B,MAAM,sBAAsB,WAAW,MAAM,UAAU,KAAK,GAC5D,MAAM,sBAAsB,WAAW,MAAM,SAAS,GACxD,OAAO,WAAW,WAAW;AA6CjC,QALgB,CAnBoB,eAnBV,IAAI,IAC5B,OAAO,OAAO,YAAY,CAAC,SAAS,eAAe;EACjD,MAAM,UAAU,EAAE;EAClB,MAAM,sBAAsB,OAAO,WAAW,cAAc;AAE5D,MAAI,WAAW,YACb,SAAQ,KAAK,GAAG,oBAAoB,QAAQ;AAG9C,MAAI,WAAW,KAAK,QAAQ,IAAI,KAC9B,SAAQ,KAAK,WAAW,KAAK,QAAQ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,sBAAsB,YAAY,SAAS,GACnD,OAAO,WAAW;CAEtB,MAAM,cAAc,QACjB,SAAS,WAAW,OAAO,QAAQ,CACnC,KAAK,QAAQ,IAAI,KAAK;AA4BzB,QAAO,CACL;EACE,SAVY;GACd;GAlB2B,YAFH,IAAI,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAS,CAEN,KACzD,MACD,CAAC,WAAW,oBAAoB;GAEb,oBAAoB;IACtC,OAAO;IACP,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB;IACA;IACA;IACD,CAAC;GAMA;GACD,CAAC,KAAK,KAAK;EAMR,MALe,KAAK,KAAK,SAAS,cAAc,YAAY;EAM7D,CACF;;AAGH,MAAa,qBAA8C,OACzD,aACA,QACA,YACG;CACH,MAAM,SAAS,eAAe,aAAa,QAAQ,QAAQ;CAC3D,MAAM,CAAC,MAAM,eAAe,MAAM,QAAQ,IAAI,CAC5C,iBAAiB,aAAa,QAAQ,QAAQ,EAC9C,wBAAwB,aAAa,QAAQ,QAAQ,CACtD,CAAC;AAEF,QAAO;EAAC,GAAG;EAAQ,GAAG;EAAM,GAAG;EAAY;;AAG7C,MAAM,mBAA4C;CAChD,QAAQ;CACR,QAAQ;CACR,YAAY;CACb;AAED,MAAa,sBAAsB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/mcp",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.14.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"nuke": "rimraf .turbo dist node_modules"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@orval/core": "8.
|
|
39
|
-
"@orval/fetch": "8.
|
|
40
|
-
"@orval/zod": "8.
|
|
38
|
+
"@orval/core": "8.14.0",
|
|
39
|
+
"@orval/fetch": "8.14.0",
|
|
40
|
+
"@orval/zod": "8.14.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"eslint": "10.1.0",
|