@kubb/mcp 4.12.9 → 4.12.10
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 +1 -1
- package/dist/index.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/dist/{src-CA7MwIqB.cjs → src-0mmCuQsW.cjs} +2 -2
- package/dist/{src-CA7MwIqB.cjs.map → src-0mmCuQsW.cjs.map} +1 -1
- package/dist/{src-CCtk34JO.js → src-C0hwNk8V.js} +2 -2
- package/dist/{src-CCtk34JO.js.map → src-C0hwNk8V.js.map} +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/dist/server.cjs
CHANGED
package/dist/server.js
CHANGED
|
@@ -38,7 +38,7 @@ let _kubb_plugin_ts = require("@kubb/plugin-ts");
|
|
|
38
38
|
let _kubb_react_fabric = require("@kubb/react-fabric");
|
|
39
39
|
|
|
40
40
|
//#region package.json
|
|
41
|
-
var version = "4.12.
|
|
41
|
+
var version = "4.12.10";
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/schemas/generateSchema.ts
|
|
@@ -140,4 +140,4 @@ Object.defineProperty(exports, 'startServer', {
|
|
|
140
140
|
return startServer;
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
|
-
//# sourceMappingURL=src-
|
|
143
|
+
//# sourceMappingURL=src-0mmCuQsW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src-
|
|
1
|
+
{"version":3,"file":"src-0mmCuQsW.cjs","names":["z","FileProcessor","definedConfig: Config","AsyncEventEmitter","StdioServerTransport","McpServer"],"sources":["../package.json","../src/schemas/generateSchema.ts","../src/tools/generate.ts","../src/index.ts"],"sourcesContent":["","import { z } from 'zod'\n\nexport const generateSchema = z.object({\n openApi: z.string().default('https://petstore.swagger.io/v2/swagger.json').describe('OpenAPI/Swagger spec'),\n plugin: z.enum(['typescript', 'react-query']).describe('Plugin to use'),\n operationId: z.string().nullable().optional().describe('Which operationId should be used'),\n // schemaName: z.string().nullable().optional().describe('Which schema should be used'),\n})\n","import { type Config, type KubbEvents, type Plugin, safeBuild } from '@kubb/core'\nimport { AsyncEventEmitter } from '@kubb/core/utils'\nimport { type Include, pluginOas } from '@kubb/plugin-oas'\nimport { pluginReactQuery } from '@kubb/plugin-react-query'\nimport { pluginTs } from '@kubb/plugin-ts'\nimport { createFile, FileProcessor } from '@kubb/react-fabric'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.d.ts'\nimport type { z } from 'zod'\nimport type { generateSchema } from '../schemas/generateSchema.ts'\n\nexport async function generate({ plugin, openApi, operationId }: z.infer<typeof generateSchema>): Promise<CallToolResult> {\n try {\n const include = [\n operationId\n ? {\n type: 'operationId',\n pattern: operationId,\n }\n : undefined,\n ].filter(Boolean) as Include[]\n\n const plugins = [\n pluginOas({ validate: false, generators: [] }),\n pluginTs({\n output: {\n path: 'typescript.ts',\n },\n generators: plugin === 'typescript' ? undefined : [],\n include,\n }),\n pluginReactQuery({\n output: {\n path: 'react-query.ts',\n },\n generators: plugin === 'react-query' ? undefined : [],\n include,\n }),\n ].filter(Boolean) as Plugin[]\n\n const fileProcessor = new FileProcessor()\n const definedConfig: Config = {\n root: process.cwd(),\n input: {\n data: openApi,\n },\n output: {\n path: './',\n write: false,\n barrelType: 'named',\n },\n plugins,\n }\n\n const { fabric, error } = await safeBuild({\n config: definedConfig,\n events: new AsyncEventEmitter<KubbEvents>(),\n })\n\n if (error) {\n return {\n content: [\n {\n type: 'text',\n text: error.message,\n },\n ],\n isError: true,\n }\n }\n\n const promises = fabric.files.map(async (file) => {\n return fileProcessor.parse(createFile(file))\n })\n\n const sources = await Promise.all(promises)\n\n return {\n content: [\n // {\n // type: 'resource',\n // resource: {}\n // },\n {\n type: 'text',\n text: `Config: ${JSON.stringify(definedConfig, null, 2)}`,\n },\n {\n type: 'text',\n text: `Files: ${JSON.stringify(sources, null, 2)}`,\n },\n ],\n }\n } catch (caughtError) {\n const error = caughtError as Error\n\n return {\n content: [\n {\n type: 'text',\n text: error.message,\n },\n ],\n isError: true,\n }\n }\n}\n","import process from 'node:process'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { version } from '../package.json'\nimport { generateSchema } from './schemas/generateSchema.ts'\nimport { generate } from './tools/generate.ts'\n\nexport async function startServer() {\n try {\n const transport = new StdioServerTransport()\n const server = new McpServer({\n name: 'Kubb',\n version,\n })\n\n server.tool('generate', 'generate an openAPI spec to a code snippet', generateSchema.shape, generate)\n\n await server.connect(transport)\n } catch (error) {\n console.error('Failed to start server:', error)\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEA,MAAa,iBAAiBA,MAAE,OAAO;CACrC,SAASA,MAAE,QAAQ,CAAC,QAAQ,8CAA8C,CAAC,SAAS,uBAAuB;CAC3G,QAAQA,MAAE,KAAK,CAAC,cAAc,cAAc,CAAC,CAAC,SAAS,gBAAgB;CACvE,aAAaA,MAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,mCAAmC;CAE3F,CAAC;;;;ACGF,eAAsB,SAAS,EAAE,QAAQ,SAAS,eAAwE;AACxH,KAAI;EACF,MAAM,UAAU,CACd,cACI;GACE,MAAM;GACN,SAAS;GACV,GACD,OACL,CAAC,OAAO,QAAQ;EAEjB,MAAM,UAAU;mCACJ;IAAE,UAAU;IAAO,YAAY,EAAE;IAAE,CAAC;iCACrC;IACP,QAAQ,EACN,MAAM,iBACP;IACD,YAAY,WAAW,eAAe,SAAY,EAAE;IACpD;IACD,CAAC;kDACe;IACf,QAAQ,EACN,MAAM,kBACP;IACD,YAAY,WAAW,gBAAgB,SAAY,EAAE;IACrD;IACD,CAAC;GACH,CAAC,OAAO,QAAQ;EAEjB,MAAM,gBAAgB,IAAIC,kCAAe;EACzC,MAAMC,gBAAwB;GAC5B,MAAM,QAAQ,KAAK;GACnB,OAAO,EACL,MAAM,SACP;GACD,QAAQ;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACb;GACD;GACD;EAED,MAAM,EAAE,QAAQ,UAAU,gCAAgB;GACxC,QAAQ;GACR,QAAQ,IAAIC,oCAA+B;GAC5C,CAAC;AAEF,MAAI,MACF,QAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;IACb,CACF;GACD,SAAS;GACV;EAGH,MAAM,WAAW,OAAO,MAAM,IAAI,OAAO,SAAS;AAChD,UAAO,cAAc,yCAAiB,KAAK,CAAC;IAC5C;EAEF,MAAM,UAAU,MAAM,QAAQ,IAAI,SAAS;AAE3C,SAAO,EACL,SAAS,CAKP;GACE,MAAM;GACN,MAAM,WAAW,KAAK,UAAU,eAAe,MAAM,EAAE;GACxD,EACD;GACE,MAAM;GACN,MAAM,UAAU,KAAK,UAAU,SAAS,MAAM,EAAE;GACjD,CACF,EACF;UACM,aAAa;AAGpB,SAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MANQ,YAMI;IACb,CACF;GACD,SAAS;GACV;;;;;;AChGL,eAAsB,cAAc;AAClC,KAAI;EACF,MAAM,YAAY,IAAIC,gEAAsB;EAC5C,MAAM,SAAS,IAAIC,kDAAU;GAC3B,MAAM;GACN;GACD,CAAC;AAEF,SAAO,KAAK,YAAY,8CAA8C,eAAe,OAAO,SAAS;AAErG,QAAM,OAAO,QAAQ,UAAU;UACxB,OAAO;AACd,UAAQ,MAAM,2BAA2B,MAAM;AAC/C,uBAAQ,KAAK,EAAE"}
|
|
@@ -10,7 +10,7 @@ import { pluginTs } from "@kubb/plugin-ts";
|
|
|
10
10
|
import { FileProcessor, createFile } from "@kubb/react-fabric";
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "4.12.
|
|
13
|
+
var version = "4.12.10";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/schemas/generateSchema.ts
|
|
@@ -107,4 +107,4 @@ async function startServer() {
|
|
|
107
107
|
|
|
108
108
|
//#endregion
|
|
109
109
|
export { startServer as t };
|
|
110
|
-
//# sourceMappingURL=src-
|
|
110
|
+
//# sourceMappingURL=src-C0hwNk8V.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"src-
|
|
1
|
+
{"version":3,"file":"src-C0hwNk8V.js","names":["definedConfig: Config"],"sources":["../package.json","../src/schemas/generateSchema.ts","../src/tools/generate.ts","../src/index.ts"],"sourcesContent":["","import { z } from 'zod'\n\nexport const generateSchema = z.object({\n openApi: z.string().default('https://petstore.swagger.io/v2/swagger.json').describe('OpenAPI/Swagger spec'),\n plugin: z.enum(['typescript', 'react-query']).describe('Plugin to use'),\n operationId: z.string().nullable().optional().describe('Which operationId should be used'),\n // schemaName: z.string().nullable().optional().describe('Which schema should be used'),\n})\n","import { type Config, type KubbEvents, type Plugin, safeBuild } from '@kubb/core'\nimport { AsyncEventEmitter } from '@kubb/core/utils'\nimport { type Include, pluginOas } from '@kubb/plugin-oas'\nimport { pluginReactQuery } from '@kubb/plugin-react-query'\nimport { pluginTs } from '@kubb/plugin-ts'\nimport { createFile, FileProcessor } from '@kubb/react-fabric'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.d.ts'\nimport type { z } from 'zod'\nimport type { generateSchema } from '../schemas/generateSchema.ts'\n\nexport async function generate({ plugin, openApi, operationId }: z.infer<typeof generateSchema>): Promise<CallToolResult> {\n try {\n const include = [\n operationId\n ? {\n type: 'operationId',\n pattern: operationId,\n }\n : undefined,\n ].filter(Boolean) as Include[]\n\n const plugins = [\n pluginOas({ validate: false, generators: [] }),\n pluginTs({\n output: {\n path: 'typescript.ts',\n },\n generators: plugin === 'typescript' ? undefined : [],\n include,\n }),\n pluginReactQuery({\n output: {\n path: 'react-query.ts',\n },\n generators: plugin === 'react-query' ? undefined : [],\n include,\n }),\n ].filter(Boolean) as Plugin[]\n\n const fileProcessor = new FileProcessor()\n const definedConfig: Config = {\n root: process.cwd(),\n input: {\n data: openApi,\n },\n output: {\n path: './',\n write: false,\n barrelType: 'named',\n },\n plugins,\n }\n\n const { fabric, error } = await safeBuild({\n config: definedConfig,\n events: new AsyncEventEmitter<KubbEvents>(),\n })\n\n if (error) {\n return {\n content: [\n {\n type: 'text',\n text: error.message,\n },\n ],\n isError: true,\n }\n }\n\n const promises = fabric.files.map(async (file) => {\n return fileProcessor.parse(createFile(file))\n })\n\n const sources = await Promise.all(promises)\n\n return {\n content: [\n // {\n // type: 'resource',\n // resource: {}\n // },\n {\n type: 'text',\n text: `Config: ${JSON.stringify(definedConfig, null, 2)}`,\n },\n {\n type: 'text',\n text: `Files: ${JSON.stringify(sources, null, 2)}`,\n },\n ],\n }\n } catch (caughtError) {\n const error = caughtError as Error\n\n return {\n content: [\n {\n type: 'text',\n text: error.message,\n },\n ],\n isError: true,\n }\n }\n}\n","import process from 'node:process'\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { version } from '../package.json'\nimport { generateSchema } from './schemas/generateSchema.ts'\nimport { generate } from './tools/generate.ts'\n\nexport async function startServer() {\n try {\n const transport = new StdioServerTransport()\n const server = new McpServer({\n name: 'Kubb',\n version,\n })\n\n server.tool('generate', 'generate an openAPI spec to a code snippet', generateSchema.shape, generate)\n\n await server.connect(transport)\n } catch (error) {\n console.error('Failed to start server:', error)\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;ACEA,MAAa,iBAAiB,EAAE,OAAO;CACrC,SAAS,EAAE,QAAQ,CAAC,QAAQ,8CAA8C,CAAC,SAAS,uBAAuB;CAC3G,QAAQ,EAAE,KAAK,CAAC,cAAc,cAAc,CAAC,CAAC,SAAS,gBAAgB;CACvE,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,mCAAmC;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C,KAAI;EACF,MAAM,YAAY,IAAI,sBAAsB;EAC5C,MAAM,SAAS,IAAI,UAAU;GAC3B,MAAM;GACN;GACD,CAAC;AAEF,SAAO,KAAK,YAAY,8CAA8C,eAAe,OAAO,SAAS;AAErG,QAAM,OAAO,QAAQ,UAAU;UACxB,OAAO;AACd,UAAQ,MAAM,2BAA2B,MAAM;AAC/C,YAAQ,KAAK,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/mcp",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.10",
|
|
4
4
|
"description": "Generator MCP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"@kubb/react-fabric": "0.7.4",
|
|
57
57
|
"@modelcontextprotocol/sdk": "1.21.1",
|
|
58
58
|
"zod": "^3.25.76",
|
|
59
|
-
"@kubb/core": "4.12.
|
|
60
|
-
"@kubb/plugin-oas": "4.12.
|
|
61
|
-
"@kubb/plugin-react-query": "4.12.
|
|
62
|
-
"@kubb/plugin-ts": "4.12.
|
|
59
|
+
"@kubb/core": "4.12.10",
|
|
60
|
+
"@kubb/plugin-oas": "4.12.10",
|
|
61
|
+
"@kubb/plugin-react-query": "4.12.10",
|
|
62
|
+
"@kubb/plugin-ts": "4.12.10"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@kubb/react-fabric": "0.7.4"
|