@mastra/mcp 0.10.8-alpha.0 → 0.10.9-alpha.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.
Files changed (47) hide show
  1. package/.turbo/turbo-build.log +2 -21
  2. package/CHANGELOG.md +42 -0
  3. package/dist/__fixtures__/fire-crawl-complex-schema.d.ts +5 -0
  4. package/dist/__fixtures__/fire-crawl-complex-schema.d.ts.map +1 -0
  5. package/dist/__fixtures__/server-weather.d.ts +2 -0
  6. package/dist/__fixtures__/server-weather.d.ts.map +1 -0
  7. package/dist/__fixtures__/stock-price.d.ts +26 -0
  8. package/dist/__fixtures__/stock-price.d.ts.map +1 -0
  9. package/dist/__fixtures__/tools.d.ts +15 -0
  10. package/dist/__fixtures__/tools.d.ts.map +1 -0
  11. package/dist/__fixtures__/weather.d.ts +4 -0
  12. package/dist/__fixtures__/weather.d.ts.map +1 -0
  13. package/dist/client/client.d.ts +225 -0
  14. package/dist/client/client.d.ts.map +1 -0
  15. package/dist/client/configuration.d.ts +190 -0
  16. package/dist/client/configuration.d.ts.map +1 -0
  17. package/dist/client/elicitationActions.d.ts +19 -0
  18. package/dist/client/elicitationActions.d.ts.map +1 -0
  19. package/dist/client/index.d.ts +4 -0
  20. package/dist/client/index.d.ts.map +1 -0
  21. package/dist/client/promptActions.d.ts +39 -0
  22. package/dist/client/promptActions.d.ts.map +1 -0
  23. package/dist/client/resourceActions.d.ts +92 -0
  24. package/dist/client/resourceActions.d.ts.map +1 -0
  25. package/dist/index.cjs +2 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.ts +3 -21
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/server/index.d.ts +3 -0
  32. package/dist/server/index.d.ts.map +1 -0
  33. package/dist/server/promptActions.d.ts +20 -0
  34. package/dist/server/promptActions.d.ts.map +1 -0
  35. package/dist/server/resourceActions.d.ts +31 -0
  36. package/dist/server/resourceActions.d.ts.map +1 -0
  37. package/dist/server/server.d.ts +196 -0
  38. package/dist/server/server.d.ts.map +1 -0
  39. package/dist/server/types.d.ts +41 -0
  40. package/dist/server/types.d.ts.map +1 -0
  41. package/package.json +5 -5
  42. package/tsconfig.build.json +9 -0
  43. package/tsconfig.json +1 -1
  44. package/tsup.config.ts +22 -0
  45. package/dist/_tsup-dts-rollup.d.cts +0 -987
  46. package/dist/_tsup-dts-rollup.d.ts +0 -987
  47. package/dist/index.d.cts +0 -21
