modality-mcp-kit 0.3.0 → 0.5.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.
@@ -201,13 +201,11 @@ function createJsonRpcManager(middleware) {
201
201
  const prompts = mcpPrompts.map((prompt) => ({
202
202
  name: prompt.name,
203
203
  ...(prompt.description && { description: prompt.description }),
204
- ...(prompt.title && { title: prompt.title }),
205
204
  ...(prompt.arguments && {
206
205
  arguments: prompt.arguments.map((arg) => ({
207
206
  name: arg.name,
208
207
  ...(arg.description && { description: arg.description }),
209
208
  ...(arg.required !== undefined && { required: arg.required }),
210
- ...(arg.title && { title: arg.title }),
211
209
  ...(arg.enum && { enum: Array.from(arg.enum) }),
212
210
  })),
213
211
  }),
@@ -1,5 +1,5 @@
1
1
  export { toJsonSchema } from "xsschema";
2
2
  export { setupAITools, ModalityFastMCP } from "./util_mcp_tools_converter";
3
3
  export type { AITools, AITool, FastMCPTool, } from "./schemas/schemas_tool_config";
4
- export type { FastMCPCompatible, Prompt } from "./util_mcp_tools_converter";
4
+ export type { FastMCPCompatible, BasePrompt, } from "./util_mcp_tools_converter";
5
5
  export { FastHonoMcp } from "./FastHonoMcp";
@@ -32,7 +32,9 @@ export declare namespace ToolParameters {
32
32
  readonly output: Output;
33
33
  }
34
34
  type InferInput<Schema extends ToolParameters> = NonNullable<Schema["~standard"]["types"]>["input"];
35
- type InferOutput<Schema extends ToolParameters> = NonNullable<Schema["~standard"]["types"]>["output"];
35
+ type InferOutput<Schema extends ToolParameters> = Schema["~standard"]["types"] extends {
36
+ output: infer O;
37
+ } ? O : any;
36
38
  }
37
39
  /**
38
40
  * Tool interface for AI SDK compatibility
@@ -1,17 +1,21 @@
1
1
  import type { AITools, FastMCPTool, ToolParameters } from "./schemas/schemas_tool_config";
2
- export interface Prompt {
2
+ /**
3
+ * Minimal prompt interface for cross-library compatibility
4
+ * Compatible with both FastMCP's InputPrompt and modality's InputPrompt
5
+ */
6
+ export interface BasePrompt {
3
7
  name: string;
4
8
  description?: string;
5
- title?: string;
6
- completionLimit?: number;
7
9
  arguments?: Array<{
8
10
  name: string;
9
11
  description?: string;
10
12
  required?: boolean;
11
- title?: string;
12
- enum?: readonly string[];
13
+ enum?: string[];
14
+ complete?: (...args: any[]) => Promise<any>;
13
15
  }>;
14
- load: (params: Record<string, string>) => Promise<string>;
16
+ complete?: (...args: any[]) => Promise<any>;
17
+ load: (...args: any[]) => Promise<any>;
18
+ completionLimit?: number;
15
19
  }
16
20
  /**
17
21
  * FastMCP-compatible interface for MCP server functionality
@@ -20,8 +24,8 @@ export interface Prompt {
20
24
  export interface FastMCPCompatible {
21
25
  addTool<Params extends ToolParameters>(tool: FastMCPTool<any, Params>): void;
22
26
  getTools?(): FastMCPTool<any, any>[];
23
- addPrompt(prompt: Prompt): void;
24
- getPrompts(): Prompt[];
27
+ addPrompt?(prompt: BasePrompt): void;
28
+ getPrompts?(): BasePrompt[];
25
29
  }
26
30
  /**
27
31
  * ModalityFastMCP - A FastMCP-compatible implementation
@@ -38,8 +42,8 @@ export declare class ModalityFastMCP implements FastMCPCompatible {
38
42
  * Get all registered tools
39
43
  */
40
44
  getTools(): FastMCPTool<any, any>[];
41
- addPrompt(prompt: Prompt): void;
42
- getPrompts(): Prompt[];
45
+ addPrompt(prompt: BasePrompt): void;
46
+ getPrompts(): BasePrompt[];
43
47
  }
44
48
  /**
45
49
  * Setup function that optionally registers AITools with MCP server
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0",
2
+ "version": "0.5.0",
3
3
  "name": "modality-mcp-kit",
4
4
  "repository": {
5
5
  "type": "git",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "modality-kit": "^0.14.17",
26
26
  "xsschema": "0.3.5",
27
- "zod": "^3.25.76",
28
- "zod-to-json-schema": "^3.25.0"
27
+ "zod": "^4.3.4",
28
+ "zod-to-json-schema": "^3.25.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/bun": "^1.3.5",