@mastra/mcp-docs-server 0.13.2-alpha.1 → 0.13.2-alpha.3
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%2Fastra.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +15 -15
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Flance.md +13 -0
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +13 -0
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +14 -14
- package/.docs/organized/changelogs/mastra.md +22 -22
- package/.docs/organized/code-examples/agent.md +182 -5
- package/.docs/organized/code-examples/assistant-ui.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
- package/.docs/organized/code-examples/crypto-chatbot.md +2 -2
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
- package/.docs/raw/agents/using-tools-and-mcp.mdx +3 -2
- package/.docs/raw/course/01-first-agent/04-project-structure.md +8 -3
- package/.docs/raw/course/01-first-agent/07-creating-your-agent.md +5 -3
- package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +20 -6
- package/.docs/raw/course/01-first-agent/11-creating-transactions-tool.md +5 -3
- package/.docs/raw/course/01-first-agent/12-connecting-tool-to-agent.md +2 -2
- package/.docs/raw/course/04-workflows/01-introduction-to-workflows.md +44 -0
- package/.docs/raw/course/04-workflows/02-understanding-steps.md +53 -0
- package/.docs/raw/course/04-workflows/03-creating-your-first-step.md +57 -0
- package/.docs/raw/course/04-workflows/04-creating-a-second-step.md +58 -0
- package/.docs/raw/course/04-workflows/05-chaining-steps-together.md +56 -0
- package/.docs/raw/course/04-workflows/06-registering-with-mastra.md +24 -0
- package/.docs/raw/course/04-workflows/07-using-playground.md +58 -0
- package/.docs/raw/course/04-workflows/08-running-workflows-programmatically.md +77 -0
- package/.docs/raw/course/04-workflows/09-adding-a-third-step.md +70 -0
- package/.docs/raw/course/04-workflows/10-updating-the-workflow.md +55 -0
- package/.docs/raw/course/04-workflows/11-creating-an-ai-agent.md +67 -0
- package/.docs/raw/course/04-workflows/12-using-agent-in-workflow.md +91 -0
- package/.docs/raw/course/04-workflows/13-creating-ai-enhanced-workflow.md +75 -0
- package/.docs/raw/course/04-workflows/14-understanding-parallel-execution.md +38 -0
- package/.docs/raw/course/04-workflows/15-creating-parallel-steps.md +115 -0
- package/.docs/raw/course/04-workflows/16-building-parallel-workflow.md +100 -0
- package/.docs/raw/course/04-workflows/17-testing-parallel-performance.md +40 -0
- package/.docs/raw/course/04-workflows/18-understanding-conditional-branching.md +58 -0
- package/.docs/raw/course/04-workflows/19-creating-conditional-steps.md +128 -0
- package/.docs/raw/course/04-workflows/20-building-conditional-workflow.md +60 -0
- package/.docs/raw/course/04-workflows/21-testing-conditional-logic.md +58 -0
- package/.docs/raw/course/04-workflows/22-conclusion.md +58 -0
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +111 -0
- package/.docs/raw/deployment/cloud-providers/index.mdx +15 -0
- package/.docs/raw/memory/working-memory.mdx +56 -0
- package/.docs/raw/networks-vnext/complex-task-execution.mdx +137 -0
- package/.docs/raw/networks-vnext/overview.mdx +85 -0
- package/.docs/raw/networks-vnext/single-task-execution.mdx +131 -0
- package/.docs/raw/reference/client-js/agents.mdx +41 -0
- package/.docs/raw/reference/deployer/netlify.mdx +22 -68
- package/.docs/raw/reference/deployer/vercel.mdx +7 -77
- package/.docs/raw/reference/tools/mcp-client.mdx +244 -0
- package/.docs/raw/reference/tools/mcp-server.mdx +186 -0
- package/.docs/raw/reference/workflows/create-run.mdx +1 -1
- package/.docs/raw/reference/workflows/resume.mdx +1 -1
- package/.docs/raw/reference/workflows/start.mdx +1 -1
- package/.docs/raw/reference/workflows/stream.mdx +1 -1
- package/.docs/raw/reference/workflows/watch.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow.mdx +6 -2
- package/.docs/raw/workflows/control-flow.mdx +42 -1
- package/.docs/raw/workflows/overview.mdx +73 -5
- package/.docs/raw/workflows/pausing-execution.mdx +1 -1
- package/.docs/raw/workflows/suspend-and-resume.mdx +68 -23
- package/.docs/raw/workflows/using-with-agents-and-tools.mdx +1 -1
- package/package.json +3 -3
|
@@ -157,12 +157,12 @@ With the Mastra Dev Server running you can run the workflow from the Mastra Play
|
|
|
157
157
|
|
|
158
158
|
#### Command line
|
|
159
159
|
|
|
160
|
-
Create a run instance of any Mastra workflow using `
|
|
160
|
+
Create a run instance of any Mastra workflow using `createRunAsync` and `start`:
|
|
161
161
|
|
|
162
162
|
```typescript {3,5} filename="src/test-workflow.ts" showLineNumbers copy
|
|
163
163
|
import { mastra } from "./mastra";
|
|
164
164
|
|
|
165
|
-
const run = mastra.getWorkflow("testWorkflow").
|
|
165
|
+
const run = await mastra.getWorkflow("testWorkflow").createRunAsync();
|
|
166
166
|
|
|
167
167
|
const result = await run.start({
|
|
168
168
|
inputData: {
|
|
@@ -172,7 +172,7 @@ const result = await run.start({
|
|
|
172
172
|
|
|
173
173
|
console.log(JSON.stringify(result, null, 2));
|
|
174
174
|
```
|
|
175
|
-
> see [
|
|
175
|
+
> see [createRunAsync](/reference/workflows/create-run-async) and [start](/reference/workflows/start) for more information.
|
|
176
176
|
|
|
177
177
|
To trigger this workflow, run the following:
|
|
178
178
|
|
|
@@ -182,6 +182,74 @@ npx tsx src/test-workflow.ts
|
|
|
182
182
|
|
|
183
183
|
</Steps>
|
|
184
184
|
|
|
185
|
+
#### Run Workflow Results
|
|
186
|
+
|
|
187
|
+
The result of running a workflow using either `start()` or `resume()` will look like one of the following, depending on the outcome.
|
|
188
|
+
|
|
189
|
+
##### Status success
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"status": "success",
|
|
194
|
+
"steps": {
|
|
195
|
+
// ...
|
|
196
|
+
"step-1": {
|
|
197
|
+
// ...
|
|
198
|
+
"status": "success",
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"result": {
|
|
202
|
+
"output": "London + step-1"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
- **status**: Shows the final state of the workflow execution, either: `success`, `suspended`, or `error`
|
|
208
|
+
- **steps**: Lists each step in the workflow, including inputs and outputs
|
|
209
|
+
- **status**: Shows the outcome of each individual step
|
|
210
|
+
- **result**: Includes the final output of the workflow, typed according to the `outputSchema`
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
##### Status suspended
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"status": "suspended",
|
|
218
|
+
"steps": {
|
|
219
|
+
// ...
|
|
220
|
+
"step-1": {
|
|
221
|
+
// ...
|
|
222
|
+
"status": "suspended",
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"suspended": [
|
|
226
|
+
[
|
|
227
|
+
"step-1"
|
|
228
|
+
]
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
- **suspended**: An optional array listing any steps currently awaiting input before continuing
|
|
234
|
+
|
|
235
|
+
##### Status failed
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"status": "failed",
|
|
240
|
+
"steps": {
|
|
241
|
+
// ...
|
|
242
|
+
"step-1": {
|
|
243
|
+
// ...
|
|
244
|
+
"status": "failed",
|
|
245
|
+
"error": "Test error",
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"error": "Test error"
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
- **error**: An optional field that includes the error message if the workflow fails
|
|
252
|
+
|
|
185
253
|
### Stream Workflow
|
|
186
254
|
|
|
187
255
|
Similar to the run method shown above, workflows can also be streamed:
|
|
@@ -189,7 +257,7 @@ Similar to the run method shown above, workflows can also be streamed:
|
|
|
189
257
|
```typescript {5} filename="src/test-workflow.ts" showLineNumbers copy
|
|
190
258
|
import { mastra } from "./mastra";
|
|
191
259
|
|
|
192
|
-
const run = mastra.getWorkflow("testWorkflow").
|
|
260
|
+
const run = await mastra.getWorkflow("testWorkflow").createRunAsync();
|
|
193
261
|
|
|
194
262
|
const result = await run.stream({
|
|
195
263
|
inputData: {
|
|
@@ -211,7 +279,7 @@ A workflow can also be watched, allowing you to inspect each event that is emitt
|
|
|
211
279
|
```typescript {5} filename="src/test-workflow.ts" showLineNumbers copy
|
|
212
280
|
import { mastra } from "./mastra";
|
|
213
281
|
|
|
214
|
-
const run = mastra.getWorkflow("testWorkflow").
|
|
282
|
+
const run = await mastra.getWorkflow("testWorkflow").createRunAsync();
|
|
215
283
|
|
|
216
284
|
run.watch((event) => {
|
|
217
285
|
console.log(event);
|
|
@@ -27,29 +27,26 @@ When running a workflow, its `status` can be one of the following:
|
|
|
27
27
|
|
|
28
28
|
## Suspend
|
|
29
29
|
|
|
30
|
-
When the state is `suspended`, you can identify any and all steps that have been suspended by looking at the `suspended` array of the workflow.
|
|
30
|
+
When the state is `suspended`, you can identify any and all steps that have been suspended by looking at the `suspended` array of the workflow result output.
|
|
31
31
|
|
|
32
32
|
```typescript {17} filename="src/mastra/workflows/test-workflow.ts" showLineNumbers copy
|
|
33
33
|
const step1 = createStep({
|
|
34
34
|
id: "step-1",
|
|
35
35
|
description: "Test suspend",
|
|
36
36
|
inputSchema: z.object({
|
|
37
|
-
input: z.
|
|
38
|
-
}),
|
|
39
|
-
resumeSchema: z.object({
|
|
40
|
-
city: z.string()
|
|
37
|
+
input: z.string()
|
|
41
38
|
}),
|
|
42
39
|
outputSchema: z.object({
|
|
43
40
|
output: z.string()
|
|
44
41
|
}),
|
|
42
|
+
suspendSchema: z.object({}),
|
|
43
|
+
resumeSchema: z.object({
|
|
44
|
+
city: z.string()
|
|
45
|
+
}),
|
|
45
46
|
execute: async ({ resumeData, suspend }) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (!city) {
|
|
47
|
+
if (!(resumeData ?? {}).city) {
|
|
49
48
|
await suspend({});
|
|
50
|
-
return {
|
|
51
|
-
outcome: ""
|
|
52
|
-
};
|
|
49
|
+
return { output: "" };
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
return {
|
|
@@ -65,17 +62,69 @@ export const testWorkflow = createWorkflow({})
|
|
|
65
62
|
|
|
66
63
|
> See [Define Suspendable workflow](/examples/workflows/human-in-the-loop#define-suspendable-workflow) for more information.
|
|
67
64
|
|
|
65
|
+
### Identifying Suspended steps
|
|
66
|
+
|
|
67
|
+
To resume a suspended workflow, inspect the `suspended` array in the result to determine which step needs input:
|
|
68
|
+
|
|
69
|
+
```typescript {15} filename="src/test-workflow.ts" showLineNumbers copy
|
|
70
|
+
import { mastra } from "./mastra";
|
|
71
|
+
|
|
72
|
+
const run = await mastra.getWorkflow("testWorkflow").createRunAsync();
|
|
73
|
+
|
|
74
|
+
const result = await run.start({
|
|
75
|
+
inputData: {
|
|
76
|
+
city: "London"
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
console.log(JSON.stringify(result, null, 2));
|
|
81
|
+
|
|
82
|
+
if (result.status === "suspended") {
|
|
83
|
+
const resumedResult = await run.resume({
|
|
84
|
+
step: result.suspended[0],
|
|
85
|
+
resumeData: {
|
|
86
|
+
city: "Berlin"
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
In this case, the logic resumes the first step listed in the `suspended` array. A `step` can also be defined using it's `id`, for example: 'step-1'.
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"status": "suspended",
|
|
98
|
+
"steps": {
|
|
99
|
+
// ...
|
|
100
|
+
"step-1": {
|
|
101
|
+
// ...
|
|
102
|
+
"status": "suspended",
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"suspended": [
|
|
106
|
+
[
|
|
107
|
+
"step-1"
|
|
108
|
+
]
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
> See [Run Workflow Results](/workflows/overview#run-workflow-results) for more details.
|
|
114
|
+
|
|
68
115
|
## Resume
|
|
69
116
|
|
|
70
117
|
A workflow can be resumed by calling `resume` and providing the required `resumeData`.
|
|
71
118
|
|
|
72
|
-
```typescript {
|
|
119
|
+
```typescript {16-18} filename="src/test-workflow.ts" showLineNumbers copy
|
|
73
120
|
import { mastra } from "./mastra";
|
|
74
121
|
|
|
75
|
-
const run = mastra.getWorkflow("testWorkflow").
|
|
122
|
+
const run = await mastra.getWorkflow("testWorkflow").createRunAsync();
|
|
76
123
|
|
|
77
124
|
const result = await run.start({
|
|
78
|
-
|
|
125
|
+
inputData: {
|
|
126
|
+
city: "London"
|
|
127
|
+
}
|
|
79
128
|
});
|
|
80
129
|
|
|
81
130
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -83,19 +132,15 @@ console.log(JSON.stringify(result, null, 2));
|
|
|
83
132
|
if (result.status === "suspended") {
|
|
84
133
|
const resumedResult = await run.resume({
|
|
85
134
|
step: 'step-1',
|
|
86
|
-
resumeData: {
|
|
135
|
+
resumeData: {
|
|
136
|
+
city: "Berlin"
|
|
137
|
+
}
|
|
87
138
|
});
|
|
88
139
|
|
|
89
140
|
console.log(JSON.stringify(resumedResult, null, 2));
|
|
90
141
|
}
|
|
91
142
|
```
|
|
92
143
|
|
|
93
|
-
To execute this run from your terminal:
|
|
94
|
-
|
|
95
|
-
```bash copy
|
|
96
|
-
npx tsx src/test-workflow.ts
|
|
97
|
-
```
|
|
98
|
-
|
|
99
144
|
### Nested Workflow
|
|
100
145
|
|
|
101
146
|
To resume a suspended nested workflow pass the workflow instance to the `step` parameter of the `resume` function.
|
|
@@ -128,7 +173,7 @@ const dowhileWorkflow = createWorkflow({
|
|
|
128
173
|
)
|
|
129
174
|
.commit();
|
|
130
175
|
|
|
131
|
-
const run = dowhileWorkflow.
|
|
176
|
+
const run = await dowhileWorkflow.createRunAsync();
|
|
132
177
|
const result = await run.start({ inputData: { value: 0 } });
|
|
133
178
|
|
|
134
179
|
if (result.status === "suspended") {
|
|
@@ -151,7 +196,7 @@ import { RuntimeContext } from "@mastra/core/di";
|
|
|
151
196
|
import { mastra } from "./mastra";
|
|
152
197
|
|
|
153
198
|
const runtimeContext = new RuntimeContext();
|
|
154
|
-
const run = mastra.getWorkflow("testWorkflow").
|
|
199
|
+
const run = await mastra.getWorkflow("testWorkflow").createRunAsync();
|
|
155
200
|
|
|
156
201
|
const result = await run.start({
|
|
157
202
|
inputData: { suggestions: ["London", "Paris", "New York"] },
|
|
@@ -238,7 +238,7 @@ export const cityCoordinatesTool = createTool({
|
|
|
238
238
|
|
|
239
239
|
const workflow = mastra?.getWorkflow("cityStringWorkflow");
|
|
240
240
|
|
|
241
|
-
const run = workflow?.
|
|
241
|
+
const run = await workflow?.createRunAsync();
|
|
242
242
|
|
|
243
243
|
const { result } = await run?.start({
|
|
244
244
|
inputData: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "0.13.2-alpha.
|
|
3
|
+
"version": "0.13.2-alpha.3",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
33
|
"zod": "^3.25.67",
|
|
34
34
|
"zod-to-json-schema": "^3.24.5",
|
|
35
|
-
"@mastra/mcp": "^0.10.5-alpha.
|
|
35
|
+
"@mastra/mcp": "^0.10.5-alpha.2"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@hono/node-server": "^1.14.4",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"typescript": "^5.8.3",
|
|
49
49
|
"vitest": "^3.2.3",
|
|
50
50
|
"@internal/lint": "0.0.13",
|
|
51
|
-
"@mastra/core": "0.10.7-alpha.
|
|
51
|
+
"@mastra/core": "0.10.7-alpha.4"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@mastra/core": "^0.10.0-alpha.0"
|