@mastra/mcp-docs-server 0.13.2-alpha.3 → 0.13.3-alpha.0

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 (117) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +33 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fagui.md +48 -0
  3. package/.docs/organized/changelogs/%40mastra%2Fastra.md +30 -30
  4. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +30 -30
  5. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +33 -33
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +98 -98
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +41 -41
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +42 -42
  9. package/.docs/organized/changelogs/%40mastra%2Fcore.md +77 -77
  10. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +29 -29
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +106 -106
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +101 -101
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +99 -99
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +111 -111
  15. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +35 -35
  16. package/.docs/organized/changelogs/%40mastra%2Fevals.md +26 -26
  17. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +29 -29
  18. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +26 -26
  19. package/.docs/organized/changelogs/%40mastra%2Flance.md +32 -0
  20. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +35 -35
  21. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +59 -59
  22. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +29 -29
  23. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +31 -31
  24. package/.docs/organized/changelogs/%40mastra%2Fmem0.md +26 -26
  25. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +56 -56
  26. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +44 -44
  27. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +30 -17
  28. package/.docs/organized/changelogs/%40mastra%2Fpg.md +57 -57
  29. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +29 -29
  30. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +126 -126
  31. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +29 -29
  32. package/.docs/organized/changelogs/%40mastra%2Frag.md +27 -27
  33. package/.docs/organized/changelogs/%40mastra%2Fragie.md +26 -26
  34. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +13 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fserver.md +88 -88
  36. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +29 -29
  37. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +33 -33
  38. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +38 -38
  39. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +35 -35
  40. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +26 -26
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +26 -26
  42. package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +25 -0
  43. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +26 -26
  44. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +26 -26
  45. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +23 -23
  46. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +26 -26
  47. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +26 -26
  48. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +26 -26
  49. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +26 -26
  50. package/.docs/organized/changelogs/create-mastra.md +43 -43
  51. package/.docs/organized/changelogs/mastra.md +123 -123
  52. package/.docs/organized/code-examples/a2a.md +1 -30
  53. package/.docs/organized/code-examples/agent-network.md +26 -115
  54. package/.docs/organized/code-examples/agent.md +1 -29
  55. package/.docs/organized/code-examples/agui.md +0 -22
  56. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -16
  57. package/.docs/organized/code-examples/assistant-ui.md +1 -16
  58. package/.docs/organized/code-examples/bird-checker-with-express.md +1 -19
  59. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -20
  60. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -18
  61. package/.docs/organized/code-examples/client-side-tools.md +1 -18
  62. package/.docs/organized/code-examples/crypto-chatbot.md +4 -25
  63. package/.docs/organized/code-examples/experimental-auth-weather-agent.md +1 -26
  64. package/.docs/organized/code-examples/fireworks-r1.md +1 -21
  65. package/.docs/organized/code-examples/mcp-configuration.md +1 -24
  66. package/.docs/organized/code-examples/mcp-registry-registry.md +1 -22
  67. package/.docs/organized/code-examples/memory-per-resource-example.md +0 -14
  68. package/.docs/organized/code-examples/memory-todo-agent.md +1 -20
  69. package/.docs/organized/code-examples/memory-with-context.md +1 -20
  70. package/.docs/organized/code-examples/memory-with-libsql.md +1 -21
  71. package/.docs/organized/code-examples/memory-with-mem0.md +1 -21
  72. package/.docs/organized/code-examples/memory-with-pg.md +1 -22
  73. package/.docs/organized/code-examples/memory-with-processors.md +1 -17
  74. package/.docs/organized/code-examples/memory-with-upstash.md +1 -24
  75. package/.docs/organized/code-examples/openapi-spec-writer.md +1 -21
  76. package/.docs/organized/code-examples/quick-start.md +1 -21
  77. package/.docs/organized/code-examples/stock-price-tool.md +1 -21
  78. package/.docs/organized/code-examples/weather-agent.md +1 -20
  79. package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -22
  80. package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -20
  81. package/.docs/organized/code-examples/workflow-with-memory.md +1 -21
  82. package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -22
  83. package/.docs/raw/course/01-first-agent/08-exporting-your-agent.md +3 -2
  84. package/.docs/raw/course/01-first-agent/11-creating-transactions-tool.md +1 -1
  85. package/.docs/raw/course/03-agent-memory/24-working-memory-in-practice.md +0 -3
  86. package/.docs/raw/course/03-agent-memory/29-memory-best-practices.md +0 -6
  87. package/.docs/raw/course/04-workflows/05-chaining-steps-together.md +6 -5
  88. package/.docs/raw/course/04-workflows/18-understanding-conditional-branching.md +6 -3
  89. package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +81 -0
  90. package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +136 -0
  91. package/.docs/raw/deployment/cloud-providers/index.mdx +2 -0
  92. package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +111 -0
  93. package/.docs/raw/deployment/{deployment.mdx → serverless-platforms/index.mdx} +5 -10
  94. package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +94 -0
  95. package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +91 -0
  96. package/.docs/raw/frameworks/ai-sdk-v5.mdx +91 -0
  97. package/.docs/raw/frameworks/web-frameworks/next-js.mdx +56 -18
  98. package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +456 -0
  99. package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +28 -9
  100. package/.docs/raw/getting-started/model-providers.mdx +118 -127
  101. package/.docs/raw/memory/overview.mdx +30 -0
  102. package/.docs/raw/reference/agents/generate.mdx +3 -3
  103. package/.docs/raw/reference/agents/getModel.mdx +1 -1
  104. package/.docs/raw/reference/agents/stream.mdx +3 -3
  105. package/.docs/raw/reference/deployer/cloudflare.mdx +4 -119
  106. package/.docs/raw/reference/deployer/netlify.mdx +4 -83
  107. package/.docs/raw/reference/deployer/vercel.mdx +4 -51
  108. package/.docs/raw/reference/memory/Memory.mdx +71 -2
  109. package/.docs/raw/reference/observability/logger.mdx +70 -0
  110. package/.docs/raw/reference/rag/pg.mdx +15 -0
  111. package/.docs/raw/reference/storage/postgresql.mdx +17 -0
  112. package/.docs/raw/reference/workflows/step.mdx +8 -1
  113. package/.docs/raw/workflows/overview.mdx +1 -1
  114. package/dist/{chunk-P5AHYMUI.js → chunk-7QXT2IEP.js} +48 -11
  115. package/dist/prepare-docs/prepare.js +1 -1
  116. package/dist/stdio.js +1 -1
  117. package/package.json +6 -6
