xmcp 1.1.3 → 1.2.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/config/index.d.ts +30 -30
- package/dist/index.d.ts +4 -1
- package/dist/index.js +13 -13
- package/dist/runtime/adapter-express.js +24 -22
- package/dist/runtime/adapter-fastify.js +24 -22
- package/dist/runtime/adapter-nestjs.js +24 -22
- package/dist/runtime/adapter-nextjs.js +24 -22
- package/dist/runtime/cloudflare-worker.js +32 -30
- package/dist/runtime/contexts/request-context.d.ts +24 -0
- package/dist/runtime/headers.js +1 -1
- package/dist/runtime/http.js +46 -44
- package/dist/runtime/stdio.js +19 -17
- package/dist/runtime/utils/mcp-middleware.d.ts +14 -0
- package/dist/runtime/utils/tools.d.ts +2 -1
- package/dist/runtime/utils/transformers/prompt.d.ts +7 -5
- package/dist/runtime/utils/transformers/tool.d.ts +1 -0
- package/dist/runtime/vercel.js +46 -44
- package/dist/types/mcp-middleware.d.ts +17 -0
- package/dist/types/prompt.d.ts +1 -0
- package/dist/utils/context.d.ts +3 -1
- package/package.json +1 -1
package/dist/config/index.d.ts
CHANGED
|
@@ -226,6 +226,21 @@ export declare const configSchema: z.ZodObject<{
|
|
|
226
226
|
skipTypeCheck?: boolean | undefined;
|
|
227
227
|
}>>;
|
|
228
228
|
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
http?: boolean | {
|
|
230
|
+
port: number;
|
|
231
|
+
host: string;
|
|
232
|
+
bodySizeLimit: number;
|
|
233
|
+
debug: boolean;
|
|
234
|
+
endpoint: string;
|
|
235
|
+
cors: {
|
|
236
|
+
origin: string | boolean | string[];
|
|
237
|
+
methods: string | string[];
|
|
238
|
+
allowedHeaders: string | string[];
|
|
239
|
+
exposedHeaders: string | string[];
|
|
240
|
+
credentials: boolean;
|
|
241
|
+
maxAge: number;
|
|
242
|
+
};
|
|
243
|
+
} | undefined;
|
|
229
244
|
template?: {
|
|
230
245
|
name: string;
|
|
231
246
|
description: string;
|
|
@@ -242,21 +257,6 @@ export declare const configSchema: z.ZodObject<{
|
|
|
242
257
|
debug: boolean;
|
|
243
258
|
silent: boolean;
|
|
244
259
|
} | undefined;
|
|
245
|
-
http?: boolean | {
|
|
246
|
-
port: number;
|
|
247
|
-
host: string;
|
|
248
|
-
bodySizeLimit: number;
|
|
249
|
-
debug: boolean;
|
|
250
|
-
endpoint: string;
|
|
251
|
-
cors: {
|
|
252
|
-
origin: string | boolean | string[];
|
|
253
|
-
methods: string | string[];
|
|
254
|
-
allowedHeaders: string | string[];
|
|
255
|
-
exposedHeaders: string | string[];
|
|
256
|
-
credentials: boolean;
|
|
257
|
-
maxAge: number;
|
|
258
|
-
};
|
|
259
|
-
} | undefined;
|
|
260
260
|
experimental?: {
|
|
261
261
|
adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
|
|
262
262
|
} | undefined;
|
|
@@ -270,6 +270,21 @@ export declare const configSchema: z.ZodObject<{
|
|
|
270
270
|
skipTypeCheck: boolean;
|
|
271
271
|
} | undefined;
|
|
272
272
|
}, {
|
|
273
|
+
http?: boolean | {
|
|
274
|
+
port?: number | undefined;
|
|
275
|
+
host?: string | undefined;
|
|
276
|
+
bodySizeLimit?: number | undefined;
|
|
277
|
+
debug?: boolean | undefined;
|
|
278
|
+
endpoint?: string | undefined;
|
|
279
|
+
cors?: {
|
|
280
|
+
origin?: string | boolean | string[] | undefined;
|
|
281
|
+
methods?: string | string[] | undefined;
|
|
282
|
+
allowedHeaders?: string | string[] | undefined;
|
|
283
|
+
exposedHeaders?: string | string[] | undefined;
|
|
284
|
+
credentials?: boolean | undefined;
|
|
285
|
+
maxAge?: number | undefined;
|
|
286
|
+
} | undefined;
|
|
287
|
+
} | undefined;
|
|
273
288
|
template?: {
|
|
274
289
|
name?: string | undefined;
|
|
275
290
|
description?: string | undefined;
|
|
@@ -286,21 +301,6 @@ export declare const configSchema: z.ZodObject<{
|
|
|
286
301
|
debug?: boolean | undefined;
|
|
287
302
|
silent?: boolean | undefined;
|
|
288
303
|
} | undefined;
|
|
289
|
-
http?: boolean | {
|
|
290
|
-
port?: number | undefined;
|
|
291
|
-
host?: string | undefined;
|
|
292
|
-
bodySizeLimit?: number | undefined;
|
|
293
|
-
debug?: boolean | undefined;
|
|
294
|
-
endpoint?: string | undefined;
|
|
295
|
-
cors?: {
|
|
296
|
-
origin?: string | boolean | string[] | undefined;
|
|
297
|
-
methods?: string | string[] | undefined;
|
|
298
|
-
allowedHeaders?: string | string[] | undefined;
|
|
299
|
-
exposedHeaders?: string | string[] | undefined;
|
|
300
|
-
credentials?: boolean | undefined;
|
|
301
|
-
maxAge?: number | undefined;
|
|
302
|
-
} | undefined;
|
|
303
|
-
} | undefined;
|
|
304
304
|
experimental?: {
|
|
305
305
|
adapter?: "express" | "nextjs" | "nestjs" | "fastify" | undefined;
|
|
306
306
|
} | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type { Middleware, WebMiddleware, WebMiddlewareContext, } from "./types/middleware";
|
|
2
|
+
export type { McpMiddleware, McpMiddlewareContext, McpMiddlewareMethod, McpMiddlewareNext, McpMiddlewareResult, } from "./types/mcp-middleware";
|
|
2
3
|
export type { ToolMetadata, ToolSchema, ToolOutputSchema, ToolExtraArguments, InferSchema, ElicitResult, SampleRequest, SampleResult, } from "./types/tool";
|
|
3
4
|
export type { McpClientInfo } from "./types/client-info";
|
|
4
|
-
export type { PromptMetadata } from "./types/prompt";
|
|
5
|
+
export type { PromptMetadata, PromptMessage, GetPromptResult, } from "./types/prompt";
|
|
5
6
|
export type { ResourceMetadata } from "./types/resource";
|
|
6
7
|
export type { UIMetadata } from "./types/ui-meta";
|
|
7
8
|
export type { XmcpConfigInputSchema as XmcpConfig } from "./config";
|
|
@@ -9,6 +10,8 @@ import "./types/declarations";
|
|
|
9
10
|
export { apiKeyAuthMiddleware } from "./auth/api-key";
|
|
10
11
|
export { jwtAuthMiddleware } from "./auth/jwt";
|
|
11
12
|
export { createContext } from "./utils/context";
|
|
13
|
+
export { getRequestContext } from "./runtime/contexts/request-context";
|
|
14
|
+
export type { RequestContext } from "./runtime/contexts/request-context";
|
|
12
15
|
export { completable, UrlElicitationRequiredError, inputRequired, inputResponse, acceptedContent, isInputRequiredResult, createRequestStateCodec, } from "@modelcontextprotocol/server";
|
|
13
16
|
export type { InputRequiredResult, InputRequests, InputResponses, RequestStateCodec, } from "@modelcontextprotocol/server";
|
|
14
17
|
export { createHTTPClient, createSTDIOClient, listSTDIOClientTools, callSTDIOClientTool, disconnectSTDIOClient, } from "./client";
|