@mastra/mcp-docs-server 0.13.0 → 0.13.1-alpha.2
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/%40internal%2Fstorage-test-utils.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Fagui.md +14 -0
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +64 -64
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +65 -65
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +82 -82
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +79 -79
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +77 -77
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +94 -94
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +54 -0
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Flance.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +47 -47
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +32 -32
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +12 -0
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +108 -108
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +66 -66
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +13 -13
- package/.docs/organized/changelogs/create-mastra.md +35 -35
- package/.docs/organized/changelogs/mastra.md +124 -124
- package/.docs/organized/code-examples/agent.md +5 -2
- package/.docs/organized/code-examples/agui.md +4 -1
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
- package/.docs/organized/code-examples/fireworks-r1.md +1 -1
- package/.docs/organized/code-examples/memory-with-processors.md +2 -2
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/organized/code-examples/weather-agent.md +7 -1
- package/.docs/raw/course/01-first-agent/03-verifying-installation.md +4 -2
- package/.docs/raw/course/01-first-agent/16-adding-memory-to-agent.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/15-updating-mcp-config-github.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/20-updating-mcp-config-hackernews.md +1 -1
- package/.docs/raw/course/02-agent-tools-mcp/26-updating-mcp-config-filesystem.md +1 -1
- package/.docs/raw/course/03-agent-memory/03-installing-memory.md +4 -2
- package/.docs/raw/course/03-agent-memory/04-creating-basic-memory-agent.md +1 -1
- package/.docs/raw/course/03-agent-memory/08-configuring-conversation-history.md +3 -3
- package/.docs/raw/course/03-agent-memory/13-vector-store-configuration.md +27 -0
- package/.docs/raw/course/03-agent-memory/{13-what-is-semantic-recall.md → 14-what-is-semantic-recall.md} +1 -1
- package/.docs/raw/course/03-agent-memory/16-configuring-semantic-recall.md +41 -0
- package/.docs/raw/course/03-agent-memory/18-advanced-configuration-semantic-recall.md +28 -0
- package/.docs/raw/course/03-agent-memory/21-configuring-working-memory.md +9 -9
- package/.docs/raw/course/03-agent-memory/22-custom-working-memory-templates.md +10 -2
- package/.docs/raw/course/03-agent-memory/25-combining-memory-features.md +8 -1
- package/.docs/raw/course/03-agent-memory/27-creating-learning-assistant.md +8 -1
- package/.docs/raw/deployment/deployment.mdx +26 -97
- package/.docs/raw/deployment/overview.mdx +18 -3
- package/.docs/raw/deployment/web-framework.mdx +63 -0
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +7 -1
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +1 -1
- package/.docs/raw/getting-started/installation.mdx +98 -558
- package/.docs/raw/getting-started/project-structure.mdx +3 -16
- package/.docs/raw/rag/vector-databases.mdx +4 -7
- package/.docs/raw/reference/agents/generate.mdx +35 -3
- package/.docs/raw/reference/agents/stream.mdx +35 -3
- package/.docs/raw/reference/client-js/memory.mdx +14 -0
- package/.docs/raw/reference/client-js/workflows.mdx +28 -0
- package/.docs/raw/reference/deployer/cloudflare.mdx +9 -3
- package/.docs/raw/reference/deployer/deployer.mdx +1 -1
- package/.docs/raw/reference/deployer/netlify.mdx +25 -4
- package/.docs/raw/reference/deployer/vercel.mdx +10 -4
- package/.docs/raw/workflows/control-flow.mdx +45 -171
- package/.docs/raw/workflows/input-data-mapping.mdx +21 -88
- package/.docs/raw/workflows/overview.mdx +24 -47
- package/.docs/raw/workflows/suspend-and-resume.mdx +46 -34
- package/.docs/raw/workflows/using-with-agents-and-tools.mdx +55 -191
- package/dist/_tsup-dts-rollup.d.ts +14 -0
- package/dist/{chunk-QWIXFGFR.js → chunk-P5AHYMUI.js} +126 -20
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +42 -17
- package/package.json +15 -15
- package/.docs/raw/course/03-agent-memory/15-configuring-semantic-recall.md +0 -46
- package/.docs/raw/course/03-agent-memory/16-vector-store-configuration.md +0 -37
- package/.docs/raw/course/03-agent-memory/18-disabling-semantic-recall.md +0 -24
- /package/.docs/raw/{deployment/client.mdx → client-js/overview.mdx} +0 -0
- /package/.docs/raw/course/03-agent-memory/{14-how-semantic-recall-works.md → 15-how-semantic-recall-works.md} +0 -0
|
@@ -13,22 +13,9 @@ You could write everything in a single file, or separate each agent, tool, and w
|
|
|
13
13
|
|
|
14
14
|
We don't enforce a specific folder structure, but we do recommend some best practices, and the CLI will scaffold a project with a sensible structure.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Example Project Structure
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **Choose a directory for Mastra files**: Specify where you want the Mastra files to be placed (default is `src/mastra`).
|
|
21
|
-
- **Select components to install**: Choose which components you want to include in your project:
|
|
22
|
-
- Agents
|
|
23
|
-
- Tools
|
|
24
|
-
- Workflows
|
|
25
|
-
- **Select a default LLM provider**: Choose from supported providers like OpenAI, Anthropic, Groq, Google or Cerebras.
|
|
26
|
-
- **Include example code**: Decide whether to include example code to help you get started.
|
|
27
|
-
- **Install Mastra docs MCP server**: Make your AI IDE a Mastra expert
|
|
28
|
-
|
|
29
|
-
### Example Project Structure
|
|
30
|
-
|
|
31
|
-
Assuming you select all components and include example code, your project structure will look like this:
|
|
18
|
+
A default project created with the CLI looks like this:
|
|
32
19
|
|
|
33
20
|
<FileTree>
|
|
34
21
|
<FileTree.Folder name="src" defaultOpen>
|
|
@@ -49,7 +36,7 @@ Assuming you select all components and include example code, your project struct
|
|
|
49
36
|
<FileTree.File name="package.json" />
|
|
50
37
|
<FileTree.File name="tsconfig.json" />
|
|
51
38
|
</FileTree>
|
|
52
|
-
{/*
|
|
39
|
+
{/*
|
|
53
40
|
```
|
|
54
41
|
root/
|
|
55
42
|
├── src/
|
|
@@ -180,22 +180,19 @@ await store.upsert({
|
|
|
180
180
|
```ts filename="vector-store.ts" showLineNumbers copy
|
|
181
181
|
import { UpstashVector } from '@mastra/upstash'
|
|
182
182
|
|
|
183
|
+
// In upstash they refer to the store as an index
|
|
183
184
|
const store = new UpstashVector({
|
|
184
185
|
url: process.env.UPSTASH_URL,
|
|
185
186
|
token: process.env.UPSTASH_TOKEN
|
|
186
187
|
})
|
|
187
188
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
dimension: 1536,
|
|
191
|
-
});
|
|
192
|
-
|
|
189
|
+
// There is no store.createIndex call here, Upstash creates indexes (known as namespaces in Upstash) automatically
|
|
190
|
+
// when you upsert if that namespace does not exist yet.
|
|
193
191
|
await store.upsert({
|
|
194
|
-
indexName: "myCollection",
|
|
192
|
+
indexName: "myCollection", // the namespace name in Upstash
|
|
195
193
|
vectors: embeddings,
|
|
196
194
|
metadata: chunks.map(chunk => ({ text: chunk.text })),
|
|
197
195
|
});
|
|
198
|
-
|
|
199
196
|
```
|
|
200
197
|
</Tabs.Tab>
|
|
201
198
|
|
|
@@ -66,6 +66,38 @@ An optional object that can include configuration for output structure, memory m
|
|
|
66
66
|
description:
|
|
67
67
|
"Defines the expected structure of the output. Can be a JSON Schema object or a Zod schema.",
|
|
68
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: "memory",
|
|
71
|
+
type: "object",
|
|
72
|
+
isOptional: true,
|
|
73
|
+
description: "Configuration for memory. This is the preferred way to manage memory.",
|
|
74
|
+
properties: [
|
|
75
|
+
{
|
|
76
|
+
parameters: [{
|
|
77
|
+
name: "thread",
|
|
78
|
+
type: "string | { id: string; metadata?: Record<string, any>, title?: string }",
|
|
79
|
+
isOptional: false,
|
|
80
|
+
description: "The conversation thread, as a string ID or an object with an `id` and optional `metadata`."
|
|
81
|
+
}]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
parameters: [{
|
|
85
|
+
name: "resource",
|
|
86
|
+
type: "string",
|
|
87
|
+
isOptional: false,
|
|
88
|
+
description: "Identifier for the user or resource associated with the thread."
|
|
89
|
+
}]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
parameters: [{
|
|
93
|
+
name: "options",
|
|
94
|
+
type: "MemoryConfig",
|
|
95
|
+
isOptional: true,
|
|
96
|
+
description: "Configuration for memory behavior, like message history and semantic recall. See `MemoryConfig` below."
|
|
97
|
+
}]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
69
101
|
{
|
|
70
102
|
name: "maxSteps",
|
|
71
103
|
type: "number",
|
|
@@ -85,7 +117,7 @@ An optional object that can include configuration for output structure, memory m
|
|
|
85
117
|
type: "MemoryConfig",
|
|
86
118
|
isOptional: true,
|
|
87
119
|
description:
|
|
88
|
-
"Configuration options for memory management. See MemoryConfig section below for details.",
|
|
120
|
+
"**Deprecated.** Use `memory.options` instead. Configuration options for memory management. See MemoryConfig section below for details.",
|
|
89
121
|
},
|
|
90
122
|
{
|
|
91
123
|
name: "onStepFinish",
|
|
@@ -99,7 +131,7 @@ An optional object that can include configuration for output structure, memory m
|
|
|
99
131
|
type: "string",
|
|
100
132
|
isOptional: true,
|
|
101
133
|
description:
|
|
102
|
-
"Identifier for the user or resource interacting with the agent. Must be provided if threadId is provided.",
|
|
134
|
+
"**Deprecated.** Use `memory.resource` instead. Identifier for the user or resource interacting with the agent. Must be provided if threadId is provided.",
|
|
103
135
|
},
|
|
104
136
|
{
|
|
105
137
|
name: "telemetry",
|
|
@@ -120,7 +152,7 @@ An optional object that can include configuration for output structure, memory m
|
|
|
120
152
|
type: "string",
|
|
121
153
|
isOptional: true,
|
|
122
154
|
description:
|
|
123
|
-
"Identifier for the conversation thread. Allows for maintaining context across multiple interactions. Must be provided if resourceId is provided.",
|
|
155
|
+
"**Deprecated.** Use `memory.thread` instead. Identifier for the conversation thread. Allows for maintaining context across multiple interactions. Must be provided if resourceId is provided.",
|
|
124
156
|
},
|
|
125
157
|
{
|
|
126
158
|
name: "toolChoice",
|
|
@@ -59,6 +59,38 @@ An optional object that can include configuration for output structure, memory m
|
|
|
59
59
|
description:
|
|
60
60
|
"Custom instructions that override the agent's default instructions for this specific generation. Useful for dynamically modifying agent behavior without creating a new agent instance.",
|
|
61
61
|
},
|
|
62
|
+
{
|
|
63
|
+
name: "memory",
|
|
64
|
+
type: "object",
|
|
65
|
+
isOptional: true,
|
|
66
|
+
description: "Configuration for memory. This is the preferred way to manage memory.",
|
|
67
|
+
properties: [
|
|
68
|
+
{
|
|
69
|
+
parameters: [{
|
|
70
|
+
name: "thread",
|
|
71
|
+
type: "string | { id: string; metadata?: Record<string, any>, title?: string }",
|
|
72
|
+
isOptional: false,
|
|
73
|
+
description: "The conversation thread, as a string ID or an object with an `id` and optional `metadata`."
|
|
74
|
+
}]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
parameters: [{
|
|
78
|
+
name: "resource",
|
|
79
|
+
type: "string",
|
|
80
|
+
isOptional: false,
|
|
81
|
+
description: "Identifier for the user or resource associated with the thread."
|
|
82
|
+
}]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
parameters: [{
|
|
86
|
+
name: "options",
|
|
87
|
+
type: "MemoryConfig",
|
|
88
|
+
isOptional: true,
|
|
89
|
+
description: "Configuration for memory behavior, like message history and semantic recall. See `MemoryConfig` below."
|
|
90
|
+
}]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
62
94
|
{
|
|
63
95
|
name: "maxSteps",
|
|
64
96
|
type: "number",
|
|
@@ -78,7 +110,7 @@ An optional object that can include configuration for output structure, memory m
|
|
|
78
110
|
type: "MemoryConfig",
|
|
79
111
|
isOptional: true,
|
|
80
112
|
description:
|
|
81
|
-
"Configuration options for memory management. See MemoryConfig section below for details.",
|
|
113
|
+
"**Deprecated.** Use `memory.options` instead. Configuration options for memory management. See MemoryConfig section below for details.",
|
|
82
114
|
},
|
|
83
115
|
{
|
|
84
116
|
name: "onFinish",
|
|
@@ -105,7 +137,7 @@ An optional object that can include configuration for output structure, memory m
|
|
|
105
137
|
type: "string",
|
|
106
138
|
isOptional: true,
|
|
107
139
|
description:
|
|
108
|
-
"Identifier for the user or resource interacting with the agent. Must be provided if threadId is provided.",
|
|
140
|
+
"**Deprecated.** Use `memory.resource` instead. Identifier for the user or resource interacting with the agent. Must be provided if threadId is provided.",
|
|
109
141
|
},
|
|
110
142
|
{
|
|
111
143
|
name: "telemetry",
|
|
@@ -126,7 +158,7 @@ An optional object that can include configuration for output structure, memory m
|
|
|
126
158
|
type: "string",
|
|
127
159
|
isOptional: true,
|
|
128
160
|
description:
|
|
129
|
-
"Identifier for the conversation thread. Allows for maintaining context across multiple interactions. Must be provided if resourceId is provided.",
|
|
161
|
+
"**Deprecated.** Use `memory.thread` instead. Identifier for the conversation thread. Allows for maintaining context across multiple interactions. Must be provided if resourceId is provided.",
|
|
130
162
|
},
|
|
131
163
|
{
|
|
132
164
|
name: "toolChoice",
|
|
@@ -79,6 +79,8 @@ Delete a thread and its messages:
|
|
|
79
79
|
await thread.delete();
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
|
|
83
|
+
|
|
82
84
|
## Message Operations
|
|
83
85
|
|
|
84
86
|
### Save Messages
|
|
@@ -101,6 +103,18 @@ const savedMessages = await client.saveMessageToMemory({
|
|
|
101
103
|
});
|
|
102
104
|
```
|
|
103
105
|
|
|
106
|
+
### Retrieve Thread Messages
|
|
107
|
+
|
|
108
|
+
Get messages associated with a memory thread:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
// Get all messages in the thread
|
|
112
|
+
const { messages } = await thread.getMessages();
|
|
113
|
+
|
|
114
|
+
// Limit the number of messages retrieved
|
|
115
|
+
const { messages } = await thread.getMessages({ limit: 10 });
|
|
116
|
+
```
|
|
117
|
+
|
|
104
118
|
### Get Memory Status
|
|
105
119
|
|
|
106
120
|
Check the status of the memory system:
|
|
@@ -125,6 +125,34 @@ try {
|
|
|
125
125
|
}
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
+
### Get Workflow Run result
|
|
129
|
+
|
|
130
|
+
Get the result of a workflow run:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
try {
|
|
134
|
+
const workflow = client.getWorkflow("testWorkflow");
|
|
135
|
+
|
|
136
|
+
const run = await workflow.createRun();
|
|
137
|
+
|
|
138
|
+
// start the workflow run
|
|
139
|
+
const startResult = await workflow.start({
|
|
140
|
+
runId: run.runId,
|
|
141
|
+
inputData: {
|
|
142
|
+
city: "New York",
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const result = await workflow.runExecutionResult(run.runId);
|
|
147
|
+
|
|
148
|
+
console.log(result);
|
|
149
|
+
} catch (e) {
|
|
150
|
+
console.error(e);
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
This is useful when dealing with long running workflows. You can use this to poll the result of the workflow run.
|
|
155
|
+
|
|
128
156
|
### Workflow run result
|
|
129
157
|
|
|
130
158
|
A workflow run result yields the following:
|
|
@@ -5,15 +5,22 @@ description: "Documentation for the CloudflareDeployer class, which deploys Mast
|
|
|
5
5
|
|
|
6
6
|
# CloudflareDeployer
|
|
7
7
|
|
|
8
|
-
The CloudflareDeployer deploys Mastra applications to Cloudflare Workers, handling configuration, environment variables, and route management. It extends the abstract Deployer class to provide Cloudflare-specific deployment functionality.
|
|
8
|
+
The CloudflareDeployer deploys standalone Mastra applications to Cloudflare Workers, handling configuration, environment variables, and route management. It extends the abstract Deployer class to provide Cloudflare-specific deployment functionality.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash copy
|
|
13
|
+
npm install @mastra/deployer-cloudflare@latest
|
|
14
|
+
```
|
|
9
15
|
|
|
10
16
|
## Usage Example
|
|
11
17
|
|
|
12
|
-
```typescript
|
|
18
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
13
19
|
import { Mastra } from "@mastra/core";
|
|
14
20
|
import { CloudflareDeployer } from "@mastra/deployer-cloudflare";
|
|
15
21
|
|
|
16
22
|
const mastra = new Mastra({
|
|
23
|
+
// ...
|
|
17
24
|
deployer: new CloudflareDeployer({
|
|
18
25
|
scope: "your-account-id",
|
|
19
26
|
projectName: "your-project-name",
|
|
@@ -43,7 +50,6 @@ const mastra = new Mastra({
|
|
|
43
50
|
},
|
|
44
51
|
],
|
|
45
52
|
}),
|
|
46
|
-
// ... other Mastra configuration options
|
|
47
53
|
});
|
|
48
54
|
```
|
|
49
55
|
|
|
@@ -5,7 +5,7 @@ description: Documentation for the Deployer abstract class, which handles packag
|
|
|
5
5
|
|
|
6
6
|
# Deployer
|
|
7
7
|
|
|
8
|
-
The Deployer handles the deployment of Mastra applications by packaging code, managing environment files, and serving applications using the Hono framework. Concrete implementations must define the deploy method for specific deployment targets.
|
|
8
|
+
The Deployer handles the deployment of standalone Mastra applications by packaging code, managing environment files, and serving applications using the Hono framework. Concrete implementations must define the deploy method for specific deployment targets.
|
|
9
9
|
|
|
10
10
|
## Usage Example
|
|
11
11
|
|
|
@@ -5,21 +5,27 @@ description: "Documentation for the NetlifyDeployer class, which deploys Mastra
|
|
|
5
5
|
|
|
6
6
|
# NetlifyDeployer
|
|
7
7
|
|
|
8
|
-
The NetlifyDeployer deploys Mastra applications to Netlify Functions, handling site creation, configuration, and deployment processes. It extends the abstract Deployer class to provide Netlify-specific deployment functionality.
|
|
8
|
+
The NetlifyDeployer deploys standalone Mastra applications to Netlify Functions, handling site creation, configuration, and deployment processes. It extends the abstract Deployer class to provide Netlify-specific deployment functionality.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash copy
|
|
13
|
+
npm install @mastra/deployer-netlify@latest
|
|
14
|
+
```
|
|
9
15
|
|
|
10
16
|
## Usage Example
|
|
11
17
|
|
|
12
|
-
```typescript
|
|
18
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
13
19
|
import { Mastra } from "@mastra/core";
|
|
14
20
|
import { NetlifyDeployer } from "@mastra/deployer-netlify";
|
|
15
21
|
|
|
16
22
|
const mastra = new Mastra({
|
|
23
|
+
// ...
|
|
17
24
|
deployer: new NetlifyDeployer({
|
|
18
25
|
scope: "your-team-slug",
|
|
19
26
|
projectName: "your-project-name",
|
|
20
27
|
token: "your-netlify-token",
|
|
21
|
-
})
|
|
22
|
-
// ... other Mastra configuration options
|
|
28
|
+
})
|
|
23
29
|
});
|
|
24
30
|
```
|
|
25
31
|
|
|
@@ -115,6 +121,21 @@ After building, you can deploy your Mastra application `.mastra/output` to Netli
|
|
|
115
121
|
|
|
116
122
|
2. **Netlify Dashboard**: Connect your Git repository or drag-and-drop the build output through the Netlify dashboard
|
|
117
123
|
|
|
124
|
+
When connecting a Mastra project Git repository to Netlify, use these recommended build settings since Netlify resolves paths relative to the project root:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Build command
|
|
128
|
+
npm run build
|
|
129
|
+
|
|
130
|
+
# Publish directory
|
|
131
|
+
.mastra/output
|
|
132
|
+
|
|
133
|
+
# Functions directory
|
|
134
|
+
.mastra/output/netlify/functions
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
118
139
|
3. **Netlify Dev**: Run your Mastra application locally with Netlify's development environment
|
|
119
140
|
|
|
120
141
|
> You can also run `netlify dev` in your output directory `.mastra/output` to test your Mastra application locally.
|
|
@@ -5,21 +5,27 @@ description: "Documentation for the VercelDeployer class, which deploys Mastra a
|
|
|
5
5
|
|
|
6
6
|
# VercelDeployer
|
|
7
7
|
|
|
8
|
-
The VercelDeployer deploys Mastra applications to Vercel, handling configuration, environment variable synchronization, and deployment processes. It extends the abstract Deployer class to provide Vercel-specific deployment functionality.
|
|
8
|
+
The VercelDeployer deploys standalone Mastra applications to Vercel, handling configuration, environment variable synchronization, and deployment processes. It extends the abstract Deployer class to provide Vercel-specific deployment functionality.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash copy
|
|
13
|
+
npm install @mastra/deployer-vercel@latest
|
|
14
|
+
```
|
|
9
15
|
|
|
10
16
|
## Usage Example
|
|
11
17
|
|
|
12
|
-
```typescript
|
|
18
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
13
19
|
import { Mastra } from "@mastra/core";
|
|
14
20
|
import { VercelDeployer } from "@mastra/deployer-vercel";
|
|
15
21
|
|
|
16
22
|
const mastra = new Mastra({
|
|
23
|
+
// ...
|
|
17
24
|
deployer: new VercelDeployer({
|
|
18
25
|
teamSlug: "your-team-slug",
|
|
19
26
|
projectName: "your-project-name",
|
|
20
27
|
token: "your-vercel-token",
|
|
21
|
-
})
|
|
22
|
-
// ... other Mastra configuration options
|
|
28
|
+
})
|
|
23
29
|
});
|
|
24
30
|
```
|
|
25
31
|
|