@mastra/mcp-docs-server 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/.docs/organized/changelogs/%40internal%2Fplayground.md +20 -0
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +42 -42
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Flance.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Freact.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +34 -34
- package/.docs/organized/changelogs/create-mastra.md +5 -5
- package/.docs/organized/changelogs/mastra.md +35 -35
- package/.docs/raw/guides/migrations/upgrade-to-v1/cli.mdx +15 -1
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +88 -4
- package/.docs/raw/memory/storage.mdx +3 -3
- package/.docs/raw/reference/cli/mastra.mdx +20 -4
- package/.docs/raw/reference/configuration.mdx +1 -1
- package/.docs/raw/reference/core/getStorage.mdx +1 -1
- package/.docs/raw/reference/core/mastra-class.mdx +1 -1
- package/.docs/raw/reference/core/setStorage.mdx +2 -2
- package/.docs/raw/reference/memory/memory-class.mdx +1 -1
- package/.docs/raw/reference/storage/composite.mdx +16 -16
- package/CHANGELOG.md +14 -0
- package/dist/stdio.js +2 -2
- package/package.json +3 -3
|
@@ -228,29 +228,45 @@ Do not include example code. Useful when using the `--default` flag.
|
|
|
228
228
|
|
|
229
229
|
Configure your code editor with Mastra's MCP server. Choose from: `"cursor" | "cursor-global" | "windsurf" | "vscode"`.
|
|
230
230
|
|
|
231
|
+
## `mastra migrate`
|
|
232
|
+
|
|
233
|
+
Runs database migrations to update your storage schema. This command is useful when upgrading Mastra versions that include storage schema changes.
|
|
234
|
+
|
|
235
|
+
The command bundles your project, connects to your configured storage backend, and executes any pending migrations. Currently supports:
|
|
236
|
+
|
|
237
|
+
- **Duplicate spans migration**: Removes duplicate `(traceId, spanId)` entries and adds a unique constraint to ensure data integrity.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
mastra migrate
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
See the [Storage migration guide](/guides/v1/migrations/upgrade-to-v1/storage#duplicate-spans-migration) for details on when migrations are needed.
|
|
244
|
+
|
|
245
|
+
It accepts [common flags][common-flags].
|
|
246
|
+
|
|
231
247
|
## Common flags
|
|
232
248
|
|
|
233
249
|
### `--dir`
|
|
234
250
|
|
|
235
|
-
**Available in:** `dev`, `build`, `lint`
|
|
251
|
+
**Available in:** `dev`, `build`, `lint`, `migrate`
|
|
236
252
|
|
|
237
253
|
The path to your Mastra folder. Defaults to `src/mastra`.
|
|
238
254
|
|
|
239
255
|
### `--debug`
|
|
240
256
|
|
|
241
|
-
**Available in:** `dev`, `build`
|
|
257
|
+
**Available in:** `dev`, `build`, `migrate`
|
|
242
258
|
|
|
243
259
|
Enable verbose logging for Mastra's internals. Defaults to `false`.
|
|
244
260
|
|
|
245
261
|
### `--env`
|
|
246
262
|
|
|
247
|
-
**Available in:** `dev`, `start`, `studio`
|
|
263
|
+
**Available in:** `dev`, `start`, `studio`, `migrate`
|
|
248
264
|
|
|
249
265
|
Custom environment variables file to include. By default, includes `.env.development`, `.env.local`, and `.env`.
|
|
250
266
|
|
|
251
267
|
### `--root`
|
|
252
268
|
|
|
253
|
-
**Available in:** `dev`, `build`, `lint`
|
|
269
|
+
**Available in:** `dev`, `build`, `lint`, `migrate`
|
|
254
270
|
|
|
255
271
|
Path to your root folder. Defaults to `process.cwd()`.
|
|
256
272
|
|
|
@@ -307,7 +307,7 @@ export const mastra = new Mastra({
|
|
|
307
307
|
|
|
308
308
|
### storage
|
|
309
309
|
|
|
310
|
-
**Type:** `
|
|
310
|
+
**Type:** `MastraCompositeStore`
|
|
311
311
|
|
|
312
312
|
Storage provider for persisting application data. Used by memory, workflows, traces, and other components that require persistence. Mastra supports multiple database backends including PostgreSQL, MongoDB, libSQL, and more.
|
|
313
313
|
|
|
@@ -25,7 +25,7 @@ This method does not accept any parameters.
|
|
|
25
25
|
content={[
|
|
26
26
|
{
|
|
27
27
|
name: "storage",
|
|
28
|
-
type: "
|
|
28
|
+
type: "MastraCompositeStore | undefined",
|
|
29
29
|
description:
|
|
30
30
|
"The configured storage instance, or undefined if no storage has been configured.",
|
|
31
31
|
},
|
|
@@ -59,7 +59,7 @@ Visit the [Configuration reference](/reference/v1/configuration) for detailed do
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
name: "storage",
|
|
62
|
-
type: "
|
|
62
|
+
type: "MastraCompositeStore",
|
|
63
63
|
description: "Storage engine instance for persisting data",
|
|
64
64
|
isOptional: true,
|
|
65
65
|
},
|
|
@@ -7,7 +7,7 @@ packages:
|
|
|
7
7
|
|
|
8
8
|
# Mastra.setStorage()
|
|
9
9
|
|
|
10
|
-
The `.setStorage()` method is used to set the storage instance for the Mastra instance. This method accepts a single `
|
|
10
|
+
The `.setStorage()` method is used to set the storage instance for the Mastra instance. This method accepts a single `MastraCompositeStore` parameter.
|
|
11
11
|
|
|
12
12
|
## Usage example
|
|
13
13
|
|
|
@@ -26,7 +26,7 @@ mastra.setStorage(
|
|
|
26
26
|
content={[
|
|
27
27
|
{
|
|
28
28
|
name: "storage",
|
|
29
|
-
type: "
|
|
29
|
+
type: "MastraCompositeStore",
|
|
30
30
|
description: "The storage instance to set for the Mastra instance.",
|
|
31
31
|
},
|
|
32
32
|
]}
|
|
@@ -40,7 +40,7 @@ export const agent = new Agent({
|
|
|
40
40
|
content={[
|
|
41
41
|
{
|
|
42
42
|
name: "storage",
|
|
43
|
-
type: "
|
|
43
|
+
type: "MastraCompositeStore",
|
|
44
44
|
description:
|
|
45
45
|
'Storage implementation for persisting memory data. Defaults to `new DefaultStorage({ config: { url: "file:memory.db" } })` if not provided.',
|
|
46
46
|
isOptional: true,
|
|
@@ -10,11 +10,11 @@ packages:
|
|
|
10
10
|
|
|
11
11
|
# Composite Storage
|
|
12
12
|
|
|
13
|
-
`
|
|
13
|
+
`MastraCompositeStore` can compose storage domains from different providers. Use it when you need different databases for different purposes. For example, use LibSQL for memory and PostgreSQL for workflows.
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
`
|
|
17
|
+
`MastraCompositeStore` is included in `@mastra/core`:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install @mastra/core@beta
|
|
@@ -45,13 +45,13 @@ Mastra organizes storage into five specialized domains, each handling a specific
|
|
|
45
45
|
Import domain classes directly from each store package and compose them:
|
|
46
46
|
|
|
47
47
|
```typescript title="src/mastra/index.ts"
|
|
48
|
-
import {
|
|
48
|
+
import { MastraCompositeStore } from "@mastra/core/storage";
|
|
49
49
|
import { WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
50
50
|
import { MemoryLibSQL } from "@mastra/libsql";
|
|
51
51
|
import { Mastra } from "@mastra/core";
|
|
52
52
|
|
|
53
53
|
export const mastra = new Mastra({
|
|
54
|
-
storage: new
|
|
54
|
+
storage: new MastraCompositeStore({
|
|
55
55
|
id: "composite",
|
|
56
56
|
domains: {
|
|
57
57
|
memory: new MemoryLibSQL({ url: "file:./local.db" }),
|
|
@@ -67,7 +67,7 @@ export const mastra = new Mastra({
|
|
|
67
67
|
Use `default` to specify a fallback storage, then override specific domains:
|
|
68
68
|
|
|
69
69
|
```typescript title="src/mastra/index.ts"
|
|
70
|
-
import {
|
|
70
|
+
import { MastraCompositeStore } from "@mastra/core/storage";
|
|
71
71
|
import { PostgresStore } from "@mastra/pg";
|
|
72
72
|
import { MemoryLibSQL } from "@mastra/libsql";
|
|
73
73
|
import { Mastra } from "@mastra/core";
|
|
@@ -78,7 +78,7 @@ const pgStore = new PostgresStore({
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
export const mastra = new Mastra({
|
|
81
|
-
storage: new
|
|
81
|
+
storage: new MastraCompositeStore({
|
|
82
82
|
id: "composite",
|
|
83
83
|
default: pgStore,
|
|
84
84
|
domains: {
|
|
@@ -100,7 +100,7 @@ export const mastra = new Mastra({
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
name: "default",
|
|
103
|
-
type: "
|
|
103
|
+
type: "MastraCompositeStore",
|
|
104
104
|
description:
|
|
105
105
|
"Default storage adapter. Domains not explicitly specified in `domains` will use this storage's domains as fallbacks.",
|
|
106
106
|
isOptional: true,
|
|
@@ -154,14 +154,14 @@ export const mastra = new Mastra({
|
|
|
154
154
|
|
|
155
155
|
## Initialization
|
|
156
156
|
|
|
157
|
-
`
|
|
157
|
+
`MastraCompositeStore` initializes each configured domain independently. When passed to the Mastra class, `init()` is called automatically:
|
|
158
158
|
|
|
159
159
|
```typescript title="src/mastra/index.ts"
|
|
160
|
-
import {
|
|
160
|
+
import { MastraCompositeStore } from "@mastra/core/storage";
|
|
161
161
|
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
162
162
|
import { Mastra } from "@mastra/core";
|
|
163
163
|
|
|
164
|
-
const storage = new
|
|
164
|
+
const storage = new MastraCompositeStore({
|
|
165
165
|
id: "composite",
|
|
166
166
|
domains: {
|
|
167
167
|
memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
|
@@ -178,10 +178,10 @@ export const mastra = new Mastra({
|
|
|
178
178
|
If using storage directly, call `init()` explicitly:
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
|
-
import {
|
|
181
|
+
import { MastraCompositeStore } from "@mastra/core/storage";
|
|
182
182
|
import { MemoryPG } from "@mastra/pg";
|
|
183
183
|
|
|
184
|
-
const storage = new
|
|
184
|
+
const storage = new MastraCompositeStore({
|
|
185
185
|
id: "composite",
|
|
186
186
|
domains: {
|
|
187
187
|
memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
|
@@ -202,11 +202,11 @@ const thread = await memoryStore?.getThreadById({ threadId: "..." });
|
|
|
202
202
|
Use a local database for development while keeping production data in a managed service:
|
|
203
203
|
|
|
204
204
|
```typescript
|
|
205
|
-
import {
|
|
205
|
+
import { MastraCompositeStore } from "@mastra/core/storage";
|
|
206
206
|
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
207
207
|
import { MemoryLibSQL } from "@mastra/libsql";
|
|
208
208
|
|
|
209
|
-
const storage = new
|
|
209
|
+
const storage = new MastraCompositeStore({
|
|
210
210
|
id: "composite",
|
|
211
211
|
domains: {
|
|
212
212
|
// Use local SQLite for development, PostgreSQL for production
|
|
@@ -225,11 +225,11 @@ const storage = new MastraStorage({
|
|
|
225
225
|
Use a time-series database for traces while keeping other data in PostgreSQL:
|
|
226
226
|
|
|
227
227
|
```typescript
|
|
228
|
-
import {
|
|
228
|
+
import { MastraCompositeStore } from "@mastra/core/storage";
|
|
229
229
|
import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
|
|
230
230
|
import { ObservabilityStorageClickhouse } from "@mastra/clickhouse";
|
|
231
231
|
|
|
232
|
-
const storage = new
|
|
232
|
+
const storage = new MastraCompositeStore({
|
|
233
233
|
id: "composite",
|
|
234
234
|
domains: {
|
|
235
235
|
memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`50fd320`](https://github.com/mastra-ai/mastra/commit/50fd320003d0d93831c230ef531bef41f5ba7b3a)]:
|
|
8
|
+
- @mastra/core@1.0.0-beta.27
|
|
9
|
+
|
|
10
|
+
## 1.0.0-beta.26
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`026b848`](https://github.com/mastra-ai/mastra/commit/026b8483fbf5b6d977be8f7e6aac8d15c75558ac), [`ffa553a`](https://github.com/mastra-ai/mastra/commit/ffa553a3edc1bd17d73669fba66d6b6f4ac10897)]:
|
|
15
|
+
- @mastra/core@1.0.0-beta.26
|
|
16
|
+
|
|
3
17
|
## 1.0.0-beta.25
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/stdio.js
CHANGED
|
@@ -191,7 +191,7 @@ function getUpgradeToV1Messages(area) {
|
|
|
191
191
|
- If "${area}" doesn't end with 's', try adding 's' (e.g., "agent" \u2192 "agents")
|
|
192
192
|
4. If the guide exists, walk me through the changes step by step
|
|
193
193
|
5. If neither form exists, list available migration guides in "upgrade-to-v1/" and suggest which ones might be relevant to "${area}"
|
|
194
|
-
6. After you find the guide, collect all the codemod calls to run to codemods. These callouts are marked with ":::tip[Codemod]" in the docs. Run the codemods with "npx @mastra/codemod@
|
|
194
|
+
6. After you find the guide, collect all the codemod calls to run to codemods. These callouts are marked with ":::tip[Codemod]" in the docs. Run the codemods with "npx @mastra/codemod@latest <codemod-name> <path>" to automate all those changes. Afterwards, help me with any remaining manual changes needed.`
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
];
|
|
@@ -207,7 +207,7 @@ function getUpgradeToV1Messages(area) {
|
|
|
207
207
|
2. First, list all available migration guides with path: "upgrade-to-v1/"
|
|
208
208
|
2. Give me a high-level overview of what changed in each area
|
|
209
209
|
3. Find relevant migration areas to focus on based on my project's codebase and confirm the list with me
|
|
210
|
-
4. After the areas are confirmed, check the migration guides for callouts to codemods. These callouts are marked with ":::tip[Codemod]" in the docs. Run the codemods with "npx @mastra/codemod@
|
|
210
|
+
4. After the areas are confirmed, check the migration guides for callouts to codemods. These callouts are marked with ":::tip[Codemod]" in the docs. Run the codemods with "npx @mastra/codemod@latest v1" to automate all those changes. Afterwards, help me with any remaining manual changes needed.
|
|
211
211
|
|
|
212
212
|
After the areas are confirmed, we'll go through each one systematically.`
|
|
213
213
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.27",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^3.25.76",
|
|
32
|
-
"@mastra/core": "1.0.0-beta.
|
|
32
|
+
"@mastra/core": "1.0.0-beta.27",
|
|
33
33
|
"@mastra/mcp": "^1.0.0-beta.10"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "4.0.16",
|
|
49
49
|
"@internal/lint": "0.0.53",
|
|
50
|
-
"@mastra/core": "1.0.0-beta.
|
|
50
|
+
"@mastra/core": "1.0.0-beta.27"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|