@mastra/mcp-docs-server 1.2.8-alpha.19 → 1.2.8-alpha.23

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 (33) hide show
  1. package/.docs/docs/getting-started/build-with-ai.md +2 -6
  2. package/.docs/docs/getting-started/manual-install.md +1 -1
  3. package/.docs/docs/long-running-agents/goals.md +3 -1
  4. package/.docs/docs/mastra-platform/observability.md +4 -12
  5. package/.docs/docs/mastra-platform/workspace.md +7 -7
  6. package/.docs/docs/observability/feedback.md +4 -0
  7. package/.docs/docs/server/auth/fga.md +40 -0
  8. package/.docs/guides/getting-started/quickstart.md +40 -25
  9. package/.docs/guides/index.md +1 -1
  10. package/.docs/models/environment-variables.md +2 -0
  11. package/.docs/models/gateways/netlify.md +3 -1
  12. package/.docs/models/gateways/openrouter.md +5 -2
  13. package/.docs/models/gateways/vercel.md +3 -1
  14. package/.docs/models/index.md +1 -1
  15. package/.docs/models/providers/aki-io.md +78 -0
  16. package/.docs/models/providers/cline-pass.md +82 -0
  17. package/.docs/models/providers/deepseek.md +3 -1
  18. package/.docs/models/providers/google.md +4 -2
  19. package/.docs/models/providers/inferx.md +3 -3
  20. package/.docs/models/providers/llmgateway.md +3 -1
  21. package/.docs/models/providers/opencode.md +4 -2
  22. package/.docs/models/providers/wandb.md +2 -1
  23. package/.docs/models/providers.md +2 -0
  24. package/.docs/reference/cli/create-mastra.md +118 -43
  25. package/.docs/reference/cli/mastra.md +34 -0
  26. package/.docs/reference/code-sdk/mount-agent-controller.md +3 -1
  27. package/.docs/reference/observability/tracing/exporters/posthog.md +39 -1
  28. package/.docs/reference/templates/overview.md +6 -32
  29. package/.docs/reference/workspace/platform-filesystem.md +2 -2
  30. package/.docs/reference/workspace/platform-sandbox.md +2 -2
  31. package/.docs/reference/workspace/railway-sandbox.md +37 -1
  32. package/CHANGELOG.md +14 -0
  33. package/package.json +5 -5
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![LLM Gateway logo](https://models.dev/logos/llmgateway.svg)LLM Gateway
4
4
 
5
- Access 171 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
5
+ Access 173 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [LLM Gateway documentation](https://llmgateway.io/docs).
8
8
 
@@ -64,6 +64,8 @@ for await (const chunk of stream) {
64
64
  | `llmgateway/gemini-3.1-flash-lite` | 1.0M | | | | | | $0.25 | $2 |
65
65
  | `llmgateway/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
66
66
  | `llmgateway/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
67
+ | `llmgateway/gemini-3.5-flash-lite` | 1.0M | | | | | | $0.30 | $3 |
68
+ | `llmgateway/gemini-3.6-flash` | 1.0M | | | | | | $2 | $8 |
67
69
  | `llmgateway/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
68
70
  | `llmgateway/gemma-4-26b-a4b-it` | 262K | | | | | | $0.07 | $0.34 |
69
71
  | `llmgateway/gemma-4-31b-it` | 262K | | | | | | $0.13 | $0.38 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![OpenCode Zen logo](https://models.dev/logos/opencode.svg)OpenCode Zen
4
4
 
5
- Access 55 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
5
+ Access 57 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [OpenCode Zen documentation](https://opencode.ai/docs/zen).
8
8
 
@@ -54,6 +54,8 @@ for await (const chunk of stream) {
54
54
  | `opencode/gemini-3-flash` | 1.0M | | | | | | $0.50 | $3 |
55
55
  | `opencode/gemini-3.1-pro` | 1.0M | | | | | | $2 | $12 |
56
56
  | `opencode/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
57
+ | `opencode/gemini-3.5-flash-lite` | 1.0M | | | | | | $0.30 | $3 |
58
+ | `opencode/gemini-3.6-flash` | 1.0M | | | | | | $2 | $8 |
57
59
  | `opencode/glm-5` | 205K | | | | | | $1 | $3 |
58
60
  | `opencode/glm-5.1` | 205K | | | | | | $1 | $4 |
59
61
  | `opencode/glm-5.2` | 1.0M | | | | | | $1 | $4 |
@@ -79,10 +81,10 @@ for await (const chunk of stream) {
79
81
  | `opencode/gpt-5.6-terra` | 1.1M | | | | | | $3 | $15 |
80
82
  | `opencode/grok-4.5` | 500K | | | | | | $2 | $6 |
81
83
  | `opencode/grok-build-0.1` | 256K | | | | | | $1 | $2 |
82
- | `opencode/hy3-free` | 190K | | | | | | — | — |
83
84
  | `opencode/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
84
85
  | `opencode/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
85
86
  | `opencode/kimi-k2.7-code` | 262K | | | | | | $0.95 | $4 |
87
+ | `opencode/laguna-s-2.1-free` | 256K | | | | | | — | — |
86
88
  | `opencode/mimo-v2.5-free` | 200K | | | | | | — | — |
87
89
  | `opencode/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
88
90
  | `opencode/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Weights & Biases logo](https://models.dev/logos/wandb.svg)Weights & Biases
4
4
 
5
- Access 25 Weights & Biases models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
5
+ Access 26 Weights & Biases models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Weights & Biases documentation](https://docs.wandb.ai).
8
8
 
@@ -46,6 +46,7 @@ for await (const chunk of stream) {
46
46
  | `wandb/meta-llama/Llama-3.1-8B-Instruct` | 128K | | | | | | $0.22 | $0.22 |
47
47
  | `wandb/meta-llama/Llama-3.3-70B-Instruct` | 128K | | | | | | $0.71 | $0.71 |
48
48
  | `wandb/MiniMaxAI/MiniMax-M2.5` | 197K | | | | | | $0.30 | $1 |
49
+ | `wandb/MiniMaxAI/MiniMax-M3` | 262K | | | | | | $0.29 | $1 |
49
50
  | `wandb/moonshotai/Kimi-K2.5` | 262K | | | | | | $0.60 | $3 |
50
51
  | `wandb/moonshotai/Kimi-K2.6` | 262K | | | | | | $0.95 | $4 |
51
52
  | `wandb/moonshotai/Kimi-K2.7-Code` | 262K | | | | | | $0.94 | $4 |
@@ -15,6 +15,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
15
15
  - [Abacus](https://mastra.ai/models/providers/abacus)
16
16
  - [abliteration.ai](https://mastra.ai/models/providers/abliteration-ai)
17
17
  - [AI-ROUTER](https://mastra.ai/models/providers/ai-router)
18
+ - [AKI.IO](https://mastra.ai/models/providers/aki-io)
18
19
  - [Alibaba](https://mastra.ai/models/providers/alibaba)
19
20
  - [Alibaba (China)](https://mastra.ai/models/providers/alibaba-cn)
20
21
  - [Alibaba Coding Plan](https://mastra.ai/models/providers/alibaba-coding-plan)
@@ -33,6 +34,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
33
34
  - [Chutes](https://mastra.ai/models/providers/chutes)
34
35
  - [Clarifai](https://mastra.ai/models/providers/clarifai)
35
36
  - [Claudinio](https://mastra.ai/models/providers/claudinio)
37
+ - [ClinePass](https://mastra.ai/models/providers/cline-pass)
36
38
  - [CloudFerro Sherlock](https://mastra.ai/models/providers/cloudferro-sherlock)
37
39
  - [Cloudflare Workers AI](https://mastra.ai/models/providers/cloudflare-workers-ai)
38
40
  - [Cortecs](https://mastra.ai/models/providers/cortecs)
@@ -2,9 +2,7 @@
2
2
 
3
3
  # create-mastra
4
4
 
5
- The `create-mastra` command **creates** a new standalone Mastra project. Use this command to scaffold a complete Mastra setup in a dedicated directory. You can run it with additional flags to customize the setup process.
6
-
7
- ## Usage
5
+ Create a standalone Mastra project. By default, `create-mastra` installs a default starter and configures it for your selected model provider.
8
6
 
9
7
  **npm**:
10
8
 
@@ -30,116 +28,193 @@ yarn dlx create-mastra@latest
30
28
  bun x create-mastra@latest
31
29
  ```
32
30
 
33
- `create-mastra` automatically runs in _interactive_ mode, but you can also specify your project name and template with command line arguments.
31
+ ## Creation modes
32
+
33
+ ### Default starter
34
+
35
+ The default starter creates an agent harness with workspace tools, memory, task tracking, web access, recurring schedules, storage, and observability. Select OpenAI, Anthropic, Gemini, or xAI as your model provider.
36
+
37
+ Provide both the project name and provider to create the project without prompts. This example uses Anthropic; you can also pass `openai`, `google`, or `xai`:
34
38
 
35
39
  **npm**:
36
40
 
37
41
  ```bash
38
- npx create-mastra@latest my-mastra-project -- --template coding-agent
42
+ npx create-mastra@latest my-mastra-project --llm anthropic
39
43
  ```
40
44
 
41
45
  **pnpm**:
42
46
 
43
47
  ```bash
44
- pnpm dlx create-mastra@latest my-mastra-project -- --template coding-agent
48
+ pnpm dlx create-mastra@latest my-mastra-project --llm anthropic
45
49
  ```
46
50
 
47
51
  **Yarn**:
48
52
 
49
53
  ```bash
50
- yarn dlx create-mastra@latest my-mastra-project -- --template coding-agent
54
+ yarn dlx create-mastra@latest my-mastra-project --llm anthropic
51
55
  ```
52
56
 
53
57
  **Bun**:
54
58
 
55
59
  ```bash
56
- bun x create-mastra@latest my-mastra-project -- --template coding-agent
60
+ bun x create-mastra@latest my-mastra-project --llm anthropic
61
+ ```
62
+
63
+ Omit `--llm` to select the provider and optionally enter its API key interactively. The interactive setup also offers to connect your project to the Mastra platform. If enabled, the command opens the browser authentication flow, creates a platform project with the same name as the local project, and writes `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` to `.env`.
64
+
65
+ ### Template
66
+
67
+ Use a template slug or a public GitHub URL:
68
+
69
+ **npm**:
70
+
71
+ ```bash
72
+ npx create-mastra@latest my-mastra-project --template agent-harness
73
+ ```
74
+
75
+ **pnpm**:
76
+
77
+ ```bash
78
+ pnpm dlx create-mastra@latest my-mastra-project --template agent-harness
79
+ ```
80
+
81
+ **Yarn**:
82
+
83
+ ```bash
84
+ yarn dlx create-mastra@latest my-mastra-project --template agent-harness
85
+ ```
86
+
87
+ **Bun**:
88
+
89
+ ```bash
90
+ bun x create-mastra@latest my-mastra-project --template agent-harness
91
+ ```
92
+
93
+ **npm**:
94
+
95
+ ```bash
96
+ npx create-mastra@latest my-mastra-project --template https://github.com/mastra-ai/template-agent-harness
97
+ ```
98
+
99
+ **pnpm**:
100
+
101
+ ```bash
102
+ pnpm dlx create-mastra@latest my-mastra-project --template https://github.com/mastra-ai/template-agent-harness
57
103
  ```
58
104
 
59
- Check out the [full list](https://mastra.ai/api/templates.json) of templates and use the `slug` as input to the `--template` CLI flag.
105
+ **Yarn**:
60
106
 
61
- You can also use any GitHub repo as a template (it has to be a valid Mastra project):
107
+ ```bash
108
+ yarn dlx create-mastra@latest my-mastra-project --template https://github.com/mastra-ai/template-agent-harness
109
+ ```
110
+
111
+ **Bun**:
62
112
 
63
113
  ```bash
64
- npx create-mastra@latest my-mastra-project -- --template mastra-ai/template-coding-agent
114
+ bun x create-mastra@latest my-mastra-project --template https://github.com/mastra-ai/template-agent-harness
65
115
  ```
66
116
 
67
- You can install Mastra skills for specific agents during project creation:
117
+ Leave the template value blank to select a template interactively:
68
118
 
69
119
  **npm**:
70
120
 
71
121
  ```bash
72
- npx create-mastra@latest my-project -- --default --skills claude-code,cursor
122
+ npx create-mastra@latest my-mastra-project --template
73
123
  ```
74
124
 
75
125
  **pnpm**:
76
126
 
77
127
  ```bash
78
- pnpm dlx create-mastra@latest my-project -- --default --skills claude-code,cursor
128
+ pnpm dlx create-mastra@latest my-mastra-project --template
79
129
  ```
80
130
 
81
131
  **Yarn**:
82
132
 
83
133
  ```bash
84
- yarn dlx create-mastra@latest my-project -- --default --skills claude-code,cursor
134
+ yarn dlx create-mastra@latest my-mastra-project --template
85
135
  ```
86
136
 
87
137
  **Bun**:
88
138
 
89
139
  ```bash
90
- bun x create-mastra@latest my-project -- --default --skills claude-code,cursor
140
+ bun x create-mastra@latest my-mastra-project --template
91
141
  ```
92
142
 
93
- ## CLI flags
143
+ Template authors own their dependencies, models, environment variables, and source code. `create-mastra` doesn't apply `--llm` or `--llm-api-key`.
94
144
 
95
- Instead of an interactive prompt you can also define these CLI flags.
145
+ ### Empty scaffold
96
146
 
97
- **--version** (`boolean`): Output the version number
147
+ Use `--empty` to create a provider-free project without agents, examples, model SDKs, or environment files:
98
148
 
99
- **--project-name** (`string`): Project name that will be used in package.json and as the project directory name
149
+ **npm**:
100
150
 
101
- **--default** (`boolean`): Quickstart with defaults (src, OpenAI, no examples)
151
+ ```bash
152
+ npx create-mastra@latest my-empty-project --empty
153
+ ```
102
154
 
103
- **--components** (`string`): Comma-separated list of components (agents, tools, workflows, scorers)
155
+ **pnpm**:
104
156
 
105
- **--llm** (`string`): Default model provider (openai, anthropic, groq, google, or cerebras)
157
+ ```bash
158
+ pnpm dlx create-mastra@latest my-empty-project --empty
159
+ ```
106
160
 
107
- **--llm-api-key** (`string`): API key for the model provider
161
+ **Yarn**:
108
162
 
109
- **--example** (`boolean`): Include example code
163
+ ```bash
164
+ yarn dlx create-mastra@latest my-empty-project --empty
165
+ ```
166
+
167
+ **Bun**:
110
168
 
111
- **--no-example** (`boolean`): Do not include example code
169
+ ```bash
170
+ bun x create-mastra@latest my-empty-project --empty
171
+ ```
112
172
 
113
- **--template** (`string`): Create project from a template (use template name, public GitHub URL, or leave blank to select from list)
173
+ ## Automatic setup
114
174
 
115
- **--timeout** (`number`): Configurable timeout for package installation, defaults to 60000 ms
175
+ After installing dependencies, the command:
116
176
 
117
- **--dir** (`string`): Target directory for Mastra source code (default: src/)
177
+ 1. Detects supported coding assistants on `PATH` and installs Mastra skills. If none are detected, it installs universal skills.
178
+ 2. Creates an initial Git commit when the current directory and generated project aren't already inside Git repositories.
118
179
 
119
- **--mcp** (`string`): MCP Server for code editor (cursor, cursor-global, windsurf, vscode)
180
+ Use `--no-skills` or `--no-git` to skip these steps. Skills and Git setup failures produce warnings but don't remove a successfully created project.
120
181
 
121
- **--skills** (`string`): Comma-separated list of agents to install Mastra skills for (e.g., claude-code,cursor,windsurf)
182
+ ## Conflicts and validation
122
183
 
123
- **--observability** (`boolean`): Enable Observability on the Mastra platform during project creation. This opens browser login when needed, prompts for an organization, provisions a platform project, and configures the observability exporters.
184
+ - `--empty` and `--template` can't be used together.
185
+ - `--llm` and `--llm-api-key` are only valid for the default starter project.
186
+ - The project name must be a safe, lowercase, single directory name and the target must not already exist.
124
187
 
125
- **--no-observability** (`boolean`): Skip the Observability prompt during project creation.
188
+ Invalid input is rejected before templates are fetched or files are created.
126
189
 
127
- **--observability-project** (`string`): Set the platform project name to use when Mastra Observability is enabled.
190
+ ## Arguments and flags
128
191
 
129
- **--help** (`boolean`): Display help for command
192
+ **\[project-name]** (`string`): Project directory and package name. When omitted, the command prompts for it.
130
193
 
131
- ## Telemetry
194
+ **--empty** (`boolean`): Create a minimal, provider-free Mastra project.
132
195
 
133
- By default, Mastra collects anonymous information about your project like your OS, Mastra version or Node.js version. You can read the [source code](https://github.com/mastra-ai/mastra/blob/main/packages/cli/src/analytics/index.ts) to check what's collected.
196
+ **-l, --llm \<provider>** (`string`): Managed agent-harness provider: openai, anthropic, google, or xai.
134
197
 
135
- You can opt out of the CLI analytics by setting an environment variable:
198
+ **-k, --llm-api-key \<key>** (`string`): Write the selected provider API key to the generated .env file.
136
199
 
137
- ```bash
138
- MASTRA_TELEMETRY_DISABLED=1
139
- ```
200
+ **--no-skills** (`boolean`): Skip automatic Mastra skills installation.
201
+
202
+ **--no-git** (`boolean`): Skip automatic Git initialization and the initial commit.
203
+
204
+ **-t, --template \[template]** (`string`): Use a template slug or public GitHub URL. Omit the value to select interactively.
205
+
206
+ **--timeout \<milliseconds>** (`number`): Positive integer timeout for dependency installation. Defaults to 60000.
207
+
208
+ **--version** (`boolean`): Print the create-mastra version.
209
+
210
+ **--help** (`boolean`): Display command help.
211
+
212
+ ## Telemetry
213
+
214
+ Mastra collects anonymous CLI usage information, such as the operating system, Mastra version, and Node.js version. You can review the [analytics source](https://github.com/mastra-ai/mastra/blob/main/packages/cli/src/analytics/index.ts).
140
215
 
141
- You can also set this while using other `mastra` commands:
216
+ Set `MASTRA_TELEMETRY_DISABLED=1` to opt out:
142
217
 
143
218
  ```bash
144
- MASTRA_TELEMETRY_DISABLED=1 npx create-mastra@latest
219
+ MASTRA_TELEMETRY_DISABLED=1 npx create-mastra@latest my-project --empty
145
220
  ```
@@ -804,6 +804,40 @@ Use the [`list`](#list) command to get the correct ID.
804
804
 
805
805
  List all available scorer templates. Use the ID for the `add` command.
806
806
 
807
+ ## `mastra create`
808
+
809
+ Create a standalone Mastra project with the same project-creation flow as [`create-mastra`](https://mastra.ai/reference/cli/create-mastra).
810
+
811
+ **npm**:
812
+
813
+ ```bash
814
+ npx mastra@latest create
815
+ ```
816
+
817
+ **pnpm**:
818
+
819
+ ```bash
820
+ pnpm dlx mastra@latest create
821
+ ```
822
+
823
+ **Yarn**:
824
+
825
+ ```bash
826
+ yarn dlx mastra@latest create
827
+ ```
828
+
829
+ **Bun**:
830
+
831
+ ```bash
832
+ bun x mastra@latest create
833
+ ```
834
+
835
+ Providing both the project name and `--llm` skips the interactive setup prompts. Use `--template [template]` for an arbitrary template or `--empty` for a minimal provider-free scaffold.
836
+
837
+ The command installs Mastra skills for detected coding assistants and initializes Git when appropriate. Use `--no-skills` or `--no-git` to opt out.
838
+
839
+ See the [`create-mastra` reference](https://mastra.ai/reference/cli/create-mastra) for mode behavior, conflicts, validation, and complete flag descriptions.
840
+
807
841
  ## `mastra init`
808
842
 
809
843
  The `mastra init` command initializes Mastra in an existing project. Use this command to scaffold the necessary folders and configuration without generating a new project from scratch.
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Beta:** The `@mastra/code-sdk` package is experimental and subject to breaking changes in minor versions.
6
6
 
7
- The `mountAgentControllerOnMastra()` function builds the Mastra Code agent controller the coding agent behind the [`mastracode`](https://www.npmjs.com/package/mastracode) CLI, with its modes, tools, memory, and thread management and registers it on a server-owned [Mastra](https://mastra.ai/reference/core/mastra-class) instance. Use it to serve the Mastra Code agent to your own UI (web app, editor, bot): each client creates or resumes its own isolated session through the returned [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class).
7
+ The `mountAgentControllerOnMastra()` function builds the Mastra Code agent controller (the coding agent behind the [`mastracode`](https://www.npmjs.com/package/mastracode) CLI, with its modes, tools, memory, and thread management) and registers it on a server-owned [Mastra](https://mastra.ai/reference/core/mastra-class) instance. Use it to serve the Mastra Code agent to your own UI (web app, editor, bot): each client creates or resumes its own isolated session through the returned [`AgentController`](https://mastra.ai/reference/agent-controller/agent-controller-class).
8
8
 
9
9
  To construct the `Mastra` instance yourself (for example in a deployable entry file), use `prepareAgentControllerMount()` from the same package, which returns the constructor args plus a `finalize()` callback.
10
10
 
@@ -48,6 +48,8 @@ const { controller } = await mountAgentControllerOnMastra({ mastra })
48
48
 
49
49
  **postToolObserver** (`(context: ToolAfterHookContext) => void | Promise<void>`): Observes completed tool calls without replacing the tool or changing hook-manager behavior. Observer errors are logged and do not fail successful tool calls.
50
50
 
51
+ **inputProcessors** (`InputProcessor[]`): Stateless input processors prepended before Mastra Code's mandatory safety and compatibility processors. Custom processors extend the pipeline but can't replace the built-in processors.
52
+
51
53
  **disabledTools** (`string[]`): Tools removed from the dynamic tool set before exposure to the model.
52
54
 
53
55
  **storage** (`StorageConfig`): Custom storage config instead of the auto-detected default.
@@ -39,6 +39,14 @@ async exportTracingEvent(event: TracingEvent): Promise<void>
39
39
 
40
40
  Exports a tracing event to PostHog.
41
41
 
42
+ ### `onFeedbackEvent`
43
+
44
+ ```typescript
45
+ async onFeedbackEvent(event: FeedbackEvent): Promise<void>
46
+ ```
47
+
48
+ Exports a feedback event to PostHog. See [Feedback export](#feedback-export).
49
+
42
50
  ### flush
43
51
 
44
52
  ```typescript
@@ -92,4 +100,34 @@ const exporter = new PosthogExporter({
92
100
  | `AGENT_RUN` | `$ai_span` |
93
101
  | `WORKFLOW_RUN` | `$ai_span` |
94
102
  | All other workflows | `$ai_span` |
95
- | `GENERIC` | `$ai_span` |
103
+ | `GENERIC` | `$ai_span` |
104
+
105
+ ## Feedback export
106
+
107
+ Feedback recorded with [`addFeedback()`](https://mastra.ai/docs/observability/feedback) is exported to PostHog as a native `$ai_feedback` event. PostHog shows it as **User feedback** on the linked trace. No extra configuration is needed.
108
+
109
+ ```typescript
110
+ const trace = await mastra.observability.getRecordedTrace({ traceId })
111
+ await trace.addFeedback({
112
+ feedbackType: 'thumbs',
113
+ value: 'down',
114
+ comment: 'Wrong answer',
115
+ })
116
+ ```
117
+
118
+ Feedback events map to these PostHog properties:
119
+
120
+ | Mastra feedback field | PostHog property |
121
+ | -------------------------------------- | ------------------- |
122
+ | `traceId` | `$ai_trace_id` |
123
+ | `comment` (or `value` when no comment) | `$ai_feedback_text` |
124
+ | `feedbackId` | `feedback_id` |
125
+ | `feedbackType` | `feedback_type` |
126
+ | `value` | `feedback_value` |
127
+ | `feedbackSource` | `feedback_source` |
128
+ | `spanId` | `span_id` |
129
+ | `sourceId` | `source_id` |
130
+ | `metadata.sessionId` | `$ai_session_id` |
131
+ | `metadata` (other keys) | custom properties |
132
+
133
+ Feedback without a `traceId` is dropped because PostHog anchors feedback to a trace through `$ai_trace_id`. The event's distinct ID resolves from `feedbackUserId`, then `metadata.userId`, then `defaultDistinctId`, then `anonymous`.
@@ -30,28 +30,28 @@ Install a template using the `create-mastra` command:
30
30
  **npm**:
31
31
 
32
32
  ```sh
33
- npx create-mastra@latest --template template-name
33
+ npx create-mastra@latest my-project --template template-name
34
34
  ```
35
35
 
36
36
  **pnpm**:
37
37
 
38
38
  ```sh
39
- pnpm dlx create-mastra@latest --template template-name
39
+ pnpm dlx create-mastra@latest my-project --template template-name
40
40
  ```
41
41
 
42
42
  **Yarn**:
43
43
 
44
44
  ```sh
45
- yarn dlx create-mastra@latest --template template-name
45
+ yarn dlx create-mastra@latest my-project --template template-name
46
46
  ```
47
47
 
48
48
  **Bun**:
49
49
 
50
50
  ```sh
51
- bun x create-mastra@latest --template template-name
51
+ bun x create-mastra@latest my-project --template template-name
52
52
  ```
53
53
 
54
- This creates a complete project with all necessary code and configuration.
54
+ This creates a complete project and installs its dependencies. The template author controls the models, provider dependencies, environment variables, and source code.
55
55
 
56
56
  ### Setup Process
57
57
 
@@ -71,33 +71,7 @@ After installation:
71
71
 
72
72
  Edit `.env` with required API keys as documented in the template's README.
73
73
 
74
- 3. **Install dependencies** (if not done automatically):
75
-
76
- **npm**:
77
-
78
- ```sh
79
- npm install
80
- ```
81
-
82
- **pnpm**:
83
-
84
- ```sh
85
- pnpm install
86
- ```
87
-
88
- **Yarn**:
89
-
90
- ```sh
91
- yarn install
92
- ```
93
-
94
- **Bun**:
95
-
96
- ```sh
97
- bun install
98
- ```
99
-
100
- 4. **Start development server**:
74
+ 3. **Start development server**:
101
75
 
102
76
  **npm**:
103
77
 
@@ -39,7 +39,7 @@ Configure the platform credentials. The access token, project ID, and bucket nam
39
39
  **.env file**:
40
40
 
41
41
  ```bash
42
- MASTRA_PLATFORM_ACCESS_TOKEN=your-platform-access-token
42
+ MASTRA_PLATFORM_SECRET_KEY=your-platform-secret-key
43
43
  MASTRA_PROJECT_ID=your-project-id
44
44
  MASTRA_PLATFORM_BUCKET_NAME=your-bucket-name
45
45
  ```
@@ -116,7 +116,7 @@ await fs.writeFile('/analyses/repo.md', 'x') // throws WorkspaceReadOnlyError
116
116
 
117
117
  ## Constructor parameters
118
118
 
119
- **accessToken** (`string`): Platform access token. Falls back to the MASTRA\_PLATFORM\_ACCESS\_TOKEN environment variable.
119
+ **accessToken** (`string`): Platform secret key. Falls back to the MASTRA\_PLATFORM\_SECRET\_KEY environment variable (MASTRA\_PLATFORM\_ACCESS\_TOKEN is a deprecated fallback).
120
120
 
121
121
  **projectId** (`string`): Platform project ID. Falls back to the MASTRA\_PROJECT\_ID environment variable.
122
122
 
@@ -39,7 +39,7 @@ Configure the platform credentials. The access token, project ID, and environmen
39
39
  **.env file**:
40
40
 
41
41
  ```bash
42
- MASTRA_PLATFORM_ACCESS_TOKEN=your-platform-access-token
42
+ MASTRA_PLATFORM_SECRET_KEY=your-platform-secret-key
43
43
  MASTRA_PROJECT_ID=your-project-id
44
44
  MASTRA_ENVIRONMENT_ID=your-environment-id
45
45
  ```
@@ -135,7 +135,7 @@ console.log(result.exitCode)
135
135
 
136
136
  ## Constructor parameters
137
137
 
138
- **accessToken** (`string`): Platform access token. Falls back to the MASTRA\_PLATFORM\_ACCESS\_TOKEN environment variable.
138
+ **accessToken** (`string`): Platform secret key. Falls back to the MASTRA\_PLATFORM\_SECRET\_KEY environment variable (MASTRA\_PLATFORM\_ACCESS\_TOKEN is a deprecated fallback).
139
139
 
140
140
  **projectId** (`string`): Platform project ID. Falls back to the MASTRA\_PROJECT\_ID environment variable.
141
141
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # RailwaySandbox
4
4
 
5
- Executes commands in ephemeral, isolated [Railway](https://docs.railway.com/sandboxes) sandboxes. Each sandbox is an isolated Debian Linux VM provisioned on demand through the Railway TypeScript SDK. Supports command execution with streaming output, command timeouts, configurable idle timeout, `ISOLATED`/`PRIVATE` network isolation, custom base images via the Railway template builder, forking a running sandbox, and reattaching to an existing sandbox by ID. For interface details, see [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox).
5
+ Executes commands in ephemeral, isolated [Railway](https://docs.railway.com/sandboxes) sandboxes. Each sandbox is an isolated Debian Linux VM provisioned on demand through the Railway TypeScript SDK. Supports command execution with streaming output, command timeouts, configurable idle timeout, `ISOLATED`/`PRIVATE` network isolation, custom base images via the Railway template builder, checkpoint-backed recovery, forking a running sandbox, and reattaching to an existing sandbox by ID. For interface details, see [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox).
6
6
 
7
7
  ## Installation
8
8
 
@@ -128,6 +128,38 @@ console.log(result.stdout)
128
128
 
129
129
  The forked sandbox inherits the parent's credentials and defaults unless overridden via the `fork()` options.
130
130
 
131
+ ### Checkpoint recovery
132
+
133
+ Set `checkpointName` to preserve a sandbox filesystem across Railway sandbox replacement. On `start()`, `RailwaySandbox` first tries to create the sandbox from the named checkpoint. If the checkpoint is missing, it creates a sandbox from the configured template or default image, then captures the checkpoint.
134
+
135
+ ```typescript
136
+ const sandbox = new RailwaySandbox({
137
+ checkpointName: 'project-session-42',
138
+ idleTimeoutMinutes: 30,
139
+ })
140
+ ```
141
+
142
+ `RailwaySandbox` refreshes the checkpoint shortly before the idle timeout. Recovery restores the latest successful checkpoint. It doesn't restore running processes or filesystem writes made after the last checkpoint.
143
+
144
+ Use one stable checkpoint name for each independent filesystem. Do not share a checkpoint name across unrelated sessions or projects.
145
+
146
+ ### Derived sandbox checkpoints
147
+
148
+ Use `derive({ checkpointName })` when a configured `RailwaySandbox` acts as the template for a sandbox fleet:
149
+
150
+ ```typescript
151
+ const template = new RailwaySandbox({ idleTimeoutMinutes: 30 })
152
+
153
+ const sessionSandbox = template.derive({
154
+ id: 'session-42',
155
+ checkpointName: 'project-session-42',
156
+ })
157
+
158
+ await sessionSandbox.start()
159
+ ```
160
+
161
+ A derived sandbox uses the checkpoint passed to `derive()`. If no override is passed, it inherits the template sandbox's `checkpointName`.
162
+
131
163
  ### Streaming output
132
164
 
133
165
  Stream command output in real time via `onStdout` and `onStderr` callbacks:
@@ -162,6 +194,8 @@ const result = await sandbox.executeCommand('cat', ['/tmp/state.txt'])
162
194
 
163
195
  **sandboxId** (`string`): Reattach to an existing Railway sandbox by its Railway ID instead of creating a new one. When set, start() calls Sandbox.connect().
164
196
 
197
+ **checkpointName** (`string`): Named Railway checkpoint used to seed new sandboxes and preserve the filesystem before idle teardown. Use a unique stable name for each independent filesystem.
198
+
165
199
  **idleTimeoutMinutes** (`number`): How long the sandbox can sit idle (no exec interaction) before Railway destroys it automatically. The valid range and default depend on your Railway plan.
166
200
 
167
201
  **networkIsolation** (`'ISOLATED' | 'PRIVATE'`): Network access mode. 'ISOLATED' allows outbound internet only; 'PRIVATE' joins the environment's private network. (Default: `'ISOLATED'`)
@@ -192,6 +226,8 @@ const result = await sandbox.executeCommand('cat', ['/tmp/state.txt'])
192
226
 
193
227
  **fork** (`(options?) => Promise<RailwaySandbox>`): Clone this running sandbox into a new, independent RailwaySandbox. The returned sandbox is already started and reattached to the forked Railway sandbox. Accepts optional id, idleTimeoutMinutes, networkIsolation, and env overrides. Throws SandboxNotReadyError if this sandbox has not been started.
194
228
 
229
+ **derive** (`(options?) => RailwaySandbox`): Construct an unstarted sibling sandbox that inherits credentials and defaults. Accepts optional id, sandboxId, env, idleTimeoutMinutes, and checkpointName overrides. The derived sandbox uses options.checkpointName when set, otherwise it inherits the template checkpointName.
230
+
195
231
  ## Background processes
196
232
 
197
233
  `RailwaySandbox` includes a built-in process manager for spawning and managing background processes. Each spawned process runs as a Railway `exec` session.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.8-alpha.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`c7d30cd`](https://github.com/mastra-ai/mastra/commit/c7d30cd86009c407df91105591f03cd6e3d2854d), [`ef03fbc`](https://github.com/mastra-ai/mastra/commit/ef03fbcc556bcbc04c9b3d06fab88771ecaa043c), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`a7bbe77`](https://github.com/mastra-ai/mastra/commit/a7bbe773577f60bc4761b534ef7ec6b476332dad), [`4e68363`](https://github.com/mastra-ai/mastra/commit/4e683634f94ebd062d26a3bb6093a8dfc7263d37), [`9251370`](https://github.com/mastra-ai/mastra/commit/9251370ad413af464aa22d7566338bec5613e8de)]:
8
+ - @mastra/core@1.52.0-alpha.11
9
+
10
+ ## 1.2.8-alpha.20
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`41a5392`](https://github.com/mastra-ai/mastra/commit/41a5392d9f6c5e18d6b227f0fc0ddf49c50774e9), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`da009e1`](https://github.com/mastra-ai/mastra/commit/da009e1aacd89ed94b8d1b2af09c9d4fe7c4db49), [`35c2181`](https://github.com/mastra-ai/mastra/commit/35c2181e6a50e47c90ba36260db7c9723d54696f), [`b4b7ea8`](https://github.com/mastra-ai/mastra/commit/b4b7ea8733f033fc441ea47ed03f6afb17ec2248), [`675fbff`](https://github.com/mastra-ai/mastra/commit/675fbff84d3274391b33e852f76083c38a5514e5), [`c328769`](https://github.com/mastra-ai/mastra/commit/c3287698ff8ef98dba86d415faa566fa3e5f4d56), [`232fcbc`](https://github.com/mastra-ai/mastra/commit/232fcbc14fce625dd672ba043329c0b732c62be2), [`3491666`](https://github.com/mastra-ai/mastra/commit/34916663c4fdd43b48c21f4ab2d5fb6dcccc94f9)]:
15
+ - @mastra/core@1.52.0-alpha.10
16
+
3
17
  ## 1.2.8-alpha.18
4
18
 
5
19
  ### Patch Changes