@ai-sdk/mcp 1.0.38 → 1.0.40

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/index.mjs CHANGED
@@ -175,9 +175,21 @@ var EmbeddedResourceSchema = z.object({
175
175
  type: z.literal("resource"),
176
176
  resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema])
177
177
  }).loose();
178
+ var ResourceLinkContentSchema = z.object({
179
+ type: z.literal("resource_link"),
180
+ uri: z.string(),
181
+ name: z.string(),
182
+ description: z.optional(z.string()),
183
+ mimeType: z.optional(z.string())
184
+ }).loose();
178
185
  var CallToolResultSchema = ResultSchema.extend({
179
186
  content: z.array(
180
- z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])
187
+ z.union([
188
+ TextContentSchema,
189
+ ImageContentSchema,
190
+ EmbeddedResourceSchema,
191
+ ResourceLinkContentSchema
192
+ ])
181
193
  ),
182
194
  /**
183
195
  * @see https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content
@@ -223,7 +235,8 @@ var PromptMessageSchema = z.object({
223
235
  content: z.union([
224
236
  TextContentSchema,
225
237
  ImageContentSchema,
226
- EmbeddedResourceSchema
238
+ EmbeddedResourceSchema,
239
+ ResourceLinkContentSchema
227
240
  ])
228
241
  }).loose();
229
242
  var GetPromptResultSchema = ResultSchema.extend({
@@ -1639,7 +1652,8 @@ async function createMCPClient(config) {
1639
1652
  var DefaultMCPClient = class {
1640
1653
  constructor({
1641
1654
  transport: transportConfig,
1642
- name: name3 = "ai-sdk-mcp-client",
1655
+ name: name3,
1656
+ clientName = name3 != null ? name3 : "ai-sdk-mcp-client",
1643
1657
  version = CLIENT_VERSION,
1644
1658
  onUncaughtError,
1645
1659
  capabilities
@@ -1674,7 +1688,7 @@ var DefaultMCPClient = class {
1674
1688
  this.onResponse(message);
1675
1689
  };
1676
1690
  this.clientInfo = {
1677
- name: name3,
1691
+ name: clientName,
1678
1692
  version
1679
1693
  };
1680
1694
  }
@@ -1964,6 +1978,9 @@ var DefaultMCPClient = class {
1964
1978
  const toolWithExecute = schemas === "automatic" ? dynamicTool({
1965
1979
  description,
1966
1980
  title: resolvedTitle,
1981
+ providerMetadata: {
1982
+ mcp: { clientName: this.clientInfo.name }
1983
+ },
1967
1984
  inputSchema: jsonSchema({
1968
1985
  ...inputSchema,
1969
1986
  properties: (_b3 = inputSchema.properties) != null ? _b3 : {},
@@ -1974,6 +1991,9 @@ var DefaultMCPClient = class {
1974
1991
  }) : tool({
1975
1992
  description,
1976
1993
  title: resolvedTitle,
1994
+ providerMetadata: {
1995
+ mcp: { clientName: this.clientInfo.name }
1996
+ },
1977
1997
  inputSchema: schemas[name3].inputSchema,
1978
1998
  ...outputSchema != null ? { outputSchema } : {},
1979
1999
  execute,