@kubb/plugin-mcp 4.29.1 → 4.31.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.
@@ -1,6 +1,6 @@
1
- import { t as __name } from "./chunk-cy2TeOE5.cjs";
2
- import { KubbFile } from "@kubb/fabric-core/types";
1
+ import { t as __name } from "./chunk-DKWOrOAv.js";
3
2
  import { OperationSchemas } from "@kubb/plugin-oas";
3
+ import { KubbFile } from "@kubb/fabric-core/types";
4
4
  import { FabricReactNode } from "@kubb/react-fabric/types";
5
5
 
6
6
  //#region src/components/Server.d.ts
@@ -1,11 +1,11 @@
1
- import { t as __name } from "./chunk-cy2TeOE5.cjs";
2
- import { n as PluginMcp } from "./types-DigTVU-V.js";
3
- import { KubbFile } from "@kubb/fabric-core/types";
4
- import { FabricReactNode } from "@kubb/react-fabric/types";
1
+ import { t as __name } from "./chunk-DKWOrOAv.js";
2
+ import { n as PluginMcp } from "./types-BTZNpUo1.js";
5
3
  import { BaseGenerator, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
4
+ import { Fabric } from "@kubb/react-fabric";
6
5
  import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
6
+ import { KubbFile } from "@kubb/fabric-core/types";
7
+ import { FabricReactNode } from "@kubb/react-fabric/types";
7
8
  import { AsyncEventEmitter } from "@kubb/core/utils";
8
- import { Fabric } from "@kubb/react-fabric";
9
9
 
10
10
  //#region ../plugin-oas/src/types.d.ts
11
11
  type GetOasOptions = {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { t as __name } from "./chunk-cy2TeOE5.cjs";
2
- import { n as PluginMcp, t as Options } from "./types-DigTVU-V.js";
1
+ import { t as __name } from "./chunk-DKWOrOAv.js";
2
+ import { n as PluginMcp, t as Options } from "./types-BTZNpUo1.js";
3
3
  import * as _kubb_core0 from "@kubb/core";
4
4
 
5
5
  //#region src/plugin.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-mcp",
3
- "version": "4.29.1",
3
+ "version": "4.31.0",
4
4
  "description": "Model Context Protocol (MCP) plugin for Kubb, generating MCP-compatible tools and schemas from OpenAPI specifications for AI assistants.",
5
5
  "keywords": [
6
6
  "mcp",
@@ -62,7 +62,8 @@
62
62
  "src",
63
63
  "dist",
64
64
  "!/**/**.test.**",
65
- "!/**/__tests__/**"
65
+ "!/**/__tests__/**",
66
+ "!/**/__snapshots__/**"
66
67
  ],
67
68
  "size-limit": [
68
69
  {
@@ -72,13 +73,13 @@
72
73
  }
73
74
  ],
74
75
  "dependencies": {
75
- "@kubb/react-fabric": "0.13.1",
76
- "@kubb/core": "4.29.1",
77
- "@kubb/oas": "4.29.1",
78
- "@kubb/plugin-client": "4.29.1",
79
- "@kubb/plugin-oas": "4.29.1",
80
- "@kubb/plugin-ts": "4.29.1",
81
- "@kubb/plugin-zod": "4.29.1"
76
+ "@kubb/react-fabric": "0.13.2",
77
+ "@kubb/core": "4.31.0",
78
+ "@kubb/oas": "4.31.0",
79
+ "@kubb/plugin-client": "4.31.0",
80
+ "@kubb/plugin-oas": "4.31.0",
81
+ "@kubb/plugin-ts": "4.31.0",
82
+ "@kubb/plugin-zod": "4.31.0"
82
83
  },
83
84
  "devDependencies": {},
84
85
  "engines": {
@@ -1,9 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "Swagger PetStore": {
4
- "type": "stdio",
5
- "command": "npx",
6
- "args": ["tsx", "server.ts"]
7
- }
8
- }
9
- }
@@ -1,28 +0,0 @@
1
- import type { ResponseErrorConfig } from './test/.kubb/fetch'
2
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types'
3
- import { fetch } from './test/.kubb/fetch'
4
-
5
- /**
6
- * @description Creates a pet in the store.
7
- * This is an arbitrary description with lots of `strange` but likely formatting from the real world.
8
- * - We like to make lists - And we need to escape: some, type, of `things`
9
- * @summary Create a pet
10
- * {@link /pets}
11
- */
12
- export async function createPetsHandler({ data }: { data: CreatePetsMutationRequest }): Promise<Promise<CallToolResult>> {
13
- const requestData = data
14
-
15
- const res = await fetch<CreatePetsMutationResponse, ResponseErrorConfig<Error>, CreatePetsMutationRequest>({
16
- method: 'POST',
17
- url: `/pets`,
18
- data: requestData,
19
- })
20
- return {
21
- content: [
22
- {
23
- type: 'text',
24
- text: JSON.stringify(res.data),
25
- },
26
- ],
27
- }
28
- }
@@ -1,18 +0,0 @@
1
- import type { ResponseErrorConfig } from './test/.kubb/fetch'
2
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types'
3
- import { fetch } from './test/.kubb/fetch'
4
-
5
- /**
6
- * {@link /pets/:petId}
7
- */
8
- export async function deletePetsPetidHandler(): Promise<Promise<CallToolResult>> {
9
- const res = await fetch<DeletePetsPetidMutationResponse, ResponseErrorConfig<Error>, unknown>({ method: 'DELETE', url: `/pets/${petId}` })
10
- return {
11
- content: [
12
- {
13
- type: 'text',
14
- text: JSON.stringify(res.data),
15
- },
16
- ],
17
- }
18
- }
@@ -1,20 +0,0 @@
1
- import type { ResponseErrorConfig } from './test/.kubb/fetch'
2
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types'
3
- import { fetch } from './test/.kubb/fetch'
4
-
5
- /**
6
- * @description Returns all `pets` from the system \n that the user has access to
7
- * @summary List all pets
8
- * {@link /pets}
9
- */
10
- export async function listPetsHandler({ params }: { params?: ListPetsQueryParams } = {}): Promise<Promise<CallToolResult>> {
11
- const res = await fetch<ListPetsQueryResponse, ResponseErrorConfig<Error>, unknown>({ method: 'GET', url: `/pets`, params })
12
- return {
13
- content: [
14
- {
15
- type: 'text',
16
- text: JSON.stringify(res.data),
17
- },
18
- ],
19
- }
20
- }
@@ -1,12 +0,0 @@
1
- import type { ResponseErrorConfig } from './test/.kubb/fetch'
2
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types'
3
- import { fetch } from './test/.kubb/fetch'
4
-
5
- /**
6
- * @description Returns all `pets` from the system \n that the user has access to
7
- * @summary List all pets
8
- * {@link /pets}
9
- */
10
- export async function listPetsHandler({ params }: { params?: ListPetsQueryParams } = {}): Promise<Promise<CallToolResult>> {
11
- const res = await fetch<ListPetsQueryResponse, ResponseErrorConfig<Error>, unknown>({ method: 'GET', url: `/pets`, baseURL: `${123456}`, params })
12
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * Generated by Kubb (https://kubb.dev/).
3
- * Do not edit manually.
4
- */
5
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp'
6
- import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio'
7
- import { createPetsHandler, createPetsMutationRequest, listPetsHandler, listPetsQueryParams, showPetByIdHandler, showPetByIdPathParams } from './showPetById'
8
-
9
- export const server = new McpServer({
10
- name: 'Swagger PetStore',
11
- version: '3.0.0',
12
- })
13
-
14
- server.tool('listPets', 'Returns all `pets` from the system \\n that the user has access to', { params: listPetsQueryParams }, async ({ params }) => {
15
- return listPetsHandler({ params })
16
- })
17
-
18
- server.tool(
19
- 'createPets',
20
- 'Creates a pet in the store.\nThis is an arbitrary description with lots of `strange` but likely formatting from the real world.\n- We like to make lists - And we need to escape: some, type, of `things`\n',
21
- { data: createPetsMutationRequest },
22
- async ({ data }) => {
23
- return createPetsHandler({ data })
24
- },
25
- )
26
-
27
- server.tool(
28
- 'showPetById',
29
- 'Make a GET request to /pets/{petId}',
30
- { petId: showPetByIdPathParams.shape['petId'], testId: showPetByIdPathParams.shape['testId'] },
31
- async ({ petId, testId }) => {
32
- return showPetByIdHandler({ petId, testId })
33
- },
34
- )
35
-
36
- export async function startServer() {
37
- try {
38
- const transport = new StdioServerTransport()
39
- await server.connect(transport)
40
- } catch (error) {
41
- console.error('Failed to start server:', error)
42
- process.exit(1)
43
- }
44
- }
@@ -1,25 +0,0 @@
1
- import type { ResponseErrorConfig } from './test/.kubb/fetch'
2
- import type { CallToolResult } from '@modelcontextprotocol/sdk/types'
3
- import { fetch } from './test/.kubb/fetch'
4
-
5
- /**
6
- * @summary Info for a specific pet
7
- * {@link /pets/:petId}
8
- */
9
- export async function showPetByIdHandler({
10
- petId,
11
- testId,
12
- }: {
13
- petId: ShowPetByIdPathParams['petId']
14
- testId: ShowPetByIdPathParams['testId']
15
- }): Promise<Promise<CallToolResult>> {
16
- const res = await fetch<ShowPetByIdQueryResponse, ResponseErrorConfig<Error>, unknown>({ method: 'GET', url: `/pets/${petId}` })
17
- return {
18
- content: [
19
- {
20
- type: 'text',
21
- text: JSON.stringify(res.data),
22
- },
23
- ],
24
- }
25
- }