@mastra/mcp-docs-server 1.2.7-alpha.8 → 1.2.8-alpha.0
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/agent-builder/integrations.md +44 -2
- package/.docs/docs/agent-builder/skill-registries.md +1 -3
- package/.docs/docs/agent-controller/overview.md +1 -1
- package/.docs/docs/agent-controller/session.md +1 -3
- package/.docs/docs/agents/code-mode.md +17 -1
- package/.docs/docs/agents/guardrails.md +8 -8
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/processors.md +9 -3
- package/.docs/docs/agents/skills.md +2 -4
- package/.docs/docs/agents/structured-output.md +1 -1
- package/.docs/docs/agents/supervisor-agents.md +1 -3
- package/.docs/docs/agents/using-tools.md +4 -4
- package/.docs/docs/browser/agent-browser.md +1 -3
- package/.docs/docs/browser/browser-viewer.md +1 -3
- package/.docs/docs/browser/stagehand.md +1 -1
- package/.docs/docs/capabilities/channels/overview.md +1 -3
- package/.docs/docs/deployment/mastra-server.md +2 -4
- package/.docs/docs/editor/overview.md +2 -6
- package/.docs/docs/editor/prompts.md +1 -1
- package/.docs/docs/editor/tools.md +3 -5
- package/.docs/docs/evals/custom-scorers.md +1 -3
- package/.docs/docs/evals/datasets/overview.md +4 -4
- package/.docs/docs/evals/datasets/running-experiments.md +4 -2
- package/.docs/docs/evals/evals-with-memory.md +1 -3
- package/.docs/docs/evals/gates-and-verdicts.md +17 -2
- package/.docs/docs/evals/quick-checks.md +1 -3
- package/.docs/docs/getting-started/file-based-agents.md +9 -4
- package/.docs/docs/long-running-agents/background-tasks.md +1 -1
- package/.docs/docs/long-running-agents/durable-agents.md +3 -5
- package/.docs/docs/long-running-agents/goals.md +1 -3
- package/.docs/docs/long-running-agents/signal-providers.md +1 -3
- package/.docs/docs/long-running-agents/signals.md +7 -21
- package/.docs/docs/mastra-platform/configuration.md +15 -22
- package/.docs/docs/mastra-platform/database.md +50 -6
- package/.docs/docs/mastra-platform/deploy.md +142 -0
- package/.docs/docs/mastra-platform/environments.md +103 -0
- package/.docs/docs/mastra-platform/github.md +2 -2
- package/.docs/docs/mastra-platform/overview.md +5 -5
- package/.docs/docs/mastra-platform/server.md +2 -0
- package/.docs/docs/mastra-platform/studio.md +5 -3
- package/.docs/docs/mcp/mcp-apps.md +3 -3
- package/.docs/docs/mcp/overview.md +6 -10
- package/.docs/docs/memory/overview.md +4 -4
- package/.docs/docs/observability/integrations/exporters/mastra-platform.md +1 -3
- package/.docs/docs/observability/logging.md +3 -1
- package/.docs/docs/observability/metrics/querying.md +2 -0
- package/.docs/docs/observability/tracing/overview.md +3 -1
- package/.docs/docs/server/auth/auth0.md +1 -1
- package/.docs/docs/server/auth/better-auth.md +2 -2
- package/.docs/docs/server/auth/clerk.md +1 -1
- package/.docs/docs/server/auth/firebase.md +1 -1
- package/.docs/docs/server/auth/google.md +2 -2
- package/.docs/docs/server/auth/jwt.md +2 -2
- package/.docs/docs/server/auth/okta.md +2 -2
- package/.docs/docs/server/auth/workos.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/mastra-server.md +1 -1
- package/.docs/docs/server/pubsub.md +1 -1
- package/.docs/docs/server/request-context.md +4 -4
- package/.docs/docs/server/server-adapters.md +8 -8
- package/.docs/docs/studio/auth.md +1 -3
- package/.docs/docs/workflows/agents-and-tools.md +3 -5
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/overview.md +5 -5
- package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
- package/.docs/guides/build-your-ui/copilotkit/overview.md +1 -1
- package/.docs/guides/concepts/streaming.md +3 -3
- package/.docs/guides/guide/chef-michel.md +1 -1
- package/.docs/guides/guide/coding-agent.md +392 -0
- package/.docs/guides/migrations/mastra-cloud.md +5 -12
- package/.docs/models/environment-variables.md +14 -2
- package/.docs/models/gateways/azure-openai.md +15 -15
- package/.docs/models/gateways/mastra.md +2 -2
- package/.docs/models/gateways/openrouter.md +4 -7
- package/.docs/models/gateways/vercel.md +5 -10
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/abacus.md +44 -14
- package/.docs/models/providers/ai-router.md +77 -0
- package/.docs/models/providers/ambient.md +10 -6
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/blueclaw.md +74 -0
- package/.docs/models/providers/crossmodel.md +8 -2
- package/.docs/models/providers/daoxe.md +81 -0
- package/.docs/models/providers/databricks.md +7 -2
- package/.docs/models/providers/deepinfra.md +2 -2
- package/.docs/models/providers/deepseek.md +2 -2
- package/.docs/models/providers/ebcloud.md +76 -0
- package/.docs/models/providers/empiriolabs.md +108 -0
- package/.docs/models/providers/google.md +4 -0
- package/.docs/models/providers/hpc-ai.md +16 -10
- package/.docs/models/providers/inferx.md +78 -0
- package/.docs/models/providers/llmgateway.md +2 -8
- package/.docs/models/providers/lynkr.md +73 -0
- package/.docs/models/providers/model-oracle-ai.md +87 -0
- package/.docs/models/providers/neon.md +1 -1
- package/.docs/models/providers/nvidia.md +1 -3
- package/.docs/models/providers/openai.md +12 -3
- package/.docs/models/providers/opencode.md +5 -2
- package/.docs/models/providers/pioneer.md +148 -0
- package/.docs/models/providers/routing-run.md +4 -1
- package/.docs/models/providers/snowflake-cortex.md +4 -1
- package/.docs/models/providers/stepfun-ai-step-plan.md +75 -0
- package/.docs/models/providers/stepfun-ai.md +6 -6
- package/.docs/models/providers/stepfun-step-plan.md +76 -0
- package/.docs/models/providers/stepfun.md +5 -5
- package/.docs/models/providers/unorouter.md +95 -0
- package/.docs/models/providers/vivgrid.md +5 -2
- package/.docs/models/providers/wafer.ai.md +9 -12
- package/.docs/models/providers/xai.md +1 -1
- package/.docs/models/providers/zenmux.md +5 -1
- package/.docs/models/providers.md +14 -2
- package/.docs/reference/agents/generateLegacy.md +8 -2
- package/.docs/reference/cli/mastra.md +131 -10
- package/.docs/reference/code-sdk/mount-agent-controller.md +2 -0
- package/.docs/reference/coding-agent/create-coding-agent.md +5 -4
- package/.docs/reference/evals/create-scorer.md +63 -0
- package/.docs/reference/evals/run-evals.md +2 -2
- package/.docs/reference/file-based-agents/logger.md +26 -0
- package/.docs/reference/file-based-agents/scorers.md +54 -0
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/mastra-platform/api.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +8 -8
- package/.docs/reference/observability/tracing/exporters/braintrust.md +1 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +10 -9
- package/.docs/reference/observability/tracing/exporters/langsmith.md +8 -7
- package/.docs/reference/observability/tracing/exporters/posthog.md +13 -12
- package/.docs/reference/observability/tracing/exporters/sentry.md +1 -0
- package/.docs/reference/observability/tracing/interfaces.md +9 -0
- package/.docs/reference/processors/stream-error-retry-processor.md +39 -2
- package/.docs/reference/pubsub/base.md +10 -0
- package/.docs/reference/pubsub/caching-pubsub.md +8 -0
- package/.docs/reference/pubsub/redis-streams.md +12 -0
- package/.docs/reference/server/express-adapter.md +1 -3
- package/.docs/reference/server/fastify-adapter.md +1 -3
- package/.docs/reference/server/hono-adapter.md +1 -3
- package/.docs/reference/server/koa-adapter.md +1 -3
- package/.docs/reference/server/nestjs-adapter.md +1 -3
- package/.docs/reference/server/register-api-route.md +5 -4
- package/.docs/reference/templates/overview.md +1 -1
- package/.docs/reference/tools/mcp-client.md +22 -0
- package/.docs/reference/tools/mcp-server.md +161 -4
- package/.docs/reference/voice/google.md +48 -8
- package/.docs/reference/voice/speechify.md +10 -6
- package/.docs/reference/workspace/agentcore-runtime-sandbox.md +1 -3
- package/.docs/reference/workspace/agentfs-filesystem.md +1 -3
- package/.docs/reference/workspace/apple-container-sandbox.md +1 -3
- package/.docs/reference/workspace/archil-filesystem.md +1 -3
- package/.docs/reference/workspace/azure-blob-filesystem.md +1 -3
- package/.docs/reference/workspace/blaxel-sandbox.md +1 -3
- package/.docs/reference/workspace/daytona-sandbox.md +1 -3
- package/.docs/reference/workspace/docker-sandbox.md +1 -3
- package/.docs/reference/workspace/e2b-sandbox.md +20 -3
- package/.docs/reference/workspace/files-sdk-filesystem.md +1 -3
- package/.docs/reference/workspace/gcs-filesystem.md +1 -3
- package/.docs/reference/workspace/google-drive-filesystem.md +1 -3
- package/.docs/reference/workspace/local-filesystem.md +1 -3
- package/.docs/reference/workspace/local-sandbox.md +1 -3
- package/.docs/reference/workspace/modal-sandbox.md +1 -3
- package/.docs/reference/workspace/railway-sandbox.md +1 -3
- package/.docs/reference/workspace/s3-filesystem.md +1 -3
- package/.docs/reference/workspace/vercel-sandbox.md +5 -7
- package/.docs/reference/workspace/vercel-serverless.md +1 -3
- package/CHANGELOG.md +79 -0
- package/package.json +10 -10
|
@@ -8,9 +8,9 @@ The [Mastra platform](https://projects.mastra.ai) provides three products for de
|
|
|
8
8
|
- [**Studio**](https://mastra.ai/docs/mastra-platform/studio): A hosted visual environment for testing agents, running workflows, and inspecting traces. Starting with Studio also gives you Observability.
|
|
9
9
|
- [**Server**](https://mastra.ai/docs/mastra-platform/server): A production deployment target that runs your Mastra application as an API server. Starting with Server also gives you Observability.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Deploy with a single command, [`mastra deploy`](https://mastra.ai/docs/mastra-platform/deploy), or connect a GitHub repository for push-to-deploy. See the [GitHub integration](https://mastra.ai/docs/mastra-platform/github) for the repository-linked flow.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Each project can run multiple [**Environments**](https://mastra.ai/docs/mastra-platform/environments) (for example `production` and `staging`) and provision [**Hosted databases**](https://mastra.ai/docs/mastra-platform/database) from the CLI or project settings to persist application data with no manual configuration.
|
|
14
14
|
|
|
15
15
|
## Get started
|
|
16
16
|
|
|
@@ -20,7 +20,7 @@ Choose the path that matches what you want to do:
|
|
|
20
20
|
- **Deploy Studio**: Use [Studio](https://mastra.ai/docs/mastra-platform/studio) to host the visual development environment for your team. Start here if you want a shared UI for testing agents, running workflows, and inspecting traces.
|
|
21
21
|
- **Deploy Server**: Use [Server](https://mastra.ai/docs/mastra-platform/server) to run your Mastra application as a production API server. Start here when you’re ready to serve agents, tools, and workflows from the cloud.
|
|
22
22
|
|
|
23
|
-
## Key
|
|
23
|
+
## Key concepts
|
|
24
24
|
|
|
25
25
|
**Projects** are the shared parent entity across all products. A single project can have Observability, a Studio deployment, and a Server deployment. Projects belong to an **Organization**, which is the multi-tenant container for your team.
|
|
26
26
|
|
|
@@ -34,8 +34,8 @@ Your Mastra application is built from three building blocks:
|
|
|
34
34
|
|
|
35
35
|
Develop your project locally with [`mastra dev`](https://mastra.ai/reference/cli/mastra) and open [Studio](https://mastra.ai/docs/studio/overview) to test your agents, workflows, and tools in a visual environment.
|
|
36
36
|
|
|
37
|
-
Once you're ready to deploy your application to production,
|
|
37
|
+
Once you're ready to deploy your application to production, run [`mastra deploy`](https://mastra.ai/reference/cli/mastra) to push your application to the cloud.
|
|
38
38
|
|
|
39
|
-
Follow the [
|
|
39
|
+
Follow the [Deploy](https://mastra.ai/docs/mastra-platform/deploy) docs for step-by-step instructions.
|
|
40
40
|
|
|
41
41
|
If you host your Mastra application on your own infrastructure, you can still send observability data to Mastra platform using the [MastraPlatformExporter](https://mastra.ai/docs/observability/integrations/exporters/mastra-platform).
|
|
@@ -6,6 +6,8 @@ Server on Mastra platform is a production deployment target that runs your Mastr
|
|
|
6
6
|
|
|
7
7
|
You get a stable API endpoint, environment variable management, custom domain support, and deploy history out of the box.
|
|
8
8
|
|
|
9
|
+
> **Note:** `mastra server deploy` is the earlier split deploy path. New projects should use the unified [`mastra deploy`](https://mastra.ai/docs/mastra-platform/deploy) command, which adds preflight validation, environments, and CLI-managed databases.
|
|
10
|
+
|
|
9
11
|
> **Note:** Server deploy provisions hosted storage automatically. If you override storage with [LibSQLStore](https://mastra.ai/reference/storage/libsql) and a file URL, switch to a remotely hosted database because Mastra platform uses an ephemeral filesystem.
|
|
10
12
|
|
|
11
13
|
## Quickstart
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Studio on Mastra platform
|
|
4
4
|
|
|
5
|
-
Studio on Mastra platform is a hosted visual
|
|
5
|
+
Studio on Mastra platform is a hosted visual workspace for testing agents, running workflows, and inspecting traces. Use it when you want to share Studio with your team without hosting the Studio UI yourself.
|
|
6
6
|
|
|
7
7
|
You can deploy Studio from the CLI as shown below, or link a GitHub repository for push-to-deploy. See the [GitHub integration](https://mastra.ai/docs/mastra-platform/github) for the repository-linked flow.
|
|
8
8
|
|
|
9
|
+
> **Note:** `mastra studio deploy` is the earlier split deploy path. New projects should use the unified [`mastra deploy`](https://mastra.ai/docs/mastra-platform/deploy) command, which adds preflight validation, environments, and CLI-managed databases.
|
|
10
|
+
|
|
9
11
|
## Quickstart
|
|
10
12
|
|
|
11
13
|
1. Follow the [get started guide](https://mastra.ai/docs) to create your first Mastra project.
|
|
@@ -56,7 +58,7 @@ See the [`mastra studio deploy` CLI reference](https://mastra.ai/reference/cli/m
|
|
|
56
58
|
|
|
57
59
|
## Environment files
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
A local env file is optional. When a `.env` or `.env.*` file is present in the project directory, the deploy bundles its environment variables.
|
|
60
62
|
|
|
61
63
|
When multiple env files are present, the CLI prompts you to pick one. To select non-interactively, pass `--env-file`:
|
|
62
64
|
|
|
@@ -64,7 +66,7 @@ When multiple env files are present, the CLI prompts you to pick one. To select
|
|
|
64
66
|
mastra studio deploy --env-file .env.production --yes
|
|
65
67
|
```
|
|
66
68
|
|
|
67
|
-
|
|
69
|
+
To run the same codebase across `production` and `staging`, use the unified [`mastra deploy --env`](https://mastra.ai/docs/mastra-platform/deploy) command instead. [Environments](https://mastra.ai/docs/mastra-platform/environments) replace the earlier pattern of one project per environment.
|
|
68
70
|
|
|
69
71
|
## Create a new project non-interactively
|
|
70
72
|
|
|
@@ -81,7 +81,7 @@ calculatorTool._meta = {
|
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
Visit [MCPServer reference](https://mastra.ai/reference/tools/mcp-server) for the full `appResources` configuration.
|
|
85
85
|
|
|
86
86
|
## Connecting MCP Apps to agents
|
|
87
87
|
|
|
@@ -249,7 +249,7 @@ Establishes the connection to the host. Call this after registering all event ha
|
|
|
249
249
|
await app.connect()
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
|
|
252
|
+
See the [`App` class API reference](https://apps.extensions.modelcontextprotocol.io/api/classes/app.App.html) for the full list of methods, callbacks, and lifecycle hooks.
|
|
253
253
|
|
|
254
254
|
## Using external MCP servers with apps
|
|
255
255
|
|
|
@@ -284,7 +284,7 @@ export const mastra = new Mastra({
|
|
|
284
284
|
})
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
Visit [MCPClient reference](https://mastra.ai/reference/tools/mcp-client) for more details on proxying external servers.
|
|
288
288
|
|
|
289
289
|
## Sandbox security
|
|
290
290
|
|
|
@@ -62,7 +62,7 @@ export const testMcpClient = new MCPClient({
|
|
|
62
62
|
})
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Visit [MCPClient](https://mastra.ai/reference/tools/mcp-client) for a full list of configuration options.
|
|
66
66
|
|
|
67
67
|
> **Authentication:** For connecting to OAuth-protected MCP servers, see the [OAuth Authentication](https://mastra.ai/reference/tools/mcp-client) section.
|
|
68
68
|
|
|
@@ -89,7 +89,7 @@ export const testAgent = new Agent({
|
|
|
89
89
|
})
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
Visit [Agent Class](https://mastra.ai/reference/agents/agent) for a full list of configuration options.
|
|
93
93
|
|
|
94
94
|
## Tool approval
|
|
95
95
|
|
|
@@ -129,7 +129,7 @@ export const testMcpServer = new MCPServer({
|
|
|
129
129
|
})
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
Visit [MCPServer](https://mastra.ai/reference/tools/mcp-server) for a full list of configuration options.
|
|
133
133
|
|
|
134
134
|
> **Authentication:** To protect your MCP server with OAuth, see the [OAuth Protection](https://mastra.ai/reference/tools/mcp-server) section.
|
|
135
135
|
|
|
@@ -160,9 +160,7 @@ export const mastra = new Mastra({
|
|
|
160
160
|
|
|
161
161
|
### Static tools
|
|
162
162
|
|
|
163
|
-
Use the `.listTools()` method to fetch tools from all configured MCP servers. This is suitable when configuration (such as API keys) is static and consistent across users or requests. Call it once and pass the result to the `tools` property when defining your agent.
|
|
164
|
-
|
|
165
|
-
> **Info:** Visit [listTools()](https://mastra.ai/reference/tools/mcp-client) for more information.
|
|
163
|
+
Use the `.listTools()` method to fetch tools from all configured MCP servers. This is suitable when configuration (such as API keys) is static and consistent across users or requests. Call it once and pass the result to the `tools` property when defining your agent. Visit [listTools()](https://mastra.ai/reference/tools/mcp-client) for more information.
|
|
166
164
|
|
|
167
165
|
```typescript
|
|
168
166
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -211,7 +209,7 @@ async function handleRequest(userPrompt: string, userApiKey: string) {
|
|
|
211
209
|
}
|
|
212
210
|
```
|
|
213
211
|
|
|
214
|
-
|
|
212
|
+
Visit [listToolsets()](https://mastra.ai/reference/tools/mcp-client) for more information.
|
|
215
213
|
|
|
216
214
|
## Connecting to an MCP registry
|
|
217
215
|
|
|
@@ -412,9 +410,7 @@ As an alternative to MCP, Ampersand's AI SDK also has an adapter for Mastra, so
|
|
|
412
410
|
|
|
413
411
|
## MCP Apps
|
|
414
412
|
|
|
415
|
-
MCP servers can serve interactive HTML UIs via the MCP Apps extension. Tools with associated `ui://` resources render sandboxed iframes in Studio — both on tool detail pages and inline in agent chat. The app iframe can call server tools and inject messages into the conversation.
|
|
416
|
-
|
|
417
|
-
> **Note:** Visit [MCP Apps](https://mastra.ai/docs/mcp/mcp-apps) for setup instructions and the app bridge API.
|
|
413
|
+
MCP servers can serve interactive HTML UIs via the MCP Apps extension. Tools with associated `ui://` resources render sandboxed iframes in Studio — both on tool detail pages and inline in agent chat. The app iframe can call server tools and inject messages into the conversation. Visit [MCP Apps](https://mastra.ai/docs/mcp/mcp-apps) for setup instructions and the app bridge API.
|
|
418
414
|
|
|
419
415
|
## Related
|
|
420
416
|
|
|
@@ -77,7 +77,7 @@ Use memory when your agent needs to maintain multi-turn conversations that refer
|
|
|
77
77
|
bun add @mastra/libsql@latest
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
For more details on available providers and how storage works in Mastra, visit the [storage](https://mastra.ai/docs/storage/overview) documentation.
|
|
81
81
|
|
|
82
82
|
3. Add the storage provider to your main Mastra instance to enable memory across all configured agents.
|
|
83
83
|
|
|
@@ -110,7 +110,7 @@ Use memory when your agent needs to maintain multi-turn conversations that refer
|
|
|
110
110
|
})
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Visit [Memory Class](https://mastra.ai/reference/memory/memory-class) for a full list of configuration options.
|
|
114
114
|
|
|
115
115
|
5. Call your agent, for example in [Studio](https://mastra.ai/docs/studio/overview). Inside Studio, start a new chat with your agent and take a look at the right sidebar. It'll now display various memory-related information.
|
|
116
116
|
|
|
@@ -166,7 +166,7 @@ export const memoryAgent = new Agent({
|
|
|
166
166
|
})
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
See [Observational Memory](https://mastra.ai/docs/memory/observational-memory) for details on how observations and reflections work, and [the reference](https://mastra.ai/reference/memory/observational-memory) for all configuration options.
|
|
170
170
|
|
|
171
171
|
## Memory in multi-agent systems
|
|
172
172
|
|
|
@@ -238,7 +238,7 @@ export const memoryAgent = new Agent({
|
|
|
238
238
|
})
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
Visit [Request Context](https://mastra.ai/docs/server/request-context) for more information.
|
|
242
242
|
|
|
243
243
|
## Related
|
|
244
244
|
|
|
@@ -126,9 +126,7 @@ If you prefer, rely entirely on environment variables:
|
|
|
126
126
|
new MastraPlatformExporter()
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
With `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` set, `MastraPlatformExporter` sends data to the Mastra platform project you configured. If you also set `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT`, it sends data to that collector instead.
|
|
130
|
-
|
|
131
|
-
> **Note:** Visit [MastraPlatformExporter reference](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter) for the full list of configuration options.
|
|
129
|
+
With `MASTRA_PLATFORM_ACCESS_TOKEN` and `MASTRA_PROJECT_ID` set, `MastraPlatformExporter` sends data to the Mastra platform project you configured. If you also set `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT`, it sends data to that collector instead. Visit [MastraPlatformExporter reference](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter) for the full list of configuration options.
|
|
132
130
|
|
|
133
131
|
## Recommended configuration
|
|
134
132
|
|
|
@@ -6,6 +6,8 @@ Mastra's logging system captures function execution, input data, and output resp
|
|
|
6
6
|
|
|
7
7
|
When deploying to the Mastra platform, logs are shown in the dashboard. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api log list '{"level":"error","page":0,"perPage":50}'` to inspect recent error logs directly instead of opening Studio or writing a temporary script. The command requires a running Mastra server with observability logging configured; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api log list --schema` before constructing different filters. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## Configuring logs with `PinoLogger`
|
|
10
12
|
|
|
11
13
|
When [initializing a new Mastra project](https://mastra.ai/guides/getting-started/quickstart) using the CLI, `PinoLogger` is included by default.
|
|
@@ -22,7 +24,7 @@ export const mastra = new Mastra({
|
|
|
22
24
|
})
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
Visit [PinoLogger](https://mastra.ai/reference/logging/pino-logger) for all available configuration options.
|
|
26
28
|
|
|
27
29
|
## Logging to observability storage
|
|
28
30
|
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Mastra exposes the same five OLAP queries (`getMetricAggregate`, `getMetricBreakdown`, `getMetricTimeSeries`, `getMetricPercentiles`, and discovery helpers) through three surfaces: an in-process store accessor, the runtime HTTP API, and the `mastra api metric` CLI. All three accept the same Zod-validated input shapes, so you can move from a one-off CLI investigation to a programmatic dashboard tool without re-learning the API.
|
|
6
6
|
|
|
7
|
+
**For AI agents:** Run `npx mastra api metric aggregate '{"name":"mastra_agent_duration_ms","aggregation":"avg"}'` to query average agent latency directly instead of writing a temporary script. Querying local metrics requires a running Mastra server with an OLAP-capable observability store; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api metric aggregate --schema` before constructing a different query. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
8
|
+
|
|
7
9
|
## When to use this
|
|
8
10
|
|
|
9
11
|
- Build a custom dashboard or KPI tile alongside Studio.
|
|
@@ -6,6 +6,8 @@ Tracing is the observability signal that records how a request moves through age
|
|
|
6
6
|
|
|
7
7
|
This page focuses on trace-specific concepts: span hierarchy, sampling, metadata, filtering, trace IDs, and third-party trace context.
|
|
8
8
|
|
|
9
|
+
**For AI agents:** Run `npx mastra api trace list '{"page":0,"perPage":20}'` to inspect recent traces directly instead of opening Studio or writing a temporary script. The command requires a running Mastra server with observability configured; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api trace list --schema` before constructing different filters. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
10
|
+
|
|
9
11
|
## When to use tracing
|
|
10
12
|
|
|
11
13
|
- Debug unexpected agent or workflow behavior by inspecting the full execution path.
|
|
@@ -325,7 +327,7 @@ const result = await agent.generate([{ role: 'user', content: 'Sensitive operati
|
|
|
325
327
|
})
|
|
326
328
|
```
|
|
327
329
|
|
|
328
|
-
|
|
330
|
+
For more granular control over sensitive data, consider using the [Sensitive Data Filter](https://mastra.ai/docs/observability/integrations/processors/sensitive-data-filter) processor, which can redact specific fields (like passwords, tokens, and keys) while preserving the rest of the input/output.
|
|
329
331
|
|
|
330
332
|
#### Child spans and metadata extraction
|
|
331
333
|
|
|
@@ -105,7 +105,7 @@ const auth0Provider = new MastraAuthAuth0({
|
|
|
105
105
|
})
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
Visit [MastraAuthAuth0](https://mastra.ai/reference/auth/auth0) for all available configuration options.
|
|
109
109
|
|
|
110
110
|
## Client-side setup
|
|
111
111
|
|
|
@@ -87,7 +87,7 @@ export const mastra = new Mastra({
|
|
|
87
87
|
})
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Visit [MastraAuthBetterAuth](https://mastra.ai/reference/auth/better-auth) for all available configuration options.
|
|
91
91
|
|
|
92
92
|
## Custom authorization
|
|
93
93
|
|
|
@@ -180,7 +180,7 @@ export const mastraClient = new MastraClient({
|
|
|
180
180
|
})
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
184
184
|
|
|
185
185
|
### Making authenticated requests
|
|
186
186
|
|
|
@@ -88,7 +88,7 @@ export const useClerkAuth = () => {
|
|
|
88
88
|
}
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Refer to the [Clerk documentation](https://clerk.com/docs) for more information.
|
|
92
92
|
|
|
93
93
|
## Configuring `MastraClient`
|
|
94
94
|
|
|
@@ -118,7 +118,7 @@ const firebaseAuth = new MastraAuthFirebase({
|
|
|
118
118
|
})
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
Visit [MastraAuthFirebase](https://mastra.ai/reference/auth/firebase) for all available configuration options.
|
|
122
122
|
|
|
123
123
|
## Client-side setup
|
|
124
124
|
|
|
@@ -168,7 +168,7 @@ export const mastra = new Mastra({
|
|
|
168
168
|
})
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
Visit [MastraAuthGoogle](https://mastra.ai/reference/auth/google) for all available configuration options.
|
|
172
172
|
|
|
173
173
|
## Role mapping
|
|
174
174
|
|
|
@@ -242,7 +242,7 @@ export const createMastraClient = (idToken: string) => {
|
|
|
242
242
|
}
|
|
243
243
|
```
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
246
246
|
|
|
247
247
|
### Making authenticated requests
|
|
248
248
|
|
|
@@ -61,7 +61,7 @@ export const mastra = new Mastra({
|
|
|
61
61
|
})
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Visit [MastraJwtAuth](https://mastra.ai/reference/auth/jwt) for all available configuration options.
|
|
65
65
|
|
|
66
66
|
Inside [Studio](https://mastra.ai/docs/studio/overview), go to **Settings** and under **Headers** select the **"Add Header"** button. Enter `Authorization` as the header name and `Bearer <your-jwt>` as the value.
|
|
67
67
|
|
|
@@ -80,7 +80,7 @@ export const mastraClient = new MastraClient({
|
|
|
80
80
|
})
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
84
84
|
|
|
85
85
|
### Making authenticated requests
|
|
86
86
|
|
|
@@ -120,7 +120,7 @@ export const mastra = new Mastra({
|
|
|
120
120
|
|
|
121
121
|
> **Note:** To link users between providers, store the Okta user ID in the other provider's user metadata. Mastra uses this ID to fetch groups from Okta.
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
Visit [MastraAuthOkta](https://mastra.ai/reference/auth/okta) for all available configuration options.
|
|
124
124
|
|
|
125
125
|
## Role mapping
|
|
126
126
|
|
|
@@ -194,7 +194,7 @@ export const createMastraClient = (accessToken: string) => {
|
|
|
194
194
|
}
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
Visit [Mastra Client SDK](https://mastra.ai/docs/server/mastra-client) for more configuration options.
|
|
198
198
|
|
|
199
199
|
### Making authenticated requests
|
|
200
200
|
|
|
@@ -149,7 +149,7 @@ const workosAuth = new AdminOnlyWorkosAuth({
|
|
|
149
149
|
})
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Visit [MastraAuthWorkos](https://mastra.ai/reference/auth/workos) for all available configuration options.
|
|
153
153
|
|
|
154
154
|
## Client-side setup
|
|
155
155
|
|
|
@@ -134,7 +134,7 @@ export const mastraClient = new MastraClient({
|
|
|
134
134
|
})
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
Visit [MastraClient](https://mastra.ai/reference/client-js/mastra-client) for more configuration options.
|
|
138
138
|
|
|
139
139
|
## Credentials and session cookies
|
|
140
140
|
|
|
@@ -32,7 +32,7 @@ export const mastra = new Mastra({
|
|
|
32
32
|
})
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Visit the [configuration reference](https://mastra.ai/reference/configuration) for a full list of available server options.
|
|
36
36
|
|
|
37
37
|
## Deploy your server
|
|
38
38
|
|
|
@@ -116,7 +116,7 @@ export const mastra = new Mastra({
|
|
|
116
116
|
})
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
Visit the [PubSub reference](https://mastra.ai/reference/pubsub/base) for the full delivery contract and the configuration options for each backend.
|
|
120
120
|
|
|
121
121
|
## Related
|
|
122
122
|
|
|
@@ -82,7 +82,7 @@ export const mastra = new Mastra({
|
|
|
82
82
|
})
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
Visit [Middleware](https://mastra.ai/docs/server/middleware) for how to use server middleware.
|
|
86
86
|
|
|
87
87
|
## Studio
|
|
88
88
|
|
|
@@ -188,7 +188,7 @@ export const registryAgent = new Agent({
|
|
|
188
188
|
})
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
Visit [Agent](https://mastra.ai/reference/agents/agent) for a full list of configuration options.
|
|
192
192
|
|
|
193
193
|
## Accessing values from workflow steps
|
|
194
194
|
|
|
@@ -210,7 +210,7 @@ const stepOne = createStep({
|
|
|
210
210
|
})
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
Visit [createStep()](https://mastra.ai/reference/workflows/step) for a full list of configuration options.
|
|
214
214
|
|
|
215
215
|
## Accessing values with tools
|
|
216
216
|
|
|
@@ -232,7 +232,7 @@ export const weatherTool = createTool({
|
|
|
232
232
|
})
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
Visit [createTool()](https://mastra.ai/reference/tools/create-tool) for a full list of configuration options.
|
|
236
236
|
|
|
237
237
|
## Reserved keys
|
|
238
238
|
|
|
@@ -303,7 +303,7 @@ app.listen(4111, () => {
|
|
|
303
303
|
})
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
See the [Express Adapter](https://mastra.ai/reference/server/express-adapter) documentation for full configuration options.
|
|
307
307
|
|
|
308
308
|
**Hono**:
|
|
309
309
|
|
|
@@ -324,7 +324,7 @@ serve({ fetch: app.fetch, port: 4111 }, () => {
|
|
|
324
324
|
})
|
|
325
325
|
```
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
See the [Hono Adapter](https://mastra.ai/reference/server/hono-adapter) documentation for full configuration options.
|
|
328
328
|
|
|
329
329
|
**Fastify**:
|
|
330
330
|
|
|
@@ -352,7 +352,7 @@ app.listen({ port }, () => {
|
|
|
352
352
|
})
|
|
353
353
|
```
|
|
354
354
|
|
|
355
|
-
|
|
355
|
+
See the [Fastify Adapter](https://mastra.ai/reference/server/fastify-adapter) documentation for full configuration options.
|
|
356
356
|
|
|
357
357
|
**Koa**:
|
|
358
358
|
|
|
@@ -387,7 +387,7 @@ app.listen(port, () => {
|
|
|
387
387
|
})
|
|
388
388
|
```
|
|
389
389
|
|
|
390
|
-
|
|
390
|
+
See the [Koa Adapter](https://mastra.ai/reference/server/koa-adapter) documentation for full configuration options.
|
|
391
391
|
|
|
392
392
|
**NestJS**:
|
|
393
393
|
|
|
@@ -418,7 +418,7 @@ async function bootstrap() {
|
|
|
418
418
|
bootstrap()
|
|
419
419
|
```
|
|
420
420
|
|
|
421
|
-
|
|
421
|
+
See the [NestJS Adapter](https://mastra.ai/reference/server/nestjs-adapter) documentation for full configuration options.
|
|
422
422
|
|
|
423
423
|
## Initialization flow
|
|
424
424
|
|
|
@@ -460,7 +460,7 @@ You can add your own routes to the app alongside Mastra's routes.
|
|
|
460
460
|
- When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer `registerApiRoute()`.
|
|
461
461
|
- When you mount routes directly on the framework app, use the adapter's exported `createAuthMiddleware()` helper if those routes need Mastra auth.
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
Visit "Adding custom routes" for [Express](https://mastra.ai/reference/server/express-adapter) and [Hono](https://mastra.ai/reference/server/hono-adapter) for more information.
|
|
464
464
|
|
|
465
465
|
## Route prefixes
|
|
466
466
|
|
|
@@ -513,7 +513,7 @@ const server = new MastraServer({
|
|
|
513
513
|
})
|
|
514
514
|
```
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
See [MastraServer](https://mastra.ai/reference/server/mastra-server) for full configuration options.
|
|
517
517
|
|
|
518
518
|
## Per-route auth overrides
|
|
519
519
|
|
|
@@ -540,7 +540,7 @@ const server = new MastraServer({
|
|
|
540
540
|
})
|
|
541
541
|
```
|
|
542
542
|
|
|
543
|
-
|
|
543
|
+
See [MastraServer](https://mastra.ai/reference/server/mastra-server) for full configuration options.
|
|
544
544
|
|
|
545
545
|
## Accessing the app
|
|
546
546
|
|
|
@@ -35,9 +35,7 @@ export const mastra = new Mastra({
|
|
|
35
35
|
})
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Once configured, Studio shows a login screen and requires authentication for all API requests.
|
|
39
|
-
|
|
40
|
-
> **Note:** Visit the [Auth docs](https://mastra.ai/docs/server/auth) for a full list of supported providers.
|
|
38
|
+
Once configured, Studio shows a login screen and requires authentication for all API requests. Visit the [Auth docs](https://mastra.ai/docs/server/auth) for a full list of supported providers.
|
|
41
39
|
|
|
42
40
|
## How it works
|
|
43
41
|
|
|
@@ -57,7 +57,7 @@ export const testWorkflow = createWorkflow({})
|
|
|
57
57
|
.commit()
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Visit [Input Data Mapping](https://mastra.ai/docs/workflows/control-flow) for more information.
|
|
61
61
|
|
|
62
62
|
When no `structuredOutput` option is provided, Mastra agents use a default schema that expects a `prompt` string as input and returns a `text` string as output:
|
|
63
63
|
|
|
@@ -106,9 +106,7 @@ export const testWorkflow = createWorkflow({})
|
|
|
106
106
|
.commit()
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
The `structuredOutput.schema` option accepts any Standard JSON Schema. The agent will generate output conforming to this schema, and the step's `outputSchema` will be automatically set to match.
|
|
110
|
-
|
|
111
|
-
> **Info:** Visit [Structured Output](https://mastra.ai/docs/agents/structured-output) for more options like error handling strategies and streaming with structured output.
|
|
109
|
+
The `structuredOutput.schema` option accepts any Standard JSON Schema. The agent will generate output conforming to this schema, and the step's `outputSchema` will be automatically set to match. Visit [Structured Output](https://mastra.ai/docs/agents/structured-output) for more options like error handling strategies and streaming with structured output.
|
|
112
110
|
|
|
113
111
|
## Using tools in workflows
|
|
114
112
|
|
|
@@ -157,7 +155,7 @@ export const testWorkflow = createWorkflow({})
|
|
|
157
155
|
.commit()
|
|
158
156
|
```
|
|
159
157
|
|
|
160
|
-
|
|
158
|
+
Visit [Input Data Mapping](https://mastra.ai/docs/workflows/control-flow) for more information.
|
|
161
159
|
|
|
162
160
|
## Related
|
|
163
161
|
|
|
@@ -208,7 +208,7 @@ const writerStep = createStep({
|
|
|
208
208
|
})
|
|
209
209
|
```
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
Visit [Choosing the right pattern](#choosing-the-right-pattern) to understand when to use `.parallel()` vs `.foreach()`.
|
|
212
212
|
|
|
213
213
|
## Conditional logic with `.branch()`
|
|
214
214
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Workflows let you define complex sequences of tasks using clear, structured steps rather than relying on the reasoning of a single agent. They give you full control over how tasks are broken down, how data moves between them, and what gets executed when. Workflows run using the built-in execution engine by default, or can be deployed to [workflow runners](https://mastra.ai/docs/deployment/workflow-runners) like Inngest for managed infrastructure.
|
|
6
6
|
|
|
7
|
-
!
|
|
7
|
+
**For AI agents:** Run `npx mastra api workflow run start test-workflow '{"inputData":{"message":"Hello, world!"}}'` to start this workflow directly instead of writing a temporary script. The command requires a running Mastra server; start the local server with `npx mastra dev`, or pass the reachable server's base URL with `--url`. Run `npx mastra api workflow run start --schema` before constructing different input. Install Mastra's skill with `npx skills add mastra-ai/skills --skill mastra` for complete API CLI discovery, targeting, schema, authentication, and error-handling guidance.
|
|
8
8
|
|
|
9
9
|
## When to use workflows
|
|
10
10
|
|
|
@@ -101,7 +101,7 @@ const step1 = createStep({
|
|
|
101
101
|
})
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
Visit [`Step`](https://mastra.ai/reference/workflows/step) for a full list of configuration options.
|
|
105
105
|
|
|
106
106
|
### Using agents and tools
|
|
107
107
|
|
|
@@ -175,7 +175,7 @@ export const testWorkflow = createWorkflow({
|
|
|
175
175
|
.commit();
|
|
176
176
|
```
|
|
177
177
|
|
|
178
|
-
|
|
178
|
+
Visit [Workflow Class](https://mastra.ai/reference/workflows/workflow) for a full list of configuration options.
|
|
179
179
|
|
|
180
180
|
### Understanding control flow
|
|
181
181
|
|
|
@@ -212,7 +212,7 @@ const step1 = createStep({
|
|
|
212
212
|
})
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
Visit [Workflow State](https://mastra.ai/docs/workflows/workflow-state) for complete documentation on state schemas, initial state, persistence across suspend/resume, and nested workflows.
|
|
216
216
|
|
|
217
217
|
## Workflows as steps
|
|
218
218
|
|
|
@@ -533,7 +533,7 @@ const step1 = createStep({
|
|
|
533
533
|
})
|
|
534
534
|
```
|
|
535
535
|
|
|
536
|
-
|
|
536
|
+
Visit [Request Context](https://mastra.ai/docs/server/request-context) for more information.
|
|
537
537
|
|
|
538
538
|
> **Tip:** For type-safe request context schema validation, see [Schema Validation](https://mastra.ai/docs/server/request-context).
|
|
539
539
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
> **Info:** For a full-stack integration approach where Mastra runs directly in your Next.js API routes, see the [Full-Stack Integration Guide](https://www.assistant-ui.com/docs/integrations/frameworks/mastra/full-stack) on Assistant UI's documentation site.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Visit Mastra's [**"UI Dojo"**](https://ui-dojo.mastra.ai/) to see real-world examples of Assistant UI integrated with Mastra.
|
|
10
10
|
|
|
11
11
|
## Integration guide
|
|
12
12
|
|