@mastra/mcp-docs-server 0.13.9-alpha.1 → 0.13.9-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.
Files changed (63) hide show
  1. package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fastra.md +14 -14
  3. package/.docs/organized/changelogs/%40mastra%2Fauth.md +6 -0
  4. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +14 -14
  5. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +22 -22
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +15 -15
  7. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +14 -14
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +14 -14
  9. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +14 -14
  10. package/.docs/organized/changelogs/%40mastra%2Fcore.md +15 -15
  11. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +14 -14
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +17 -17
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +16 -16
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +16 -16
  15. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +17 -17
  16. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +14 -14
  17. package/.docs/organized/changelogs/%40mastra%2Fevals.md +14 -14
  18. package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +6 -0
  19. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +15 -15
  20. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +14 -14
  21. package/.docs/organized/changelogs/%40mastra%2Flance.md +13 -0
  22. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +15 -15
  23. package/.docs/organized/changelogs/%40mastra%2Floggers.md +14 -14
  24. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +14 -14
  25. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +14 -14
  26. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +14 -14
  27. package/.docs/organized/changelogs/%40mastra%2Fmem0.md +14 -14
  28. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +18 -18
  29. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +21 -21
  30. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +14 -0
  31. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +15 -15
  32. package/.docs/organized/changelogs/%40mastra%2Fpg.md +15 -15
  33. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +14 -14
  34. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +18 -18
  35. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +14 -14
  36. package/.docs/organized/changelogs/%40mastra%2Frag.md +14 -14
  37. package/.docs/organized/changelogs/%40mastra%2Fragie.md +14 -14
  38. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
  39. package/.docs/organized/changelogs/%40mastra%2Fserver.md +15 -15
  40. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +14 -14
  41. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +17 -17
  42. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +14 -14
  43. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +14 -14
  44. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +15 -15
  45. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +14 -14
  46. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +14 -14
  47. package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +13 -0
  48. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +14 -14
  49. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +14 -14
  50. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +14 -14
  51. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +16 -16
  52. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +14 -14
  53. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +14 -14
  54. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +14 -14
  55. package/.docs/organized/changelogs/create-mastra.md +3 -3
  56. package/.docs/organized/changelogs/mastra.md +18 -18
  57. package/.docs/organized/code-examples/workflow-with-separate-steps.md +83 -40
  58. package/.docs/raw/agents/overview.mdx +1 -0
  59. package/.docs/raw/course/02-agent-tools-mcp/14-getting-github-mcp-url.md +27 -8
  60. package/.docs/raw/course/02-agent-tools-mcp/15-updating-mcp-config-github.md +1 -1
  61. package/.docs/raw/memory/memory-processors.mdx +4 -3
  62. package/.docs/raw/workflows/using-with-agents-and-tools.mdx +25 -0
  63. package/package.json +6 -6
@@ -20,15 +20,21 @@
20
20
  import { mastra } from './mastra';
21
21
 
