xmcp 0.6.8 → 0.6.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.
Files changed (33) hide show
  1. package/README.md +0 -32
  2. package/dist/cli.js +27 -24
  3. package/dist/compiler/config/index.d.ts +11 -11
  4. package/dist/compiler/config/schemas/experimental/index.d.ts +4 -4
  5. package/dist/compiler/config/schemas/transport/http.d.ts +13 -13
  6. package/dist/index.js +5 -5
  7. package/dist/runtime/adapter-express.js +16 -16
  8. package/dist/runtime/adapter-fastify.js +488 -0
  9. package/dist/runtime/adapter-nestjs.js +16 -16
  10. package/dist/runtime/adapter-nextjs.js +14 -14
  11. package/dist/runtime/http.js +24 -24
  12. package/dist/runtime/stdio.js +17 -17
  13. package/dist/runtime/utils/client-info.d.ts +8 -0
  14. package/dist/types/client-info.d.ts +1 -0
  15. package/package.json +4 -2
  16. package/src/compiler/config/__tests__/config.test.ts +56 -0
  17. package/src/compiler/config/schemas/experimental/index.ts +6 -1
  18. package/src/compiler/config/schemas/transport/http.ts +5 -0
  19. package/src/compiler/get-bundler-config/get-entries.ts +3 -0
  20. package/src/compiler/get-bundler-config/get-externals.ts +10 -0
  21. package/src/compiler/get-bundler-config/plugins/index.ts +8 -3
  22. package/src/compiler/get-bundler-config/plugins/types/fastify.ts +4 -0
  23. package/src/compiler/get-bundler-config/plugins/types/index.ts +1 -0
  24. package/src/runtime/adapters/fastify/__tests__/fastify.test.ts +115 -0
  25. package/src/runtime/adapters/fastify/index.ts +78 -0
  26. package/src/runtime/transports/http/cors/index.ts +4 -2
  27. package/src/runtime/transports/http/stateless-streamable-http.ts +11 -89
  28. package/src/runtime/utils/__tests__/client-info.test.ts +47 -0
  29. package/src/runtime/utils/__tests__/tool-extra.test.ts +91 -1
  30. package/src/runtime/utils/client-info.ts +36 -0
  31. package/src/runtime/utils/transformers/tool.ts +5 -1
  32. package/src/telemetry/events/definitions.ts +2 -0
  33. package/src/types/client-info.ts +8 -0
@@ -63,10 +63,10 @@ export declare const configSchema: z.ZodObject<{
63
63
  maxAge?: number | undefined;
64
64
  }>>;
