@ai-sdk/mcp 1.0.0-beta.25 → 1.0.0-beta.27
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/CHANGELOG.md +14 -0
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/mcp-stdio/index.js +3 -1
- package/dist/mcp-stdio/index.js.map +1 -1
- package/dist/mcp-stdio/index.mjs +3 -1
- package/dist/mcp-stdio/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ai-sdk/mcp
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3ed5519: chore: rename ToolCallOptions to ToolExecutionOptions
|
|
8
|
+
- Updated dependencies [3ed5519]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.0-beta.42
|
|
10
|
+
|
|
11
|
+
## 1.0.0-beta.26
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 17c04d4: feat(mcp): expose `_meta` field from MCP tool definitions
|
|
16
|
+
|
|
3
17
|
## 1.0.0-beta.25
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -242,18 +242,23 @@ type MCPTransportConfig = {
|
|
|
242
242
|
authProvider?: OAuthClientProvider;
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
+
/** MCP tool metadata - keys should follow MCP _meta key format specification */
|
|
246
|
+
declare const ToolMetaSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
247
|
+
type ToolMeta = z.infer<typeof ToolMetaSchema>;
|
|
245
248
|
type ToolSchemas = Record<string, {
|
|
246
249
|
inputSchema: FlexibleSchema<JSONObject | unknown>;
|
|
247
250
|
}> | 'automatic' | undefined;
|
|
251
|
+
/** Base MCP tool type with execute and _meta */
|
|
252
|
+
type McpToolBase<INPUT = unknown> = Tool<INPUT, CallToolResult> & Required<Pick<Tool<INPUT, CallToolResult>, 'execute'>> & {
|
|
253
|
+
_meta?: ToolMeta;
|
|
254
|
+
};
|
|
248
255
|
type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
|
|
249
256
|
inputSchema: FlexibleSchema<any>;
|
|
250
257
|
}> ? {
|
|
251
258
|
[K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
|
|
252
259
|
inputSchema: FlexibleSchema<infer INPUT>;
|
|
253
|
-
} ?
|
|
254
|
-
} :
|
|
255
|
-
inputSchema: FlexibleSchema<unknown>;
|
|
256
|
-
}>>;
|
|
260
|
+
} ? McpToolBase<INPUT> : never;
|
|
261
|
+
} : Record<string, McpToolBase<unknown>>;
|
|
257
262
|
declare const BaseParamsSchema: z.ZodObject<{
|
|
258
263
|
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
259
264
|
}, z.core.$loose>;
|
package/dist/index.d.ts
CHANGED
|
@@ -242,18 +242,23 @@ type MCPTransportConfig = {
|
|
|
242
242
|
authProvider?: OAuthClientProvider;
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
+
/** MCP tool metadata - keys should follow MCP _meta key format specification */
|
|
246
|
+
declare const ToolMetaSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
247
|
+
type ToolMeta = z.infer<typeof ToolMetaSchema>;
|
|
245
248
|
type ToolSchemas = Record<string, {
|
|
246
249
|
inputSchema: FlexibleSchema<JSONObject | unknown>;
|
|
247
250
|
}> | 'automatic' | undefined;
|
|
251
|
+
/** Base MCP tool type with execute and _meta */
|
|
252
|
+
type McpToolBase<INPUT = unknown> = Tool<INPUT, CallToolResult> & Required<Pick<Tool<INPUT, CallToolResult>, 'execute'>> & {
|
|
253
|
+
_meta?: ToolMeta;
|
|
254
|
+
};
|
|
248
255
|
type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
|
|
249
256
|
inputSchema: FlexibleSchema<any>;
|
|
250
257
|
}> ? {
|
|
251
258
|
[K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
|
|
252
259
|
inputSchema: FlexibleSchema<infer INPUT>;
|
|
253
|
-
} ?
|
|
254
|
-
} :
|
|
255
|
-
inputSchema: FlexibleSchema<unknown>;
|
|
256
|
-
}>>;
|
|
260
|
+
} ? McpToolBase<INPUT> : never;
|
|
261
|
+
} : Record<string, McpToolBase<unknown>>;
|
|
257
262
|
declare const BaseParamsSchema: z.ZodObject<{
|
|
258
263
|
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
259
264
|
}, z.core.$loose>;
|
package/dist/index.js
CHANGED
|
@@ -79,6 +79,7 @@ var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
|
79
79
|
"2025-03-26",
|
|
80
80
|
"2024-11-05"
|
|
81
81
|
];
|
|
82
|
+
var ToolMetaSchema = import_v4.z.optional(import_v4.z.record(import_v4.z.string(), import_v4.z.unknown()));
|
|
82
83
|
var ClientOrServerImplementationSchema = import_v4.z.looseObject({
|
|
83
84
|
name: import_v4.z.string(),
|
|
84
85
|
version: import_v4.z.string()
|
|
@@ -138,7 +139,8 @@ var ToolSchema = import_v4.z.object({
|
|
|
138
139
|
import_v4.z.object({
|
|
139
140
|
title: import_v4.z.optional(import_v4.z.string())
|
|
140
141
|
}).loose()
|
|
141
|
-
)
|
|
142
|
+
),
|
|
143
|
+
_meta: ToolMetaSchema
|
|
142
144
|
}).loose();
|
|
143
145
|
var ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
144
146
|
tools: import_v4.z.array(ToolSchema)
|
|
@@ -1866,7 +1868,8 @@ var DefaultMCPClient = class {
|
|
|
1866
1868
|
name: name3,
|
|
1867
1869
|
description,
|
|
1868
1870
|
inputSchema,
|
|
1869
|
-
annotations
|
|
1871
|
+
annotations,
|
|
1872
|
+
_meta
|
|
1870
1873
|
} of listToolsResult.tools) {
|
|
1871
1874
|
const title = annotations == null ? void 0 : annotations.title;
|
|
1872
1875
|
if (schemas !== "automatic" && !(name3 in schemas)) {
|
|
@@ -1893,7 +1896,7 @@ var DefaultMCPClient = class {
|
|
|
1893
1896
|
inputSchema: schemas[name3].inputSchema,
|
|
1894
1897
|
execute
|
|
1895
1898
|
});
|
|
1896
|
-
tools[name3] = toolWithExecute;
|
|
1899
|
+
tools[name3] = { ...toolWithExecute, _meta };
|
|
1897
1900
|
}
|
|
1898
1901
|
return tools;
|
|
1899
1902
|
} catch (error) {
|