@@ -2,14 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-openapi-spec-writer",
5
- "type": "module",
6
- "private": true,
7
- "scripts": {
8
- "dev": "next dev --turbopack",
9
- "build": "next build",
10
- "start": "next start",
11
- "lint": "next lint"
12
- },
13
5
  "dependencies": {
14
6
  "@ai-sdk/openai": "^1.3.22",
15
7
  "@mastra/core": "latest",
@@ -50,20 +42,8 @@
50
42
  "peerDependencies": {
51
43
  "react": ">= 0.14.0 || 19",
52
44
  "react-dom": ">= 0.14.0 || 19"
53
- },
54
- "version": "0.0.1",
55
- "pnpm": {
56
- "overrides": {
57
- "@mastra/core": "link:../../packages/core",
58
- "@mastra/firecrawl": "link:../../integrations/firecrawl",
59
- "@mastra/github": "link:../../integrations/github",
60
- "@mastra/loggers": "link:../../packages/loggers",
61
- "@mastra/rag": "link:../../packages/rag"
62
- }
63
- },
64
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
45
+ }
65
46
  }
66
-
67
47
  ```
68
48
 
69
49
  ### lib/hooks/useCopyToClipboard.ts
@@ -2,16 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-quick-start",
5
- "type": "module",
6
- "private": true,
7
- "description": "",
8
- "main": "index.js",
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
- },
12
- "keywords": [],
13
- "author": "",
14
- "license": "MIT",
15
5
  "devDependencies": {
16
6
  "@types/node": "^20.17.57",
17
7
  "tsx": "^4.19.3",
@@ -26,18 +16,8 @@
26
16
  "@mastra/loggers": "latest",
27
17
  "@mastra/memory": "latest",
28
18
  "ai": "latest"
29
- },
30
- "pnpm": {
31
- "overrides": {
32
- "@mastra/core": "link:../../packages/core",
33
- "@mastra/loggers": "link:../../packages/loggers",
34
- "@mastra/memory": "link:../../packages/memory"
35
- }
36
- },
37
- "version": "0.0.1",
38
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
19
+ }
39
20
  }
40
-
41
21
  ```
