@mastra/mcp-docs-server 1.0.0-beta.14 → 1.0.0-beta.15
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/organized/changelogs/%40mastra%2Fagent-builder.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +76 -76
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +218 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +308 -308
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Flance.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +128 -128
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +219 -219
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +235 -235
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +81 -81
- package/.docs/organized/changelogs/%40mastra%2Freact.md +70 -70
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +125 -125
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +195 -195
- package/.docs/organized/changelogs/create-mastra.md +11 -11
- package/.docs/organized/changelogs/mastra.md +40 -40
- package/.docs/organized/code-examples/agent-v6.md +70 -11
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/raw/agents/adding-voice.mdx +8 -3
- package/.docs/raw/deployment/overview.mdx +3 -4
- package/.docs/raw/deployment/workflow-runners.mdx +14 -0
- package/.docs/raw/getting-started/studio.mdx +1 -1
- package/.docs/raw/guides/deployment/inngest.mdx +198 -140
- package/.docs/raw/guides/migrations/upgrade-to-v1/memory.mdx +11 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/processors.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/storage.mdx +41 -0
- package/.docs/raw/mastra-cloud/deployment.mdx +39 -0
- package/.docs/raw/mastra-cloud/observability.mdx +9 -15
- package/.docs/raw/mastra-cloud/overview.mdx +14 -44
- package/.docs/raw/mastra-cloud/setup.mdx +64 -0
- package/.docs/raw/mastra-cloud/studio.mdx +35 -0
- package/.docs/raw/reference/logging/pino-logger.mdx +1 -1
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +39 -18
- package/.docs/raw/reference/storage/cloudflare-d1.mdx +4 -2
- package/.docs/raw/reference/storage/lance.mdx +3 -2
- package/.docs/raw/reference/storage/libsql.mdx +5 -2
- package/.docs/raw/reference/storage/mongodb.mdx +4 -2
- package/.docs/raw/reference/storage/mssql.mdx +4 -2
- package/.docs/raw/reference/storage/postgresql.mdx +4 -2
- package/.docs/raw/voice/overview.mdx +1 -1
- package/.docs/raw/workflows/overview.mdx +1 -1
- package/.docs/raw/workflows/snapshots.mdx +2 -1
- package/CHANGELOG.md +7 -0
- package/package.json +4 -4
- package/.docs/raw/mastra-cloud/dashboard.mdx +0 -96
- package/.docs/raw/mastra-cloud/setting-up.mdx +0 -106
- package/.docs/raw/workflows/inngest-workflow.mdx +0 -362
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"zod": "^3",
|
|
7
7
|
"typescript": "^5.8.3",
|
|
8
|
-
"@ai-sdk/openai": "3.0.0
|
|
9
|
-
"@ai-sdk/provider": "3.0.0
|
|
10
|
-
"ai": "^6.0.
|
|
8
|
+
"@ai-sdk/openai": "^3.0.0",
|
|
9
|
+
"@ai-sdk/provider": "^3.0.0",
|
|
10
|
+
"ai": "^6.0.1",
|
|
11
11
|
"@mastra/client-js": "beta",
|
|
12
12
|
"@mastra/core": "beta",
|
|
13
13
|
"@mastra/evals": "beta",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"@mastra/mcp": "beta",
|
|
17
17
|
"@mastra/memory": "beta",
|
|
18
18
|
"@mastra/observability": "beta",
|
|
19
|
-
"@mastra/voice-openai": "beta"
|
|
19
|
+
"@mastra/voice-openai": "beta",
|
|
20
|
+
"@mastra/ai-sdk": "beta"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"mastra": "beta",
|
|
@@ -54,8 +55,9 @@ console.log(result.object);
|
|
|
54
55
|
```typescript
|
|
55
56
|
import { Memory } from '@mastra/memory';
|
|
56
57
|
import { Agent } from '@mastra/core/agent';
|
|
58
|
+
import { stepCountIs, ToolLoopAgent } from 'ai';
|
|
57
59
|
import { openai } from '@ai-sdk/openai';
|
|
58
|
-
import { weatherInfo } from '../tools';
|
|
60
|
+
import { weatherInfo, weatherTool } from '../tools';
|
|
59
61
|
|
|
60
62
|
const memory = new Memory();
|
|
61
63
|
|
|
@@ -65,21 +67,51 @@ export const weatherAgent = new Agent({
|
|
|
65
67
|
instructions: `Your goal is to provide weather information for cities when requested`,
|
|
66
68
|
description: `An agent that can help you get weather information for a given city`,
|
|
67
69
|
model: openai('gpt-4o-mini'),
|
|
68
|
-
|
|
70
|
+
defaultOptions: {
|
|
71
|
+
stopWhen: stepCountIs(1),
|
|
72
|
+
},
|
|
73
|
+
tools: {
|
|
74
|
+
weatherInfo,
|
|
75
|
+
},
|
|
69
76
|
memory,
|
|
70
77
|
});
|
|
71
78
|
|
|
79
|
+
// AI SDK ToolLoopAgent
|
|
80
|
+
export const weatherToolLoopAgent = new ToolLoopAgent({
|
|
81
|
+
model: openai('gpt-4o-mini'),
|
|
82
|
+
instructions: 'You are a helpful weather assistant. Use the weather tool to get current conditions.',
|
|
83
|
+
stopWhen: stepCountIs(1),
|
|
84
|
+
tools: {
|
|
85
|
+
weather: weatherTool,
|
|
86
|
+
},
|
|
87
|
+
// temperature: 0.7,
|
|
88
|
+
// maxRetries: 2,
|
|
89
|
+
// stopWhen: stepCountIs(1),
|
|
90
|
+
// prepareCall: async args => {
|
|
91
|
+
// console.log('prepareCall', args);
|
|
92
|
+
// return args;
|
|
93
|
+
// },
|
|
94
|
+
// prepareStep: args => {
|
|
95
|
+
// console.log('prepareStep', args);
|
|
96
|
+
// return args;
|
|
97
|
+
// },
|
|
98
|
+
// onStepFinish: event => {
|
|
99
|
+
// console.log('onStepFinish', event);
|
|
100
|
+
// },
|
|
101
|
+
// onFinish: event => {
|
|
102
|
+
// console.log('onFinish', event);
|
|
103
|
+
// },
|
|
104
|
+
});
|
|
105
|
+
|
|
72
106
|
```
|
|
73
107
|
|
|
74
108
|
### mastra/index.ts
|
|
75
109
|
```typescript
|
|
76
110
|
import { Mastra } from '@mastra/core/mastra';
|
|
77
|
-
import { PinoLogger } from '@mastra/loggers';
|
|
78
111
|
import { LibSQLStore } from '@mastra/libsql';
|
|
112
|
+
import { weatherAgent, weatherToolLoopAgent } from './agents';
|
|
79
113
|
import { Observability } from '@mastra/observability';
|
|
80
114
|
|
|
81
|
-
import { weatherAgent } from './agents';
|
|
82
|
-
|
|
83
115
|
const storage = new LibSQLStore({
|
|
84
116
|
id: 'mastra-storage',
|
|
85
117
|
url: 'file:./mastra.db',
|
|
@@ -88,6 +120,7 @@ const storage = new LibSQLStore({
|
|
|
88
120
|
export const mastra = new Mastra({
|
|
89
121
|
storage,
|
|
90
122
|
agents: {
|
|
123
|
+
weatherToolLoopAgent,
|
|
91
124
|
weatherAgent,
|
|
92
125
|
},
|
|
93
126
|
bundler: {
|
|
@@ -98,7 +131,6 @@ export const mastra = new Mastra({
|
|
|
98
131
|
swaggerUI: true,
|
|
99
132
|
},
|
|
100
133
|
},
|
|
101
|
-
logger: new PinoLogger({ name: 'Chef', level: 'debug' }),
|
|
102
134
|
observability: new Observability({
|
|
103
135
|
default: { enabled: true },
|
|
104
136
|
}),
|
|
@@ -109,6 +141,7 @@ export const mastra = new Mastra({
|
|
|
109
141
|
### mastra/tools/index.ts
|
|
110
142
|
```typescript
|
|
111
143
|
import { createTool } from '@mastra/core/tools';
|
|
144
|
+
import { tool } from 'ai';
|
|
112
145
|
import { z } from 'zod';
|
|
113
146
|
|
|
114
147
|
export const weatherInfo = createTool({
|
|
@@ -129,12 +162,38 @@ export const weatherInfo = createTool({
|
|
|
129
162
|
},
|
|
130
163
|
});
|
|
131
164
|
|
|
165
|
+
// Create a tool using AI SDK's tool() helper
|
|
166
|
+
export const weatherTool = tool({
|
|
167
|
+
description: 'Get the current weather for a city',
|
|
168
|
+
inputSchema: z.object({
|
|
169
|
+
city: z.string().describe('The city to get weather for'),
|
|
170
|
+
}),
|
|
171
|
+
outputSchema: z.object({
|
|
172
|
+
city: z.string(),
|
|
173
|
+
weather: z.string(),
|
|
174
|
+
temperature: z.number(),
|
|
175
|
+
unit: z.string(),
|
|
176
|
+
}),
|
|
177
|
+
execute: async ({ city }) => {
|
|
178
|
+
// Simulated weather data
|
|
179
|
+
return {
|
|
180
|
+
city,
|
|
181
|
+
weather: 'sunny',
|
|
182
|
+
temperature: 72,
|
|
183
|
+
unit: 'fahrenheit',
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
132
188
|
```
|
|
133
189
|
|
|
134
190
|
### structured-output-example.ts
|
|
135
191
|
```typescript
|
|
136
192
|
import z from 'zod';
|
|
137
|
-
import {
|
|
193
|
+
import { mastra } from './mastra/index';
|
|
194
|
+
// import { weatherAgent } from './mastra/agents';
|
|
195
|
+
|
|
196
|
+
const weatherAgent = mastra.getAgent('weatherToolLoopAgent');
|
|
138
197
|
|
|
139
198
|
const result = await weatherAgent.generate('weather in new york', {
|
|
140
199
|
structuredOutput: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Voice | Agents"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Voice
|
|
6
6
|
|
|
7
7
|
Mastra agents can be enhanced with voice capabilities, allowing them to speak responses and listen to user input. You can configure an agent to use either a single voice provider or combine multiple providers for different operations.
|
|
8
8
|
|
|
@@ -348,4 +348,9 @@ Mastra supports multiple voice providers for text-to-speech (TTS) and speech-to-
|
|
|
348
348
|
| Azure | `@mastra/voice-azure` | TTS, STT | [Documentation](/reference/v1/voice/mastra-voice) |
|
|
349
349
|
| Cloudflare | `@mastra/voice-cloudflare` | TTS | [Documentation](/reference/v1/voice/mastra-voice) |
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
## Next Steps
|
|
352
|
+
|
|
353
|
+
- [Voice API Reference](/reference/v1/voice/mastra-voice) - Detailed API documentation for voice capabilities
|
|
354
|
+
- [Text to Speech Examples](https://github.com/mastra-ai/voice-examples/tree/main/text-to-speech) - Interactive story generator and other TTS implementations
|
|
355
|
+
- [Speech to Text Examples](https://github.com/mastra-ai/voice-examples/tree/main/speech-to-text) - Voice memo app and other STT implementations
|
|
356
|
+
- [Speech to Speech Examples](https://github.com/mastra-ai/voice-examples/tree/main/speech-to-speech) - Real-time voice conversation with call analysis
|
|
@@ -22,7 +22,7 @@ Mastra can run against any of these runtime environments:
|
|
|
22
22
|
|
|
23
23
|
Mastra provides a [server](/docs/v1/server/mastra-server) powered by Hono that can be deployed independently. Use the `mastra build` command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Visit the [Mastra server deployment guide](/docs/v1/deployment/mastra-server).
|
|
26
26
|
|
|
27
27
|
### Monorepo
|
|
28
28
|
|
|
@@ -58,7 +58,6 @@ Learn more in the [Mastra Cloud docs](/docs/v1/mastra-cloud/overview).
|
|
|
58
58
|
|
|
59
59
|
## Workflow Runners
|
|
60
60
|
|
|
61
|
-
Mastra
|
|
61
|
+
Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like [Inngest](https://www.inngest.com) that provide step memoization, automatic retries, and real-time monitoring.
|
|
62
62
|
|
|
63
|
-
- [Inngest deployment guide](/guides/v1/deployment/inngest)
|
|
64
|
-
- [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest)
|
|
63
|
+
Visit the [Workflow Runners guide](/docs/v1/deployment/workflow-runners) for execution options and the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Workflow Runners | Deployment"
|
|
3
|
+
description: "Deploy Mastra workflows to specialized workflow execution platforms"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Runners
|
|
7
|
+
|
|
8
|
+
Mastra [workflows](../workflows/overview.mdx) can be executed using the built-in workflow runner or deployed to specialized workflow execution platforms that handle orchestration, monitoring, and reliability.
|
|
9
|
+
|
|
10
|
+
## Inngest
|
|
11
|
+
|
|
12
|
+
Inngest is a developer platform for running background workflows without managing infrastructure. Mastra workflows can be deployed to Inngest, which provides step memoization, automatic retries, real-time monitoring, and suspend/resume capabilities.
|
|
13
|
+
|
|
14
|
+
Visit the [Inngest deployment guide](/guides/v1/deployment/inngest) for setup instructions and the [Inngest workflow example](https://github.com/mastra-ai/mastra/tree/main/examples/inngest) for a complete implementation.
|
|
@@ -14,7 +14,7 @@ Studio provides an interactive UI for building and testing your agents, along wi
|
|
|
14
14
|
|
|
15
15
|
As your project evolves, Studio's development environment helps you iterate on your agent quickly. Meanwhile, Observability and Scorer features give you visibility into performance at every stage.
|
|
16
16
|
|
|
17
|
-
To get started, run Studio locally using the instructions below, or [create a project in Mastra Cloud](
|
|
17
|
+
To get started, run Studio locally using the instructions below, or [create a project in Mastra Cloud](/docs/v1/mastra-cloud/setup) to collaborate with your team.
|
|
18
18
|
|
|
19
19
|
<YouTube id="ojGu6Bi4wYk" />
|
|
20
20
|
|