@mastra/mcp-docs-server 1.0.0-beta.0 → 1.0.0-beta.2

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 (133) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +10 -10
  2. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +17 -17
  3. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +8 -0
  4. package/.docs/organized/changelogs/%40mastra%2Fcore.md +18 -18
  5. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +19 -19
  6. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +19 -19
  7. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +18 -18
  8. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +12 -12
  9. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +16 -16
  10. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +32 -32
  11. package/.docs/organized/changelogs/%40mastra%2Freact.md +15 -15
  12. package/.docs/organized/changelogs/%40mastra%2Fserver.md +15 -15
  13. package/.docs/organized/changelogs/create-mastra.md +7 -7
  14. package/.docs/organized/changelogs/mastra.md +13 -13
  15. package/.docs/raw/agents/agent-memory.mdx +1 -1
  16. package/.docs/raw/agents/overview.mdx +2 -2
  17. package/.docs/raw/auth/auth0.mdx +1 -1
  18. package/.docs/raw/auth/clerk.mdx +1 -1
  19. package/.docs/raw/auth/firebase.mdx +1 -1
  20. package/.docs/raw/auth/jwt.mdx +1 -1
  21. package/.docs/raw/auth/supabase.mdx +1 -1
  22. package/.docs/raw/auth/workos.mdx +1 -1
  23. package/.docs/raw/course/01-first-agent/03-verifying-installation.md +1 -1
  24. package/.docs/raw/course/02-agent-tools-mcp/02-installing-mcp.md +1 -1
  25. package/.docs/raw/course/03-agent-memory/03-installing-memory.md +1 -1
  26. package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +1 -1
  27. package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +1 -1
  28. package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +2 -2
  29. package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +1 -1
  30. package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +1 -1
  31. package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +1 -1
  32. package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +1 -1
  33. package/.docs/raw/evals/overview.mdx +1 -1
  34. package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +8 -4
  35. package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +1 -1
  36. package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +9 -9
  37. package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +1 -1
  38. package/.docs/raw/frameworks/servers/express.mdx +1 -1
  39. package/.docs/raw/frameworks/web-frameworks/astro.mdx +12 -12
  40. package/.docs/raw/frameworks/web-frameworks/next-js.mdx +4 -4
  41. package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +12 -12
  42. package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +5 -5
  43. package/.docs/raw/getting-started/installation.mdx +13 -13
  44. package/.docs/raw/getting-started/templates.mdx +5 -5
  45. package/.docs/raw/guides/guide/notes-mcp-server.mdx +1 -1
  46. package/.docs/raw/guides/guide/research-assistant.mdx +1 -10
  47. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +16 -6
  48. package/.docs/raw/guides/migrations/upgrade-to-v1/client.mdx +42 -2
  49. package/.docs/raw/guides/migrations/upgrade-to-v1/evals.mdx +31 -1
  50. package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +28 -4
  51. package/.docs/raw/guides/migrations/upgrade-to-v1/mcp.mdx +3 -3
  52. package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +28 -0
  53. package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +50 -36
  54. package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +80 -0
  55. package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +2 -2
  56. package/.docs/raw/guides/migrations/upgrade-to-v1/tracing.mdx +13 -13
  57. package/.docs/raw/guides/migrations/upgrade-to-v1/vectors.mdx +25 -1
  58. package/.docs/raw/guides/migrations/upgrade-to-v1/voice.mdx +1 -1
  59. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +32 -2
  60. package/.docs/raw/guides/quickstarts/nextjs.mdx +275 -0
  61. package/.docs/raw/index.mdx +1 -1
  62. package/.docs/raw/logging.mdx +3 -3
  63. package/.docs/raw/mastra-cloud/observability.mdx +6 -6
  64. package/.docs/raw/memory/overview.mdx +2 -2
  65. package/.docs/raw/memory/semantic-recall.mdx +2 -2
  66. package/.docs/raw/memory/storage/memory-with-libsql.mdx +2 -2
  67. package/.docs/raw/memory/storage/memory-with-mongodb.mdx +152 -0
  68. package/.docs/raw/memory/storage/memory-with-pg.mdx +2 -2
  69. package/.docs/raw/memory/storage/memory-with-upstash.mdx +2 -2
  70. package/.docs/raw/observability/overview.mdx +5 -5
  71. package/.docs/raw/observability/tracing/exporters/arize.mdx +2 -2
  72. package/.docs/raw/observability/tracing/exporters/braintrust.mdx +2 -2
  73. package/.docs/raw/observability/tracing/exporters/cloud.mdx +2 -2
  74. package/.docs/raw/observability/tracing/exporters/default.mdx +5 -5
  75. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +2 -2
  76. package/.docs/raw/observability/tracing/exporters/langsmith.mdx +2 -2
  77. package/.docs/raw/observability/tracing/exporters/otel.mdx +5 -5
  78. package/.docs/raw/observability/tracing/overview.mdx +21 -21
  79. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +2 -2
  80. package/.docs/raw/rag/overview.mdx +1 -1
  81. package/.docs/raw/reference/agents/agent.mdx +2 -2
  82. package/.docs/raw/reference/cli/create-mastra.mdx +10 -10
  83. package/.docs/raw/reference/cli/mastra.mdx +7 -7
  84. package/.docs/raw/reference/core/getLogger.mdx +2 -2
  85. package/.docs/raw/reference/core/getMCPServer.mdx +2 -2
  86. package/.docs/raw/reference/core/getMCPServerById.mdx +4 -4
  87. package/.docs/raw/reference/core/getTelemetry.mdx +2 -2
  88. package/.docs/raw/reference/core/listLogs.mdx +2 -2
  89. package/.docs/raw/reference/core/listLogsByRunId.mdx +2 -2
  90. package/.docs/raw/reference/core/listMCPServers.mdx +4 -4
  91. package/.docs/raw/reference/core/setLogger.mdx +2 -2
  92. package/.docs/raw/reference/core/setTelemetry.mdx +2 -2
  93. package/.docs/raw/reference/evals/create-scorer.mdx +58 -49
  94. package/.docs/raw/reference/evals/mastra-scorer.mdx +2 -0
  95. package/.docs/raw/reference/observability/tracing/configuration.mdx +12 -12
  96. package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +1 -1
  97. package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +8 -8
  98. package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +8 -8
  99. package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +8 -8
  100. package/.docs/raw/reference/observability/tracing/instances.mdx +8 -8
  101. package/.docs/raw/reference/observability/tracing/interfaces.mdx +7 -7
  102. package/.docs/raw/reference/observability/tracing/spans.mdx +7 -7
  103. package/.docs/raw/reference/processors/batch-parts-processor.mdx +8 -2
  104. package/.docs/raw/reference/processors/language-detector.mdx +8 -2
  105. package/.docs/raw/reference/processors/moderation-processor.mdx +8 -2
  106. package/.docs/raw/reference/processors/pii-detector.mdx +8 -2
  107. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +8 -2
  108. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +8 -2
  109. package/.docs/raw/reference/processors/token-limiter-processor.mdx +8 -2
  110. package/.docs/raw/reference/processors/unicode-normalizer.mdx +8 -2
  111. package/.docs/raw/reference/storage/cloudflare-d1.mdx +1 -1
  112. package/.docs/raw/reference/storage/cloudflare.mdx +1 -1
  113. package/.docs/raw/reference/storage/dynamodb.mdx +3 -3
  114. package/.docs/raw/reference/storage/lance.mdx +1 -1
  115. package/.docs/raw/reference/storage/libsql.mdx +1 -1
  116. package/.docs/raw/reference/storage/mongodb.mdx +1 -1
  117. package/.docs/raw/reference/storage/mssql.mdx +1 -1
  118. package/.docs/raw/reference/storage/postgresql.mdx +1 -1
  119. package/.docs/raw/reference/storage/upstash.mdx +1 -1
  120. package/.docs/raw/reference/templates/overview.mdx +1 -1
  121. package/.docs/raw/reference/tools/mcp-server.mdx +49 -0
  122. package/.docs/raw/reference/vectors/couchbase.mdx +8 -2
  123. package/.docs/raw/reference/vectors/libsql.mdx +1 -1
  124. package/.docs/raw/reference/vectors/mongodb.mdx +7 -1
  125. package/.docs/raw/reference/vectors/s3vectors.mdx +1 -1
  126. package/.docs/raw/server-db/mastra-client.mdx +4 -4
  127. package/.docs/raw/tools-mcp/mcp-overview.mdx +1 -1
  128. package/.docs/raw/voice/speech-to-text.mdx +1 -1
  129. package/.docs/raw/voice/text-to-speech.mdx +1 -1
  130. package/.docs/raw/workflows/inngest-workflow.mdx +1 -1
  131. package/CHANGELOG.md +17 -0
  132. package/dist/stdio.js +11 -15
  133. package/package.json +4 -4