42
22
 
43
23
  ### index.ts
@@ -2,17 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-stock-price-tool",
5
- "type": "module",
6
- "private": true,
7
- "main": "index.js",
8
- "scripts": {
9
- "dev": "mastra dev",
10
- "test": "cross-env NODE_OPTIONS='--experimental-vm-modules --max-old-space-size=8192' jest"
11
- },
12
- "keywords": [],
13
- "author": "",
14
- "license": "MIT",
15
- "description": "",
16
5
  "dependencies": {
17
6
  "@ai-sdk/openai": "latest",
18
7
  "@mastra/core": "latest",
@@ -23,17 +12,8 @@
23
12
  "jest": "^29.7.0",
24
13
  "mastra": "latest",
25
14
  "ts-jest": "^29.2.6"
26
- },
27
- "pnpm": {
28
- "overrides": {
29
- "@mastra/core": "link:../../packages/core",
30
- "mastra": "link:../../packages/cli"
31
- }
32
- },
33
- "version": "0.0.1",
34
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
15
+ }
35
16
  }
36
-
37
17
  ```
38
18
 
39
19
  ### index.ts
@@ -2,32 +2,13 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-weather-agent",
5
- "type": "module",
6
- "private": true,
7
- "description": "",
8
- "main": "index.js",
9
- "scripts": {
10
- "dev": "npx tsx src/mastra/index.ts"
11
- },
12
- "keywords": [],
13
- "author": "",
14
- "license": "MIT",
15
5
  "dependencies": {
16
6
  "@ai-sdk/openai": "^1.3.22",
17
7
  "@mastra/core": "latest",
18
8
  "@mastra/libsql": "latest",
19
9
  "zod": "^3.25.67"
20
- },
21
- "version": "0.0.1",
22
- "pnpm": {
23
- "overrides": {
24
- "@mastra/core": "link:../../packages/core",
25
- "@mastra/libsql": "link:../../stores/libsql"
26
- }
27
- },
28
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
10
+ }
29
11
  }
30
-
31
12
  ```
32
13
 
33
14
  ### mastra/agents/index.ts
@@ -2,18 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-workflow-ai-recruiter",
5
- "type": "module",
6
- "private": true,
7
- "main": "index.js",
8
- "scripts": {
9
- "test": "echo \"Error: no test specified\" && exit 1",
10
- "dev": "mastra dev",
11
- "start:dev": "npx bun src/mastra/index.ts"
12
- },
13
- "keywords": [],
14
- "author": "",
15
- "license": "MIT",
16
- "description": "",
17
5
  "devDependencies": {
18
6
  "@types/node": "^20.17.57",
19
7
  "mastra": "latest",
@@ -26,17 +14,8 @@
26
14
  "@mastra/core": "latest",
27
15
  "ai": "latest",
28
16
  "mastra": "latest"
29
- },
30
- "version": "0.0.1",
31
- "pnpm": {
32
- "overrides": {
33
- "@mastra/core": "link:../../packages/core",
34
- "mastra": "link:../../packages/cli"
35
- }
36
- },
37
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
17
+ }
38
18
  }
