@modelcontextprotocol/ext-apps 0.2.2 → 0.3.1
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/README.md +8 -4
- package/dist/src/app-bridge.d.ts +2 -2
- package/dist/src/app-bridge.js +35 -17
- package/dist/src/app-with-deps.js +61 -0
- package/dist/src/app.d.ts +6 -6
- package/dist/src/app.js +35 -17
- package/dist/src/generated/schema.d.ts +66 -26
- package/dist/src/message-transport.d.ts +2 -2
- package/dist/src/react/index.js +35 -17
- package/dist/src/react/react-with-deps.js +61 -0
- package/dist/src/server/index.d.ts +10 -6
- package/dist/src/server/index.js +32 -14
- package/dist/src/spec.types.d.ts +50 -14
- package/dist/src/types.d.ts +1 -1
- package/package.json +16 -6
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @module server-helpers
|
|
5
5
|
*/
|
|
6
6
|
import { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE, McpUiResourceMeta, McpUiToolMeta } from "../app.js";
|
|
7
|
-
import type { McpServer, ResourceMetadata, ToolCallback, ReadResourceCallback } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import type { McpServer, RegisteredTool, ResourceMetadata, ToolCallback, ReadResourceCallback } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
import type { AnySchema, ZodRawShapeCompat } from "@modelcontextprotocol/sdk/server/zod-compat.js";
|
|
8
9
|
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
9
|
-
import type { ZodRawShape } from "zod";
|
|
10
10
|
export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE };
|
|
11
11
|
export type { ResourceMetadata, ToolCallback, ReadResourceCallback };
|
|
12
12
|
/**
|
|
@@ -15,7 +15,8 @@ export type { ResourceMetadata, ToolCallback, ReadResourceCallback };
|
|
|
15
15
|
export interface ToolConfig {
|
|
16
16
|
title?: string;
|
|
17
17
|
description?: string;
|
|
18
|
-
inputSchema?:
|
|
18
|
+
inputSchema?: ZodRawShapeCompat | AnySchema;
|
|
19
|
+
outputSchema?: ZodRawShapeCompat | AnySchema;
|
|
19
20
|
annotations?: ToolAnnotations;
|
|
20
21
|
_meta?: Record<string, unknown>;
|
|
21
22
|
}
|
|
@@ -43,8 +44,8 @@ export interface McpUiAppToolConfig extends ToolConfig {
|
|
|
43
44
|
* MCP App Resource configuration for `registerAppResource`.
|
|
44
45
|
*/
|
|
45
46
|
export interface McpUiAppResourceConfig extends ResourceMetadata {
|
|
46
|
-
_meta
|
|
47
|
-
ui
|
|
47
|
+
_meta?: {
|
|
48
|
+
ui?: McpUiResourceMeta;
|
|
48
49
|
[key: string]: unknown;
|
|
49
50
|
};
|
|
50
51
|
}
|
|
@@ -76,7 +77,10 @@ export interface McpUiAppResourceConfig extends ResourceMetadata {
|
|
|
76
77
|
* });
|
|
77
78
|
* ```
|
|
78
79
|
*/
|
|
79
|
-
export declare function registerAppTool(server: Pick<McpServer, "registerTool">, name: string, config: McpUiAppToolConfig
|
|
80
|
+
export declare function registerAppTool<OutputArgs extends ZodRawShapeCompat | AnySchema, InputArgs extends undefined | ZodRawShapeCompat | AnySchema = undefined>(server: Pick<McpServer, "registerTool">, name: string, config: McpUiAppToolConfig & {
|
|
81
|
+
inputSchema?: InputArgs;
|
|
82
|
+
outputSchema?: OutputArgs;
|
|
83
|
+
}, cb: ToolCallback<InputArgs>): RegisteredTool;
|
|
80
84
|
/**
|
|
81
85
|
* Register an app resource with the MCP server.
|
|
82
86
|
*
|