@mastra/mcp-docs-server 1.2.19-alpha.15 → 1.2.19-alpha.16
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/channels.md +27 -1
- package/.docs/docs/memory/semantic-recall.md +19 -0
- package/.docs/docs/observability/metrics/overview.md +31 -44
- package/.docs/docs/server/server-adapters.md +97 -26
- package/.docs/models/environment-variables.md +4 -0
- package/.docs/models/gateways/netlify.md +2 -1
- package/.docs/models/gateways/openrouter.md +3 -1
- package/.docs/models/gateways/vercel.md +5 -2
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/agnes.md +74 -0
- package/.docs/models/providers/cline-pass.md +4 -2
- package/.docs/models/providers/deepseek.md +4 -6
- package/.docs/models/providers/digitalocean.md +3 -3
- package/.docs/models/providers/edenai.md +4 -5
- package/.docs/models/providers/iteracompute.md +73 -0
- package/.docs/models/providers/kilo.md +9 -7
- package/.docs/models/providers/nano-gpt.md +8 -8
- package/.docs/models/providers/neosmith.md +104 -0
- package/.docs/models/providers/openai.md +2 -2
- package/.docs/models/providers/standardcompute.md +73 -0
- package/.docs/models/providers/vivgrid.md +2 -1
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers/zai.md +2 -1
- package/.docs/models/providers.md +4 -0
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/observability/metrics/automatic-metrics.md +1 -1
- package/.docs/reference/observability/metrics/queries.md +462 -0
- package/.docs/reference/server/elysia-adapter.md +184 -0
- package/CHANGELOG.md +7 -0
- package/package.json +4 -4
- package/.docs/docs/observability/metrics/querying.md +0 -314
package/.docs/docs/channels.md
CHANGED
|
@@ -82,7 +82,7 @@ For example, a Slack adapter on an agent with the `your-agent` ID uses:
|
|
|
82
82
|
/api/agents/your-agent/channels/slack/webhook
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
Point the platform's webhook, event, or interactions URL to this path. Follow the guide for your platform or the [Chat SDK docs](https://chat-sdk.dev/adapters).
|
|
85
|
+
Point the platform's webhook, event, or interactions URL to this path. Follow the guide for your platform or the [Chat SDK docs](https://chat-sdk.dev/adapters). The webhook acknowledges the request before the agent finishes responding. See [Error handling and delivery](#error-handling-and-delivery) for what happens when verification or a handler fails.
|
|
86
86
|
|
|
87
87
|
During local development, platform webhooks need a public URL to reach your local server. Use a tunnel like [cloudflared](https://github.com/cloudflare/cloudflared) or [ngrok](https://ngrok.com/) to expose your server, `localhost:4111` by default:
|
|
88
88
|
|
|
@@ -215,6 +215,32 @@ Add only JSON-serializable, non-sensitive values. Signal metadata may be stored
|
|
|
215
215
|
|
|
216
216
|
Use `requestContext` for run-scoped configuration, such as credentials for a message that starts a run. Use `signalMetadata` for context that must stay attached to one message, including messages delivered to an active run.
|
|
217
217
|
|
|
218
|
+
## Error handling and delivery
|
|
219
|
+
|
|
220
|
+
A channel webhook acknowledges the platform before the agent finishes, so a `200` response means "received", not "answered". Before that acknowledgment, the adapter rejects bad requests synchronously (`401` for failed verification, `400` for an unparseable body, `503` for transient state failures) and the platform redelivers on non-`2xx` responses per its own policy. After the `200`, the platform never retries and Mastra owns errors. The default handler catches agent-run failures and posts an error message to the thread (customize it with `formatError`, which defaults to `❌ Error: {message}`). A custom handler that throws is only logged by Chat SDK, so nothing is posted or retried. Catch failures in custom handlers yourself:
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
channels: {
|
|
224
|
+
adapters: {
|
|
225
|
+
slack: createSlackAdapter(),
|
|
226
|
+
},
|
|
227
|
+
handlers: {
|
|
228
|
+
onDirectMessage: async (thread, message, defaultHandler, ctx) => {
|
|
229
|
+
try {
|
|
230
|
+
ctx.signalMetadata.ticketId = await lookupTicket(message)
|
|
231
|
+
} catch (error) {
|
|
232
|
+
ctx.mastra?.getLogger().error('Ticket lookup failed', { error })
|
|
233
|
+
await thread.post('Something went wrong looking up your ticket. Try again in a moment.')
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
await defaultHandler(thread, message)
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Platform retries also mean the same event can arrive more than once. Adapters deduplicate redelivered events using channel state, so configure [storage](https://mastra.ai/docs/storage) to keep deduplication reliable across restarts. Deduplication is best effort, so keep side effects in custom handlers idempotent so a duplicate that slips through doesn't repeat work like creating a ticket.
|
|
243
|
+
|
|
218
244
|
## Multimodal content
|
|
219
245
|
|
|
220
246
|
Models like Gemini can process images, video, and audio natively. Combine `inlineMedia` and `inlineLinks` to let users share rich content with your agent across platforms:
|
|
@@ -350,6 +350,25 @@ const agent = new Agent({
|
|
|
350
350
|
})
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
+
FastEmbed also exposes the multilingual E5 model for non-English content. E5 is asymmetric, so it's exposed as two models: `multilingualE5LargePassage` for text you index and `multilingualE5LargeQuery` for search text.
|
|
354
|
+
|
|
355
|
+
```ts
|
|
356
|
+
import { Memory } from '@mastra/memory'
|
|
357
|
+
import { Agent } from '@mastra/core/agent'
|
|
358
|
+
import { fastembed } from '@mastra/fastembed'
|
|
359
|
+
|
|
360
|
+
const agent = new Agent({
|
|
361
|
+
id: 'agent',
|
|
362
|
+
memory: new Memory({
|
|
363
|
+
embedder: fastembed.multilingualE5LargePassage,
|
|
364
|
+
}),
|
|
365
|
+
})
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Memory uses a single embedder for both storing and recalling messages, so pick one of the two models and use it consistently. Use the paired `multilingualE5LargeQuery` model only where you control both sides of the pipeline, such as a RAG workflow that indexes with the passage model and searches with the query model.
|
|
369
|
+
|
|
370
|
+
Multilingual E5 produces 1024-dimensional vectors. Your vector index must be created with matching dimensions, and E5 vectors can't be mixed with vectors from another embedder in the same index.
|
|
371
|
+
|
|
353
372
|
## PostgreSQL index optimization
|
|
354
373
|
|
|
355
374
|
When using PostgreSQL as your vector store, you can optimize semantic recall performance by configuring the vector index. This is particularly important for large-scale deployments with thousands of messages.
|
|
@@ -2,30 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
# Metrics
|
|
4
4
|
|
|
5
|
-
Mastra automatically
|
|
5
|
+
Mastra automatically derives metrics from spans as traced operations complete. No separate metric instrumentation is required.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Mastra emits:
|
|
8
8
|
|
|
9
|
-
- **Duration metrics
|
|
10
|
-
- **Token usage metrics
|
|
11
|
-
- **Cost
|
|
9
|
+
- **Duration metrics** for agent runs, workflows, tools, model calls, and processors
|
|
10
|
+
- **Token usage metrics** for model input and output, including detailed token categories when the provider reports them
|
|
11
|
+
- **Cost estimates** calculated from token usage, provider, model, and an embedded pricing registry
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
>
|
|
15
|
-
> For local development, use [DuckDB](https://duckdb.org/) through `@mastra/duckdb`. For production, use [ClickHouse](https://clickhouse.com/) through `@mastra/clickhouse`. `PostgresStoreVNext` with the observability domain enabled also supports metrics, but always provide a time range to avoid full partition scans.
|
|
16
|
-
>
|
|
17
|
-
> Google Cloud Spanner supports metrics, but it's not recommended for heavy metrics workloads. The Spanner adapter disables metrics by default because metrics are write-heavy and scan-heavy. Set `disableMetrics: false` only for light workloads, or route metrics to an OLAP store.
|
|
13
|
+
Metrics retain trace correlation context, so you can investigate a change in a chart by finding the related span. See the [Automatic metrics reference](https://mastra.ai/reference/observability/metrics/automatic-metrics) for metric names, labels, and cost fields.
|
|
18
14
|
|
|
19
15
|
## When to use metrics
|
|
20
16
|
|
|
21
17
|
- Monitor latency across agents, tools, workflows, and model calls
|
|
22
|
-
- Track token consumption and cost
|
|
23
|
-
-
|
|
24
|
-
-
|
|
18
|
+
- Track token consumption and estimated cost over time
|
|
19
|
+
- Compare success and error rates across agents or tools
|
|
20
|
+
- Measure the effect of prompt, model, or code changes
|
|
25
21
|
|
|
26
|
-
##
|
|
22
|
+
## Storage support
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
Metrics require an analytics-capable observability store:
|
|
25
|
+
|
|
26
|
+
- **DuckDB** through `@mastra/duckdb` is recommended for local development.
|
|
27
|
+
- **ClickHouse** through `@mastra/clickhouse` is recommended for high-volume production workloads.
|
|
28
|
+
- **PostgresStoreVNext** supports metrics when its observability domain is enabled.
|
|
29
|
+
- **In-memory storage** supports metrics, but its data is lost when the process restarts.
|
|
30
|
+
- **Google Cloud Spanner** disables metrics by default. Set `disableMetrics: false` only for light workloads, or route metrics to a dedicated OLAP store.
|
|
31
|
+
|
|
32
|
+
Other storage adapters, including LibSQL, MSSQL, and MongoDB, can store other observability signals but don't implement metric storage and queries.
|
|
33
|
+
|
|
34
|
+
## Set up local metrics
|
|
35
|
+
|
|
36
|
+
Install the observability, application storage, and DuckDB packages:
|
|
29
37
|
|
|
30
38
|
**npm**:
|
|
31
39
|
|
|
@@ -51,7 +59,7 @@ yarn add @mastra/observability @mastra/libsql @mastra/duckdb
|
|
|
51
59
|
bun add @mastra/observability @mastra/libsql @mastra/duckdb
|
|
52
60
|
```
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
Configure a composite store that routes the observability domain to DuckDB:
|
|
55
63
|
|
|
56
64
|
```ts
|
|
57
65
|
import { Mastra } from '@mastra/core/mastra'
|
|
@@ -83,37 +91,16 @@ export const mastra = new Mastra({
|
|
|
83
91
|
})
|
|
84
92
|
```
|
|
85
93
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
The Studio metrics dashboard visualizes all automatic metrics with KPI cards, detailed breakdowns, token usage timelines, and configurable time ranges. See [Studio observability](https://mastra.ai/docs/studio/observability) for a full walkthrough.
|
|
89
|
-
|
|
90
|
-
## What Mastra measures
|
|
91
|
-
|
|
92
|
-
Mastra emits three categories of metrics automatically:
|
|
94
|
+
`MastraStorageExporter` persists metrics to the configured observability store and makes them available to Studio. Use `MastraPlatformExporter` instead, or alongside it, to send metrics to Mastra Platform.
|
|
93
95
|
|
|
94
|
-
|
|
95
|
-
- **Token usage**: Input and output token counts, broken down by type (text, cache, audio, image, reasoning).
|
|
96
|
-
- **Cost estimation**: Estimated cost per model call, based on an embedded pricing registry.
|
|
96
|
+
## View and query metrics
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
Use the [Studio observability dashboard](https://mastra.ai/docs/studio/observability) to inspect KPI cards, breakdowns, and time-series charts. For custom dashboards and analysis, use the observability store, `@mastra/client-js`, HTTP endpoints, or CLI described in the [Metric queries reference](https://mastra.ai/reference/observability/metrics/queries).
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
In production, always include a timestamp range in metric queries. Time bounds limit the data scanned and allow partitioned backends to skip unrelated partitions or chunks.
|
|
101
101
|
|
|
102
|
-
##
|
|
102
|
+
## Related
|
|
103
103
|
|
|
104
|
-
Mastra auto-instruments agent runs, workflow steps, tool calls, and model generations as spans. When a span ends, the observability layer extracts metrics from it:
|
|
105
|
-
|
|
106
|
-
1. **Duration**: Calculated from the span's start and end timestamps.
|
|
107
|
-
2. **Token usage**: Extracted from the `usage` attribute on model generation spans.
|
|
108
|
-
3. **Cost estimation**: Runs each token metric through an embedded pricing registry that matches by provider and model name.
|
|
109
|
-
|
|
110
|
-
Before storage, all metric labels pass through a cardinality filter that blocks known high-cardinality values (such as trace IDs and UUIDs) to keep storage efficient. Metrics are then batched by an internal event buffer and flushed to storage by the `MastraStorageExporter`.
|
|
111
|
-
|
|
112
|
-
## Next steps
|
|
113
|
-
|
|
114
|
-
- [Automatic metrics reference](https://mastra.ai/reference/observability/metrics/automatic-metrics)
|
|
115
|
-
- [Querying metrics](https://mastra.ai/docs/observability/metrics/querying)
|
|
116
|
-
- [Tracing overview](https://mastra.ai/docs/observability/tracing/overview)
|
|
117
|
-
- [Studio observability](https://mastra.ai/docs/studio/observability)
|
|
118
104
|
- [Observability overview](https://mastra.ai/docs/observability/overview)
|
|
119
|
-
- [
|
|
105
|
+
- [Tracing overview](https://mastra.ai/docs/observability/tracing/overview)
|
|
106
|
+
- [MastraStorageExporter](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage)
|
|
@@ -20,6 +20,7 @@ Server adapters let you run Mastra with your own HTTP server instead of the Hono
|
|
|
20
20
|
|
|
21
21
|
Mastra currently provides these official server adapters:
|
|
22
22
|
|
|
23
|
+
- [@mastra/elysia](https://mastra.ai/reference/server/elysia-adapter)
|
|
23
24
|
- [@mastra/express](https://mastra.ai/reference/server/express-adapter)
|
|
24
25
|
- [@mastra/hono](https://mastra.ai/reference/server/hono-adapter)
|
|
25
26
|
- [@mastra/fastify](https://mastra.ai/reference/server/fastify-adapter)
|
|
@@ -32,8 +33,58 @@ You can build your own adapter, read [custom adapters](https://mastra.ai/docs/se
|
|
|
32
33
|
|
|
33
34
|
Install the adapter for the framework of your choice.
|
|
34
35
|
|
|
36
|
+
**Elysia**:
|
|
37
|
+
|
|
38
|
+
**npm**:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install @mastra/elysia@latest elysia
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**pnpm**:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm add @mastra/elysia@latest elysia
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Yarn**:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
yarn add @mastra/elysia@latest elysia
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Bun**:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bun add @mastra/elysia@latest elysia
|
|
60
|
+
```
|
|
61
|
+
|
|
35
62
|
**Express**:
|
|
36
63
|
|
|
64
|
+
```bash
|
|
65
|
+
npm install @mastra/elysia@latest elysia
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Hono**:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm add @mastra/elysia@latest elysia
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Fastify**:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
yarn add @mastra/elysia@latest elysia
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Koa**:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bun add @mastra/elysia@latest elysia
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**NestJS**:
|
|
87
|
+
|
|
37
88
|
**npm**:
|
|
38
89
|
|
|
39
90
|
```bash
|
|
@@ -58,31 +109,31 @@ yarn add @mastra/express@latest
|
|
|
58
109
|
bun add @mastra/express@latest
|
|
59
110
|
```
|
|
60
111
|
|
|
61
|
-
**
|
|
112
|
+
**Tab 7**:
|
|
62
113
|
|
|
63
114
|
```bash
|
|
64
115
|
npm install @mastra/express@latest
|
|
65
116
|
```
|
|
66
117
|
|
|
67
|
-
**
|
|
118
|
+
**Tab 8**:
|
|
68
119
|
|
|
69
120
|
```bash
|
|
70
121
|
pnpm add @mastra/express@latest
|
|
71
122
|
```
|
|
72
123
|
|
|
73
|
-
**
|
|
124
|
+
**Tab 9**:
|
|
74
125
|
|
|
75
126
|
```bash
|
|
76
127
|
yarn add @mastra/express@latest
|
|
77
128
|
```
|
|
78
129
|
|
|
79
|
-
**
|
|
130
|
+
**Tab 10**:
|
|
80
131
|
|
|
81
132
|
```bash
|
|
82
133
|
bun add @mastra/express@latest
|
|
83
134
|
```
|
|
84
135
|
|
|
85
|
-
**Tab
|
|
136
|
+
**Tab 11**:
|
|
86
137
|
|
|
87
138
|
**npm**:
|
|
88
139
|
|
|
@@ -108,31 +159,31 @@ yarn add @mastra/hono@latest
|
|
|
108
159
|
bun add @mastra/hono@latest
|
|
109
160
|
```
|
|
110
161
|
|
|
111
|
-
**Tab
|
|
162
|
+
**Tab 12**:
|
|
112
163
|
|
|
113
164
|
```bash
|
|
114
165
|
npm install @mastra/hono@latest
|
|
115
166
|
```
|
|
116
167
|
|
|
117
|
-
**Tab
|
|
168
|
+
**Tab 13**:
|
|
118
169
|
|
|
119
170
|
```bash
|
|
120
171
|
pnpm add @mastra/hono@latest
|
|
121
172
|
```
|
|
122
173
|
|
|
123
|
-
**Tab
|
|
174
|
+
**Tab 14**:
|
|
124
175
|
|
|
125
176
|
```bash
|
|
126
177
|
yarn add @mastra/hono@latest
|
|
127
178
|
```
|
|
128
179
|
|
|
129
|
-
**Tab
|
|
180
|
+
**Tab 15**:
|
|
130
181
|
|
|
131
182
|
```bash
|
|
132
183
|
bun add @mastra/hono@latest
|
|
133
184
|
```
|
|
134
185
|
|
|
135
|
-
**Tab
|
|
186
|
+
**Tab 16**:
|
|
136
187
|
|
|
137
188
|
**npm**:
|
|
138
189
|
|
|
@@ -158,31 +209,31 @@ yarn add @mastra/fastify@latest
|
|
|
158
209
|
bun add @mastra/fastify@latest
|
|
159
210
|
```
|
|
160
211
|
|
|
161
|
-
**Tab
|
|
212
|
+
**Tab 17**:
|
|
162
213
|
|
|
163
214
|
```bash
|
|
164
215
|
npm install @mastra/fastify@latest
|
|
165
216
|
```
|
|
166
217
|
|
|
167
|
-
**Tab
|
|
218
|
+
**Tab 18**:
|
|
168
219
|
|
|
169
220
|
```bash
|
|
170
221
|
pnpm add @mastra/fastify@latest
|
|
171
222
|
```
|
|
172
223
|
|
|
173
|
-
**Tab
|
|
224
|
+
**Tab 19**:
|
|
174
225
|
|
|
175
226
|
```bash
|
|
176
227
|
yarn add @mastra/fastify@latest
|
|
177
228
|
```
|
|
178
229
|
|
|
179
|
-
**Tab
|
|
230
|
+
**Tab 20**:
|
|
180
231
|
|
|
181
232
|
```bash
|
|
182
233
|
bun add @mastra/fastify@latest
|
|
183
234
|
```
|
|
184
235
|
|
|
185
|
-
**Tab
|
|
236
|
+
**Tab 21**:
|
|
186
237
|
|
|
187
238
|
**npm**:
|
|
188
239
|
|
|
@@ -208,31 +259,31 @@ yarn add @mastra/koa@latest
|
|
|
208
259
|
bun add @mastra/koa@latest
|
|
209
260
|
```
|
|
210
261
|
|
|
211
|
-
**Tab
|
|
262
|
+
**Tab 22**:
|
|
212
263
|
|
|
213
264
|
```bash
|
|
214
265
|
npm install @mastra/koa@latest
|
|
215
266
|
```
|
|
216
267
|
|
|
217
|
-
**Tab
|
|
268
|
+
**Tab 23**:
|
|
218
269
|
|
|
219
270
|
```bash
|
|
220
271
|
pnpm add @mastra/koa@latest
|
|
221
272
|
```
|
|
222
273
|
|
|
223
|
-
**Tab
|
|
274
|
+
**Tab 24**:
|
|
224
275
|
|
|
225
276
|
```bash
|
|
226
277
|
yarn add @mastra/koa@latest
|
|
227
278
|
```
|
|
228
279
|
|
|
229
|
-
**Tab
|
|
280
|
+
**Tab 25**:
|
|
230
281
|
|
|
231
282
|
```bash
|
|
232
283
|
bun add @mastra/koa@latest
|
|
233
284
|
```
|
|
234
285
|
|
|
235
|
-
**Tab
|
|
286
|
+
**Tab 26**:
|
|
236
287
|
|
|
237
288
|
**npm**:
|
|
238
289
|
|
|
@@ -258,25 +309,25 @@ yarn add @mastra/nestjs@latest
|
|
|
258
309
|
bun add @mastra/nestjs@latest
|
|
259
310
|
```
|
|
260
311
|
|
|
261
|
-
**Tab
|
|
312
|
+
**Tab 27**:
|
|
262
313
|
|
|
263
314
|
```bash
|
|
264
315
|
npm install @mastra/nestjs@latest
|
|
265
316
|
```
|
|
266
317
|
|
|
267
|
-
**Tab
|
|
318
|
+
**Tab 28**:
|
|
268
319
|
|
|
269
320
|
```bash
|
|
270
321
|
pnpm add @mastra/nestjs@latest
|
|
271
322
|
```
|
|
272
323
|
|
|
273
|
-
**Tab
|
|
324
|
+
**Tab 29**:
|
|
274
325
|
|
|
275
326
|
```bash
|
|
276
327
|
yarn add @mastra/nestjs@latest
|
|
277
328
|
```
|
|
278
329
|
|
|
279
|
-
**Tab
|
|
330
|
+
**Tab 30**:
|
|
280
331
|
|
|
281
332
|
```bash
|
|
282
333
|
bun add @mastra/nestjs@latest
|
|
@@ -286,6 +337,25 @@ bun add @mastra/nestjs@latest
|
|
|
286
337
|
|
|
287
338
|
Initialize your app as usual, then create a `MastraServer` by passing in the `app` and your main `mastra` instance from `src/mastra/index.ts`. Calling `init()` automatically registers Mastra middleware and all available endpoints. You can continue adding your own routes as normal, either before or after `init()`, and they’ll run alongside Mastra’s endpoints.
|
|
288
339
|
|
|
340
|
+
**Elysia**:
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
import { Elysia } from 'elysia'
|
|
344
|
+
import { MastraServer } from '@mastra/elysia'
|
|
345
|
+
import { mastra } from './mastra'
|
|
346
|
+
|
|
347
|
+
const app = new Elysia()
|
|
348
|
+
const server = new MastraServer({ app, mastra })
|
|
349
|
+
|
|
350
|
+
await server.init()
|
|
351
|
+
|
|
352
|
+
app.listen(4111)
|
|
353
|
+
|
|
354
|
+
console.log('Server running on http://localhost:4111')
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
> **Note:** See the [Elysia Adapter](https://mastra.ai/reference/server/elysia-adapter) documentation for full configuration options.
|
|
358
|
+
|
|
289
359
|
**Express**:
|
|
290
360
|
|
|
291
361
|
```typescript
|
|
@@ -466,7 +536,7 @@ You can add your own routes to the app alongside Mastra's routes.
|
|
|
466
536
|
- When you want Mastra-managed auth and route metadata such as `requiresAuth`, prefer `registerApiRoute()`.
|
|
467
537
|
- When you mount routes directly on the framework app, use the adapter's exported `createAuthMiddleware()` helper if those routes need Mastra auth.
|
|
468
538
|
|
|
469
|
-
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.
|
|
539
|
+
Visit "Adding custom routes" for [Elysia](https://mastra.ai/reference/server/elysia-adapter), [Express](https://mastra.ai/reference/server/express-adapter), and [Hono](https://mastra.ai/reference/server/hono-adapter) for more information.
|
|
470
540
|
|
|
471
541
|
## Route prefixes
|
|
472
542
|
|
|
@@ -607,7 +677,7 @@ When using adapters, configure these features directly with your framework. For
|
|
|
607
677
|
|
|
608
678
|
Server adapters register MCP (Model Context Protocol) routes during `registerRoutes()` when MCP servers are configured in your Mastra instance. MCP allows external tools and services to connect to your Mastra server and interact with your agents.
|
|
609
679
|
|
|
610
|
-
|
|
680
|
+
Most adapters register routes for both HTTP and SSE (Server-Sent Events) transports, enabling different client connection patterns. The Elysia adapter currently supports MCP HTTP transport only.
|
|
611
681
|
|
|
612
682
|
### Serverless mode
|
|
613
683
|
|
|
@@ -643,6 +713,7 @@ See [MCP](https://mastra.ai/docs/connections/mcp) for configuration details and
|
|
|
643
713
|
|
|
644
714
|
## Related
|
|
645
715
|
|
|
716
|
+
- [Elysia Adapter](https://mastra.ai/reference/server/elysia-adapter) - Elysia-specific setup
|
|
646
717
|
- [Hono Adapter](https://mastra.ai/reference/server/hono-adapter) - Hono-specific setup
|
|
647
718
|
- [Express Adapter](https://mastra.ai/reference/server/express-adapter) - Express-specific setup
|
|
648
719
|
- [NestJS Adapter](https://mastra.ai/reference/server/nestjs-adapter) - NestJS-specific setup
|
|
@@ -10,6 +10,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
10
10
|
| [Abacus](https://mastra.ai/models/providers/abacus) | `abacus/*` | `ABACUS_API_KEY` |
|
|
11
11
|
| [abliteration.ai](https://mastra.ai/models/providers/abliteration-ai) | `abliteration-ai/*` | `ABLIT_KEY` |
|
|
12
12
|
| [AgentRouter](https://mastra.ai/models/providers/agentrouter) | `agentrouter/*` | `AGENTROUTER_API_KEY` |
|
|
13
|
+
| [Agnes AI](https://mastra.ai/models/providers/agnes) | `agnes/*` | `AGNES_API_KEY` |
|
|
13
14
|
| [AI-ROUTER](https://mastra.ai/models/providers/ai-router) | `ai-router/*` | `AI_ROUTER_API_KEY` |
|
|
14
15
|
| [ai&](https://mastra.ai/models/providers/aiand) | `aiand/*` | `AIAND_API_KEY` |
|
|
15
16
|
| [AKI.IO](https://mastra.ai/models/providers/aki-io) | `aki-io/*` | `AKI_IO_API_KEY` |
|
|
@@ -77,6 +78,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
77
78
|
| [InferX](https://mastra.ai/models/providers/inferx) | `inferx/*` | `INFERX_API_KEY` |
|
|
78
79
|
| [Infomaniak](https://mastra.ai/models/providers/infomaniak) | `infomaniak/*` | `INFOMANIAK_PRODUCT_ID`, `INFOMANIAK_API_KEY` |
|
|
79
80
|
| [IO.NET](https://mastra.ai/models/providers/io-net) | `io-net/*` | `IOINTELLIGENCE_API_KEY` |
|
|
81
|
+
| [IteraCompute](https://mastra.ai/models/providers/iteracompute) | `iteracompute/*` | `ITERACOMPUTE_API_KEY` |
|
|
80
82
|
| [Jalapeno Cloud](https://mastra.ai/models/providers/jalapeno) | `jalapeno/*` | `JALAPENO_API_KEY` |
|
|
81
83
|
| [Jiekou.AI](https://mastra.ai/models/providers/jiekou) | `jiekou/*` | `JIEKOU_API_KEY` |
|
|
82
84
|
| [Kenari](https://mastra.ai/models/providers/kenari) | `kenari/*` | `KENARI_API_KEY` |
|
|
@@ -111,6 +113,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
111
113
|
| [NanoGPT](https://mastra.ai/models/providers/nano-gpt) | `nano-gpt/*` | `NANO_GPT_API_KEY` |
|
|
112
114
|
| [NEAR AI Cloud](https://mastra.ai/models/providers/nearai) | `nearai/*` | `NEARAI_API_KEY` |
|
|
113
115
|
| [Nebius Token Factory](https://mastra.ai/models/providers/nebius) | `nebius/*` | `NEBIUS_API_KEY` |
|
|
116
|
+
| [NeoSmith](https://mastra.ai/models/providers/neosmith) | `neosmith/*` | `NEOSMITH_API_KEY` |
|
|
114
117
|
| [Neuralwatt](https://mastra.ai/models/providers/neuralwatt) | `neuralwatt/*` | `NEURALWATT_API_KEY` |
|
|
115
118
|
| [Nova](https://mastra.ai/models/providers/nova) | `nova/*` | `NOVA_API_KEY` |
|
|
116
119
|
| [NovitaAI](https://mastra.ai/models/providers/novita-ai) | `novita-ai/*` | `NOVITA_API_KEY` |
|
|
@@ -144,6 +147,7 @@ List of required environment variables for each model provider and gateway suppo
|
|
|
144
147
|
| [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn) | `siliconflow-cn/*` | `SILICONFLOW_CN_API_KEY` |
|
|
145
148
|
| [Snowflake Cortex](https://mastra.ai/models/providers/snowflake-cortex) | `snowflake-cortex/*` | `SNOWFLAKE_ACCOUNT`, `SNOWFLAKE_CORTEX_PAT` |
|
|
146
149
|
| [STACKIT](https://mastra.ai/models/providers/stackit) | `stackit/*` | `STACKIT_API_KEY` |
|
|
150
|
+
| [Standard Compute](https://mastra.ai/models/providers/standardcompute) | `standardcompute/*` | `STANDARDCOMPUTE_API_KEY` |
|
|
147
151
|
| [StepFun (China)](https://mastra.ai/models/providers/stepfun) | `stepfun/*` | `STEPFUN_API_KEY` |
|
|
148
152
|
| [StepFun (Global)](https://mastra.ai/models/providers/stepfun-ai) | `stepfun-ai/*` | `STEPFUN_API_KEY` |
|
|
149
153
|
| [StepFun Step Plan (China)](https://mastra.ai/models/providers/stepfun-step-plan) | `stepfun-step-plan/*` | `STEPFUN_API_KEY` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Netlify
|
|
4
4
|
|
|
5
|
-
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access
|
|
5
|
+
Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 234 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
|
|
8
8
|
|
|
@@ -169,6 +169,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
169
169
|
| `openrouter/mistralai/ministral-8b-2512` |
|
|
170
170
|
| `openrouter/mistralai/mistral-large-2512` |
|
|
171
171
|
| `openrouter/mistralai/mistral-medium-3` |
|
|
172
|
+
| `openrouter/mistralai/mistral-medium-3-5` |
|
|
172
173
|
| `openrouter/mistralai/mistral-medium-3.1` |
|
|
173
174
|
| `openrouter/mistralai/mistral-nemo` |
|
|
174
175
|
| `openrouter/mistralai/mistral-small-24b-instruct-2501` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# OpenRouter
|
|
4
4
|
|
|
5
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 357 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
8
8
|
|
|
@@ -170,7 +170,9 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
170
170
|
| `minimax/minimax-m2.1` |
|
|
171
171
|
| `minimax/minimax-m2.5` |
|
|
172
172
|
| `minimax/minimax-m2.7` |
|
|
173
|
+
| `minimax/minimax-m2.7:free` |
|
|
173
174
|
| `minimax/minimax-m3` |
|
|
175
|
+
| `minimax/minimax-m3:free` |
|
|
174
176
|
| `mistralai/codestral-2508` |
|
|
175
177
|
| `mistralai/devstral-2512` |
|
|
176
178
|
| `mistralai/ministral-14b-2512` |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Vercel
|
|
4
4
|
|
|
5
|
-
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
5
|
+
Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 351 models through Mastra's model router.
|
|
6
6
|
|
|
7
7
|
Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
|
|
8
8
|
|
|
@@ -75,6 +75,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
75
75
|
| `alibaba/wan-v2.6-t2v` |
|
|
76
76
|
| `alibaba/wan-v2.7-r2v` |
|
|
77
77
|
| `alibaba/wan-v2.7-t2v` |
|
|
78
|
+
| `alibaba/wan-v3.0-video` |
|
|
78
79
|
| `amazon/nova-2-lite` |
|
|
79
80
|
| `amazon/nova-lite` |
|
|
80
81
|
| `amazon/nova-micro` |
|
|
@@ -203,8 +204,10 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
203
204
|
| `minimax/minimax-m2.5` |
|
|
204
205
|
| `minimax/minimax-m2.5-highspeed` |
|
|
205
206
|
| `minimax/minimax-m2.7` |
|
|
207
|
+
| `minimax/minimax-m2.7-free` |
|
|
206
208
|
| `minimax/minimax-m2.7-highspeed` |
|
|
207
209
|
| `minimax/minimax-m3` |
|
|
210
|
+
| `minimax/minimax-m3-free` |
|
|
208
211
|
| `mistral/codestral` |
|
|
209
212
|
| `mistral/codestral-embed` |
|
|
210
213
|
| `mistral/devstral-2` |
|
|
@@ -233,7 +236,6 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
233
236
|
| `nvidia/nemotron-3-super-120b-a12b` |
|
|
234
237
|
| `nvidia/nemotron-3-ultra-550b-a55b` |
|
|
235
238
|
| `nvidia/nemotron-3.5-lightning` |
|
|
236
|
-
| `nvidia/nemotron-3.5-lightning-free` |
|
|
237
239
|
| `nvidia/nemotron-nano-12b-v2-vl` |
|
|
238
240
|
| `nvidia/nemotron-nano-9b-v2` |
|
|
239
241
|
| `openai/gpt-3.5-turbo` |
|
|
@@ -289,6 +291,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
289
291
|
| `openai/gpt-image-2` |
|
|
290
292
|
| `openai/gpt-oss-120b` |
|
|
291
293
|
| `openai/gpt-oss-20b` |
|
|
294
|
+
| `openai/gpt-oss-safeguard-120b` |
|
|
292
295
|
| `openai/gpt-oss-safeguard-20b` |
|
|
293
296
|
| `openai/gpt-realtime-1.5` |
|
|
294
297
|
| `openai/gpt-realtime-2` |
|
package/.docs/models/index.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Model Providers
|
|
4
4
|
|
|
5
|
-
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to
|
|
5
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 6837 models from 186 providers through a single API.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|