39
-
40
19
  ```
41
20
 
42
21
  ### mastra/index.ts
@@ -2,16 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "workflow-with-inline-steps",
5
- "main": "index.js",
6
- "private": true,
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "dev": "mastra dev"
10
- },
11
- "keywords": [],
12
- "author": "",
13
- "license": "MIT",
14
- "description": "",
15
5
  "devDependencies": {
16
6
  "@types/node": "^20.17.57",
17
7
  "mastra": "latest",
@@ -21,17 +11,8 @@
21
11
  },
22
12
  "dependencies": {
23
13
  "@mastra/core": "latest"
24
- },
25
- "pnpm": {
26
- "overrides": {
27
- "@mastra/core": "link:../../packages/core",
28
- "mastra": "link:../../packages/cli"
29
- }
30
- },
31
- "version": "0.0.1-alpha.2",
32
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
14
+ }
33
15
  }
34
-
35
16
  ```
36
17
 
37
18
  ### mastra/index.ts
@@ -2,16 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-workflow-with-memory",
5
- "type": "module",
6
- "private": true,
7
- "main": "index.js",
8
- "scripts": {
9
- "test": "echo \"Error: no test specified\" && exit 1"
10
- },
11
- "keywords": [],
12
- "author": "",
13
- "license": "MIT",
14
- "description": "",
15
5
  "devDependencies": {
16
6
  "@types/node": "^20.17.57",
17
7
  "tsx": "^4.19.3",
@@ -23,18 +13,8 @@
23
13
  "@mastra/core": "latest",
24
14
  "@mastra/memory": "latest",
25
15
  "@mastra/pg": "latest"
26
- },
27
- "version": "0.0.1",
28
- "pnpm": {
29
- "overrides": {
30
- "@mastra/core": "link:../../packages/core",
31
- "@mastra/memory": "link:../../packages/memory",
32
- "@mastra/pg": "link:../../stores/pg"
33
- }
34
- },
35
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
16
+ }
36
17
  }
37
-
38
18
  ```
39
19
 
40
20
  ### mastra/agents/index.ts
@@ -2,18 +2,6 @@
2
2
  ```json
3
3
  {
4
4
  "name": "examples-workflow-with-separate-steps",
5
- "type": "module",
6
- "private": true,
7
- "main": "index.js",
8
- "scripts": {
9
- "test": "echo \"Error: no test specified\" && exit 1",
10
- "dev": "mastra dev",
11
- "start:workflow": "npx tsx src/index.ts"
12
- },
13
- "keywords": [],
14
- "author": "",
15
- "license": "MIT",
16
- "description": "",
17
5
  "devDependencies": {
18
6
  "@types/node": "^20.17.57",
19
7
  "mastra": "latest",
@@ -23,17 +11,8 @@
23
11
  },
24
12
  "dependencies": {
25
13
  "@mastra/core": "latest"
26
- },
27
- "pnpm": {
28
- "overrides": {
29
- "@mastra/core": "link:../../packages/core",
30
- "mastra": "link:../../packages/mastra"
31
- }
32
- },
33
- "version": "0.0.1-alpha.2",
34
- "packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
14
+ }
35
15
  }
36
-
37
16
  ```
38
17
 
39
18
  ### index.ts
@@ -18,13 +18,14 @@ export const mastra = new Mastra({
18
18
  url: ":memory:",
19
19
  }),
20
20
  logger: new PinoLogger({
21
- name: 'Mastra',
22
- level: 'info',
21
+ name: "Mastra",
22
+ level: "info",
23
23
  }),
24
24
  });
25
25
  ```
26
26
 
27
27
  This creates a new Mastra instance that includes:
28
+
28
29
  - Your financial agent
29
30
  - In-memory storage for development
30
31
  - A logger for debugging and monitoring
