@mastra/mcp-docs-server 1.1.18-alpha.1 → 1.1.18
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/agents/overview.md +4 -4
- package/.docs/docs/agents/processors.md +1 -1
- package/.docs/docs/community/licensing.md +7 -9
- package/.docs/docs/deployment/monorepo.md +0 -6
- package/.docs/docs/evals/built-in-scorers.md +1 -1
- package/.docs/docs/{observability → evals}/datasets/overview.md +12 -12
- package/.docs/docs/{observability → evals}/datasets/running-experiments.md +9 -9
- package/.docs/docs/evals/overview.md +8 -9
- package/.docs/docs/getting-started/manual-install.md +1 -2
- package/.docs/docs/index.md +1 -1
- package/.docs/docs/mastra-cloud/deployment.md +2 -2
- package/.docs/docs/mastra-cloud/observability.md +2 -2
- package/.docs/docs/mastra-cloud/overview.md +1 -1
- package/.docs/docs/mastra-cloud/setup.md +3 -3
- package/.docs/docs/mcp/publishing-mcp-server.md +20 -0
- package/.docs/docs/memory/message-history.md +6 -4
- package/.docs/docs/memory/observational-memory.md +20 -11
- package/.docs/docs/memory/overview.md +4 -4
- package/.docs/docs/memory/semantic-recall.md +28 -19
- package/.docs/docs/memory/storage.md +4 -4
- package/.docs/docs/observability/metrics/overview.md +114 -0
- package/.docs/docs/observability/overview.md +13 -5
- package/.docs/docs/observability/tracing/exporters/default.md +2 -4
- package/.docs/docs/observability/tracing/exporters/laminar.md +4 -4
- package/.docs/docs/observability/tracing/exporters/sentry.md +4 -4
- package/.docs/docs/observability/tracing/overview.md +2 -2
- package/.docs/docs/rag/chunking-and-embedding.md +2 -2
- package/.docs/docs/server/auth/composite-auth.md +1 -7
- package/.docs/docs/server/auth/custom-auth-provider.md +2 -4
- package/.docs/docs/server/auth/jwt.md +1 -1
- package/.docs/docs/server/auth/simple-auth.md +1 -7
- package/.docs/docs/server/auth.md +3 -3
- package/.docs/docs/server/custom-adapters.md +3 -1
- package/.docs/docs/server/custom-api-routes.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -3
- package/.docs/docs/server/mastra-server.md +8 -0
- package/.docs/docs/server/request-context.md +17 -17
- package/.docs/docs/server/server-adapters.md +8 -8
- package/.docs/docs/streaming/events.md +1 -90
- package/.docs/docs/streaming/overview.md +0 -42
- package/.docs/docs/studio/auth.md +142 -0
- package/.docs/docs/{deployment/studio.md → studio/deployment.md} +42 -16
- package/.docs/docs/studio/observability.md +98 -0
- package/.docs/docs/studio/overview.md +127 -0
- package/.docs/docs/workflows/agents-and-tools.md +7 -10
- package/.docs/docs/workflows/control-flow.md +1 -1
- package/.docs/docs/workflows/overview.md +12 -7
- package/.docs/docs/workflows/suspend-and-resume.md +1 -1
- package/.docs/guides/concepts/multi-agent-systems.md +4 -4
- package/.docs/guides/deployment/vercel.md +1 -1
- package/.docs/guides/getting-started/next-js.md +1 -1
- package/.docs/guides/getting-started/quickstart.md +1 -1
- package/.docs/guides/guide/ai-recruiter.md +1 -1
- package/.docs/guides/guide/chef-michel.md +1 -1
- package/.docs/guides/guide/code-review-bot.md +1 -1
- package/.docs/guides/guide/dev-assistant.md +1 -1
- package/.docs/guides/guide/docs-manager.md +1 -1
- package/.docs/guides/guide/github-actions-pr-description.md +1 -1
- package/.docs/guides/guide/notes-mcp-server.md +1 -1
- package/.docs/guides/guide/stock-agent.md +1 -1
- package/.docs/guides/guide/web-search.md +2 -2
- package/.docs/guides/index.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/client.md +1 -1
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
- package/.docs/models/index.md +2 -2
- package/.docs/models/providers/aihubmix.md +17 -102
- package/.docs/models/providers/synthetic.md +2 -1
- package/.docs/models/providers.md +0 -1
- package/.docs/reference/agents/agent.md +1 -1
- package/.docs/reference/cli/mastra.md +3 -3
- package/.docs/reference/client-js/workflows.md +2 -2
- package/.docs/reference/configuration.md +4 -4
- package/.docs/reference/deployer/cloudflare.md +1 -1
- package/.docs/reference/deployer/vercel.md +1 -1
- package/.docs/reference/index.md +16 -14
- package/.docs/reference/memory/observational-memory.md +1 -1
- package/.docs/reference/observability/metrics/automatic-metrics.md +132 -0
- package/.docs/reference/storage/cloudflare-d1.md +1 -1
- package/.docs/reference/storage/cloudflare.md +3 -3
- package/.docs/reference/storage/convex.md +1 -1
- package/.docs/reference/storage/dynamodb.md +1 -1
- package/.docs/reference/storage/lance.md +1 -1
- package/.docs/reference/storage/upstash.md +1 -1
- package/.docs/reference/workspace/vercel.md +118 -0
- package/CHANGELOG.md +23 -0
- package/package.json +6 -6
- package/.docs/docs/getting-started/studio.md +0 -113
- package/.docs/docs/mastra-cloud/studio.md +0 -24
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Automatic metrics reference
|
|
2
|
+
|
|
3
|
+
Mastra automatically extracts performance and usage metrics from traced execution. This page is the complete reference for every metric name, label, and context field that Mastra emits.
|
|
4
|
+
|
|
5
|
+
For setup instructions, see the [Metrics overview](https://mastra.ai/docs/observability/metrics/overview).
|
|
6
|
+
|
|
7
|
+
## When Mastra emits automatic metrics
|
|
8
|
+
|
|
9
|
+
Metrics are extracted from spans when they end. The observability layer inspects each completed span, calculates duration, and (for model generation spans) reads token usage data. No manual instrumentation is needed.
|
|
10
|
+
|
|
11
|
+
Metrics are routed through an internal event bus to the `DefaultExporter`, which batches and flushes them to storage. Only DuckDB and in-memory storage backends support metrics persistence today.
|
|
12
|
+
|
|
13
|
+
### What affects whether a metric is available
|
|
14
|
+
|
|
15
|
+
Two conditions must be true for a metric to reach storage:
|
|
16
|
+
|
|
17
|
+
1. `DefaultExporter` is configured as an exporter.
|
|
18
|
+
2. The storage backend supports metrics (`DuckDB` or `InMemory`).
|
|
19
|
+
|
|
20
|
+
If metrics aren't appearing, see [troubleshooting](#troubleshooting).
|
|
21
|
+
|
|
22
|
+
## Duration metrics
|
|
23
|
+
|
|
24
|
+
Duration metrics record execution time in milliseconds, calculated from the span's start and end timestamps. Each duration metric includes a `status` label set to `ok` or `error`, derived from the span's status.
|
|
25
|
+
|
|
26
|
+
| Metric name | Span type | Description |
|
|
27
|
+
| ------------------------------ | ---------------------------- | ------------------------------------------------------- |
|
|
28
|
+
| `mastra_agent_duration_ms` | `AGENT_RUN` | Execution time of an agent run |
|
|
29
|
+
| `mastra_tool_duration_ms` | `TOOL_CALL`, `MCP_TOOL_CALL` | Execution time of a tool call, including MCP tool calls |
|
|
30
|
+
| `mastra_workflow_duration_ms` | `WORKFLOW_RUN` | Execution time of a workflow run |
|
|
31
|
+
| `mastra_model_duration_ms` | `MODEL_GENERATION` | Execution time of a model generation |
|
|
32
|
+
| `mastra_processor_duration_ms` | `PROCESSOR_RUN` | Execution time of a processor run |
|
|
33
|
+
|
|
34
|
+
## Token usage metrics
|
|
35
|
+
|
|
36
|
+
Token metrics are emitted only from `MODEL_GENERATION` spans that include `usage` data. If the provider doesn't report usage, no token metrics are emitted for that span.
|
|
37
|
+
|
|
38
|
+
### Input token metrics
|
|
39
|
+
|
|
40
|
+
| Metric name | Description |
|
|
41
|
+
| --------------------------------------- | ---------------------------------------------- |
|
|
42
|
+
| `mastra_model_total_input_tokens` | Total input tokens |
|
|
43
|
+
| `mastra_model_input_text_tokens` | Text tokens in the input prompt |
|
|
44
|
+
| `mastra_model_input_cache_read_tokens` | Tokens read from prompt cache (e.g. Anthropic) |
|
|
45
|
+
| `mastra_model_input_cache_write_tokens` | Tokens written to prompt cache |
|
|
46
|
+
| `mastra_model_input_audio_tokens` | Audio tokens in the input (multimodal models) |
|
|
47
|
+
| `mastra_model_input_image_tokens` | Image tokens in the input (vision models) |
|
|
48
|
+
|
|
49
|
+
### Output token metrics
|
|
50
|
+
|
|
51
|
+
| Metric name | Description |
|
|
52
|
+
| -------------------------------------- | ---------------------------------------------------------- |
|
|
53
|
+
| `mastra_model_total_output_tokens` | Total output tokens |
|
|
54
|
+
| `mastra_model_output_text_tokens` | Text tokens in the model's output |
|
|
55
|
+
| `mastra_model_output_reasoning_tokens` | Reasoning / chain-of-thought tokens (e.g. OpenAI o-series) |
|
|
56
|
+
| `mastra_model_output_audio_tokens` | Audio tokens in the model's output |
|
|
57
|
+
| `mastra_model_output_image_tokens` | Output image tokens |
|
|
58
|
+
|
|
59
|
+
### Provider-reported detailed token categories
|
|
60
|
+
|
|
61
|
+
The detailed breakdown metrics (everything except `total_input` and `total_output`) are only emitted when the provider reports them. If a category has zero tokens, the metric is skipped for that span. Different providers report different levels of detail. For example, not all providers report cache or audio tokens.
|
|
62
|
+
|
|
63
|
+
## Cost-related context
|
|
64
|
+
|
|
65
|
+
### When cost context is attached
|
|
66
|
+
|
|
67
|
+
Cost context is attached to token metrics when the embedded pricing registry has a matching entry for the provider and model. The registry ships with Mastra and covers common providers and models. If no match is found, token metrics are still emitted but without cost fields.
|
|
68
|
+
|
|
69
|
+
### What cost fields may be included
|
|
70
|
+
|
|
71
|
+
| Field | Description |
|
|
72
|
+
| --------------- | ---------------------------------------------------------------------------- |
|
|
73
|
+
| `provider` | Provider name (e.g. `openai`, `anthropic`) |
|
|
74
|
+
| `model` | Model identifier (e.g. `gpt-4o`, `claude-sonnet-4-20250514`) |
|
|
75
|
+
| `estimatedCost` | Estimated cost for this metric, calculated from token count and pricing tier |
|
|
76
|
+
| `costUnit` | Currency unit (e.g. `USD`) |
|
|
77
|
+
| `costMetadata` | Additional pricing context (tier information, error details) |
|
|
78
|
+
|
|
79
|
+
## Correlation with traces
|
|
80
|
+
|
|
81
|
+
### How metrics relate to spans and trace context
|
|
82
|
+
|
|
83
|
+
Each metric carries a `CorrelationContext` snapshot from the span that produced it. This context is stored alongside the metric value and lets you navigate from a metric to the exact span and trace.
|
|
84
|
+
|
|
85
|
+
The correlation fields are grouped into four categories:
|
|
86
|
+
|
|
87
|
+
**Trace correlation**
|
|
88
|
+
|
|
89
|
+
- `traceId`: trace identifier
|
|
90
|
+
- `spanId`: span identifier
|
|
91
|
+
- `tags`: tags from the span
|
|
92
|
+
|
|
93
|
+
**Entity hierarchy**
|
|
94
|
+
|
|
95
|
+
- `entityType`, `entityId`, `entityName`: The entity that produced the metric (e.g. agent, workflow)
|
|
96
|
+
- `parentEntityType`, `parentEntityId`, `parentEntityName`: The parent entity
|
|
97
|
+
- `rootEntityType`, `rootEntityId`, `rootEntityName`: The root entity in the call chain
|
|
98
|
+
|
|
99
|
+
**Identity**
|
|
100
|
+
|
|
101
|
+
- `userId`, `organizationId`, `resourceId`: Identity context from the request
|
|
102
|
+
- `runId`, `sessionId`, `threadId`, `requestId`: Correlation IDs
|
|
103
|
+
|
|
104
|
+
**Deployment**
|
|
105
|
+
|
|
106
|
+
- `environment`: Deployment environment (e.g. `production`, `staging`)
|
|
107
|
+
- `source`: Source identifier
|
|
108
|
+
- `serviceName`: Service name from the observability config
|
|
109
|
+
- `experimentId`: Experiment identifier, if applicable
|
|
110
|
+
|
|
111
|
+
### Why correlation helps with debugging
|
|
112
|
+
|
|
113
|
+
When you spot a spike in latency or token usage on the Metrics dashboard, correlation context lets you drill directly into the trace that produced the metric. From there you can inspect the individual span to find the root cause: a slow tool call, a large prompt, or an unexpected error.
|
|
114
|
+
|
|
115
|
+
## Troubleshooting
|
|
116
|
+
|
|
117
|
+
### No metrics are appearing
|
|
118
|
+
|
|
119
|
+
- **Observability is configured**: Verify that your `Mastra` instance has an `observability` config with at least one exporter.
|
|
120
|
+
- **`DefaultExporter` is present**: Other exporters (Datadog, Langfuse, etc.) don't persist metrics to Mastra storage. `DefaultExporter` is required for the Studio dashboard.
|
|
121
|
+
- **Storage supports metrics**: Metrics require a separate OLAP store for observability. Relational databases like PostgreSQL, LibSQL, etc. are not supported for metrics. In-memory storage resets on restart.
|
|
122
|
+
- **Sampling isn't 0%**: If sampling probability is `0` or strategy is `never`, all spans become no-ops and no metrics are extracted.
|
|
123
|
+
|
|
124
|
+
### Duration metrics are missing
|
|
125
|
+
|
|
126
|
+
- **Span has timestamps**: Duration is calculated from `startTime` and `endTime`. If either is missing, the metric is skipped.
|
|
127
|
+
- **Span type maps to a metric**: Only `AGENT_RUN`, `TOOL_CALL`, `MCP_TOOL_CALL`, `WORKFLOW_RUN`, `MODEL_GENERATION`, and `PROCESSOR_RUN` spans produce duration metrics.
|
|
128
|
+
|
|
129
|
+
### Token metrics are missing
|
|
130
|
+
|
|
131
|
+
- **Span is a model generation**: Token metrics are only emitted from `MODEL_GENERATION` spans.
|
|
132
|
+
- **Provider reports usage**: The model provider must include `usage` data in its response. If usage is absent, no token metrics are emitted.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Cloudflare D1 storage implementation provides a serverless SQL database solution using Cloudflare D1, supporting relational operations and transactional consistency.
|
|
4
4
|
|
|
5
|
-
> **Observability Not Supported:** Cloudflare D1 storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to D1, and
|
|
5
|
+
> **Observability Not Supported:** Cloudflare D1 storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to D1, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with D1 as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
6
6
|
|
|
7
7
|
> **Row Size Limit:** Cloudflare D1 enforces a **1 MiB maximum row size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage.
|
|
8
8
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Mastra provides two Cloudflare storage implementations:
|
|
4
4
|
|
|
5
|
-
- **Cloudflare KV** (`CloudflareKVStorage`)
|
|
6
|
-
- **Cloudflare Durable Objects** (`CloudflareDOStorage`)
|
|
5
|
+
- **Cloudflare KV** (`CloudflareKVStorage`): A globally distributed, eventually consistent key-value store
|
|
6
|
+
- **Cloudflare Durable Objects** (`CloudflareDOStorage`): A strongly consistent, SQLite-based storage using Durable Objects
|
|
7
7
|
|
|
8
|
-
> **Observability Not Supported:** Cloudflare storage **
|
|
8
|
+
> **Observability Not Supported:** Cloudflare storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with Cloudflare as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Convex storage implementation provides a serverless storage solution using [Convex](https://convex.dev), a full-stack TypeScript development platform with real-time sync and automatic caching.
|
|
4
4
|
|
|
5
|
-
> **Observability Not Supported:** Convex storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Convex, and
|
|
5
|
+
> **Observability Not Supported:** Convex storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Convex, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with Convex as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
6
6
|
|
|
7
7
|
> **Record Size Limit:** Convex enforces a **1 MiB maximum record size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage like S3, Cloudflare R2, or [Convex file storage](https://docs.convex.dev/file-storage).
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The DynamoDB storage implementation provides a scalable and performant NoSQL database solution for Mastra, leveraging a single-table design pattern with [ElectroDB](https://electrodb.dev/).
|
|
4
4
|
|
|
5
|
-
> **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and
|
|
5
|
+
> **Observability Not Supported:** DynamoDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to DynamoDB, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with DynamoDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
6
6
|
|
|
7
7
|
> **Item Size Limit:** DynamoDB enforces a **400 KB maximum item size**. This limit can be exceeded when storing messages with base64-encoded attachments such as images. See [Handling large attachments](https://mastra.ai/docs/memory/storage) for workarounds including uploading attachments to external storage.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The LanceDB storage implementation provides a high-performance storage solution using the LanceDB database system, which excels at handling both traditional data storage and vector operations.
|
|
4
4
|
|
|
5
|
-
> **Observability Not Supported:** LanceDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to LanceDB, and
|
|
5
|
+
> **Observability Not Supported:** LanceDB storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to LanceDB, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with LanceDB as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -4,7 +4,7 @@ The Upstash storage implementation provides a serverless-friendly storage soluti
|
|
|
4
4
|
|
|
5
5
|
> **Pricing:** When using Mastra with Upstash, the pay-as-you-go model can result in unexpectedly high costs due to the high volume of Redis commands generated during agent conversations. We strongly recommend using a **fixed pricing plan** for predictable costs. See [Upstash pricing](https://upstash.com/pricing/redis) for details and [GitHub issue #5850](https://github.com/mastra-ai/mastra/issues/5850) for context.
|
|
6
6
|
|
|
7
|
-
> **Observability Not Supported:** Upstash storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Upstash, and
|
|
7
|
+
> **Observability Not Supported:** Upstash storage **doesn't support the observability domain**. Traces from the `DefaultExporter` can't be persisted to Upstash, and [Studio's](https://mastra.ai/docs/studio/overview) observability features won't work with Upstash as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider like ClickHouse or PostgreSQL.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# VercelSandbox
|
|
2
|
+
|
|
3
|
+
Executes commands as [Vercel](https://vercel.com) serverless functions. Provides globally-distributed, zero-infrastructure execution with automatic scaling.
|
|
4
|
+
|
|
5
|
+
> **Info:** For interface details, see [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox).
|
|
6
|
+
|
|
7
|
+
> **Warning:** VercelSandbox is stateless. There is no persistent filesystem, no interactive shell, and no support for long-running or background processes. Only `/tmp` is writable and is ephemeral between invocations.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
**npm**:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @mastra/vercel
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**pnpm**:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @mastra/vercel
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Yarn**:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn add @mastra/vercel
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Bun**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bun add @mastra/vercel
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
Add a `VercelSandbox` to a workspace and assign it to an agent:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { Agent } from '@mastra/core/agent'
|
|
41
|
+
import { Workspace } from '@mastra/core/workspace'
|
|
42
|
+
import { VercelSandbox } from '@mastra/vercel'
|
|
43
|
+
|
|
44
|
+
const workspace = new Workspace({
|
|
45
|
+
sandbox: new VercelSandbox({
|
|
46
|
+
token: process.env.VERCEL_TOKEN,
|
|
47
|
+
}),
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const agent = new Agent({
|
|
51
|
+
name: 'dev-agent',
|
|
52
|
+
model: 'anthropic/claude-sonnet-4-6',
|
|
53
|
+
workspace,
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Team-scoped deployment with custom resources
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
const workspace = new Workspace({
|
|
61
|
+
sandbox: new VercelSandbox({
|
|
62
|
+
token: process.env.VERCEL_TOKEN,
|
|
63
|
+
teamId: 'team_abc123',
|
|
64
|
+
regions: ['iad1', 'sfo1'],
|
|
65
|
+
maxDuration: 120,
|
|
66
|
+
memory: 3008,
|
|
67
|
+
env: {
|
|
68
|
+
NODE_ENV: 'production',
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
})
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Constructor parameters
|
|
75
|
+
|
|
76
|
+
**token** (`string`): Vercel API token. Falls back to \`VERCEL\_TOKEN\` environment variable.
|
|
77
|
+
|
|
78
|
+
**teamId** (`string`): Vercel team ID for team-scoped deployments.
|
|
79
|
+
|
|
80
|
+
**projectName** (`string`): Existing Vercel project name. Auto-generated if omitted.
|
|
81
|
+
|
|
82
|
+
**regions** (`string[]`): Deployment regions. (Default: `['iad1']`)
|
|
83
|
+
|
|
84
|
+
**maxDuration** (`number`): Function maximum duration in seconds. (Default: `60`)
|
|
85
|
+
|
|
86
|
+
**memory** (`number`): Function memory in MB. (Default: `1024`)
|
|
87
|
+
|
|
88
|
+
**env** (`Record<string, string>`): Environment variables baked into the deployed function source. These are embedded at deploy time, not set dynamically.
|
|
89
|
+
|
|
90
|
+
**commandTimeout** (`number`): Per-invocation command timeout in milliseconds. (Default: `55000`)
|
|
91
|
+
|
|
92
|
+
**instructions** (`string | ((opts) => string)`): Custom instructions that override the default instructions returned by \`getInstructions()\`. Pass a string to fully replace, or a function to extend the defaults.
|
|
93
|
+
|
|
94
|
+
## Properties
|
|
95
|
+
|
|
96
|
+
**id** (`string`): Unique identifier for this sandbox instance.
|
|
97
|
+
|
|
98
|
+
**name** (`'VercelSandbox'`): Human-readable name.
|
|
99
|
+
|
|
100
|
+
**provider** (`'vercel'`): Provider type identifier.
|
|
101
|
+
|
|
102
|
+
**status** (`ProviderStatus`): Current lifecycle status: \`'pending'\`, \`'starting'\`, \`'running'\`, \`'stopping'\`, \`'stopped'\`, \`'destroying'\`, \`'destroyed'\`, or \`'error'\`.
|
|
103
|
+
|
|
104
|
+
## Limitations
|
|
105
|
+
|
|
106
|
+
VercelSandbox uses serverless functions under the hood, which means:
|
|
107
|
+
|
|
108
|
+
- **No persistent filesystem**: Files written to `/tmp` are ephemeral and cleared between invocations.
|
|
109
|
+
- **No interactive shell**: Commands run via `/bin/sh -c` with no stdin streaming.
|
|
110
|
+
- **No background processes**: No process manager, PIDs, or long-running tasks.
|
|
111
|
+
- **No mounting**: Cloud storage mounting (S3, GCS) is not supported.
|
|
112
|
+
- **Timeout limits**: Maximum execution time is bounded by `maxDuration` (default 60s).
|
|
113
|
+
|
|
114
|
+
## Related
|
|
115
|
+
|
|
116
|
+
- [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox)
|
|
117
|
+
- [Workspace class](https://mastra.ai/reference/workspace/workspace-class)
|
|
118
|
+
- [E2BSandbox](https://mastra.ai/reference/workspace/e2b-sandbox) — full-featured cloud sandbox with persistent filesystem and process management
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`180aaaf`](https://github.com/mastra-ai/mastra/commit/180aaaf4d0903d33a49bc72de2d40ca69a5bc599), [`9140989`](https://github.com/mastra-ai/mastra/commit/91409890e83f4f1d9c1b39223f1af91a6a53b549), [`d7c98cf`](https://github.com/mastra-ai/mastra/commit/d7c98cfc9d75baba9ecbf1a8835b5183d0a0aec8), [`acf5fbc`](https://github.com/mastra-ai/mastra/commit/acf5fbcb890dc7ca7167bec386ce5874dfadb997), [`24ca2ae`](https://github.com/mastra-ai/mastra/commit/24ca2ae57538ec189fabb9daee6175ad27035853), [`0762516`](https://github.com/mastra-ai/mastra/commit/07625167e029a8268ea7aaf0402416e6d8832874), [`9c57f2f`](https://github.com/mastra-ai/mastra/commit/9c57f2f7241e9f94769aa99fc86c531e8207d0f9), [`5bfc691`](https://github.com/mastra-ai/mastra/commit/5bfc69104c07ba7a9b55c2f8536422c0878b9c57), [`2de3d36`](https://github.com/mastra-ai/mastra/commit/2de3d36932b7f73ad26bc403f7da26cfe89e903e), [`d3736cb`](https://github.com/mastra-ai/mastra/commit/d3736cb9ce074d2b8e8b00218a01f790fe81a1b4), [`c627366`](https://github.com/mastra-ai/mastra/commit/c6273666f9ef4c8c617c68b7d07fe878a322f85c), [`66a7412`](https://github.com/mastra-ai/mastra/commit/66a7412ec0550f3dfa01cd05b057d8c6e5b062bc)]:
|
|
8
|
+
- @mastra/core@1.19.0
|
|
9
|
+
- @mastra/mcp@1.4.0
|
|
10
|
+
|
|
11
|
+
## 1.1.18-alpha.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`9c57f2f`](https://github.com/mastra-ai/mastra/commit/9c57f2f7241e9f94769aa99fc86c531e8207d0f9), [`5bfc691`](https://github.com/mastra-ai/mastra/commit/5bfc69104c07ba7a9b55c2f8536422c0878b9c57)]:
|
|
16
|
+
- @mastra/core@1.19.0-alpha.2
|
|
17
|
+
|
|
18
|
+
## 1.1.18-alpha.2
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`9140989`](https://github.com/mastra-ai/mastra/commit/91409890e83f4f1d9c1b39223f1af91a6a53b549), [`d7c98cf`](https://github.com/mastra-ai/mastra/commit/d7c98cfc9d75baba9ecbf1a8835b5183d0a0aec8), [`acf5fbc`](https://github.com/mastra-ai/mastra/commit/acf5fbcb890dc7ca7167bec386ce5874dfadb997), [`24ca2ae`](https://github.com/mastra-ai/mastra/commit/24ca2ae57538ec189fabb9daee6175ad27035853), [`0762516`](https://github.com/mastra-ai/mastra/commit/07625167e029a8268ea7aaf0402416e6d8832874), [`2de3d36`](https://github.com/mastra-ai/mastra/commit/2de3d36932b7f73ad26bc403f7da26cfe89e903e), [`d3736cb`](https://github.com/mastra-ai/mastra/commit/d3736cb9ce074d2b8e8b00218a01f790fe81a1b4), [`c627366`](https://github.com/mastra-ai/mastra/commit/c6273666f9ef4c8c617c68b7d07fe878a322f85c), [`66a7412`](https://github.com/mastra-ai/mastra/commit/66a7412ec0550f3dfa01cd05b057d8c6e5b062bc)]:
|
|
23
|
+
- @mastra/core@1.18.1-alpha.1
|
|
24
|
+
- @mastra/mcp@1.4.0-alpha.0
|
|
25
|
+
|
|
3
26
|
## 1.1.18-alpha.0
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.18
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@mastra/core": "1.
|
|
33
|
-
"@mastra/mcp": "^1.
|
|
32
|
+
"@mastra/core": "1.19.0",
|
|
33
|
+
"@mastra/mcp": "^1.4.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@hono/node-server": "^1.19.11",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "4.0.18",
|
|
49
|
-
"@internal/lint": "0.0.
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
49
|
+
"@internal/lint": "0.0.76",
|
|
50
|
+
"@mastra/core": "1.19.0",
|
|
51
|
+
"@internal/types-builder": "0.0.51"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Studio
|
|
2
|
-
|
|
3
|
-
Studio provides an interactive UI for building, testing, and managing your agents, workflows, and tools. Run it locally during development, or [deploy it](https://mastra.ai/docs/deployment/studio) to production so your team can manage agents, monitor performance, and gain insights through built-in observability.
|
|
4
|
-
|
|
5
|
-
Add [authentication](https://mastra.ai/docs/server/auth) to protect your deployed Studio with login screens, role-based access control, and permission-based UI rendering so you can control what each team member can see and do. You can also [create a project in Mastra Cloud](https://mastra.ai/docs/mastra-cloud/setup) for a hosted option.
|
|
6
|
-
|
|
7
|
-
[YouTube video player](https://www.youtube-nocookie.com/embed/ojGu6Bi4wYk)
|
|
8
|
-
|
|
9
|
-
## Start Studio
|
|
10
|
-
|
|
11
|
-
If you created your application with `create mastra`, start the development server using the `dev` script. You can also run it directly with `mastra dev`.
|
|
12
|
-
|
|
13
|
-
**npm**:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm run dev
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**pnpm**:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pnpm run dev
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**Yarn**:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
yarn dev
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Bun**:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
bun run dev
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Once the server is running, you can:
|
|
38
|
-
|
|
39
|
-
- Open the Studio UI at <http://localhost:4111/> to interact with your agents, workflows, and tools.
|
|
40
|
-
- Visit <http://localhost:4111/swagger-ui> to discover and interact with the underlying REST API.
|
|
41
|
-
|
|
42
|
-
To run Studio in production, see [Deploy Studio](https://mastra.ai/docs/deployment/studio).
|
|
43
|
-
|
|
44
|
-
## Studio UI
|
|
45
|
-
|
|
46
|
-
The Studio UI lets you interact with your agents, workflows, and tools, observe exactly what happens under the hood with each interaction, and tweak things as you go.
|
|
47
|
-
|
|
48
|
-
### Agents
|
|
49
|
-
|
|
50
|
-
Chat with your agent directly, dynamically switch [models](https://mastra.ai/models), and tweak settings like temperature and top-p to understand how they affect the output.
|
|
51
|
-
|
|
52
|
-
When you interact with your agent, you can follow each step of its reasoning, view tool call outputs, and [observe](#observability) traces and logs to see how responses are generated. You can also attach [scorers](#scorers) to measure and compare response quality over time.
|
|
53
|
-
|
|
54
|
-
### Workflows
|
|
55
|
-
|
|
56
|
-
Visualize your workflow as a graph and run it step by step with a custom input. During execution, the interface updates in real time to show the active step and the path taken.
|
|
57
|
-
|
|
58
|
-
When running a workflow, you can also view detailed traces showing tool calls, raw JSON outputs, and any errors that might have occurred along the way.
|
|
59
|
-
|
|
60
|
-
### Tools
|
|
61
|
-
|
|
62
|
-
Run tools in isolation to observe their behavior. Test them before assigning them to your agent, or isolate them to debug issues should something go wrong.
|
|
63
|
-
|
|
64
|
-
### Processors
|
|
65
|
-
|
|
66
|
-
View the input and output processors attached to each agent. The agent detail panel lists every processor by name and type, so you can verify your guardrails, token limiters, and custom processors are wired up correctly before testing.
|
|
67
|
-
|
|
68
|
-
See [Processors](https://mastra.ai/docs/agents/processors) and [Guardrails](https://mastra.ai/docs/agents/guardrails) for configuration details.
|
|
69
|
-
|
|
70
|
-
### MCP
|
|
71
|
-
|
|
72
|
-
List the MCP servers attached to your Mastra instance and explore their available tools.
|
|
73
|
-
|
|
74
|
-
### Observability
|
|
75
|
-
|
|
76
|
-
When you run an agent or workflow, the Observability tab displays traces that highlight the key AI operations such as model calls, tool executions, and workflow steps. Follow these traces to see how data moves, where time is spent, and what's happening under the hood.
|
|
77
|
-
|
|
78
|
-
Tracing filters out low-level framework details so your traces stay focused and readable.
|
|
79
|
-
|
|
80
|
-
### Scorers
|
|
81
|
-
|
|
82
|
-
The Scorers tab displays the results of your agent's scorers as they run. When messages pass through your agent, the defined scorers evaluate each output asynchronously and render their results here. This allows you to understand how your scorers respond to different interactions, compare performance across test cases, and identify areas for improvement.
|
|
83
|
-
|
|
84
|
-
### Datasets
|
|
85
|
-
|
|
86
|
-
Create and manage collections of test cases to evaluate your agents and workflows. Import items from CSV or JSON, define input and ground-truth schemas, and pin to specific versions so you can reproduce experiments exactly. Run experiments with [scorers](https://mastra.ai/docs/evals/overview) to compare quality across prompts, models, or code changes.
|
|
87
|
-
|
|
88
|
-
See [Datasets overview](https://mastra.ai/docs/observability/datasets/overview) for the full API and versioning details.
|
|
89
|
-
|
|
90
|
-
## REST API
|
|
91
|
-
|
|
92
|
-
Studio is backed by a complete set of REST API routes that let you programmatically interact with your agents, workflows, and tools. These are the same routes exposed by the [Mastra Server](https://mastra.ai/docs/server/mastra-server), so everything you build against locally works identically in production.
|
|
93
|
-
|
|
94
|
-
You can explore all available endpoints in the OpenAPI specification at <http://localhost:4111/api/openapi.json>, which details every endpoint and its request and response schemas.
|
|
95
|
-
|
|
96
|
-
To explore the API interactively, visit the Swagger UI at <http://localhost:4111/swagger-ui>. Here, you can discover endpoints and test them directly from your browser.
|
|
97
|
-
|
|
98
|
-
> **Note:** The OpenAPI and Swagger endpoints are disabled in production by default. To enable them, set [`server.build.openAPIDocs`](https://mastra.ai/reference/configuration) and [`server.build.swaggerUI`](https://mastra.ai/reference/configuration) to `true` respectively.
|
|
99
|
-
|
|
100
|
-
## Configuration
|
|
101
|
-
|
|
102
|
-
By default, Studio runs at <http://localhost:4111>. You can change the [`host`](https://mastra.ai/reference/configuration), [`port`](https://mastra.ai/reference/configuration), and [`studioBase`](https://mastra.ai/reference/configuration) in the Mastra server configuration.
|
|
103
|
-
|
|
104
|
-
For production deployments, see [Deploy Studio](https://mastra.ai/docs/deployment/studio) to learn about hosting Studio alongside your server, as a standalone SPA, or on a CDN.
|
|
105
|
-
|
|
106
|
-
Add [authentication](https://mastra.ai/docs/server/auth) to control who can access Studio in production. Studio displays the appropriate login UI, which can be an SSO button, an email/password form, or both. All API routes require authentication. This applies to any request made to your Mastra API, whether from Studio or a direct API call.
|
|
107
|
-
|
|
108
|
-
Mastra also supports HTTPS development through the [`--https`](https://mastra.ai/reference/cli/mastra) flag, which automatically creates and manages certificates for your project. When you run `mastra dev --https`, a private key and certificate are generated for localhost (or your configured host). Visit the [HTTPS reference](https://mastra.ai/reference/configuration) to learn more.
|
|
109
|
-
|
|
110
|
-
## Next steps
|
|
111
|
-
|
|
112
|
-
- Learn more about Mastra's suggested [project structure](https://mastra.ai/docs/getting-started/project-structure).
|
|
113
|
-
- Integrate Mastra with your frontend framework of choice - [Next.js](https://mastra.ai/guides/getting-started/next-js), [React](https://mastra.ai/guides/getting-started/vite-react), or [Astro](https://mastra.ai/guides/getting-started/astro).
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Studio
|
|
2
|
-
|
|
3
|
-
[YouTube video player](https://www.youtube-nocookie.com/embed/ojGu6Bi4wYk)
|
|
4
|
-
|
|
5
|
-
Mastra Cloud provides a hosted version of [Studio](https://mastra.ai/docs/getting-started/studio) that gives your team a shared environment for interacting with and testing your agents. Team members can chat with agents, review traces, give feedback, and tweak system prompts - without needing to run the project locally.
|
|
6
|
-
|
|
7
|
-
[Set up your project](https://mastra.ai/docs/mastra-cloud/setup) to access Studio in the cloud.
|
|
8
|
-
|
|
9
|
-
See the [Studio documentation](https://mastra.ai/docs/getting-started/studio) for details on features like the Agents playground, Workflows runner, Tools testing, and MCP Servers.
|
|
10
|
-
|
|
11
|
-
> **Note:** You don't need to deploy your agent to use Studio. Studio runs in a sandbox environment separate from your production deployment
|
|
12
|
-
|
|
13
|
-
## Sharing access
|
|
14
|
-
|
|
15
|
-
To invite team members, go to [Mastra Cloud](https://cloud.mastra.ai), select **Team Settings**, then **Members** to add them. Once invited, they can sign in and access your project's Studio.
|
|
16
|
-
|
|
17
|
-

|
|
18
|
-
|
|
19
|
-
> **Warning:** Team members can view environment variables and delete projects. Only invite people you trust.
|
|
20
|
-
|
|
21
|
-
## Next steps
|
|
22
|
-
|
|
23
|
-
- [Deployment](https://mastra.ai/docs/mastra-cloud/deployment) - Manage deployments and settings
|
|
24
|
-
- [Observability](https://mastra.ai/docs/mastra-cloud/observability) - Monitor traces and logs
|