@@ -0,0 +1,39 @@
1
+ import type { IMastraLogger } from "@mastra/core/logger";
2
+ import type { GetPromptResult, Prompt } from "@modelcontextprotocol/sdk/types.js";
3
+ import type { InternalMastraMCPClient } from "./client";
4
+ interface PromptClientActionsConfig {
5
+ client: InternalMastraMCPClient;
6
+ logger: IMastraLogger;
7
+ }
8
+ /**
9
+ * Client-side prompt actions for listing, getting, and subscribing to prompt changes.
10
+ */
11
+ export declare class PromptClientActions {
12
+ private readonly client;
13
+ private readonly logger;
14
+ constructor({ client, logger }: PromptClientActionsConfig);
15
+ /**
16
+ * Get all prompts from the connected MCP server.
17
+ * @returns A list of prompts with their versions.
18
+ */
19
+ list(): Promise<Prompt[]>;
20
+ /**
21
+ * Get a specific prompt.
22
+ * @param name The name of the prompt to get.
23
+ * @param args Optional arguments for the prompt.
24
+ * @param version Optional version of the prompt to get.
25
+ * @returns The prompt content.
26
+ */
27
+ get({ name, args, version }: {
28
+ name: string;
29
+ args?: Record<string, any>;
30
+ version?: string;
31
+ }): Promise<GetPromptResult>;
32
+ /**
33
+ * Set a notification handler for when the list of available prompts changes.
34
+ * @param handler The callback function to handle the notification.
35
+ */
36
+ onListChanged(handler: () => void): Promise<void>;
37
+ }
38
+ export {};
39
+ //# sourceMappingURL=promptActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptActions.d.ts","sourceRoot":"","sources":["../../src/client/promptActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,UAAU,yBAAyB;IACjC,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAE3B,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,yBAAyB;IAKzD;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAyBtC;;;;;;OAMG;IACU,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAC,EAAE;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAI/H;;;OAGG;IACU,aAAa,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D"}
@@ -0,0 +1,92 @@
1
+ import type { IMastraLogger } from "@mastra/core/logger";
2
+ import type { Resource, ResourceTemplate } from "@modelcontextprotocol/sdk/types.js";
3
+ import type { InternalMastraMCPClient } from "./client";
4
+ interface ResourceClientActionsConfig {
5
+ client: InternalMastraMCPClient;
6
+ logger: IMastraLogger;
7
+ }
8
+ export declare class ResourceClientActions {
9
+ private readonly client;
10
+ private readonly logger;
11
+ constructor({ client, logger }: ResourceClientActionsConfig);
12
+ /**
13
+ * Get all resources from the connected MCP server.
14
+ * @returns A list of resources.
15
+ */
16
+ list(): Promise<Resource[]>;
17
+ /**
18
+ * Get all resource templates from the connected MCP server.
19
+ * @returns A list of resource templates.
20
+ */
21
+ templates(): Promise<ResourceTemplate[]>;
22
+ /**
23
+ * Read a specific resource.
24
+ * @param uri The URI of the resource to read.
25
+ * @returns The resource content.
26
+ */
27
+ read(uri: string): Promise<import("zod").objectOutputType<{
28
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
29
+ } & {
30
+ contents: import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodObject<import("zod").objectUtil.extendShape<{
31
+ uri: import("zod").ZodString;
32
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
33
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
34
+ }, {
35
+ text: import("zod").ZodString;
36
+ }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<import("zod").objectUtil.extendShape<{
37
+ uri: import("zod").ZodString;
38
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
39
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
40
+ }, {
41
+ text: import("zod").ZodString;
42
+ }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<import("zod").objectUtil.extendShape<{
43
+ uri: import("zod").ZodString;
44
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
45
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
46
+ }, {
47
+ text: import("zod").ZodString;
48
+ }>, import("zod").ZodTypeAny, "passthrough">>, import("zod").ZodObject<import("zod").objectUtil.extendShape<{
49
+ uri: import("zod").ZodString;
50
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
51
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
52
+ }, {
53
+ blob: import("zod").ZodString;
54
+ }>, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<import("zod").objectUtil.extendShape<{
55
+ uri: import("zod").ZodString;
56
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
57
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
58
+ }, {
59
+ blob: import("zod").ZodString;
60
+ }>, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<import("zod").objectUtil.extendShape<{
61
+ uri: import("zod").ZodString;
62
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
63
+ _meta: import("zod").ZodOptional<import("zod").ZodObject<{}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{}, import("zod").ZodTypeAny, "passthrough">>>;
64
+ }, {
65
+ blob: import("zod").ZodString;
66
+ }>, import("zod").ZodTypeAny, "passthrough">>]>, "many">;
67
+ }, import("zod").ZodTypeAny, "passthrough">>;
68
+ /**
69
+ * Subscribe to a specific resource.
70
+ * @param uri The URI of the resource to subscribe to.
71
+ */
72
+ subscribe(uri: string): Promise<{}>;
73
+ /**
74
+ * Unsubscribe from a specific resource.
75
+ * @param uri The URI of the resource to unsubscribe from.
76
+ */
77
+ unsubscribe(uri: string): Promise<{}>;
78
+ /**
79
+ * Set a notification handler for when a specific resource is updated.
80
+ * @param handler The callback function to handle the notification.
81
+ */
82
+ onUpdated(handler: (params: {
83
+ uri: string;
84
+ }) => void): Promise<void>;
85
+ /**
86
+ * Set a notification handler for when the list of available resources changes.
87
+ * @param handler The callback function to handle the notification.
88
+ */
89
+ onListChanged(handler: () => void): Promise<void>;
90
+ }
91
+ export {};
92
+ //# sourceMappingURL=resourceActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceActions.d.ts","sourceRoot":"","sources":["../../src/client/resourceActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,UAAU,2BAA2B;IACnC,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAE3B,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,2BAA2B;IAK3D;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAyBxC;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA0BrD;;;;OAIG;IACU,IAAI,CAAC,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAI7B;;;OAGG;IACU,SAAS,CAAC,GAAG,EAAE,MAAM;IAIlC;;;OAGG;IACU,WAAW,CAAC,GAAG,EAAE,MAAM;IAIpC;;;OAGG;IACU,SAAS,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjF;;;OAGG;IACU,aAAa,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D"}
package/dist/index.cjs CHANGED
@@ -2562,3 +2562,5 @@ exports.MCPClient = MCPClient;
2562
2562
  exports.MCPConfiguration = MCPConfiguration;
2563
2563
  exports.MCPServer = MCPServer;
2564
2564
  exports.MastraMCPClient = MastraMCPClient;
2565
+ //# sourceMappingURL=index.cjs.map
2566
+ //# sourceMappingURL=index.cjs.map