65
65
  }, "strip", z.ZodTypeAny, {
66
- debug?: boolean | undefined;
67
66
  port?: number | undefined;
68
67
  host?: string | undefined;
69
68
  bodySizeLimit?: number | undefined;
69
+ debug?: boolean | undefined;
70
70
  endpoint?: string | undefined;
71
71
  cors?: {
72
72
  origin: string | boolean | string[];
@@ -77,10 +77,10 @@ export declare const configSchema: z.ZodObject<{
77
77
  maxAge: number;
78
78
  } | undefined;
79
79
  }, {
80
- debug?: boolean | undefined;
81
80
  port?: number | undefined;
82
81
  host?: string | undefined;
83
82
  bodySizeLimit?: number | undefined;
83
+ debug?: boolean | undefined;
84
84
  endpoint?: string | undefined;
85
85
  cors?: {
86
86
  origin?: string | boolean | string[] | undefined;
@@ -91,10 +91,10 @@ export declare const configSchema: z.ZodObject<{
91
91
  maxAge?: number | undefined;
92
92
  } | undefined;
93
93
  }>, {
94
- debug: boolean;
95
94
  port: number;
96
95
  host: string;
97
96
  bodySizeLimit: number;
97
+ debug: boolean;
98
98
  endpoint: string;
99
99
  cors: {
100
100
  origin: string | boolean | string[];
@@ -105,10 +105,10 @@ export declare const configSchema: z.ZodObject<{
105
105
  maxAge: number;
106
106
  };
107
107
  }, {
108
- debug?: boolean | undefined;
109
108
  port?: number | undefined;
110
109
  host?: string | undefined;
111
110
  bodySizeLimit?: number | undefined;
111
+ debug?: boolean | undefined;
112
112
  endpoint?: string | undefined;
113
113
  cors?: {
114
114
  origin?: string | boolean | string[] | undefined;
@@ -120,11 +120,11 @@ export declare const configSchema: z.ZodObject<{
120
120
  } | undefined;
121
121
  }>]>>;
122
122
  experimental: z.ZodOptional<z.ZodObject<{
123
- adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs", "nestjs"]>>;
123
+ adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs", "nestjs", "fastify"]>>;
124
124
  }, "strip", z.ZodTypeAny, {
125
- adapter?: "express" | "nextjs" | "nestjs" | undefined;
125
+ adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
126
126
  }, {
127
- adapter?: "express" | "nextjs" | "nestjs" | undefined;
127
+ adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
128
128
  }>>;
129
129
  paths: z.ZodOptional<z.ZodEffects<z.ZodObject<{
130
130
  tools: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>>;
@@ -243,10 +243,10 @@ export declare const configSchema: z.ZodObject<{
243
243
  silent: boolean;
244
244
  } | undefined;
245
245
  http?: boolean | {
246
- debug: boolean;
247
246
  port: number;
248
247
  host: string;
249
248
  bodySizeLimit: number;
249
+ debug: boolean;
250
250
  endpoint: string;
251
251
  cors: {
252
252
  origin: string | boolean | string[];
@@ -258,7 +258,7 @@ export declare const configSchema: z.ZodObject<{
258
258
  };
259
259
  } | undefined;
260
260
  experimental?: {
261
- adapter?: "express" | "nextjs" | "nestjs" | undefined;
261
+ adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
262
262
  } | undefined;
263
263
  paths?: {
264
264
  tools: string | boolean;
@@ -287,10 +287,10 @@ export declare const configSchema: z.ZodObject<{
287
287
  silent?: boolean | undefined;
288
288
  } | undefined;
289
289
  http?: boolean | {
290
- debug?: boolean | undefined;
291
290
  port?: number | undefined;
292
291
  host?: string | undefined;
293
292
  bodySizeLimit?: number | undefined;
293
+ debug?: boolean | undefined;
294
294
  endpoint?: string | undefined;
295
295
  cors?: {
296
296
  origin?: string | boolean | string[] | undefined;
@@ -302,7 +302,7 @@ export declare const configSchema: z.ZodObject<{
302
302
  } | undefined;
303
303
  } | undefined;
304
304
  experimental?: {
305
- adapter?: "express" | "nextjs" | "nestjs" | undefined;
305
+ adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
306
306
  } | undefined;
307
307
  paths?: {
308
308
  tools?: string | boolean | undefined;
@@ -1,11 +1,11 @@
1
1
  import { z } from "zod/v3";
2
- export declare const adapterConfigSchema: z.ZodEnum<["express", "nextjs", "nestjs"]>;
2
+ export declare const adapterConfigSchema: z.ZodEnum<["express", "nextjs", "nestjs", "fastify"]>;
3
3
  export type AdapterConfig = z.infer<typeof adapterConfigSchema>;
4
4
  export declare const experimentalConfigSchema: z.ZodObject<{
5
- adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs", "nestjs"]>>;
5
+ adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs", "nestjs", "fastify"]>>;
6
6
  }, "strip", z.ZodTypeAny, {
7
- adapter?: "express" | "nextjs" | "nestjs" | undefined;
7
+ adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
8
8
  }, {
9
- adapter?: "express" | "nextjs" | "nestjs" | undefined;
9
+ adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
10
10
  }>;
11
11
  export type ExperimentalConfig = z.infer<typeof experimentalConfigSchema>;
@@ -79,10 +79,10 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
79
79
  maxAge?: number | undefined;
80
80
  }>>;
81
81
  }, "strip", z.ZodTypeAny, {
82
- debug?: boolean | undefined;
83
82
  port?: number | undefined;
84
83
  host?: string | undefined;
85
84
  bodySizeLimit?: number | undefined;
85
+ debug?: boolean | undefined;
86
86
  endpoint?: string | undefined;
87
87
  cors?: {
88
88
  origin: string | boolean | string[];
@@ -93,10 +93,10 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
93
93
  maxAge: number;
94
94
  } | undefined;
95
95
  }, {
96
- debug?: boolean | undefined;
97
96
  port?: number | undefined;
98
97
  host?: string | undefined;
99
98
  bodySizeLimit?: number | undefined;
99
+ debug?: boolean | undefined;
100
100
  endpoint?: string | undefined;
101
101
  cors?: {
102
102
  origin?: string | boolean | string[] | undefined;
@@ -107,10 +107,10 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
107
107
  maxAge?: number | undefined;
108
108
  } | undefined;
109
109
  }>, {
110
- debug: boolean;
111
110
  port: number;
112
111
  host: string;
113
112
  bodySizeLimit: number;
113
+ debug: boolean;
114
114
  endpoint: string;
115
115
  cors: {
116
116
  origin: string | boolean | string[];
@@ -121,10 +121,10 @@ export declare const httpTransportConfigSchema: z.ZodUnion<[z.ZodBoolean, z.ZodE
121
121
  maxAge: number;
122
122
  };
123
123
  }, {
124
- debug?: boolean | undefined;
125
124
  port?: number | undefined;
126
125
  host?: string | undefined;
127
126
  bodySizeLimit?: number | undefined;
127
+ debug?: boolean | undefined;
128
128
  endpoint?: string | undefined;
129
129
  cors?: {
130
130
  origin?: string | boolean | string[] | undefined;
@@ -178,10 +178,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
178
178
  maxAge?: number | undefined;
179
179
  }>>;
180
180
  }, "strip", z.ZodTypeAny, {
181
- debug?: boolean | undefined;
182
181
  port?: number | undefined;
183
182
  host?: string | undefined;
184
183
  bodySizeLimit?: number | undefined;
184
+ debug?: boolean | undefined;
185
185
  endpoint?: string | undefined;
186
186
  cors?: {
187
187
  origin: string | boolean | string[];
@@ -192,10 +192,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
192
192
  maxAge: number;
193
193
  } | undefined;
194
194
  }, {
195
- debug?: boolean | undefined;
196
195
  port?: number | undefined;
197
196
  host?: string | undefined;
198
197
  bodySizeLimit?: number | undefined;
198
+ debug?: boolean | undefined;
199
199
  endpoint?: string | undefined;
200
200
  cors?: {
201
201
  origin?: string | boolean | string[] | undefined;
@@ -206,10 +206,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
206
206
  maxAge?: number | undefined;
207
207
  } | undefined;
208
208
  }>, {
209
- debug: boolean;
210
209
  port: number;
211
210
  host: string;
212
211
  bodySizeLimit: number;
212
+ debug: boolean;
213
213
  endpoint: string;
214
214
  cors: {
215
215
  origin: string | boolean | string[];
@@ -220,10 +220,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
220
220
  maxAge: number;
221
221
  };
222
222
  }, {
223
- debug?: boolean | undefined;
224
223
  port?: number | undefined;
225
224
  host?: string | undefined;
226
225
  bodySizeLimit?: number | undefined;
226
+ debug?: boolean | undefined;
227
227
  endpoint?: string | undefined;
228
228
  cors?: {
229
229
  origin?: string | boolean | string[] | undefined;
@@ -234,10 +234,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
234
234
  maxAge?: number | undefined;
235
235
  } | undefined;
236
236
  }>]>, {} | null, boolean | {
237
- debug?: boolean | undefined;
238
237
  port?: number | undefined;
239
238
  host?: string | undefined;
240
239
  bodySizeLimit?: number | undefined;
240
+ debug?: boolean | undefined;
241
241
  endpoint?: string | undefined;
242
242
  cors?: {
243
243
  origin?: string | boolean | string[] | undefined;
@@ -290,10 +290,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
290
290
  maxAge?: number | undefined;
291
291
  }>>;
292
292
  }, "strip", z.ZodTypeAny, {
293
- debug?: boolean | undefined;
294
293
  port?: number | undefined;
295
294
  host?: string | undefined;
296
295
  bodySizeLimit?: number | undefined;
296
+ debug?: boolean | undefined;
297
297
  endpoint?: string | undefined;
298
298
  cors?: {
299
299
  origin: string | boolean | string[];
@@ -304,10 +304,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
304
304
  maxAge: number;
305
305
  } | undefined;
306
306
  }, {
307
- debug?: boolean | undefined;
308
307
  port?: number | undefined;
309
308
  host?: string | undefined;
310
309
  bodySizeLimit?: number | undefined;
310
+ debug?: boolean | undefined;
311
311
  endpoint?: string | undefined;
312
312
  cors?: {
313
313
  origin?: string | boolean | string[] | undefined;
@@ -318,10 +318,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
318
318
  maxAge?: number | undefined;
319
319
  } | undefined;
320
320
  }>, {
321
- debug: boolean;
322
321
  port: number;
323
322
  host: string;
324
323
  bodySizeLimit: number;
324
+ debug: boolean;
325
325
  endpoint: string;
326
326
  cors: {
327
327
  origin: string | boolean | string[];
@@ -332,10 +332,10 @@ export declare const resolvedHttpTransportConfigSchema: z.ZodPipeline<z.ZodEffec
332
332
  maxAge: number;
333
333
  };
334
334
  }, {
335
- debug?: boolean | undefined;
336
335
  port?: number | undefined;
337
336
  host?: string | undefined;
338
337
  bodySizeLimit?: number | undefined;
338
+ debug?: boolean | undefined;
339
339
  endpoint?: string | undefined;
340
340
  cors?: {
341
341
  origin?: string | boolean | string[] | undefined;