@mastra/mcp 1.18.1-alpha.2 → 2.0.0-alpha.4

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 (90) hide show
  1. package/dist/client/actions/resource.d.ts +9 -59
  2. package/dist/client/actions/resource.d.ts.map +1 -1
  3. package/dist/client/client.d.ts +71 -124
  4. package/dist/client/client.d.ts.map +1 -1
  5. package/dist/client/configuration.d.ts +30 -120
  6. package/dist/client/configuration.d.ts.map +1 -1
  7. package/dist/client/error-utils.d.ts +9 -0
  8. package/dist/client/error-utils.d.ts.map +1 -1
  9. package/dist/client/index.d.ts +2 -1
  10. package/dist/client/index.d.ts.map +1 -1
  11. package/dist/client/oauth-callback-server.d.ts +8 -4
  12. package/dist/client/oauth-callback-server.d.ts.map +1 -1
  13. package/dist/client/oauth-provider.d.ts +91 -45
  14. package/dist/client/oauth-provider.d.ts.map +1 -1
  15. package/dist/client/server-proxy.d.ts +26 -46
  16. package/dist/client/server-proxy.d.ts.map +1 -1
  17. package/dist/client/types.d.ts +106 -143
  18. package/dist/client/types.d.ts.map +1 -1
  19. package/dist/conformance/fixture.d.ts +3 -0
  20. package/dist/conformance/fixture.d.ts.map +1 -0
  21. package/dist/conformance/run.d.ts +2 -0
  22. package/dist/conformance/run.d.ts.map +1 -0
  23. package/dist/conformance/stdio-server.d.ts +2 -0
  24. package/dist/conformance/stdio-server.d.ts.map +1 -0
  25. package/dist/docs/SKILL.md +2 -1
  26. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  27. package/dist/docs/references/reference-migrations-mcp-v2.md +268 -0
  28. package/dist/docs/references/reference-tools-mcp-client.md +36 -14
  29. package/dist/docs/references/reference-tools-mcp-server.md +24 -83
  30. package/dist/index.cjs +1532 -3284
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/index.js +1535 -3288
  33. package/dist/index.js.map +1 -1
  34. package/dist/server/actions.d.ts +34 -0
  35. package/dist/server/actions.d.ts.map +1 -0
  36. package/dist/server/oauth-middleware.d.ts +1 -1
  37. package/dist/server/request.d.ts +54 -0
  38. package/dist/server/request.d.ts.map +1 -0
  39. package/dist/server/server.d.ts +112 -808
  40. package/dist/server/server.d.ts.map +1 -1
  41. package/dist/server/types.d.ts +82 -138
  42. package/dist/server/types.d.ts.map +1 -1
  43. package/dist/shared/index.d.ts +1 -0
  44. package/dist/shared/index.d.ts.map +1 -1
  45. package/dist/shared/oauth-types.d.ts +3 -3
  46. package/dist/shared/oauth-types.d.ts.map +1 -1
  47. package/dist/shared/trace-context.d.ts +20 -0
  48. package/dist/shared/trace-context.d.ts.map +1 -0
  49. package/package.json +12 -17
  50. package/dist/_types/hono/dist/types/client/client.d.ts +0 -4
  51. package/dist/_types/hono/dist/types/client/fetch-result-please.d.ts +0 -35
  52. package/dist/_types/hono/dist/types/client/index.d.ts +0 -7
  53. package/dist/_types/hono/dist/types/client/types.d.ts +0 -229
  54. package/dist/_types/hono/dist/types/client/utils.d.ts +0 -18
  55. package/dist/_types/hono/dist/types/context.d.ts +0 -455
  56. package/dist/_types/hono/dist/types/helper/streaming/index.d.ts +0 -8
  57. package/dist/_types/hono/dist/types/helper/streaming/sse.d.ts +0 -13
  58. package/dist/_types/hono/dist/types/helper/streaming/stream.d.ts +0 -3
  59. package/dist/_types/hono/dist/types/helper/streaming/text.d.ts +0 -3
  60. package/dist/_types/hono/dist/types/hono-base.d.ts +0 -220
  61. package/dist/_types/hono/dist/types/hono.d.ts +0 -19
  62. package/dist/_types/hono/dist/types/index.d.ts +0 -37
  63. package/dist/_types/hono/dist/types/request/constants.d.ts +0 -1
  64. package/dist/_types/hono/dist/types/request.d.ts +0 -324
  65. package/dist/_types/hono/dist/types/router.d.ts +0 -97
  66. package/dist/_types/hono/dist/types/types.d.ts +0 -573
  67. package/dist/_types/hono/dist/types/utils/body.d.ts +0 -79
  68. package/dist/_types/hono/dist/types/utils/headers.d.ts +0 -8
  69. package/dist/_types/hono/dist/types/utils/http-status.d.ts +0 -32
  70. package/dist/_types/hono/dist/types/utils/mime.d.ts +0 -70
  71. package/dist/_types/hono/dist/types/utils/stream.d.ts +0 -31
  72. package/dist/_types/hono/dist/types/utils/types.d.ts +0 -74
  73. package/dist/_types/hono/package.json +0 -1
  74. package/dist/_types/hono-mcp-server-sse-transport/build/index.d.ts +0 -1
  75. package/dist/_types/hono-mcp-server-sse-transport/build/sse.d.ts +0 -25
  76. package/dist/_types/hono-mcp-server-sse-transport/package.json +0 -1
  77. package/dist/client/actions/elicitation.d.ts +0 -63
  78. package/dist/client/actions/elicitation.d.ts.map +0 -1
  79. package/dist/server/__tests__/mock-extra.d.ts +0 -15
  80. package/dist/server/__tests__/mock-extra.d.ts.map +0 -1
  81. package/dist/server/mrtrElicitation.d.ts +0 -39
  82. package/dist/server/mrtrElicitation.d.ts.map +0 -1
  83. package/dist/server/notificationBroadcast.d.ts +0 -24
  84. package/dist/server/notificationBroadcast.d.ts.map +0 -1
  85. package/dist/server/promptActions.d.ts +0 -49
  86. package/dist/server/promptActions.d.ts.map +0 -1
  87. package/dist/server/resourceActions.d.ts +0 -72
  88. package/dist/server/resourceActions.d.ts.map +0 -1
  89. package/dist/server/toolActions.d.ts +0 -84
  90. package/dist/server/toolActions.d.ts.map +0 -1