@@ -17,22 +17,22 @@ Install a template using the `create-mastra` command:
17
17
  <Tabs>
18
18
  <TabItem value="npm" label="npm">
19
19
  ```bash copy
20
- npx create-mastra@latest --template template-name
20
+ npx create-mastra@beta --template template-name
21
21
  ```
22
22
  </TabItem>
23
23
  <TabItem value="yarn" label="yarn">
24
24
  ```bash copy
25
- yarn dlx create-mastra@latest --template template-name
25
+ yarn dlx create-mastra@beta --template template-name
26
26
  ```
27
27
  </TabItem>
28
28
  <TabItem value="pnpm" label="pnpm">
29
29
  ```bash copy
30
- pnpm create mastra@latest --template template-name
30
+ pnpm create mastra@beta --template template-name
31
31
  ```
32
32
  </TabItem>
33
33
  <TabItem value="bun" label="bun">
34
34
  ```bash copy
35
- bun create mastra@latest --template template-name
35
+ bun create mastra@beta --template template-name
36
36
  ```
37
37
  </TabItem>
38
38
  </Tabs>
@@ -40,7 +40,7 @@ Install a template using the `create-mastra` command:
40
40
  For example, to create a text-to-SQL application:
41
41
 
42
42
  ```bash copy
43
- npx create-mastra@latest --template text-to-sql
43
+ npx create-mastra@beta --template text-to-sql
44
44
  ```
45
45
 
46
46
  ## Setting Up a Template
@@ -31,7 +31,7 @@ Before you can create an MCP server you first need to install additional depende
31
31
  Add `@mastra/mcp` to your project:
32
32
 
33
33
  ```bash copy
34
- npm install @mastra/mcp
34
+ npm install @mastra/mcp@beta
35
35
  ```
36
36
 
37
37
  </StepItem>
