@kubb/mcp 3.16.4 → 3.17.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.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/{src-CvKWfHCa.cjs → src-BxpK5WXt.cjs} +2 -2
- package/dist/src-BxpK5WXt.cjs.map +1 -0
- package/dist/{src-B3xJXrIV.js → src-COYPXBMK.js} +2 -2
- package/dist/src-COYPXBMK.js.map +1 -0
- package/package.json +16 -16
- package/dist/src-B3xJXrIV.js.map +0 -1
- package/dist/src-CvKWfHCa.cjs.map +0 -1
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
package/dist/server.cjs
CHANGED
package/dist/server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","names":["startServer"],"sources":["../src/server.ts"],"sourcesContent":["import { startServer } from './index.ts'\n\nstartServer()\n"],"mappings":";;;AAEAA
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["startServer"],"sources":["../src/server.ts"],"sourcesContent":["import { startServer } from './index.ts'\n\nstartServer()\n"],"mappings":";;;AAEAA"}
|
package/dist/server.js
CHANGED
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import { startServer } from './index.ts'\n\nstartServer()\n"],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"server.js","names":[],"sources":["../src/server.ts"],"sourcesContent":["import { startServer } from './index.ts'\n\nstartServer()\n"],"mappings":";;;AAEA"}
|
|
@@ -31,7 +31,7 @@ const __kubb_plugin_react_query = __toESM(require("@kubb/plugin-react-query"));
|
|
|
31
31
|
const __kubb_core = __toESM(require("@kubb/core"));
|
|
32
32
|
|
|
33
33
|
//#region package.json
|
|
34
|
-
var version = "3.
|
|
34
|
+
var version = "3.17.0";
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/schemas/generateSchema.ts
|
|
@@ -128,4 +128,4 @@ Object.defineProperty(exports, 'startServer', {
|
|
|
128
128
|
return startServer;
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
|
-
//# sourceMappingURL=src-
|
|
131
|
+
//# sourceMappingURL=src-BxpK5WXt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-BxpK5WXt.cjs","names":["z","definedConfig: Config","StdioServerTransport","McpServer"],"sources":["../package.json","../src/schemas/generateSchema.ts","../src/tools/generate.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@kubb/mcp\",\n \"version\": \"3.17.0\",\n \"description\": \"Generator MCP\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"MCP\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/mcp\"\n },\n \"license\": \"MIT\",\n \"author\": \"stijnvanhulle\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./server\": {\n \"import\": \"./dist/server.js\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.cts\",\n \"typesVersions\": {\n \"*\": {\n \"server\": [\n \"./dist/server.d.ts\"\n ]\n }\n },\n \"files\": [\n \"src\",\n \"dist\",\n \"!/**/**.test.**\",\n \"!/**/__tests__/**\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"start:mcp\": \"bun --watch ./src/server.ts\",\n \"debug:mcp\": \"npx -y @modelcontextprotocol/inspector node ./dist/server.js\",\n \"clean\": \"npx rimraf ./dist\",\n \"lint\": \"bun biome lint .\",\n \"lint:fix\": \"bun biome lint --fix --unsafe .\",\n \"release\": \"pnpm publish --no-git-check\",\n \"release:canary\": \"bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check\",\n \"start\": \"tsdown --watch\",\n \"test\": \"vitest --passWithNoTests\",\n \"typecheck\": \"tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false\"\n },\n \"dependencies\": {\n \"@kubb/core\": \"workspace:*\",\n \"@kubb/plugin-client\": \"workspace:*\",\n \"@kubb/plugin-cypress\": \"workspace:*\",\n \"@kubb/plugin-faker\": \"workspace:*\",\n \"@kubb/plugin-mcp\": \"workspace:*\",\n \"@kubb/plugin-msw\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@kubb/plugin-react-query\": \"workspace:*\",\n \"@kubb/plugin-redoc\": \"workspace:*\",\n \"@kubb/plugin-swr\": \"workspace:*\",\n \"@kubb/plugin-ts\": \"workspace:*\",\n \"@kubb/plugin-zod\": \"workspace:*\",\n \"@kubb/react\": \"workspace:*\",\n \"@modelcontextprotocol/sdk\": \"^1.17.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/node\": \"catalog:\",\n \"@types/react\": \"catalog:\",\n \"tsdown\": \"catalog:\",\n \"typescript\": \"catalog:\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n","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 { pluginTs } from '@kubb/plugin-ts'\nimport { type Include, pluginOas } from '@kubb/plugin-oas'\nimport { pluginReactQuery } from '@kubb/plugin-react-query'\n\nimport { type Config, safeBuild, type Plugin, getSource } from '@kubb/core'\nimport type { generateSchema } from '../schemas/generateSchema.ts'\nimport type { z } from 'zod'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.d.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 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 { files, error } = await safeBuild({\n config: definedConfig,\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 = files.map((file) => getSource(file, { extname: '.ts' }))\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 (e) {\n const error = e 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEa;;;;ACAb,MAAa,iBAAiBA,MAAE,OAAO;CACrC,SAASA,MAAE,SAAS,QAAQ,+CAA+C,SAAS;CACpF,QAAQA,MAAE,KAAK,CAAC,cAAc,cAAc,EAAE,SAAS;CACvD,aAAaA,MAAE,SAAS,WAAW,WAAW,SAAS;CAExD;;;;ACED,eAAsB,SAAS,EAAE,QAAQ,SAAS,aAA6C,EAA2B;AACxH,KAAI;EACF,MAAM,UAAU,CACd,cACI;GACE,MAAM;GACN,SAAS;GACV,GACD,OACL,CAAC,OAAO;EAET,MAAM,UAAU;oCACJ;IAAE,UAAU;IAAO,YAAY,EAAE;IAAE;kCACpC;IACP,QAAQ,EACN,MAAM,iBACP;IACD,YAAY,WAAW,eAAe,SAAY,EAAE;IACpD;IACD;mDACgB;IACf,QAAQ,EACN,MAAM,kBACP;IACD,YAAY,WAAW,gBAAgB,SAAY,EAAE;IACrD;IACD;GACF,CAAC,OAAO;EAET,MAAMC,gBAAwB;GAC5B,MAAM,QAAQ;GACd,OAAO,EACL,MAAM,SACP;GACD,QAAQ;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACb;GACD;GACD;EAED,MAAM,EAAE,OAAO,OAAO,GAAG,iCAAgB,EACvC,QAAQ,eACT;AAED,MAAI,MACF,QAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;IACb,CACF;GACD,SAAS;GACV;EAGH,MAAM,WAAW,MAAM,KAAK,oCAAmB,MAAM,EAAE,SAAS,OAAO;EAEvE,MAAM,UAAU,MAAM,QAAQ,IAAI;AAElC,SAAO,EACL,SAAS,CAKP;GACE,MAAM;GACN,MAAM,WAAW,KAAK,UAAU,eAAe,MAAM;GACtD,EACD;GACE,MAAM;GACN,MAAM,UAAU,KAAK,UAAU,SAAS,MAAM;GAC/C,CACF,EACF;CACF,SAAQ,GAAG;EACV,MAAM,QAAQ;AAEd,SAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;IACb,CACF;GACD,SAAS;GACV;CACF;AACF;;;;AC7FD,eAAsB,cAAc;AAClC,KAAI;EACF,MAAM,YAAY,IAAIC;EACtB,MAAM,SAAS,IAAIC,mDAAU;GAC3B,MAAM;GACN;GACD;AAED,SAAO,KAAK,YAAY,8CAA8C,eAAe,OAAO;AAE5F,QAAM,OAAO,QAAQ;CACtB,SAAQ,OAAO;AACd,UAAQ,MAAM,2BAA2B;AACzC,uBAAQ,KAAK;CACd;AACF"}
|
|
@@ -8,7 +8,7 @@ import { pluginReactQuery } from "@kubb/plugin-react-query";
|
|
|
8
8
|
import { getSource, safeBuild } from "@kubb/core";
|
|
9
9
|
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "3.
|
|
11
|
+
var version = "3.17.0";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/schemas/generateSchema.ts
|
|
@@ -100,4 +100,4 @@ async function startServer() {
|
|
|
100
100
|
|
|
101
101
|
//#endregion
|
|
102
102
|
export { startServer };
|
|
103
|
-
//# sourceMappingURL=src-
|
|
103
|
+
//# sourceMappingURL=src-COYPXBMK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-COYPXBMK.js","names":["definedConfig: Config"],"sources":["../package.json","../src/schemas/generateSchema.ts","../src/tools/generate.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@kubb/mcp\",\n \"version\": \"3.17.0\",\n \"description\": \"Generator MCP\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"MCP\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/mcp\"\n },\n \"license\": \"MIT\",\n \"author\": \"stijnvanhulle\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./server\": {\n \"import\": \"./dist/server.js\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.cts\",\n \"typesVersions\": {\n \"*\": {\n \"server\": [\n \"./dist/server.d.ts\"\n ]\n }\n },\n \"files\": [\n \"src\",\n \"dist\",\n \"!/**/**.test.**\",\n \"!/**/__tests__/**\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"start:mcp\": \"bun --watch ./src/server.ts\",\n \"debug:mcp\": \"npx -y @modelcontextprotocol/inspector node ./dist/server.js\",\n \"clean\": \"npx rimraf ./dist\",\n \"lint\": \"bun biome lint .\",\n \"lint:fix\": \"bun biome lint --fix --unsafe .\",\n \"release\": \"pnpm publish --no-git-check\",\n \"release:canary\": \"bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check\",\n \"start\": \"tsdown --watch\",\n \"test\": \"vitest --passWithNoTests\",\n \"typecheck\": \"tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false\"\n },\n \"dependencies\": {\n \"@kubb/core\": \"workspace:*\",\n \"@kubb/plugin-client\": \"workspace:*\",\n \"@kubb/plugin-cypress\": \"workspace:*\",\n \"@kubb/plugin-faker\": \"workspace:*\",\n \"@kubb/plugin-mcp\": \"workspace:*\",\n \"@kubb/plugin-msw\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@kubb/plugin-react-query\": \"workspace:*\",\n \"@kubb/plugin-redoc\": \"workspace:*\",\n \"@kubb/plugin-swr\": \"workspace:*\",\n \"@kubb/plugin-ts\": \"workspace:*\",\n \"@kubb/plugin-zod\": \"workspace:*\",\n \"@kubb/react\": \"workspace:*\",\n \"@modelcontextprotocol/sdk\": \"^1.17.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/node\": \"catalog:\",\n \"@types/react\": \"catalog:\",\n \"tsdown\": \"catalog:\",\n \"typescript\": \"catalog:\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n","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 { pluginTs } from '@kubb/plugin-ts'\nimport { type Include, pluginOas } from '@kubb/plugin-oas'\nimport { pluginReactQuery } from '@kubb/plugin-react-query'\n\nimport { type Config, safeBuild, type Plugin, getSource } from '@kubb/core'\nimport type { generateSchema } from '../schemas/generateSchema.ts'\nimport type { z } from 'zod'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.d.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 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 { files, error } = await safeBuild({\n config: definedConfig,\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 = files.map((file) => getSource(file, { extname: '.ts' }))\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 (e) {\n const error = e 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":";;;;;;;;;;cAEa;;;;ACAb,MAAa,iBAAiB,EAAE,OAAO;CACrC,SAAS,EAAE,SAAS,QAAQ,+CAA+C,SAAS;CACpF,QAAQ,EAAE,KAAK,CAAC,cAAc,cAAc,EAAE,SAAS;CACvD,aAAa,EAAE,SAAS,WAAW,WAAW,SAAS;CAExD;;;;ACED,eAAsB,SAAS,EAAE,QAAQ,SAAS,aAA6C,EAA2B;AACxH,KAAI;EACF,MAAM,UAAU,CACd,cACI;GACE,MAAM;GACN,SAAS;GACV,GACD,OACL,CAAC,OAAO;EAET,MAAM,UAAU;GACd,UAAU;IAAE,UAAU;IAAO,YAAY,EAAE;IAAE;GAC7C,SAAS;IACP,QAAQ,EACN,MAAM,iBACP;IACD,YAAY,WAAW,eAAe,SAAY,EAAE;IACpD;IACD;GACD,iBAAiB;IACf,QAAQ,EACN,MAAM,kBACP;IACD,YAAY,WAAW,gBAAgB,SAAY,EAAE;IACrD;IACD;GACF,CAAC,OAAO;EAET,MAAMA,gBAAwB;GAC5B,MAAM,QAAQ;GACd,OAAO,EACL,MAAM,SACP;GACD,QAAQ;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACb;GACD;GACD;EAED,MAAM,EAAE,OAAO,OAAO,GAAG,MAAM,UAAU,EACvC,QAAQ,eACT;AAED,MAAI,MACF,QAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;IACb,CACF;GACD,SAAS;GACV;EAGH,MAAM,WAAW,MAAM,KAAK,SAAS,UAAU,MAAM,EAAE,SAAS,OAAO;EAEvE,MAAM,UAAU,MAAM,QAAQ,IAAI;AAElC,SAAO,EACL,SAAS,CAKP;GACE,MAAM;GACN,MAAM,WAAW,KAAK,UAAU,eAAe,MAAM;GACtD,EACD;GACE,MAAM;GACN,MAAM,UAAU,KAAK,UAAU,SAAS,MAAM;GAC/C,CACF,EACF;CACF,SAAQ,GAAG;EACV,MAAM,QAAQ;AAEd,SAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;IACb,CACF;GACD,SAAS;GACV;CACF;AACF;;;;AC7FD,eAAsB,cAAc;AAClC,KAAI;EACF,MAAM,YAAY,IAAI;EACtB,MAAM,SAAS,IAAI,UAAU;GAC3B,MAAM;GACN;GACD;AAED,SAAO,KAAK,YAAY,8CAA8C,eAAe,OAAO;AAE5F,QAAM,OAAO,QAAQ;CACtB,SAAQ,OAAO;AACd,UAAQ,MAAM,2BAA2B;AACzC,YAAQ,KAAK;CACd;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.0",
|
|
4
4
|
"description": "Generator MCP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -48,27 +48,27 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.17.3",
|
|
50
50
|
"zod": "^3.25.76",
|
|
51
|
-
"@kubb/core": "3.
|
|
52
|
-
"@kubb/plugin-client": "3.
|
|
53
|
-
"@kubb/plugin-cypress": "3.
|
|
54
|
-
"@kubb/plugin-faker": "3.
|
|
55
|
-
"@kubb/plugin-mcp": "3.
|
|
56
|
-
"@kubb/plugin-msw": "3.
|
|
57
|
-
"@kubb/plugin-oas": "3.
|
|
58
|
-
"@kubb/plugin-react-query": "3.
|
|
59
|
-
"@kubb/plugin-redoc": "3.
|
|
60
|
-
"@kubb/plugin-swr": "3.
|
|
61
|
-
"@kubb/plugin-ts": "3.
|
|
62
|
-
"@kubb/plugin-zod": "3.
|
|
63
|
-
"@kubb/react": "3.
|
|
51
|
+
"@kubb/core": "3.17.0",
|
|
52
|
+
"@kubb/plugin-client": "3.17.0",
|
|
53
|
+
"@kubb/plugin-cypress": "3.17.0",
|
|
54
|
+
"@kubb/plugin-faker": "3.17.0",
|
|
55
|
+
"@kubb/plugin-mcp": "3.17.0",
|
|
56
|
+
"@kubb/plugin-msw": "3.17.0",
|
|
57
|
+
"@kubb/plugin-oas": "3.17.0",
|
|
58
|
+
"@kubb/plugin-react-query": "3.17.0",
|
|
59
|
+
"@kubb/plugin-redoc": "3.17.0",
|
|
60
|
+
"@kubb/plugin-swr": "3.17.0",
|
|
61
|
+
"@kubb/plugin-ts": "3.17.0",
|
|
62
|
+
"@kubb/plugin-zod": "3.17.0",
|
|
63
|
+
"@kubb/react": "3.17.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^20.19.11",
|
|
67
67
|
"@types/react": "^18.3.23",
|
|
68
68
|
"tsdown": "^0.14.1",
|
|
69
69
|
"typescript": "^5.9.2",
|
|
70
|
-
"@kubb/config-ts": "3.
|
|
71
|
-
"@kubb/plugin-oas": "3.
|
|
70
|
+
"@kubb/config-ts": "3.17.0",
|
|
71
|
+
"@kubb/plugin-oas": "3.17.0"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=20"
|
package/dist/src-B3xJXrIV.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-B3xJXrIV.js","names":["definedConfig: Config","process"],"sources":["../package.json","../src/schemas/generateSchema.ts","../src/tools/generate.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@kubb/mcp\",\n \"version\": \"3.16.4\",\n \"description\": \"Generator MCP\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"MCP\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/mcp\"\n },\n \"license\": \"MIT\",\n \"author\": \"stijnvanhulle\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./server\": {\n \"import\": \"./dist/server.js\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.cts\",\n \"typesVersions\": {\n \"*\": {\n \"server\": [\n \"./dist/server.d.ts\"\n ]\n }\n },\n \"files\": [\n \"src\",\n \"dist\",\n \"!/**/**.test.**\",\n \"!/**/__tests__/**\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"start:mcp\": \"bun --watch ./src/server.ts\",\n \"debug:mcp\": \"npx -y @modelcontextprotocol/inspector node ./dist/server.js\",\n \"clean\": \"npx rimraf ./dist\",\n \"lint\": \"bun biome lint .\",\n \"lint:fix\": \"bun biome lint --fix --unsafe .\",\n \"release\": \"pnpm publish --no-git-check\",\n \"release:canary\": \"bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check\",\n \"start\": \"tsdown --watch\",\n \"test\": \"vitest --passWithNoTests\",\n \"typecheck\": \"tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false\"\n },\n \"dependencies\": {\n \"@kubb/core\": \"workspace:*\",\n \"@kubb/plugin-client\": \"workspace:*\",\n \"@kubb/plugin-cypress\": \"workspace:*\",\n \"@kubb/plugin-faker\": \"workspace:*\",\n \"@kubb/plugin-mcp\": \"workspace:*\",\n \"@kubb/plugin-msw\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@kubb/plugin-react-query\": \"workspace:*\",\n \"@kubb/plugin-redoc\": \"workspace:*\",\n \"@kubb/plugin-swr\": \"workspace:*\",\n \"@kubb/plugin-ts\": \"workspace:*\",\n \"@kubb/plugin-zod\": \"workspace:*\",\n \"@kubb/react\": \"workspace:*\",\n \"@modelcontextprotocol/sdk\": \"^1.17.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/node\": \"catalog:\",\n \"@types/react\": \"catalog:\",\n \"tsdown\": \"catalog:\",\n \"typescript\": \"catalog:\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n","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 { pluginTs } from '@kubb/plugin-ts'\nimport { type Include, pluginOas } from '@kubb/plugin-oas'\nimport { pluginReactQuery } from '@kubb/plugin-react-query'\n\nimport { type Config, safeBuild, type Plugin, getSource } from '@kubb/core'\nimport type { generateSchema } from '../schemas/generateSchema.ts'\nimport type { z } from 'zod'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.d.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 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 { files, error } = await safeBuild({\n config: definedConfig,\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 = files.map((file) => getSource(file, { extname: '.ts' }))\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 (e) {\n const error = e 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":";;;;;;;;;;cAEa;;;;ACAb,MAAa,iBAAiB,EAAE,OAAO;CACrC,SAAS,EAAE,QAAQ,CAAC,QAAQ,8CAA8C,CAAC,SAAS,uBAAuB;CAC3G,QAAQ,EAAE,KAAK,CAAC,cAAc,aAAc,EAAC,CAAC,SAAS,gBAAgB;CACvE,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,mCAAmC;AAE3F,EAAC;;;;ACEF,eAAsB,SAAS,EAAE,QAAQ,SAAS,aAA6C,EAA2B;AACxH,KAAI;EACF,MAAM,UAAU,CACd,cACI;GACE,MAAM;GACN,SAAS;EACV,IACD,MACL,EAAC,OAAO,QAAQ;EAEjB,MAAM,UAAU;GACd,UAAU;IAAE,UAAU;IAAO,YAAY,CAAE;GAAE,EAAC;GAC9C,SAAS;IACP,QAAQ,EACN,MAAM,gBACP;IACD,YAAY,WAAW,eAAe,SAAY,CAAE;IACpD;GACD,EAAC;GACF,iBAAiB;IACf,QAAQ,EACN,MAAM,iBACP;IACD,YAAY,WAAW,gBAAgB,SAAY,CAAE;IACrD;GACD,EAAC;EACH,EAAC,OAAO,QAAQ;EAEjB,MAAMA,gBAAwB;GAC5B,MAAM,QAAQ,KAAK;GACnB,OAAO,EACL,MAAM,QACP;GACD,QAAQ;IACN,MAAM;IACN,OAAO;IACP,YAAY;GACb;GACD;EACD;EAED,MAAM,EAAE,OAAO,OAAO,GAAG,MAAM,UAAU,EACvC,QAAQ,cACT,EAAC;AAEF,MAAI,MACF,QAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;GACb,CACF;GACD,SAAS;EACV;EAGH,MAAM,WAAW,MAAM,IAAI,CAAC,SAAS,UAAU,MAAM,EAAE,SAAS,MAAO,EAAC,CAAC;EAEzE,MAAM,UAAU,MAAM,QAAQ,IAAI,SAAS;AAE3C,SAAO,EACL,SAAS,CAKP;GACE,MAAM;GACN,MAAM,CAAC,QAAQ,EAAE,KAAK,UAAU,eAAe,MAAM,EAAE,EAAE;EAC1D,GACD;GACE,MAAM;GACN,MAAM,CAAC,OAAO,EAAE,KAAK,UAAU,SAAS,MAAM,EAAE,EAAE;EACnD,CACF,EACF;CACF,SAAQ,GAAG;EACV,MAAM,QAAQ;AAEd,SAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;GACb,CACF;GACD,SAAS;EACV;CACF;AACF;;;;AC7FD,eAAsB,cAAc;AAClC,KAAI;EACF,MAAM,YAAY,IAAI;EACtB,MAAM,SAAS,IAAI,UAAU;GAC3B,MAAM;GACN;EACD;EAED,OAAO,KAAK,YAAY,8CAA8C,eAAe,OAAO,SAAS;EAErG,MAAM,OAAO,QAAQ,UAAU;CAChC,SAAQ,OAAO;EACd,QAAQ,MAAM,2BAA2B,MAAM;EAC/CC,UAAQ,KAAK,EAAE;CAChB;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-CvKWfHCa.cjs","names":["z","definedConfig: Config","StdioServerTransport","McpServer","process"],"sources":["../package.json","../src/schemas/generateSchema.ts","../src/tools/generate.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"@kubb/mcp\",\n \"version\": \"3.16.4\",\n \"description\": \"Generator MCP\",\n \"keywords\": [\n \"typescript\",\n \"plugins\",\n \"kubb\",\n \"codegen\",\n \"MCP\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/kubb-labs/kubb.git\",\n \"directory\": \"packages/mcp\"\n },\n \"license\": \"MIT\",\n \"author\": \"stijnvanhulle\",\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.cjs\"\n },\n \"./server\": {\n \"import\": \"./dist/server.js\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.cts\",\n \"typesVersions\": {\n \"*\": {\n \"server\": [\n \"./dist/server.d.ts\"\n ]\n }\n },\n \"files\": [\n \"src\",\n \"dist\",\n \"!/**/**.test.**\",\n \"!/**/__tests__/**\"\n ],\n \"scripts\": {\n \"build\": \"tsdown\",\n \"start:mcp\": \"bun --watch ./src/server.ts\",\n \"debug:mcp\": \"npx -y @modelcontextprotocol/inspector node ./dist/server.js\",\n \"clean\": \"npx rimraf ./dist\",\n \"lint\": \"bun biome lint .\",\n \"lint:fix\": \"bun biome lint --fix --unsafe .\",\n \"release\": \"pnpm publish --no-git-check\",\n \"release:canary\": \"bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check\",\n \"start\": \"tsdown --watch\",\n \"test\": \"vitest --passWithNoTests\",\n \"typecheck\": \"tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false\"\n },\n \"dependencies\": {\n \"@kubb/core\": \"workspace:*\",\n \"@kubb/plugin-client\": \"workspace:*\",\n \"@kubb/plugin-cypress\": \"workspace:*\",\n \"@kubb/plugin-faker\": \"workspace:*\",\n \"@kubb/plugin-mcp\": \"workspace:*\",\n \"@kubb/plugin-msw\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@kubb/plugin-react-query\": \"workspace:*\",\n \"@kubb/plugin-redoc\": \"workspace:*\",\n \"@kubb/plugin-swr\": \"workspace:*\",\n \"@kubb/plugin-ts\": \"workspace:*\",\n \"@kubb/plugin-zod\": \"workspace:*\",\n \"@kubb/react\": \"workspace:*\",\n \"@modelcontextprotocol/sdk\": \"^1.17.3\",\n \"zod\": \"^3.25.76\"\n },\n \"devDependencies\": {\n \"@kubb/config-ts\": \"workspace:*\",\n \"@kubb/plugin-oas\": \"workspace:*\",\n \"@types/node\": \"catalog:\",\n \"@types/react\": \"catalog:\",\n \"tsdown\": \"catalog:\",\n \"typescript\": \"catalog:\"\n },\n \"engines\": {\n \"node\": \">=20\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"registry\": \"https://registry.npmjs.org/\"\n }\n}\n","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 { pluginTs } from '@kubb/plugin-ts'\nimport { type Include, pluginOas } from '@kubb/plugin-oas'\nimport { pluginReactQuery } from '@kubb/plugin-react-query'\n\nimport { type Config, safeBuild, type Plugin, getSource } from '@kubb/core'\nimport type { generateSchema } from '../schemas/generateSchema.ts'\nimport type { z } from 'zod'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.d.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 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 { files, error } = await safeBuild({\n config: definedConfig,\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 = files.map((file) => getSource(file, { extname: '.ts' }))\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 (e) {\n const error = e 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEa;;;;ACAb,MAAa,iBAAiBA,MAAE,OAAO;CACrC,SAASA,MAAE,QAAQ,CAAC,QAAQ,8CAA8C,CAAC,SAAS,uBAAuB;CAC3G,QAAQA,MAAE,KAAK,CAAC,cAAc,aAAc,EAAC,CAAC,SAAS,gBAAgB;CACvE,aAAaA,MAAE,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,mCAAmC;AAE3F,EAAC;;;;ACEF,eAAsB,SAAS,EAAE,QAAQ,SAAS,aAA6C,EAA2B;AACxH,KAAI;EACF,MAAM,UAAU,CACd,cACI;GACE,MAAM;GACN,SAAS;EACV,IACD,MACL,EAAC,OAAO,QAAQ;EAEjB,MAAM,UAAU;oCACJ;IAAE,UAAU;IAAO,YAAY,CAAE;GAAE,EAAC;kCACrC;IACP,QAAQ,EACN,MAAM,gBACP;IACD,YAAY,WAAW,eAAe,SAAY,CAAE;IACpD;GACD,EAAC;mDACe;IACf,QAAQ,EACN,MAAM,iBACP;IACD,YAAY,WAAW,gBAAgB,SAAY,CAAE;IACrD;GACD,EAAC;EACH,EAAC,OAAO,QAAQ;EAEjB,MAAMC,gBAAwB;GAC5B,MAAM,QAAQ,KAAK;GACnB,OAAO,EACL,MAAM,QACP;GACD,QAAQ;IACN,MAAM;IACN,OAAO;IACP,YAAY;GACb;GACD;EACD;EAED,MAAM,EAAE,OAAO,OAAO,GAAG,iCAAgB,EACvC,QAAQ,cACT,EAAC;AAEF,MAAI,MACF,QAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;GACb,CACF;GACD,SAAS;EACV;EAGH,MAAM,WAAW,MAAM,IAAI,CAAC,oCAAmB,MAAM,EAAE,SAAS,MAAO,EAAC,CAAC;EAEzE,MAAM,UAAU,MAAM,QAAQ,IAAI,SAAS;AAE3C,SAAO,EACL,SAAS,CAKP;GACE,MAAM;GACN,MAAM,CAAC,QAAQ,EAAE,KAAK,UAAU,eAAe,MAAM,EAAE,EAAE;EAC1D,GACD;GACE,MAAM;GACN,MAAM,CAAC,OAAO,EAAE,KAAK,UAAU,SAAS,MAAM,EAAE,EAAE;EACnD,CACF,EACF;CACF,SAAQ,GAAG;EACV,MAAM,QAAQ;AAEd,SAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,MAAM;GACb,CACF;GACD,SAAS;EACV;CACF;AACF;;;;AC7FD,eAAsB,cAAc;AAClC,KAAI;EACF,MAAM,YAAY,IAAIC;EACtB,MAAM,SAAS,IAAIC,mDAAU;GAC3B,MAAM;GACN;EACD;EAED,OAAO,KAAK,YAAY,8CAA8C,eAAe,OAAO,SAAS;EAErG,MAAM,OAAO,QAAQ,UAAU;CAChC,SAAQ,OAAO;EACd,QAAQ,MAAM,2BAA2B,MAAM;EAC/CC,qBAAQ,KAAK,EAAE;CAChB;AACF"}
|