@@ -1,84 +0,0 @@
1
- import type { ToolsInput } from '@mastra/core/agent';
2
- import type { IMastraLogger } from '@mastra/core/logger';
3
- import type { Server, ServerNotifier } from '@modelcontextprotocol/server';
4
- interface ServerToolActionsDependencies {
5
- getLogger: () => IMastraLogger;
6
- getSdkServers: () => Server[];
7
- addTools: (tools: ToolsInput) => void;
8
- removeTools: (toolIds: string[]) => string[];
9
- /**
10
- * Publish-side facade of the 2026-07-28 handler's subscription bus, when the
11
- * server is pinned to that revision and the handler exists. Modern clients
12
- * receive change events via `subscriptions/listen` instead of server push.
13
- */
14
- getModernEraNotifier?: () => ServerNotifier | undefined;
15
- }
16
- /**
17
- * Server-side tool actions for dynamic tool management and notifying clients
18
- * about tool list changes.
19
- *
20
- * Notifications are broadcast to every active server instance (the main
21
- * stdio/SSE instance plus each streamable HTTP session). Clients connected in
22
- * stateless/serverless mode cannot receive notifications because each request
23
- * uses a transient server instance.
24
- */
25
- export declare class ServerToolActions {
26
- private readonly getLogger;
27
- private readonly getSdkServers;
28
- private readonly addTools;
29
- private readonly removeTools;
30
- private readonly getModernEraNotifier?;
31
- /**
32
- * @internal
33
- */
34
- constructor(dependencies: ServerToolActionsDependencies);
35
- /**
36
- * Registers new tools on the running server and notifies connected clients
37
- * that the tool list has changed.
38
- *
39
- * Tools are keyed by their record key, the same as tools passed to the
40
- * `MCPServer` constructor. Adding a tool under an existing key replaces it.
41
- *
42
- * @param tools - Tools to register
43
- * @throws {MastraError} If sending the notification fails on all server instances
44
- *
45
- * @example
46
- * ```typescript
47
- * await server.toolActions.add({ myNewTool });
48
- * ```
49
- */
50
- add(tools: ToolsInput): Promise<void>;
51
- /**
52
- * Removes tools from the running server and notifies connected clients that
53
- * the tool list has changed.
54
- *
55
- * Unknown tool IDs are ignored (logged as a warning). If no tools were
56
- * actually removed, no notification is sent.
57
- *
58
- * @param toolIds - IDs of the tools to remove
59
- * @throws {MastraError} If sending the notification fails on all server instances
60
- *
61
- * @example
62
- * ```typescript
63
- * await server.toolActions.remove(['myNewTool']);
64
- * ```
65
- */
66
- remove(toolIds: string[]): Promise<void>;
67
- /**
68
- * Notifies clients that the overall list of available tools has changed.
69
- *
70
- * This sends a `notifications/tools/list_changed` message to all clients,
71
- * prompting them to re-fetch the tool list.
72
- *
73
- * @throws {MastraError} If sending the notification fails on all server instances
74
- *
75
- * @example
76
- * ```typescript
77
- * // After changing which tools are available
78
- * await server.toolActions.notifyListChanged();
79
- * ```
80
- */
81
- notifyListChanged(): Promise<void>;
82
- }
83
- export {};
84
- //# sourceMappingURL=toolActions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolActions.d.ts","sourceRoot":"","sources":["../../src/server/toolActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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