@@ -60,17 +60,8 @@ Install additional dependencies
60
60
  After running the [installation guide](/docs/v1/getting-started/installation) you'll need to install additional dependencies:
61
61
 
62
62
  ```bash copy
63
- npm install @mastra/rag@latest ai@^4.0.0
63
+ npm install @mastra/rag@beta ai@^4.0.0
64
64
  ```
65
-
66
- :::info
67
-
68
- Mastra currently does not support v5 of the AI SDK (see [support
69
- thread](https://github.com/mastra-ai/mastra/issues/5470)). For this guide
70
- you'll need to use v4.
71
-
72
- :::
73
-
74
65
  </StepItem>
75
66
 
76
67
  <StepItem title="Define the Agent">
@@ -25,7 +25,7 @@ To migrate, replace all calls to `mastra.getAgents()` with `mastra.listAgents()`
25
25
  You can use Mastra's codemod CLI to update your code automatically:
26
26
 
27
27
  ```shell
28
- npx @mastra/codemod v1/agent-get-agents .
28
+ npx @mastra/codemod@beta v1/mastra-plural-apis .
29
29
  ```
30
30
 
31
31
  :::
@@ -54,7 +54,7 @@ To migrate, update all imports and parameter names from `RuntimeContext`/`runtim
54
54
  You can use Mastra's codemod CLI to update your code automatically:
55
55
 
56
56
  ```shell
57
- npx @mastra/codemod v1/runtime-context .
57
+ npx @mastra/codemod@beta v1/runtime-context .
58
58
  ```
59
59
 
60
60
  :::
@@ -79,7 +79,7 @@ To migrate, replace property access with the corresponding getter methods.
79
79
  You can use Mastra's codemod CLI to update your code automatically:
80
80
 
81
81
  ```shell
82
- npx @mastra/codemod v1/agent-property-access .
82
+ npx @mastra/codemod@beta v1/agent-property-access .
83
83
  ```
84
84
 
85
85
  :::
@@ -104,7 +104,7 @@ To migrate, update voice method calls to use the `agent.voice` namespace.
104
104
  You can use Mastra's codemod CLI to update your code automatically:
105
105
 
106
106
  ```shell
107
- npx @mastra/codemod v1/agent-voice .
107
+ npx @mastra/codemod@beta v1/agent-voice .
108
108
  ```
109
109
 
110
110
  :::
@@ -140,7 +140,7 @@ To migrate, update processor method names.
140
140
  You can use Mastra's codemod CLI to update your code automatically:
141
141
 
142
142
  ```shell
143
- npx @mastra/codemod v1/agent-processor-methods .
143
+ npx @mastra/codemod@beta v1/agent-processor-methods .
144
144
  ```
145
145
 
146
146
  :::
@@ -177,6 +177,16 @@ To migrate, move `abortSignal` from `modelSettings` to the top level.
177
177
  });
178
178
  ```
179
179
 
180
+ :::tip[Codemod]
181
+
182
+ You can use Mastra's codemod CLI to update your code automatically:
183
+
184
+ ```shell
185
+ npx @mastra/codemod@beta v1/agent-abort-signal .
186
+ ```
187
+
188
+ :::
189
+
180
190
  ### `output` to `structuredOutput.schema`
181
191
 
182
192
  The deprecated `output` and `experimental_output` options have been removed. This change consolidates on a single, stable API for structured output.
@@ -212,7 +222,7 @@ To migrate, use the standard `generate()` and `stream()` methods.
212
222
  You can use Mastra's codemod CLI to update your code automatically:
213
223
 
214
224
  ```shell
215
- npx @mastra/codemod v1/agent-generate-stream-v-next .
225
+ npx @mastra/codemod@beta v1/agent-generate-stream-v-next .
216
226
  ```
217
227
 
218
228
  :::
@@ -28,6 +28,16 @@ To migrate, update type imports to use the new naming pattern.
28
28
  + } from '@mastra/client-js';
29
29
  ```
30
30
 
31
+ :::tip[Codemod]
32
+
33
+ You can use Mastra's codemod CLI to update your code automatically:
34
+
35
+ ```shell
36
+ npx @mastra/codemod@beta v1/client-sdk-types .
37
+ ```
38
+
39
+ :::
40
+
31
41
  ### Pagination parameters from `offset/limit` to `page/perPage`
32
42
 
33
43
  All client SDK methods that used `offset/limit` now use `page/perPage`. This change provides a more intuitive pagination model aligned with web pagination patterns.
@@ -44,6 +54,16 @@ To migrate, update pagination parameters in all client SDK method calls. Example
44
54
  });
45
55
  ```
46
56
 
57
+ :::tip[Codemod]
58
+
59
+ You can use Mastra's codemod CLI to update your code automatically:
60
+
61
+ ```shell
62
+ npx @mastra/codemod@beta v1/client-offset-limit .
63
+ ```
64
+
65
+ :::
66
+
47
67
  ### `getMemoryThread` parameter structure
48
68
 
49
69
  The `getMemoryThread` method parameter structure has been updated. This change provides a more consistent API across memory methods.
@@ -51,10 +71,20 @@ The `getMemoryThread` method parameter structure has been updated. This change p
51
71
  To migrate, update the method call with the new parameter structure. Check the updated API documentation for the specific changes.
52
72
 
53
73
  ```diff
54
- - const thread = await client.memory.getMemoryThread(threadId, agentId);
55
- + const thread = await client.memory.getMemoryThread({ threadId, agentId });
74
+ - const thread = await client.getMemoryThread(threadId, agentId);
75
+ + const thread = await client.getMemoryThread({ threadId, agentId });
56
76
  ```
57
77
 
78
+ :::tip[Codemod]
79
+
80
+ You can use Mastra's codemod CLI to update your code automatically:
81
+
82
+ ```shell
83
+ npx @mastra/codemod@beta v1/client-get-memory-thread .
84
+ ```
85
+
86
+ :::
87
+
58
88
  ## Removed
59
89
 
60
90
  ### `toAISdkFormat` function
@@ -70,6 +100,16 @@ To migrate, use `toAISdkStream()` instead.
70
100
  + const stream = toAISdkStream(agentStream, { from: 'agent' });
71
101
  ```
72
102
 
103
+ :::tip[Codemod]
104
+
105
+ You can use Mastra's codemod CLI to update your code automatically:
106
+
107
+ ```shell
108
+ npx @mastra/codemod@beta v1/client-to-ai-sdk-format .
109
+ ```
110
+
111
+ :::
112
+
73
113
  ### Network memory methods
74
114
 
75
115
  Network memory methods have been removed from `@mastra/client-js`. The `NetworkMemoryThread` class and all network memory-related methods are no longer available. This change simplifies the memory API by removing specialized network memory functionality.
@@ -25,7 +25,7 @@ To migrate, replace all calls to `getScorers()` with `listScorers()`.
25
25
  You can use Mastra's codemod CLI to update your code automatically:
26
26
 
27
27
  ```shell
28
- npx @mastra/codemod v1/evals-get-scorers .
28
+ npx @mastra/codemod@beta v1/mastra-plural-apis .
29
29
  ```
30
30
 
31
31
  :::
@@ -50,6 +50,16 @@ To migrate, update function calls from `runExperiment` to `runEvals`.
50
50
  + const result = await runEvals({ target: myAgent, scorers: [scorer], data: inputs });
51
51
  ```
52
52
 
53
+ :::tip[Codemod]
54
+
55
+ You can use Mastra's codemod CLI to update your code automatically:
56
+
57
+ ```shell
58
+ npx @mastra/codemod@beta v1/evals-run-experiment .
59
+ ```
60
+
61
+ :::
62
+
53
63
  ### `getScorerByName` to `getScorerById`
54
64
 
55
65
  The `getScorerByName()` method has been renamed to `getScorerById()`. Scorers now require an `id` field instead of `name`. This change aligns with the broader API pattern of using `id` for entity identification.
@@ -67,6 +77,16 @@ To migrate, update method calls and scorer configuration to use `id` instead of
67
77
  + const scorer = mastra.getScorerById('helpfulness-scorer');
68
78
  ```
69
79
 
80
+ :::tip[Codemod]
81
+
82
+ You can use Mastra's codemod CLI to update your code automatically:
83
+
84
+ ```shell
85
+ npx @mastra/codemod@beta v1/evals-scorer-by-name .
86
+ ```
87
+
88
+ :::
89
+
70
90
  ### Scorer configuration from `name` to `id`
71
91
 
72
92
  Scorers now require an `id` field instead of `name`. The `name` field is now optional. This change provides consistency with other Mastra entities.
@@ -120,6 +140,16 @@ To migrate, update import statements to use the new `scorers/prebuilt` path.
120
140
  + import { createCompletenessScorer } from '@mastra/evals/scorers/prebuilt';
121
141
  ```
122
142
 
143
+ :::tip[Codemod]
144
+
145
+ You can use Mastra's codemod CLI to update your code automatically:
146
+
147
+ ```shell
148
+ npx @mastra/codemod@beta v1/evals-prebuilt-imports .
149
+ ```
150
+
151
+ :::
152
+
123
153
  ### Scorer message types from `UIMessage` to `MastraDBMessage`
124
154
 
125
155
  Scorer input and output types now use `MastraDBMessage[]` instead of `UIMessage`. This change aligns scorers with the database-persisted message format for consistency across the framework.
@@ -28,7 +28,7 @@ To migrate, update all imports from `@mastra/core` to use the appropriate subpat
28
28
  You can use Mastra's codemod CLI to update your code automatically:
29
29
 
30
30
  ```shell
31
- npx @mastra/codemod v1/mastra-core-imports .
31
+ npx @mastra/codemod@beta v1/mastra-core-imports .
32
32
  ```
33
33
 
34
34
  :::
@@ -53,16 +53,16 @@ To migrate, rename the `experimental_auth` key to `auth` in your Mastra configur
53
53
  You can use Mastra's codemod CLI to update your code automatically:
54
54
 
55
55
  ```shell
56
- npx @mastra/codemod v1/experimental-auth .
56
+ npx @mastra/codemod@beta v1/experimental-auth .
57
57
  ```
58
58
 
59
59
  :::
60
60
 
61
61
  ### Required `id` parameter for all mastra primitives
62
62
 
63
- All storage, vector stores, agents, workflows, mcpServers, processors, scorers, tools now require an `id` parameter during initialization. This enables the standardized Mastra API and prevents ID conflicts.
63
+ All storages, vector stores, agents, workflows, mcpServers, processors, scorers, and tools now require an `id` parameter during initialization. This enables the standardized Mastra API and prevents ID conflicts.
64
64
 
65
- All these primitives also now have a `get`, `list`, and `add` functions.
65
+ All these primitives also now have `get`, `list`, and `add` functions.
66
66
 
67
67
  To migrate, add an `id` parameter to all storage and vector store instantiations. When using the same storage/vector class multiple times, ensure each instance has a unique ID.
68
68
 
@@ -105,11 +105,35 @@ When using separate instances for different purposes, use descriptive unique IDs
105
105
 
106
106
  ### Primitive plural APIs changes from `get<primitives>` to `list<primitive>`
107
107
 
108
+ `get*` functions that returned all instances of a primitive have been renamed to `list*` to better reflect their purpose.
109
+
108
110
  ```diff
111
+ - const agents = mastra.getAgents();
112
+ + const agents = mastra.listAgents();
113
+ - const vectors = mastra.getVectors();
114
+ + const vectors = mastra.listVectors();
115
+ - const workflows = mastra.getWorkflows();
116
+ + const workflows = mastra.listWorkflows();
117
+ - const scorers = mastra.getScorers();
118
+ + const scorers = mastra.listScorers();
109
119
  - const mcpServers = mastra.getMCPServers();
110
120
  + const mcpServers = mastra.listMCPServers();
121
+ - const logsByRunId = await mastra.getLogsByRunId({ runId: 'id', transportId: 'id' });
122
+ + const logsByRunId = await mastra.listLogsByRunId({ runId: 'id', transportId: 'id' });
123
+ - const logs = await mastra.getLogs('transportId');
124
+ + const logs = await mastra.listLogs('transportId');
125
+ ```
126
+
127
+ :::tip[Codemod]
128
+
129
+ You can use Mastra's codemod CLI to update your code automatically:
130
+
131
+ ```shell
132
+ npx @mastra/codemod@beta v1/mastra-plural-apis .
111
133
  ```
112
134
 
135
+ :::
136
+
113
137
  ### Each primtive has a `getById` and a `get` function
114
138
 
115
139
  ```typescript
@@ -25,7 +25,7 @@ To migrate, replace all calls to `mastra.getMCPServers()` with `mastra.listMCPSe
25
25
  You can use Mastra's codemod CLI to update your code automatically:
26
26
 
27
27
  ```shell
28
- npx @mastra/codemod v1/mcp-get-mcp-servers .
28
+ npx @mastra/codemod@beta v1/mastra-plural-apis .
29
29
  ```
30
30
 
31
31
  :::
@@ -46,7 +46,7 @@ To migrate, replace all calls to `mcp.getTools()` with `mcp.listTools()`.
46
46
  You can use Mastra's codemod CLI to update your code automatically:
47
47
 
48
48
  ```shell
49
- npx @mastra/codemod v1/mcp-get-tools .
49
+ npx @mastra/codemod@beta v1/mcp-get-tools .
50
50
  ```
51
51
 
52
52
  :::
@@ -67,7 +67,7 @@ To migrate, replace all calls to `mcp.getToolsets()` with `mcp.listToolsets()`.
67
67
  You can use Mastra's codemod CLI to update your code automatically:
68
68
 
69
69
  ```shell
70
- npx @mastra/codemod v1/mcp-get-toolsets .
70
+ npx @mastra/codemod@beta v1/mcp-get-toolsets .
71
71
  ```
72
72
 
73
73
  :::
@@ -111,6 +111,16 @@ To migrate, rename `query()` to `recall()` and update code that expects the old
111
111
  + const messages = result.messages;
112
112
  ```
113
113
 
114
+ :::tip[Codemod]
115
+
116
+ You can use Mastra's codemod CLI to update your code automatically:
117
+
118
+ ```shell
119
+ npx @mastra/codemod@beta v1/memory-query-to-recall .
120
+ ```
121
+
122
+ :::
123
+
114
124
  ### `Memory.recall()` parameter changes
115
125
 
116
126
  The `Memory.recall()` method now uses `StorageListMessagesInput` format with pagination, and the `vectorMessageSearch` parameter has been renamed to `vectorSearchString`. These changes align the memory API with the storage pagination API and provide more consistent naming.
@@ -132,6 +142,16 @@ To migrate, update method name, query parameters, and the vector search paramete
132
142
  });
133
143
  ```
134
144
 
145
+ :::tip[Codemod]
146
+
147
+ You can use Mastra's codemod CLI to update your code automatically:
148
+
149
+ ```shell
150
+ npx @mastra/codemod@beta v1/memory-vector-search-param .
151
+ ```
152
+
153
+ :::
154
+
135
155
  ### `MastraMessageV2` type renamed to `MastraDBMessage`
136
156
 
137
157
  The `MastraMessageV2` type has been renamed to `MastraDBMessage` for clarity. This change better describes the purpose of this type as the database message format.
@@ -145,7 +165,15 @@ To migrate, replace all instances of `MastraMessageV2` with `MastraDBMessage`.
145
165
  + function yourCustomFunction(input: MastraDBMessage) {}
146
166
  ```
147
167
 
168
+ :::tip[Codemod]
169
+
170
+ You can use Mastra's codemod CLI to update your code automatically:
171
+
172
+ ```shell
173
+ npx @mastra/codemod@beta v1/memory-message-v2-type .
174
+ ```
148
175
 
176
+ :::
149
177
 
150
178
  ## Removed
151
179
 
@@ -19,65 +19,79 @@ Use your package manager to update your project's versions. Be sure to update **
19
19
 
20
20
  ### Update Node.js version
21
21
 
22
- Mastra v1 requires Node.js 22.13.0 or higher. Update your development and production environments accordingly.
22
+ Mastra v1 requires Node.js **22.13.0** or higher. Update your development and production environments accordingly.
23
+
24
+ ### Go through migration checklist
25
+
26
+ Work through the [migration checklist](#migration-checklist) below to update your codebase. Each item links to a detailed guide for that specific change.
27
+
28
+ :::info[Codemods]
29
+
30
+ We prepared automated [codemods](https://github.com/mastra-ai/mastra/tree/main/packages/codemod) for you. If you want, you can run all v1 codemods at once:
31
+
32
+ ```sh
33
+ npx @mastra/codemod@beta v1
34
+ ```
35
+
36
+ :::
23
37
 
24
38
  ## Breaking Changes by Area
25
39
 
26
- - **[Mastra Class]/guides/v1/migrations/upgrade-to-v1/mastra)** - Import restructuring and property access changes.
27
- - **[Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)** - Voice methods moved to namespace and streaming API updates.
28
- - **[Tools]/guides/v1/migrations/upgrade-to-v1/tools)** - CreateTool execute signature changed to separate input and context.
29
- - **[Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)** - Function name changes and legacy features removed.
30
- - **[Memory]/guides/v1/migrations/upgrade-to-v1/memory)** - Configuration now requires explicit parameters and defaults changed.
31
- - **[Storage]/guides/v1/migrations/upgrade-to-v1/storage)** - Pagination standardized and methods renamed to list pattern.
32
- - **[Vectors]/guides/v1/migrations/upgrade-to-v1/vectors)** - Vector store methods renamed to list pattern.
33
- - **[MCP]/guides/v1/migrations/upgrade-to-v1/mcp)** - Tool context reorganized and deprecated client classes removed.
34
- - **[Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)** - OTEL telemetry replaced with dedicated observability package and exporters.
35
- - **[Evals & Scorers]/guides/v1/migrations/upgrade-to-v1/evals)** - Scorers API consolidated with new naming conventions.
36
- - **[CLI]/guides/v1/migrations/upgrade-to-v1/cli)** - Commands and flags removed for simpler interface.
37
- - **[Client SDKs]/guides/v1/migrations/upgrade-to-v1/client)** - Types and utilities renamed for consistency.
38
- - **[Voice Packages]/guides/v1/migrations/upgrade-to-v1/voice)** - Packages renamed from speech to voice.
40
+ - **[Mastra Class](/guides/v1/migrations/upgrade-to-v1/mastra)** - Import restructuring and property access changes.
41
+ - **[Agent Class](/guides/v1/migrations/upgrade-to-v1/agent)** - Voice methods moved to namespace and streaming API updates.
42
+ - **[Tools](/guides/v1/migrations/upgrade-to-v1/tools)** - CreateTool execute signature changed to separate input and context.
43
+ - **[Workflows](/guides/v1/migrations/upgrade-to-v1/workflows)** - Function name changes and legacy features removed.
44
+ - **[Memory](/guides/v1/migrations/upgrade-to-v1/memory)** - Configuration now requires explicit parameters and defaults changed.
45
+ - **[Storage](/guides/v1/migrations/upgrade-to-v1/storage)** - Pagination standardized and methods renamed to list pattern.
46
+ - **[Vectors](/guides/v1/migrations/upgrade-to-v1/vectors)** - Vector store methods renamed to list pattern.
47
+ - **[MCP](/guides/v1/migrations/upgrade-to-v1/mcp)** - Tool context reorganized and deprecated client classes removed.
48
+ - **[Tracing](/guides/v1/migrations/upgrade-to-v1/tracing)** - OTEL telemetry replaced with dedicated observability package and exporters.
49
+ - **[Evals & Scorers](/guides/v1/migrations/upgrade-to-v1/evals)** - Scorers API consolidated with new naming conventions.
50
+ - **[CLI](/guides/v1/migrations/upgrade-to-v1/cli)** - Commands and flags removed for simpler interface.
51
+ - **[Client SDKs](/guides/v1/migrations/upgrade-to-v1/client)** - Types and utilities renamed for consistency.
52
+ - **[Voice Packages](/guides/v1/migrations/upgrade-to-v1/voice)** - Packages renamed from speech to voice.
39
53
 
40
54
  ## Migration Checklist
41
55
 
42
56
  Work through this checklist in order, starting with high-impact changes that affect most applications.
43
57
 
44
- :::info[Codemod]
58
+ :::info[Codemods]
45
59
 
46
60
  We prepared automated [codemods](https://github.com/mastra-ai/mastra/tree/main/packages/codemod) for you. Throughout the migration guide you'll find instructions on how to use them for specific changes.
47
61
 
48
62
  If you want, you can run all v1 codemods at once:
49
63
 
50
64
  ```sh
51
- npx @mastra/codemod v1
65
+ npx @mastra/codemod@beta v1
52
66
  ```
53
67
 
54
68
  :::
55
69
 
56
70
  ### High Impact Changes
57
71
 
58
- - Update `createTool` tool signatures to `(inputData, context)` format - [Tools]/guides/v1/migrations/upgrade-to-v1/tools)
59
- - Restructure `@mastra/core` imports to use subpath imports - [Mastra Class]/guides/v1/migrations/upgrade-to-v1/mastra)
60
- - Update pagination from `offset/limit` to `page/perPage` - [Storage]/guides/v1/migrations/upgrade-to-v1/storage)
61
- - Install `@mastra/observability` and wrap configuration with `new Observability()` - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
62
- - Migrate from `telemetry:` to `observability:` configuration (if upgrading from 0.x OTEL) - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
72
+ - Update `createTool` tool signatures to `(inputData, context)` format - [Tools](/guides/v1/migrations/upgrade-to-v1/tools)
73
+ - Restructure `@mastra/core` imports to use subpath imports - [Mastra Class](/guides/v1/migrations/upgrade-to-v1/mastra)
74
+ - Update pagination from `offset/limit` to `page/perPage` - [Storage](/guides/v1/migrations/upgrade-to-v1/storage)
75
+ - Install `@mastra/observability` and wrap configuration with `new Observability()` - [Tracing](/guides/v1/migrations/upgrade-to-v1/tracing)
76
+ - Migrate from `telemetry:` to `observability:` configuration (if upgrading from 0.x OTEL) - [Tracing](/guides/v1/migrations/upgrade-to-v1/tracing)
63
77
 
64
78
  ### Medium Impact Changes
65
79
 
66
- - Rename `RuntimeContext` to `RequestContext` throughout codebase - [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent), [Tools]/guides/v1/migrations/upgrade-to-v1/tools), [Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)
67
- - Update storage methods from `get*` to `list*` pattern - [Storage]/guides/v1/migrations/upgrade-to-v1/storage)
68
- - Replace direct property access with getter methods - [Mastra Class]/guides/v1/migrations/upgrade-to-v1/mastra), [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)
69
- - Update memory scope if relying on default `thread` scope - [Memory]/guides/v1/migrations/upgrade-to-v1/memory)
70
- - Update vector store calls to use named arguments - [Storage]/guides/v1/migrations/upgrade-to-v1/storage)
71
- - Remove `format` parameter from agent methods - [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)
72
- - Update voice methods to use `agent.voice` namespace - [Agent Class]/guides/v1/migrations/upgrade-to-v1/agent)
73
- - Rename configuration property `processors` to `spanOutputProcessors` (if using custom processors) - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
80
+ - Rename `RuntimeContext` to `RequestContext` throughout codebase - [Agent Class](/guides/v1/migrations/upgrade-to-v1/agent), [Tools](/guides/v1/migrations/upgrade-to-v1/tools), [Workflows](/guides/v1/migrations/upgrade-to-v1/workflows)
81
+ - Update storage methods from `get*` to `list*` pattern - [Storage](/guides/v1/migrations/upgrade-to-v1/storage)
82
+ - Replace direct property access with getter methods - [Mastra Class](/guides/v1/migrations/upgrade-to-v1/mastra), [Agent Class](/guides/v1/migrations/upgrade-to-v1/agent)
83
+ - Update memory scope if relying on default `thread` scope - [Memory](/guides/v1/migrations/upgrade-to-v1/memory)
84
+ - Update vector store calls to use named arguments - [Storage](/guides/v1/migrations/upgrade-to-v1/storage)
85
+ - Remove `format` parameter from agent methods - [Agent Class](/guides/v1/migrations/upgrade-to-v1/agent)
86
+ - Update voice methods to use `agent.voice` namespace - [Agent Class](/guides/v1/migrations/upgrade-to-v1/agent)
87
+ - Rename configuration property `processors` to `spanOutputProcessors` (if using custom processors) - [Tracing](/guides/v1/migrations/upgrade-to-v1/tracing)
74
88
 
75
89
  ### Low Impact Changes
76
90
 
77
- - Rename `createRunAsync` to `createRun` - [Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)
78
- - Update voice package names from `@mastra/speech-*` to `@mastra/voice-*` - [Voice Packages]/guides/v1/migrations/upgrade-to-v1/voice)
79
- - Update scorer methods: `runExperiment` → `runEvals`, `getScorerByName` → `getScorerById` - [Evals & Scorers]/guides/v1/migrations/upgrade-to-v1/evals)
80
- - Remove deprecated CLI flags - [CLI]/guides/v1/migrations/upgrade-to-v1/cli)
81
- - Update client SDK types from `Get*` to `List*` - [Client SDKs]/guides/v1/migrations/upgrade-to-v1/client)
82
- - Replace `runCount` with `retryCount` - [Workflows]/guides/v1/migrations/upgrade-to-v1/workflows)
83
- - Update custom exporter method `exportEvent` to `exportTracingEvent` (if using custom exporters) - [Tracing]/guides/v1/migrations/upgrade-to-v1/tracing)
91
+ - Rename `createRunAsync` to `createRun` - [Workflows](/guides/v1/migrations/upgrade-to-v1/workflows)
92
+ - Update voice package names from `@mastra/speech-*` to `@mastra/voice-*` - [Voice Packages](/guides/v1/migrations/upgrade-to-v1/voice)
93
+ - Update scorer methods: `runExperiment` → `runEvals`, `getScorerByName` → `getScorerById` - [Evals & Scorers](/guides/v1/migrations/upgrade-to-v1/evals)
94
+ - Remove deprecated CLI flags - [CLI](/guides/v1/migrations/upgrade-to-v1/cli)
95
+ - Update client SDK types from `Get*` to `List*` - [Client SDKs](/guides/v1/migrations/upgrade-to-v1/client)
96
+ - Replace `runCount` with `retryCount` - [Workflows](/guides/v1/migrations/upgrade-to-v1/workflows)
97
+ - Update custom exporter method `exportEvent` to `exportTracingEvent` (if using custom exporters) - [Tracing](/guides/v1/migrations/upgrade-to-v1/tracing)
@@ -9,6 +9,26 @@ Storage APIs have been standardized with consistent pagination and naming patter
9
9
 
10
10
  ## Changed
11
11
 
12
+ ### Required `id` property for storage instances
13
+
14
+ Storage instances now require an `id` property. This unique identifier is used for tracking and managing storage instances within Mastra. The `id` should be a descriptive, unique string for each storage instance in your application.
15
+
16
+ To migrate, add an `id` field to your storage constructor.
17
+
18
+ ```diff
19
+ const storage = new PostgresStore({
20
+ + id: 'main-postgres-store',
21
+ connectionString: process.env.POSTGRES_CONNECTION_STRING,
22
+ schemaName: 'public',
23
+ });
24
+
25
+ const upstashStore = new UpstashStore({
26
+ + id: 'upstash-cache-store',
27
+ url: process.env.UPSTASH_REDIS_REST_URL,
28
+ token: process.env.UPSTASH_REDIS_REST_TOKEN,
29
+ });
30
+ ```
31
+
12
32
  ### Pagination from `offset/limit` to `page/perPage`
13
33
 
14
34
  All pagination APIs now use `page` and `perPage` instead of `offset` and `limit`. This change provides a more intuitive pagination model that aligns with common web pagination patterns.
@@ -50,6 +70,16 @@ To migrate, rename the method and update pagination parameters. You can now use
50
70
  + });
51
71
  ```
52
72
 
73
+ :::tip[Codemod]
74
+
75
+ You can use Mastra's codemod CLI to update your code automatically:
76
+
77
+ ```shell
78
+ npx @mastra/codemod@beta v1/storage-get-messages-paginated .
79
+ ```
80
+
81
+ :::
82
+
53
83
  ### `getThreadsByResourceId` to `listThreadsByResourceId`
54
84
 
55
85
  The `getThreadsByResourceId()` method has been renamed to `listThreadsByResourceId()`. This change aligns with the convention that `list*` methods return collections.
@@ -65,6 +95,16 @@ To migrate, rename the method call and update pagination parameters.
65
95
  });
