@mastra/mcp-docs-server 1.1.24-alpha.2 → 1.1.25-alpha.1
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/docs/deployment/cloud-providers.md +5 -1
- package/.docs/docs/deployment/overview.md +11 -8
- package/.docs/docs/index.md +2 -2
- package/.docs/docs/mastra-platform/configuration.md +36 -0
- package/.docs/docs/mastra-platform/overview.md +76 -0
- package/.docs/docs/memory/storage.md +0 -2
- package/.docs/docs/observability/logging.md +1 -1
- package/.docs/docs/observability/overview.md +1 -1
- package/.docs/docs/observability/tracing/exporters/cloud.md +126 -73
- package/.docs/docs/observability/tracing/exporters/default.md +1 -1
- package/.docs/docs/observability/tracing/overview.md +3 -3
- package/.docs/docs/studio/deployment.md +24 -6
- package/.docs/docs/studio/observability.md +1 -1
- package/.docs/docs/studio/overview.md +2 -4
- package/.docs/guides/deployment/mastra-platform.md +70 -0
- package/.docs/guides/migrations/mastra-cloud.md +247 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/ollama-cloud.md +2 -1
- package/.docs/models/providers/synthetic.md +4 -2
- package/.docs/reference/cli/mastra.md +140 -0
- package/.docs/reference/client-js/agents.md +0 -14
- package/.docs/reference/configuration.md +1 -1
- package/.docs/reference/index.md +1 -0
- package/.docs/reference/logging/pino-logger.md +0 -2
- package/.docs/reference/mastra-platform/api.md +108 -0
- package/CHANGELOG.md +14 -0
- package/package.json +5 -5
- package/.docs/docs/mastra-cloud/deployment.md +0 -77
- package/.docs/docs/mastra-cloud/observability.md +0 -38
- package/.docs/docs/mastra-cloud/overview.md +0 -23
- package/.docs/docs/mastra-cloud/setup.md +0 -42
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Deploy to Mastra platform
|
|
2
|
+
|
|
3
|
+
Mastra Server deploys your application as a production API server on cloud infrastructure. You get a stable API endpoint, environment variable management, custom domain support, and deploy history out of the box.
|
|
4
|
+
|
|
5
|
+
> **Tip:** This guide covers deploying the standalone server generated by `mastra build`. If you need to deploy Studio to the Mastra platform, see [Studio deployment](https://mastra.ai/docs/studio/deployment) instead.
|
|
6
|
+
|
|
7
|
+
## Before you begin
|
|
8
|
+
|
|
9
|
+
You'll need a [Mastra application](https://mastra.ai/guides/getting-started/quickstart) and a [Mastra platform](https://projects.mastra.ai) account.
|
|
10
|
+
|
|
11
|
+
> **Warning:** Mastra platform uses an ephemeral filesystem, so any storage you configure (including observability storage) must be hosted externally. If you're using [LibSQLStore](https://mastra.ai/reference/storage/libsql) with a file URL, switch to a remotely hosted database.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Install the `mastra` CLI globally:
|
|
16
|
+
|
|
17
|
+
**npm**:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g mastra
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**pnpm**:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm add -g mastra
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Yarn**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
yarn global add mastra
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Bun**:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bun add --global mastra
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Deploy
|
|
42
|
+
|
|
43
|
+
1. Deploy your project:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
mastra server deploy
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If you're not already authenticated, the CLI will prompt you to log in. It'll store your credentials locally and any subsequent CLI commands will use these credentials.
|
|
50
|
+
|
|
51
|
+
The command runs `mastra build`, uploads the artifact, builds a Docker image, and deploys it to Railway. On first deploy, the CLI creates a `.mastra-project.json` file linking your local project to the platform. Commit this file so subsequent deploys and CI/CD target the same project.
|
|
52
|
+
|
|
53
|
+
> **Note:** Environment variables from `.env`, `.env.local`, and `.env.production` are included automatically. On the first deploy, these seed the project if no env vars are set yet. After that, manage env vars through the web dashboard. Review and sanitize these files before first deploy to avoid uploading development-only or personal secrets.
|
|
54
|
+
|
|
55
|
+
See the [CLI reference](https://mastra.ai/reference/cli/mastra) for the full list of flags and CI/CD usage.
|
|
56
|
+
|
|
57
|
+
2. Verify your deployment at the URL printed by the CLI. Append `/api/agents` to confirm it returns a JSON list of your agents.
|
|
58
|
+
|
|
59
|
+
> **Warning:** Set up [authentication](https://mastra.ai/docs/server/auth) before exposing your endpoints publicly.
|
|
60
|
+
|
|
61
|
+
## Deploy lifecycle
|
|
62
|
+
|
|
63
|
+
A deploy transitions through **queued → uploading → building → deploying → running** (or **failed**, **cancelled**, **crashed**, or **stopped**). Only one build runs per project at a time. If multiple deploys queue up, only the latest proceeds and the rest are cancelled. Builds running longer than 15 minutes are automatically failed. The first deploy provisions Railway infrastructure and seeds environment variables from your local `.env`. Your server URL remains stable across deploys.
|
|
64
|
+
|
|
65
|
+
## Related
|
|
66
|
+
|
|
67
|
+
- [CLI reference](https://mastra.ai/reference/cli/mastra)
|
|
68
|
+
- [Mastra platform overview](https://mastra.ai/docs/mastra-platform/overview)
|
|
69
|
+
- [Studio deployment](https://mastra.ai/docs/studio/deployment)
|
|
70
|
+
- [Deployment overview](https://mastra.ai/docs/deployment/overview)
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Migrate from Mastra Cloud to Mastra platform
|
|
2
|
+
|
|
3
|
+
The Mastra platform replaces Mastra Cloud with separate Studio and Server products, CLI-driven deploys, and a new observability system. This guide walks you through each step.
|
|
4
|
+
|
|
5
|
+
## What changed
|
|
6
|
+
|
|
7
|
+
| Area | Mastra Cloud | Mastra platform |
|
|
8
|
+
| -------------------- | ---------------------------------------------- | -------------------------------------------------------------- |
|
|
9
|
+
| **Products** | Single project | Separate Studio and Server |
|
|
10
|
+
| **Deploys** | Auto-deploy on push | CLI-driven (`mastra studio deploy`, `mastra server deploy`) |
|
|
11
|
+
| **Project creation** | GitHub import | CLI creates projects on first deploy |
|
|
12
|
+
| **Storage** | Managed LibSQL (Cloud Store) or bring your own | Bring your own hosted database |
|
|
13
|
+
| **Observability** | Logger-based | `Observability` class with exporters |
|
|
14
|
+
| **Env vars** | Set during project setup | Seeded from `.env` on first deploy, managed in dashboard after |
|
|
15
|
+
| **URLs** | Single URL | Separate Studio and Server URLs |
|
|
16
|
+
|
|
17
|
+
## Before you start
|
|
18
|
+
|
|
19
|
+
1. Install or update the CLI:
|
|
20
|
+
|
|
21
|
+
**npm**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g mastra@latest
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**pnpm**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add -g mastra@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Yarn**:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
yarn global add mastra@latest
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Bun**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
bun add --global mastra@latest
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
2. Authenticate:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
mastra auth login
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
3. Verify your project builds locally:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
mastra build
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Replace Mastra Cloud Store with a hosted database
|
|
58
|
+
|
|
59
|
+
Mastra Cloud provided a managed LibSQL database. The Mastra platform does not host a database for you, so you need to point your storage at an externally hosted instance.
|
|
60
|
+
|
|
61
|
+
If you were already using a hosted database ("bring your own"), no changes are needed. Make sure the connection string is set as an environment variable in the dashboard rather than hardcoded.
|
|
62
|
+
|
|
63
|
+
If you were using `file:./mastra.db` with Cloud Store, please [contact support](mailto:support@mastra.ai) for a migration path to export and import your data.
|
|
64
|
+
|
|
65
|
+
## Update observability configuration
|
|
66
|
+
|
|
67
|
+
Mastra Cloud used logger-based tracing. The Mastra platform uses the `Observability` class with explicit exporters.
|
|
68
|
+
|
|
69
|
+
Install the observability package:
|
|
70
|
+
|
|
71
|
+
**npm**:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install @mastra/observability
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**pnpm**:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pnpm add @mastra/observability
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Yarn**:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
yarn add @mastra/observability
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Bun**:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
bun add @mastra/observability
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Before (Mastra Cloud):**
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
99
|
+
import { PinoLogger } from '@mastra/loggers'
|
|
100
|
+
|
|
101
|
+
export const mastra = new Mastra({
|
|
102
|
+
logger: new PinoLogger({ name: 'my-app', level: 'info' }),
|
|
103
|
+
// traces appear in Cloud dashboard automatically
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**After (Mastra platform):**
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
111
|
+
import {
|
|
112
|
+
Observability,
|
|
113
|
+
DefaultExporter,
|
|
114
|
+
CloudExporter,
|
|
115
|
+
SensitiveDataFilter,
|
|
116
|
+
} from '@mastra/observability'
|
|
117
|
+
|
|
118
|
+
export const mastra = new Mastra({
|
|
119
|
+
observability: new Observability({
|
|
120
|
+
configs: {
|
|
121
|
+
default: {
|
|
122
|
+
serviceName: 'my-app',
|
|
123
|
+
exporters: [new DefaultExporter(), new CloudExporter()],
|
|
124
|
+
spanOutputProcessors: [new SensitiveDataFilter()],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
}),
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
- `DefaultExporter` persists traces to your storage backend for [Studio](https://mastra.ai/docs/studio/observability).
|
|
132
|
+
- `CloudExporter` sends traces to the Mastra platform when `MASTRA_CLOUD_ACCESS_TOKEN` is set.
|
|
133
|
+
- `SensitiveDataFilter` redacts passwords, tokens, and keys from span data before export.
|
|
134
|
+
|
|
135
|
+
See the [observability overview](https://mastra.ai/docs/observability/overview) for the full configuration, including composite storage with DuckDB for metrics.
|
|
136
|
+
|
|
137
|
+
## Deploy Studio
|
|
138
|
+
|
|
139
|
+
Deploy your hosted Studio instance:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
mastra studio deploy
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The CLI builds your project, uploads the artifact, and deploys it. On first deploy, a `.mastra-project.json` file is created to link your local project to the platform. Commit this file to your repository.
|
|
146
|
+
|
|
147
|
+
See [Studio deployment](https://mastra.ai/docs/studio/deployment) for details.
|
|
148
|
+
|
|
149
|
+
## Deploy Server (optional)
|
|
150
|
+
|
|
151
|
+
If you need a production API endpoint, deploy a Server:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
mastra server deploy
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This creates a separate deployment with a stable API URL, environment variable management, and custom domain support. See the [Server deployment guide](https://mastra.ai/guides/deployment/mastra-platform) for the full walkthrough.
|
|
158
|
+
|
|
159
|
+
> **Note:** Environment variables from `.env`, `.env.local`, and `.env.production` are included automatically on first deploy. After that, manage env vars through the [web dashboard](https://projects.mastra.ai). Review and sanitize these files before first deploy to avoid uploading development-only or personal secrets.
|
|
160
|
+
|
|
161
|
+
## Set up CI (optional)
|
|
162
|
+
|
|
163
|
+
Mastra Cloud auto-deployed on push. The Mastra platform uses CLI-driven deploys, which you can run from any CI provider.
|
|
164
|
+
|
|
165
|
+
### Prerequisites
|
|
166
|
+
|
|
167
|
+
1. Create an API token:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
mastra auth tokens create ci-deploy
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
2. Store the token as a GitHub Actions secret (e.g. `MASTRA_API_TOKEN`).
|
|
174
|
+
|
|
175
|
+
3. Commit `.mastra-project.json` to your repo (generated on your first manual deploy).
|
|
176
|
+
|
|
177
|
+
When `MASTRA_API_TOKEN` is set, the CLI runs in headless mode and skips all interactive prompts.
|
|
178
|
+
|
|
179
|
+
### Deploy Server on push to main
|
|
180
|
+
|
|
181
|
+
Server deploy accepts org and project from `.mastra-project.json`, so no extra env vars are needed beyond the token:
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
name: Deploy to Mastra Server
|
|
185
|
+
|
|
186
|
+
on:
|
|
187
|
+
push:
|
|
188
|
+
branches: [main]
|
|
189
|
+
|
|
190
|
+
jobs:
|
|
191
|
+
deploy:
|
|
192
|
+
runs-on: ubuntu-latest
|
|
193
|
+
steps:
|
|
194
|
+
- uses: actions/checkout@v4
|
|
195
|
+
- uses: actions/setup-node@v4
|
|
196
|
+
with:
|
|
197
|
+
node-version: '22'
|
|
198
|
+
- uses: pnpm/action-setup@v4
|
|
199
|
+
with:
|
|
200
|
+
version: 10
|
|
201
|
+
- run: pnpm install
|
|
202
|
+
- run: pnpm mastra server deploy --yes --config .mastra-project.json
|
|
203
|
+
env:
|
|
204
|
+
MASTRA_API_TOKEN: ${{ secrets.MASTRA_API_TOKEN }}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Deploy Studio on push to main
|
|
208
|
+
|
|
209
|
+
Studio deploy requires `MASTRA_ORG_ID` and `MASTRA_PROJECT_ID` as env vars in headless mode, even when `--config` is provided:
|
|
210
|
+
|
|
211
|
+
```yaml
|
|
212
|
+
name: Deploy to Mastra Studio
|
|
213
|
+
|
|
214
|
+
on:
|
|
215
|
+
push:
|
|
216
|
+
branches: [main]
|
|
217
|
+
|
|
218
|
+
jobs:
|
|
219
|
+
deploy:
|
|
220
|
+
runs-on: ubuntu-latest
|
|
221
|
+
steps:
|
|
222
|
+
- uses: actions/checkout@v4
|
|
223
|
+
- uses: actions/setup-node@v4
|
|
224
|
+
with:
|
|
225
|
+
node-version: '22'
|
|
226
|
+
- uses: pnpm/action-setup@v4
|
|
227
|
+
with:
|
|
228
|
+
version: 10
|
|
229
|
+
- run: pnpm install
|
|
230
|
+
- run: pnpm mastra studio deploy --yes --config .mastra-project.json
|
|
231
|
+
env:
|
|
232
|
+
MASTRA_API_TOKEN: ${{ secrets.MASTRA_API_TOKEN }}
|
|
233
|
+
MASTRA_ORG_ID: ${{ secrets.MASTRA_ORG_ID }}
|
|
234
|
+
MASTRA_PROJECT_ID: ${{ secrets.MASTRA_PROJECT_ID }}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Decommission old Cloud project
|
|
238
|
+
|
|
239
|
+
Update any clients pointing to your old Mastra Cloud URL to the new Server or Studio URL. Verify traces appear in the new platform by checking the [Studio observability dashboard](https://mastra.ai/docs/studio/observability). Delete your old Mastra Cloud project once everything is confirmed working.
|
|
240
|
+
|
|
241
|
+
## Related
|
|
242
|
+
|
|
243
|
+
- [Observability overview](https://mastra.ai/docs/observability/overview)
|
|
244
|
+
- [Studio deployment](https://mastra.ai/docs/studio/deployment)
|
|
245
|
+
- [Server deployment](https://mastra.ai/guides/deployment/mastra-platform)
|
|
246
|
+
- [CLI reference](https://mastra.ai/reference/cli/mastra)
|
|
247
|
+
- [Mastra platform overview](https://mastra.ai/docs/mastra-platform/overview)
|
|
@@ -46,7 +46,7 @@ export const mastra = new Mastra({
|
|
|
46
46
|
serviceName: 'mastra',
|
|
47
47
|
exporters: [
|
|
48
48
|
new DefaultExporter(), // Persists traces to storage for Studio
|
|
49
|
-
new CloudExporter(), // Sends
|
|
49
|
+
new CloudExporter(), // Sends observability data to Mastra platform (if MASTRA_CLOUD_ACCESS_TOKEN is set)
|
|
50
50
|
],
|
|
51
51
|
spanOutputProcessors: [
|
|
52
52
|
new SensitiveDataFilter(), // Redacts sensitive data like passwords, tokens, keys
|
package/.docs/models/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Model Providers
|
|
2
2
|
|
|
3
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
3
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3592 models from 99 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ollama Cloud
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 36 Ollama Cloud models through Mastra's model router. Authentication is handled automatically using the `OLLAMA_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Ollama Cloud documentation](https://docs.ollama.com/cloud).
|
|
6
6
|
|
|
@@ -43,6 +43,7 @@ for await (const chunk of stream) {
|
|
|
43
43
|
| `ollama-cloud/gemma3:12b` | 131K | | | | | | — | — |
|
|
44
44
|
| `ollama-cloud/gemma3:27b` | 131K | | | | | | — | — |
|
|
45
45
|
| `ollama-cloud/gemma3:4b` | 131K | | | | | | — | — |
|
|
46
|
+
| `ollama-cloud/gemma4:31b` | 262K | | | | | | — | — |
|
|
46
47
|
| `ollama-cloud/glm-4.6` | 203K | | | | | | — | — |
|
|
47
48
|
| `ollama-cloud/glm-4.7` | 203K | | | | | | — | — |
|
|
48
49
|
| `ollama-cloud/glm-5` | 203K | | | | | | — | — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Synthetic
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 31 Synthetic models through Mastra's model router. Authentication is handled automatically using the `SYNTHETIC_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Synthetic documentation](https://synthetic.new/pricing).
|
|
6
6
|
|
|
@@ -54,6 +54,7 @@ for await (const chunk of stream) {
|
|
|
54
54
|
| `synthetic/hf:moonshotai/Kimi-K2-Thinking` | 262K | | | | | | $0.55 | $2 |
|
|
55
55
|
| `synthetic/hf:moonshotai/Kimi-K2.5` | 262K | | | | | | $0.55 | $2 |
|
|
56
56
|
| `synthetic/hf:nvidia/Kimi-K2.5-NVFP4` | 262K | | | | | | $0.55 | $2 |
|
|
57
|
+
| `synthetic/hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4` | 262K | | | | | | $0.30 | $1 |
|
|
57
58
|
| `synthetic/hf:openai/gpt-oss-120b` | 128K | | | | | | $0.10 | $0.10 |
|
|
58
59
|
| `synthetic/hf:Qwen/Qwen2.5-Coder-32B-Instruct` | 33K | | | | | | $0.80 | $0.80 |
|
|
59
60
|
| `synthetic/hf:Qwen/Qwen3-235B-A22B-Instruct-2507` | 256K | | | | | | $0.20 | $0.60 |
|
|
@@ -63,6 +64,7 @@ for await (const chunk of stream) {
|
|
|
63
64
|
| `synthetic/hf:zai-org/GLM-4.6` | 200K | | | | | | $0.55 | $2 |
|
|
64
65
|
| `synthetic/hf:zai-org/GLM-4.7` | 200K | | | | | | $0.55 | $2 |
|
|
65
66
|
| `synthetic/hf:zai-org/GLM-4.7-Flash` | 197K | | | | | | $0.06 | $0.40 |
|
|
67
|
+
| `synthetic/hf:zai-org/GLM-5` | 197K | | | | | | $1 | $3 |
|
|
66
68
|
|
|
67
69
|
## Advanced configuration
|
|
68
70
|
|
|
@@ -92,7 +94,7 @@ const agent = new Agent({
|
|
|
92
94
|
model: ({ requestContext }) => {
|
|
93
95
|
const useAdvanced = requestContext.task === "complex";
|
|
94
96
|
return useAdvanced
|
|
95
|
-
? "synthetic/hf:zai-org/GLM-
|
|
97
|
+
? "synthetic/hf:zai-org/GLM-5"
|
|
96
98
|
: "synthetic/hf:MiniMaxAI/MiniMax-M2";
|
|
97
99
|
}
|
|
98
100
|
});
|
|
@@ -179,6 +179,10 @@ The port of the Mastra API server to connect to. Defaults to `4111`.
|
|
|
179
179
|
|
|
180
180
|
The protocol of the Mastra API server to connect to. Defaults to `http`.
|
|
181
181
|
|
|
182
|
+
#### `--server-api-prefix`
|
|
183
|
+
|
|
184
|
+
The API route prefix of the Mastra API server. Defaults to `/api`.
|
|
185
|
+
|
|
182
186
|
#### `--request-context-presets`
|
|
183
187
|
|
|
184
188
|
Path to a JSON file containing named [request context](https://mastra.ai/docs/server/request-context) presets. Works the same as the [`mastra dev` flag](#--request-context-presets).
|
|
@@ -187,6 +191,142 @@ Path to a JSON file containing named [request context](https://mastra.ai/docs/se
|
|
|
187
191
|
mastra studio --request-context-presets ./presets.json
|
|
188
192
|
```
|
|
189
193
|
|
|
194
|
+
## `mastra studio deploy`
|
|
195
|
+
|
|
196
|
+
Builds and deploys your project to Mastra platform. Requires authentication via [`mastra auth login`](#mastra-auth-login) or a `MASTRA_API_TOKEN` environment variable.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
mastra studio deploy
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The command runs `mastra build`, zips the output, reads environment variables from `.env`, `.env.local`, and `.env.production`, and uploads everything to the platform. After uploading, it polls the deploy status and streams build logs until the deploy reaches a terminal state.
|
|
203
|
+
|
|
204
|
+
Organization and project are resolved in order from: Environment variable flag, `.mastra-project.json` config file, current org from credentials, and lastly interactive prompt. On first deploy, the CLI saves the resolved IDs to `.mastra-project.json` so subsequent deploys skip the prompts.
|
|
205
|
+
|
|
206
|
+
### Arguments
|
|
207
|
+
|
|
208
|
+
#### `[dir]`
|
|
209
|
+
|
|
210
|
+
Project directory. Defaults to the current directory.
|
|
211
|
+
|
|
212
|
+
### Flags
|
|
213
|
+
|
|
214
|
+
#### `--org`
|
|
215
|
+
|
|
216
|
+
Organization ID. Can also be set via the `MASTRA_ORG_ID` environment variable.
|
|
217
|
+
|
|
218
|
+
#### `--project`
|
|
219
|
+
|
|
220
|
+
Project ID. Can also be set via the `MASTRA_PROJECT_ID` environment variable.
|
|
221
|
+
|
|
222
|
+
#### `-y, --yes`
|
|
223
|
+
|
|
224
|
+
Auto-accept defaults without confirmation prompts.
|
|
225
|
+
|
|
226
|
+
#### `-c, --config`
|
|
227
|
+
|
|
228
|
+
Path to the project config file. Defaults to `.mastra-project.json`.
|
|
229
|
+
|
|
230
|
+
#### `--skip-build`
|
|
231
|
+
|
|
232
|
+
Skip the build step and deploy the existing `.mastra/output` directory.
|
|
233
|
+
|
|
234
|
+
### CI/CD usage
|
|
235
|
+
|
|
236
|
+
Set `MASTRA_API_TOKEN`, `MASTRA_ORG_ID`, and `MASTRA_PROJECT_ID` as environment variables for headless deploys. Interactive prompts are skipped automatically when `MASTRA_API_TOKEN` is set.
|
|
237
|
+
|
|
238
|
+
### `mastra studio deploy list`
|
|
239
|
+
|
|
240
|
+
Lists all projects with their latest deploy status and URL.
|
|
241
|
+
|
|
242
|
+
### `mastra studio deploy status`
|
|
243
|
+
|
|
244
|
+
Shows the status of a specific deploy.
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
mastra studio deploy status <deploy-id>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
#### `--watch, -w`
|
|
251
|
+
|
|
252
|
+
Poll for status changes until the deploy reaches a terminal state.
|
|
253
|
+
|
|
254
|
+
### `mastra studio deploy logs`
|
|
255
|
+
|
|
256
|
+
Shows logs for a specific deploy.
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
mastra studio deploy logs <deploy-id>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### `--follow, -f`
|
|
263
|
+
|
|
264
|
+
Stream logs in real time.
|
|
265
|
+
|
|
266
|
+
#### `--tail`
|
|
267
|
+
|
|
268
|
+
Number of recent log lines to show.
|
|
269
|
+
|
|
270
|
+
### `mastra studio projects`
|
|
271
|
+
|
|
272
|
+
Lists all projects in the current organization.
|
|
273
|
+
|
|
274
|
+
### `mastra studio projects create`
|
|
275
|
+
|
|
276
|
+
Creates a new project through an interactive prompt.
|
|
277
|
+
|
|
278
|
+
## `mastra server deploy`
|
|
279
|
+
|
|
280
|
+
Builds and deploys your project to Server on Mastra platform. Works the same as [`mastra studio deploy`](#mastra-studio-deploy) with the same flags, arguments, and resolution logic.
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
mastra server deploy [dir]
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## `mastra auth`
|
|
287
|
+
|
|
288
|
+
Manages authentication for Mastra platform. Credentials are stored in `~/.mastra/credentials.json`. You can also set the `MASTRA_API_TOKEN` environment variable as an alternative to interactive login.
|
|
289
|
+
|
|
290
|
+
### `mastra auth login`
|
|
291
|
+
|
|
292
|
+
Opens a browser for login and stores the credentials locally.
|
|
293
|
+
|
|
294
|
+
### `mastra auth logout`
|
|
295
|
+
|
|
296
|
+
Removes stored credentials. If `MASTRA_API_TOKEN` is still set in the environment, the CLI warns that it will continue to be used.
|
|
297
|
+
|
|
298
|
+
### `mastra auth whoami`
|
|
299
|
+
|
|
300
|
+
Shows the current user email, user ID, and active organization.
|
|
301
|
+
|
|
302
|
+
### `mastra auth orgs`
|
|
303
|
+
|
|
304
|
+
Lists all organizations with your role in each. The current organization is marked.
|
|
305
|
+
|
|
306
|
+
#### `mastra auth orgs switch`
|
|
307
|
+
|
|
308
|
+
Switches the active organization through an interactive prompt. Cannot be used when `MASTRA_API_TOKEN` or `MASTRA_ORG_ID` environment variables are set.
|
|
309
|
+
|
|
310
|
+
### `mastra auth tokens`
|
|
311
|
+
|
|
312
|
+
Lists all API tokens with their last-used date.
|
|
313
|
+
|
|
314
|
+
#### `mastra auth tokens create`
|
|
315
|
+
|
|
316
|
+
Creates a new API token. The secret is displayed once and cannot be retrieved again.
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
mastra auth tokens create <name>
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
#### `mastra auth tokens revoke`
|
|
323
|
+
|
|
324
|
+
Revokes an API token.
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
mastra auth tokens revoke <token-id>
|
|
328
|
+
```
|
|
329
|
+
|
|
190
330
|
## `mastra lint`
|
|
191
331
|
|
|
192
332
|
The `mastra lint` command validates the structure and code of your Mastra project to ensure it follows best practices and is error-free.
|
|
@@ -445,20 +445,6 @@ console.log(result.success) // true
|
|
|
445
445
|
|
|
446
446
|
Both `Agent` (code-defined) and `StoredAgent` instances have methods for managing configuration versions. See the [Editor overview](https://mastra.ai/docs/editor/overview) for an introduction to version management.
|
|
447
447
|
|
|
448
|
-
### Server endpoints
|
|
449
|
-
|
|
450
|
-
Version management is also available through the stored agents REST API:
|
|
451
|
-
|
|
452
|
-
| Method | Endpoint | Description |
|
|
453
|
-
| -------- | ------------------------------------------------------------ | --------------------------------------- |
|
|
454
|
-
| `GET` | `/stored/agents/:agentId/versions` | List all versions. |
|
|
455
|
-
| `POST` | `/stored/agents/:agentId/versions` | Create a new version. |
|
|
456
|
-
| `GET` | `/stored/agents/:agentId/versions/:versionId` | Get a specific version. |
|
|
457
|
-
| `POST` | `/stored/agents/:agentId/versions/:versionId/activate` | Set the active version. |
|
|
458
|
-
| `POST` | `/stored/agents/:agentId/versions/:versionId/restore` | Restore a version (creates a new copy). |
|
|
459
|
-
| `DELETE` | `/stored/agents/:agentId/versions/:versionId` | Delete a version. |
|
|
460
|
-
| `GET` | `/stored/agents/:agentId/versions/compare?from=<id>&to=<id>` | Compare two versions. |
|
|
461
|
-
|
|
462
448
|
### Getting an agent with a specific version
|
|
463
449
|
|
|
464
450
|
Pass a version identifier when getting an agent:
|
|
@@ -442,7 +442,7 @@ const mastra = new Mastra({
|
|
|
442
442
|
|
|
443
443
|
When `mastra build` is run, Mastra bundles your project into the `.mastra/output` directory. This option controls which packages are excluded from the bundle (marked as "external") and installed separately through a package manager. This is useful when the internal Mastra bundler ([Rollup](https://rollupjs.org/configuration-options/#external)) has trouble bundling certain packages.
|
|
444
444
|
|
|
445
|
-
By default, `mastra build` sets this option to `true`.
|
|
445
|
+
By default, `mastra build` sets this option to `true`.
|
|
446
446
|
|
|
447
447
|
Here's an overview of what the different values mean:
|
|
448
448
|
|
package/.docs/reference/index.md
CHANGED
|
@@ -140,6 +140,7 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
140
140
|
- [.update()](https://mastra.ai/reference/datasets/update)
|
|
141
141
|
- [.updateItem()](https://mastra.ai/reference/datasets/updateItem)
|
|
142
142
|
- [Harness Class](https://mastra.ai/reference/harness/harness-class)
|
|
143
|
+
- [API Reference](https://mastra.ai/reference/mastra-platform/api)
|
|
143
144
|
- [Cloned Thread Utilities](https://mastra.ai/reference/memory/clone-utilities)
|
|
144
145
|
- [Memory Class](https://mastra.ai/reference/memory/memory-class)
|
|
145
146
|
- [Observational Memory](https://mastra.ai/reference/memory/observational-memory)
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
A Logger instance is created using `new PinoLogger()` and provides methods to record events at various severity levels.
|
|
4
4
|
|
|
5
|
-
When deploying to Mastra Cloud, logs are displayed on the [Logs](https://mastra.ai/docs/mastra-cloud/observability) page. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
|
|
6
|
-
|
|
7
5
|
## Usage example
|
|
8
6
|
|
|
9
7
|
```typescript
|