22
22
  async function main() {
23
- const myWorkflow = mastra.getWorkflow('myWorkflow');
24
- const { start } = myWorkflow.createRun();
23
+ const run = await mastra.getWorkflow('myWorkflow').createRunAsync();
25
24
  try {
26
- const res = await start({
27
- triggerData: {
28
- inputValue: 30,
25
+ const res = await run.start({
26
+ inputData: {
27
+ inputValue: 12,
29
28
  },
30
29
  });
31
- console.log(res.results);
30
+
31
+ if (res.status === 'success') {
32
+ console.log(res.result);
33
+ } else if (res.status === 'failed') {
34
+ console.log('Workflow failed:', res.error);
35
+ } else {
36
+ console.log('Workflow suspended:', res.suspended);
37
+ }
32
38
  } catch (e) {
33
39
  console.log(e);
34
40
  }
@@ -54,64 +60,101 @@ export const mastra = new Mastra({
54
60
 
55
61
  ### mastra/workflows/index.ts
56
62
  ```typescript
57
- import { Step, Workflow } from '@mastra/core/workflows';
63
+ import { createStep, createWorkflow } from '@mastra/core/workflows';
58
64
  import { z } from 'zod';
59
65
 
60
- const stepOne = new Step({
66
+ const stepOne = createStep({
61
67
  id: 'stepOne',
62
- execute: async ({ context }) => {
63
- const triggerData = context?.triggerData;
64
- const doubledValue = triggerData.inputValue * 2;
65
- return { doubledValue };
68
+ inputSchema: z.object({
69
+ inputValue: z.number(),
70
+ }),
71
+ outputSchema: z.object({
72
+ doubledValue: z.number(),
73
+ isOriginalOdd: z.boolean(), // Track original parity
74
+ }),
75
+ execute: async ({ inputData }) => {
76
+ const doubledValue = inputData.inputValue * 2;
77
+ const isOriginalOdd = inputData.inputValue % 2 === 1;
78
+ return { doubledValue, isOriginalOdd };
66
79
  },
67
80
  });
68
81
 
69
- const stepTwo = new Step({
82
+ const stepTwo = createStep({
70
83
  id: 'stepTwo',
71
- execute: async ({ context }) => {
72
- if (context?.steps.stepOne.status !== 'success') {
73
- throw new Error('stepOne failed');
74
- }
75
- const stepOneResult = context?.steps.stepOne?.output;
76
- const incrementedValue = stepOneResult.doubledValue + 1;
84
+ inputSchema: z.object({
85
+ doubledValue: z.number(),
86
+ isOriginalOdd: z.boolean(),
87
+ }),
88
+ outputSchema: z.object({
89
+ incrementedValue: z.number(),
90
+ }),
91
+ execute: async ({ inputData }) => {
92
+ // Increment only if original input was odd
93
+ const incrementedValue = inputData.doubledValue + (inputData.isOriginalOdd ? 1 : 0);
77
94
  return { incrementedValue };
78
95
  },
79
96
  });
80
97
 
81
- const stepThree = new Step({
98
+ const stepThree = createStep({
82
99
  id: 'stepThree',
83
- execute: async ({ context }) => {
84
- const triggerData = context?.triggerData;
85
- const tripledValue = triggerData.inputValue * 3;
100
+ inputSchema: z.object({
101
+ incrementedValue: z.number(),
102
+ }),
103
+ outputSchema: z.object({
104
+ tripledValue: z.number(),
105
+ }),
106
+ execute: async ({ inputData, getStepResult }) => {
107
+ try {
108
+ const stepTwoResult = getStepResult(stepTwo);
109
+ if (!stepTwoResult || typeof stepTwoResult.incrementedValue !== 'number') {
110
+ throw new Error('stepTwo failed or returned invalid data');
111
+ }
112
+ } catch (error) {
113
+ throw new Error(`stepTwo failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
114
+ }
115
+
116
+ const tripledValue = inputData.incrementedValue * 3;
86
117
  return { tripledValue };
87
118
  },
88
119
  });
89
120
 
90
- const stepFour = new Step({
121
+ const stepFour = createStep({
91
122
  id: 'stepFour',
92
- execute: async ({ context }) => {
93
- if (context?.steps.stepThree.status !== 'success') {
94
- throw new Error('stepThree failed');
123
+ inputSchema: z.object({
124
+ tripledValue: z.number(),
125
+ }),
126
+ outputSchema: z.object({
127
+ isEven: z.boolean(),
128
+ }),
129
+ execute: async ({ inputData, getStepResult }) => {
130
+ try {
131
+ const stepThreeResult = getStepResult(stepThree);
132
+ if (!stepThreeResult || typeof stepThreeResult.tripledValue !== 'number') {
133
+ throw new Error('stepThree failed or returned invalid data');
134
+ }
135
+ } catch (error) {
136
+ throw new Error(`stepThree failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
95
137
  }
96
- const stepThreeResult = context?.steps.stepThree?.output;
97
- const isEven = stepThreeResult.tripledValue % 2 === 0;
138
+
139
+ const isEven = inputData.tripledValue % 2 === 0;
98
140
  return { isEven };
99
141
  },
100
142
  });
101
143
 
102
- export const myWorkflow = new Workflow({
103
- name: 'my-workflow',
104
- triggerSchema: z.object({
144
+ export const myWorkflow = createWorkflow({
145
+ id: 'my-workflow',
146
+ inputSchema: z.object({
105
147
  inputValue: z.number(),
106
148
  }),
107
- });
108
-
109
- myWorkflow.step(stepOne).then(stepTwo).step(stepThree).then(stepFour).commit();
110
-
111
- const { start } = myWorkflow.createRun();
112
-
113
- const result = await start({ triggerData: { inputValue: 3 } });
149
+ outputSchema: z.object({
150
+ isEven: z.boolean(),
151
+ }),
152
+ })
153
+ .then(stepOne)
154
+ .then(stepTwo)
155
+ .then(stepThree)
156
+ .then(stepFour);
114
157
 
115
- console.log(result);
158
+ myWorkflow.commit();
116
159
 
117
160
  ```
@@ -100,6 +100,7 @@ await testAgent.generate([
100
100
  {
101
101
  type: 'image',
102
102
  image: "https://example.com/images/test-image.jpg",
103
+ mimeType: "image/jpeg"
103
104
  },
104
105
  {
105
106
  type: 'text',
@@ -1,16 +1,35 @@
1
- # Getting a Composio GitHub MCP URL
1
+ # Getting a Smithery GitHub MCP URL
2
2
 
3
- First, you'll need to get a Composio GitHub MCP URL. This typically requires:
3
+ First, you'll need to get a Smithery GitHub MCP URL. This typically requires:
4
4
 
5
- 1. Setting up the Composio GitHub integration
6
- 2. Authenticating with your GitHub account
7
- 3. Getting your unique MCP URL
5
+ 1. Setting up a Smithery account
6
+ 2. Creating a personal access token with your GitHub account
7
+ 3. Getting your unique MCP URL via the Smithery packages
8
8
 
9
- For this example, we'll use an environment variable to store the URL:
9
+ For this example, we'll use an environment variable to store the Smithery API key and profile name which can be found in the Smithery interface.
10
10
 
11
11
  ```bash
12
12
  # Add this to your .env file
13
- COMPOSIO_MCP_GITHUB=https://your-composio-github-mcp-url.com
13
+ SMITHERY_API_KEY=your_smithery_api_key
14
+ SMITHERY_PROFILE=your_smithery_profile_name
14
15
  ```
15
16
 
16
- Using an environment variable keeps your configuration secure and flexible. This approach allows you to easily switch between different GitHub accounts or environments without modifying your code. It also prevents sensitive information from being committed to your repository.
17
+ Using an environment variable keeps your configuration secure and flexible. It also prevents sensitive information from being committed to your repository.
18
+
19
+ We will use the Smithery packages to authenticate and create a streamable HTTP URL for the MCP server configuration
20
+
21
+ ```bash
22
+ pnpm install @smithery/sdk
23
+ ```
24
+
25
+ ```ts
26
+ import { createSmitheryUrl } from "@smithery/sdk";
27
+
28
+ const smitheryGithubMCPServerUrl = createSmitheryUrl(
29
+ "https://server.smithery.ai/@smithery-ai/github",
30
+ {
31
+ apiKey: process.env.SMITHERY_API_KEY,
32
+ profile: process.env.SMITHERY_PROFILE,
33
+ },
34
+ );
35
+ ```
@@ -9,7 +9,7 @@ const mcp = new MCPClient({
9
9
  url: new URL(process.env.ZAPIER_MCP_URL || ""),
10
10
  },
11
11
  github: {
12
- url: new URL(process.env.COMPOSIO_MCP_GITHUB || ""),
12
+ url: smitheryGithubMCPServerUrl,
13
13
  },
14
14
  },
15
15
  });
@@ -97,9 +97,10 @@ const memoryWithMultipleProcessors = new Memory({
97
97
 
98
98
  You can create custom logic by extending the base `MemoryProcessor` class.
99
99
 
100
- ```typescript copy showLineNumbers {4-19,23-26}
101
- import { Memory, CoreMessage } from "@mastra/memory";
102
- import { MemoryProcessor, MemoryProcessorOpts } from "@mastra/core/memory";
100
+ ```typescript copy showLineNumbers {5-20,24-27}
101
+ import { Memory } from "@mastra/memory";
102
+ import { CoreMessage, MemoryProcessorOpts } from "@mastra/core";
103
+ import { MemoryProcessor } from "@mastra/core/memory";
103
104
 
104
105
  class ConversationOnlyFilter extends MemoryProcessor {
105
106
  constructor() {
@@ -258,6 +258,31 @@ export const cityCoordinatesTool = createTool({
258
258
  });
259
259
  ```
260
260
 
261
+ ## Using workflows in agents
262
+
263
+ You can also use Workflows in Agents. This agent is able to choose between using the test tool or the test workflow.
264
+
265
+ ```typescript
266
+ import { openai } from "@ai-sdk/openai";
267
+ import { Agent } from "@mastra/core/agent";
268
+ import { testTool } from "../tools/test-tool";
269
+ import { testWorkflow } from "../workflows/test-workflow";
270
+
271
+ export const testAgent = new Agent({
272
+ name: "test-agent",
273
+ description: "Create facts for a country based on the city",
274
+ instructions: `Return an interesting fact about the country based on the city provided`,
275
+ model: openai("gpt-4o"),
276
+ workflows: {
277
+ test_workflow: testWorkflow
278
+ },
279
+ tools: {
280
+ test_tool: testTool
281
+ },
282
+ });
283
+ ```
284
+
285
+
261
286
  ## Exposing workflows with `MCPServer`
262
287
 
263
288
  You can convert your workflows into tools by passing them into an instance of a Mastra `MCPServer`. This allows any MCP-compatible client to access your workflow.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "0.13.9-alpha.1",
3
+ "version": "0.13.9-alpha.2",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,8 +32,8 @@
32
32
  "uuid": "^11.1.0",
33
33
  "zod": "^3.25.67",
34
34
  "zod-to-json-schema": "^3.24.5",
35
- "@mastra/core": "0.13.0-alpha.1",
36
- "@mastra/mcp": "^0.10.9"
35
+ "@mastra/core": "0.13.0-alpha.2",
36
+ "@mastra/mcp": "^0.10.10-alpha.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@hono/node-server": "^1.17.1",
@@ -43,13 +43,13 @@
43
43
  "@wong2/mcp-cli": "^1.10.0",
44
44
  "cross-env": "^7.0.3",
45
45
  "eslint": "^9.30.1",
46
- "hono": "^4.8.9",
46
+ "hono": "^4.8.11",
47
47
  "tsup": "^8.5.0",
48
48
  "tsx": "^4.19.4",
49
49
  "typescript": "^5.8.3",
50
50
  "vitest": "^3.2.4",
51
- "@internal/lint": "0.0.26",
52
- "@mastra/core": "0.13.0-alpha.1"
51
+ "@mastra/core": "0.13.0-alpha.2",
52
+ "@internal/lint": "0.0.26"
53
53
  },
54
54
  "scripts": {
55
55
  "prepare-docs": "cross-env PREPARE=true node dist/prepare-docs/prepare.js",