66
96
  ```
67
97
 
98
+ :::tip[Codemod]
99
+
100
+ You can use Mastra's codemod CLI to update your code automatically:
101
+
102
+ ```shell
103
+ npx @mastra/codemod@beta v1/storage-get-threads-by-resource .
104
+ ```
105
+
106
+ :::
107
+
68
108
  ### `getWorkflowRuns` to `listWorkflowRuns`
69
109
 
70
110
  The `getWorkflowRuns()` method has been renamed to `listWorkflowRuns()`. This change aligns with the convention that `list*` methods return collections.
@@ -81,6 +121,16 @@ To migrate, rename the method call and update pagination parameters.
81
121
  });
82
122
  ```
83
123
 
124
+ :::tip[Codemod]
125
+
126
+ You can use Mastra's codemod CLI to update your code automatically:
127
+
128
+ ```shell
129
+ npx @mastra/codemod@beta v1/storage-list-workflow-runs .
130
+ ```
131
+
132
+ :::
133
+
84
134
  ### `getMessagesById` to `listMessagesById`
85
135
 
86
136
  The `getMessagesById()` method has been renamed to `listMessagesById()`. This change aligns with the convention that `list*` methods return collections.
@@ -94,6 +144,16 @@ To migrate, rename the method call.
94
144
  });