@@ -29,7 +29,7 @@ export const getTransactionsTool = createTool({
29
29
  const getTransactions = async () => {
30
30
  // This URL points to a public Google Sheet with transaction data
31
31
  const url =
32
- "https://docs.google.com/spreadsheets/d/e/2PACX-1vTQWaCzJAFsF4owWRHQRLo4G0-ERv31c74OOZFnqLiTLaP7NweoiX7IXvzQud2H6bdUPnIqZEA485Ux/pubhtml?gid=0&single=true";
32
+ "https://docs.google.com/spreadsheets/d/e/2PACX-1vTQWaCzJAFsF4owWRHQRLo4G0-ERv31c74OOZFnqLiTLaP7NweoiX7IXvzQud2H6bdUPnIqZEA485Ux/pub?gid=0&single=true&output=csv";
33
33
  const response = await fetch(url);
34
34
  const data = await response.text();
35
35
  return {
@@ -12,17 +12,14 @@ By using working memory effectively, you can create agents that feel more person
12
12
  Here are some best practices for using working memory effectively:
13
13
 
14
14
  1. **Be selective about what goes into working memory**
15
-
16
15
  - Focus on information that will be relevant across multiple conversations
17
16
  - Don't overload working memory with transient details
18
17
 
19
18
  2. **Use clear instructions**
20
-
21
19
  - Give your agent explicit guidance on when and how to update working memory
22
20
  - Instruct it to check memory before asking for information the user has already provided
23
21
 
24
22
  3. **Design a thoughtful template**
25
-
26
23
  - Structure your template based on the specific needs of your agent
27
24
  - Include sections for different types of information
28
25
  - Use clear labels and organization to make information easy to find
@@ -3,32 +3,26 @@
3
3
  As you build memory-enhanced agents, keep these best practices in mind:
4
4
 
5
5
  1. **Be selective about what goes into working memory**
6
-
7
6
  - Focus on information that will be relevant across multiple conversations
8
7
  - Don't overload working memory with transient details
9
8
 
10
9
  2. **Use clear instructions**
11
-
12
10
  - Give your agent explicit guidance on when and how to update working memory
13
11
  - Instruct it to check memory before asking for information the user has already provided
14
12
 
15
13
  3. **Choose appropriate memory parameters**
16
-
17
14
  - Adjust `lastMessages`, `topK`, and `messageRange` based on your use case
18
15
  - More isn't always better - larger context windows can dilute focus
19
16
 
20
17
  4. **Consider privacy implications**
21
-
22
18
  - Be transparent with users about what information is being stored
23
19
  - Implement appropriate security measures for sensitive information
24
20
 
25
21
  5. **Test thoroughly**
26
-
27
22
  - Verify that your agent correctly recalls information across different scenarios
28
23
  - Test edge cases like conflicting information or corrections
29
24
 
30
25
  6. **Design thoughtful templates**
31
-
32
26
  - Structure your working memory templates based on your agent's specific needs
33
27
  - Include clear sections and organization to make information easy to find
34
28
 
@@ -14,7 +14,7 @@ export const contentWorkflow = createWorkflow({
14
14
  description: "Validates and enhances content",
15
15
  inputSchema: z.object({
16
16
  content: z.string(),
17
- type: z.enum(["article", "blog", "social"]).default("article")
17
+ type: z.enum(["article", "blog", "social"]).default("article"),
18
18
  }),
19
19
  outputSchema: z.object({
20
20
  content: z.string(),
@@ -23,9 +23,9 @@ export const contentWorkflow = createWorkflow({
23
23
  metadata: z.object({
24
24
  readingTime: z.number(),
25
25
  difficulty: z.enum(["easy", "medium", "hard"]),
26
- processedAt: z.string()
27
- })
28
- })
26
+ processedAt: z.string(),
27
+ }),
28
+ }),
29
29
  })
30
30
  .then(validateContentStep)
31
31
  .then(enhanceContentStep)
@@ -49,8 +49,9 @@ export const contentWorkflow = createWorkflow({
49
49
  ## Schema Validation
50
50
 
51
51
  The workflow automatically validates:
52
+
52
53
  - Input data matches the workflow's input schema
53
54
  - Each step's output matches the next step's input schema
54
55
  - Final output matches the workflow's output schema
55
56
 
56
- Your workflow is now ready to run! Next, you'll test the complete workflow.
57
+ Your workflow is now ready to run! Next, you'll test the complete workflow.
@@ -5,14 +5,16 @@ Learn how to create workflows that take different paths based on data conditions
5
5
  ## What is Conditional Branching?
6
6
 
7
7
  Conditional branching allows workflows to:
8
+
8
9
  - **Make decisions**: Choose different processing paths based on data
9
- - **Handle variations**: Process different content types differently
10
+ - **Handle variations**: Process different content types differently
10
11
  - **Optimize performance**: Skip unnecessary steps for certain inputs
11
12
  - **Customize behavior**: Provide different experiences based on conditions
12
13
 
13
14
  ## Real-World Example
14
15
 
15
16
  Imagine a content processing workflow that:
17
+
16
18
  - **Short content** (< 50 words): Gets quick processing
17
19
  - **Medium content** (50-200 words): Gets standard processing
18
20
  - **Long content** (> 200 words): Gets detailed processing with extra analysis
@@ -28,6 +30,7 @@ Imagine a content processing workflow that:
28
30
  ```
29
31
 
30
32
  Where:
33
+
31
34
  - **condition**: An async function that returns `true` or `false`
32
35
  - **step**: The step to execute if the condition is `true`
33
36
 
@@ -39,7 +42,7 @@ Conditions are functions that examine the input data:
39
42
  // Example condition function
40
43
  async ({ inputData }) => {
41
44
  return inputData.wordCount < 50;
42
- }
45
+ };
43
46
  ```
44
47
 
45
48
  ## Multiple Paths
@@ -55,4 +58,4 @@ async ({ inputData }) => {
55
58
  - **Flexibility**: Handle different scenarios in one workflow
56
59
  - **Maintainability**: Clear logic for different processing paths
57
60
 
58
- Next, you'll create a workflow with conditional branches!
61
+ Next, you'll create a workflow with conditional branches!
@@ -0,0 +1,81 @@
1
+ ---
2
+ title: "Amazon EC2"
3
+ description: "Deploy your Mastra applications to Amazon EC2."
4
+ ---
5
+
6
+ import { Callout, Steps } from "nextra/components";
7
+ import ServerConfig from "@/components/content-blocks/server-config.mdx";
8
+
9
+ ## Amazon EC2
10
+
11
+ Deploy your Mastra applications to Amazon EC2 (Elastic Cloud Compute).
12
+
13
+ <Callout>
14
+ This guide assumes your Mastra application has been created using the default
15
+ `npx create-mastra@latest` command.
16
+ For more information on how to create a new Mastra application,
17
+ refer to our [getting started guide](/docs/getting-started/installation)
18
+ </Callout>
19
+
20
+ ### Setting up EC2
21
+
22
+ <Steps>
23
+
24
+ #### Log into your AWS console
25
+
26
+ Navigate to the [AWS Management Console](https://aws.amazon.com/console/) and sign in to your account.
27
+
28
+ #### Navigate to EC2
29
+
30
+ Head over to **All services** in the left side navigation. Under **Compute**, click on **EC2**.
31
+
32
+ #### Launch a virtual server instance
33
+
34
+ Click on **Launch instance** to create a new EC2 instance.
35
+
36
+ #### Configure your instance details
37
+
38
+ Add the following details for your instance:
39
+
40
+ - **Name**: Give your instance a descriptive name
41
+ - **Application and OS Images**: For this example, we'll use the **Amazon Linux** environment
42
+ - **Instance type**: Select **t3.micro** (eligible for free tier)
43
+ - **Key pair**: Select an existing key pair or create a new one for secure login
44
+ - **Network settings**: Ensure to **allow HTTPS and HTTP traffic from the internet** by checking the appropriate boxes
45
+
46
+ #### Launch your instance
47
+
48
+ Review your configuration and click **Launch instance**.
49
+
50
+ #### Connect to your instance
51
+
52
+ You'll be redirected to a next steps page. You can connect to your instance either:
53
+
54
+ - **Through the browser**: Click the **Connect** button for browser-based access
55
+ - **Via SSH**: Use your key pair to SSH into the instance (instructions available when you click **Connect**)
56
+
57
+ </Steps>
58
+
59
+ ### Server Configuration
60
+
61
+ Once you have access to your EC2 instance (either via SSH or browser), follow these steps to set up your server environment:
62
+
63
+ <ServerConfig />
64
+
65
+ ### Connect to your Mastra server
66
+
67
+ You can now connect to your Mastra server from your client application using a `MastraClient` from the `@mastra/client-js` package.
68
+
69
+ Refer to the [`MastraClient` documentation](/docs/client-js/overview) for more information.
70
+
71
+ ```typescript copy showLineNumbers
72
+ import { MastraClient } from "@mastra/client-js";
73
+
74
+ const mastraClient = new MastraClient({
75
+ baseUrl: "https://<your-domain-name>",
76
+ });
77
+ ```
78
+
79
+ ## Next steps
80
+
81
+ - [Mastra Client SDK](/docs/client-js/overview)
@@ -0,0 +1,136 @@
1
+ ---
2
+ title: "Azure App Services"
3
+ description: "Deploy your Mastra applications to Azure App Services."
4
+ ---
5
+
6
+ import { Callout, Steps } from "nextra/components";
7
+
8
+ ## Azure App Services
9
+
10
+ Deploy your Mastra applications to Azure App Services.
11
+
12
+ <Callout>
13
+ This guide assumes your Mastra application has been created using the default
14
+ `npx create-mastra@latest` command.
15
+ For more information on how to create a new Mastra application,
16
+ refer to our [getting started guide](/docs/getting-started/installation)
17
+ </Callout>
18
+
19
+ ### Prerequisites
20
+
21
+ - An Azure account with an active subscription
22
+ - A GitHub repository containing your Mastra application
23
+ - Your Mastra application should be created using `npx create-mastra@latest`
24
+
25
+ ### Deployment Steps
26
+
27
+ <Steps>
28
+
29
+ #### Create a new App Service
30
+
31
+ - Log in to the [Azure Portal](https://portal.azure.com)
32
+ - Navigate to **App Services** or search for it in the top search bar
33
+ - Click **Create** to create a new App Service
34
+ - In the drop-down, select **Web App**
35
+
36
+ #### Configure App Service settings
37
+
38
+ - **Subscription**: Select your Azure subscription
39
+ - **Resource Group**: Create a new resource group or select an existing one
40
+ - **Instance name**: Enter a unique name for your app (this will be part of your URL)
41
+ - **Publish**: Select **Code**
42
+ - **Runtime stack**: Select **Node 22 LTS**
43
+ - **Operating System**: Select **Linux**
44
+ - **Region**: Choose a region close to your users
45
+ - **Linux Plan**: You may have the option of choosing a plan depending on the region you chose, pick an appropriate one for your needs.
46
+ - Click **Review + Create**
47
+ - Wait for validation to complete, then click **Create**
48
+
49
+ #### Wait for deployment
50
+
51
+ - Wait for the deployment to complete
52
+ - Once finished, click **Go to resource** under the next steps section
53
+
54
+ #### Configure environment variables
55
+
56
+ Before setting up deployment, configure your environment variables:
57
+
58
+ - Navigate to **Settings** > **Environment variables** in the left sidebar
59
+ - Add your required environment variables such as:
60
+ - Model provider API keys (e.g., `OPENAI_API_KEY`)
61
+ - Database connection strings
62
+ - Any other configuration values your Mastra application requires
63
+ - Click **Apply** to save the changes
64
+
65
+ #### Set up GitHub deployment
66
+
67
+ - Navigate to **Deployment Center** in the left sidebar
68
+ - Select **GitHub** as your source
69
+ - Sign in to GitHub if you're not already authenticated with Azure
70
+ - In this example, we will keep GitHub Actions as our provider.
71
+ - Select your organization, repository, and branch
72
+ - Azure will generate a GitHub workflow file and you can preview it before proceeding
73
+ - Click **Save** (the save button is located at the top of the page)
74
+
75
+ #### Modify the GitHub workflow
76
+
77
+ <Callout type="warning">
78
+ The default workflow generated by Azure will fail for Mastra applications and needs to be modified.
79
+ </Callout>
80
+
81
+ After Azure creates the workflow, it will trigger a GitHub Actions run and merge the workflow file into your branch. **Cancel this initial run** as it will fail without the necessary modifications.
82
+
83
+ Pull the latest changes to your local repository and modify the generated workflow file (`.github/workflows/main_<your-app-name>.yml`):
84
+
85
+ 1. **Update the build step**: Find the step named "npm install, build, and test" and:
86
+ - Change the step name to "npm install and build"
87
+ - Remove the `npm test` command from the run section
88
+
89
+ 2. **Update the zip artifact step**: Find the "Zip artifact for deployment" step and replace the zip command with:
90
+
91
+ ```yaml
92
+ run: (cd .mastra/output && zip ../../release.zip -r .)
93
+ ```
94
+
95
+ This ensures only the build outputs from `.mastra/output` are included in the deployment package.
96
+
97
+ #### Deploy your changes
98
+
99
+ - Commit and push your workflow modifications
100
+ - The build will be automatically triggered in the **Deployment Center** in your Azure dashboard
101
+ - Monitor the deployment progress until it completes successfully
102
+
103
+ #### Access your application
104
+
105
+ - Once the build is successful, wait a few moments for the application to start
106
+ - Access your deployed application using the default URL provided in the **Overview** tab in the Azure portal
107
+ - Your application will be available at `https://<your-app-name>.azurewebsites.net`
108
+
109
+ </Steps>
110
+
111
+ ### Connect to your Mastra server
112
+
113
+ You can now connect to your Mastra server from your client application using a `MastraClient` from the `@mastra/client-js` package.
114
+
115
+ Refer to the [`MastraClient` documentation](/docs/client-js/overview) for more information.
116
+
117
+ ```typescript copy showLineNumbers
118
+ import { MastraClient } from "@mastra/client-js";
119
+
120
+ const mastraClient = new MastraClient({
121
+ baseUrl: "https://<your-app-name>.azurewebsites.net",
122
+ });
123
+ ```
124
+
125
+ <Callout>
126
+ Azure App Services uses an ephemeral file system for some pricing tiers.
127
+ For production applications, avoid using Mastra storage providers that rely on the local file system,
128
+ such as `LibSQLStore` with a file URL. Consider using cloud-based storage solutions instead.
129
+ </Callout>
130
+
131
+ ## Next steps
132
+
133
+ - [Mastra Client SDK](/docs/client-js/overview)
134
+ - [Configure custom domains](https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain)
135
+ - [Enable HTTPS](https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-bindings)
136
+
@@ -12,4 +12,6 @@ Deploy your Mastra applicaitons to popular cloud providers.
12
12
 
13
13
  <CardGrid>
14
14
  <CardGridItem title="Digital Ocean" description="Deploy your Mastra applications to Digital Ocean" href="./cloud-providers/digital-ocean" />
15
+ <CardGridItem title="Amazon EC2" description="Deploy your Mastra applications to Amazon EC2" href="./cloud-providers/amazon-ec2" />
16
+ <CardGridItem title="Azure App Services" description="Deploy your Mastra applications to Azure App Services" href="./cloud-providers/azure-app-services" />
15
17
  </CardGrid>