95
145
  ```
96
146
 
147
+ :::tip[Codemod]
148
+
149
+ You can use Mastra's codemod CLI to update your code automatically:
150
+
151
+ ```shell
152
+ npx @mastra/codemod@beta v1/storage-list-messages-by-id .
153
+ ```
154
+
155
+ :::
156
+
97
157
  ### Storage `getMessages` and `saveMessages` signatures
98
158
 
99
159
  The `getMessages()` and `saveMessages()` methods have changed signatures and return types. Format overloads have been removed, and the methods now always work with `MastraDBMessage`. This change simplifies the API by removing format variations.
@@ -169,6 +229,16 @@ To migrate, pass the connection string as an object property.
169
229
  + });
170
230
  ```
171
231
 
232
+ :::tip[Codemod]
233
+
234
+ You can use Mastra's codemod CLI to update your code automatically:
235
+
236
+ ```shell
237
+ npx @mastra/codemod@beta v1/vector-pg-constructor .
238
+ ```
239
+
240
+ :::
241
+
172
242
  ### PGVector `defineIndex` to `buildIndex`
173
243
 
174
244
  The `defineIndex()` method has been removed in favor of `buildIndex()`. This change provides clearer naming for the index building operation.
@@ -198,6 +268,16 @@ To migrate, rename the parameter.
198
268
  });
199
269
  ```
200
270
 
271
+ :::tip[Codemod]
272
+
273
+ You can use Mastra's codemod CLI to update your code automatically:
274
+
275
+ ```shell
276
+ npx @mastra/codemod@beta v1/storage-postgres-schema-name .
277
+ ```
278
+
279
+ :::
280
+
201
281
  ### Score storage methods to `listScoresBy*` pattern
202
282
 
203
283
  Score storage APIs have been renamed to follow the `listScoresBy*` pattern. This change provides consistency with the broader API naming conventions.