@mastra/mcp-docs-server 0.13.2 → 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 (114) 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 +85 -85
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +34 -34
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +35 -35
  9. package/.docs/organized/changelogs/%40mastra%2Fcore.md +70 -70
  10. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +29 -29
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +92 -92
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +94 -94
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +92 -92
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +104 -104
  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 +37 -37
  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 +108 -108
  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 +7 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fserver.md +82 -82
  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 +31 -31
  39. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +28 -28
  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 +37 -37
  51. package/.docs/organized/changelogs/mastra.md +115 -115
  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/11-creating-transactions-tool.md +1 -1
  84. package/.docs/raw/course/03-agent-memory/24-working-memory-in-practice.md +0 -3
  85. package/.docs/raw/course/03-agent-memory/29-memory-best-practices.md +0 -6
  86. package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +81 -0
  87. package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +136 -0
  88. package/.docs/raw/deployment/cloud-providers/index.mdx +2 -0
  89. package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +111 -0
  90. package/.docs/raw/deployment/{deployment.mdx → serverless-platforms/index.mdx} +5 -10
  91. package/.docs/raw/deployment/serverless-platforms/netlify-deployer.mdx +94 -0
  92. package/.docs/raw/deployment/serverless-platforms/vercel-deployer.mdx +91 -0
  93. package/.docs/raw/frameworks/ai-sdk-v5.mdx +91 -0
  94. package/.docs/raw/frameworks/web-frameworks/next-js.mdx +56 -18
  95. package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +456 -0
  96. package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +28 -9
  97. package/.docs/raw/getting-started/model-providers.mdx +118 -127
  98. package/.docs/raw/memory/overview.mdx +30 -0
  99. package/.docs/raw/reference/agents/generate.mdx +3 -3
  100. package/.docs/raw/reference/agents/getModel.mdx +1 -1
  101. package/.docs/raw/reference/agents/stream.mdx +3 -3
  102. package/.docs/raw/reference/deployer/cloudflare.mdx +4 -119
  103. package/.docs/raw/reference/deployer/netlify.mdx +4 -83
  104. package/.docs/raw/reference/deployer/vercel.mdx +4 -51
  105. package/.docs/raw/reference/memory/Memory.mdx +71 -2
  106. package/.docs/raw/reference/observability/logger.mdx +70 -0
  107. package/.docs/raw/reference/rag/pg.mdx +15 -0
  108. package/.docs/raw/reference/storage/postgresql.mdx +17 -0
  109. package/.docs/raw/reference/workflows/step.mdx +8 -1
  110. package/.docs/raw/workflows/overview.mdx +1 -1
  111. package/dist/{chunk-P5AHYMUI.js → chunk-7QXT2IEP.js} +48 -11
  112. package/dist/prepare-docs/prepare.js +1 -1
  113. package/dist/stdio.js +1 -1
  114. package/package.json +5 -5
@@ -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
@@ -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
 
@@ -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>
@@ -0,0 +1,111 @@
1
+ ---
2
+ title: "Cloudflare Deployer"
3
+ description: "Learn how to deploy a Mastra application to Cloudflare using the Mastra CloudflareDeployer"
4
+ ---
5
+
6
+ import { FileTree } from "nextra/components";
7
+
8
+ # CloudflareDeployer
9
+
10
+ The `CloudflareDeployer` class handles deployment of standalone Mastra applications to Cloudflare Workers. It manages configuration, deployment, and extends the base [Deployer](/reference/deployer/deployer) class with Cloudflare specific functionality.
11
+
12
+ ## Installation
13
+
14
+ ```bash copy
15
+ npm install @mastra/deployer-cloudflare@latest
16
+ ```
17
+
18
+ ## Usage example
19
+
20
+ ```typescript filename="src/mastra/index.ts" showLineNumbers copy
21
+ import { Mastra } from "@mastra/core/mastra";
22
+ import { CloudflareDeployer } from "@mastra/deployer-cloudflare";
23
+
24
+ export const mastra = new Mastra({
25
+ // ...
26
+ deployer: new CloudflareDeployer({
27
+ projectName: "hello-mastra",
28
+ scope: "",
29
+ auth: {
30
+ apiToken: process.env.CLOUDFLARE_API_TOKEN!,
31
+ apiEmail: "name@email.com"
32
+ }
33
+ })
34
+ });
35
+ ```
36
+
37
+ > See the [CloudflareDeployer](/reference/deployer/cloudflare) API reference for all available configuration options.
38
+
39
+ ### Cloudflare API token
40
+
41
+ In your Cloudflare dashboard, navigate to **Profile** > **API Tokens**, then select **Edit Cloudflare Workers** and click **Use template** to create a token for the `CloudflareDeployer`.
42
+
43
+ > To learn how to create a Cloudflare API token, see [Create API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) in the Cloudflare docs.
44
+
45
+ ## Continuous integration
46
+ In the Cloudflare dashboard, navigate to **Workers** > **Import a repository**. After importing your Mastra project's Git repository, create an application and configure the build settings with:
47
+
48
+ - **Build command**: `npm run build`
49
+ - **Deploy command**: `cd .mastra/output && npx wrangler deploy`
50
+
51
+ - **Build command**: `npm run build` (optional)
52
+
53
+ ## Manual deployment
54
+
55
+ Manual deployments are also possible using the [Cloudflare Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/). With the Wrangler CLI installed run the following from your project root to deploy your application.
56
+
57
+ ```bash copy
58
+ npm run build && wrangler deploy --config .mastra/output/wrangler.json
59
+ ```
60
+
61
+ > You can also run `wrangler dev --config .mastra/output/wrangler.json` from your project root to test your Mastra application locally.
62
+
63
+ ## Cloudflare secrets
64
+
65
+ To add secrets to your Cloudflare Workers application, use the Wrangler CLI. Secrets are environment variables that are encrypted and stored securely.
66
+
67
+
68
+ For example, to add an API key:
69
+
70
+ ```bash copy
71
+ npx wrangler secret put OPENAI_API_KEY
72
+ ```
73
+
74
+ When prompted, enter the secret value. The secret will be encrypted and stored securely in your Cloudflare account.
75
+
76
+ > For more details on managing secrets, see [Environment Variables and Secrets](https://developers.cloudflare.com/workers/configuration/secrets/) in the Cloudflare documentation.
77
+
78
+ ## Build output
79
+
80
+ The build output for Mastra applications using the `CloudflareDeployer` includes all agents, tools, and workflows in your project, along with Mastra specific files required to run your application on Cloudflare.
81
+
82
+ <FileTree>
83
+ <FileTree.Folder name=".mastra" defaultOpen>
84
+ <FileTree.Folder name="output" defaultOpen>
85
+ <FileTree.File name="index.mjs" />
86
+ <FileTree.File name="wrangler.json" />
87
+ </FileTree.Folder>
88
+ </FileTree.Folder>
89
+ <FileTree.File name="package.json" />
90
+ </FileTree>
91
+
92
+ The `CloudflareDeployer` automatically generates a `wrangler.json` configuration file in `.mastra/output` with the following settings:
93
+
94
+ ```json
95
+ {
96
+ "name": "hello-mastra",
97
+ "main": "./index.mjs",
98
+ "compatibility_date": "2025-04-01",
99
+ "compatibility_flags": ["nodejs_compat", "nodejs_compat_populate_process_env"],
100
+ "observability": { "logs": { "enabled": true } },
101
+ "vars": {
102
+ "OPENAI_API_KEY": "..",
103
+ "CLOUDFLARE_API_TOKEN": "..."
104
+ }
105
+ }
106
+ ```
107
+
108
+
109
+ ## Next steps
110
+
111
+ - [Mastra Client SDK](/docs/client-js/overview)
@@ -5,7 +5,11 @@ description: "Build and deploy Mastra applications using platform-specific deplo
5
5
 
6
6
  # Serverless Deployment
7
7
 
8
- This guide covers deploying standalone Mastra applications to Cloudflare Workers, Vercel, and Netlify using platform-specific deployers.
8
+ Standalone Mastra applications can be deployed to popular serverless platforms using one of our deployer packages:
9
+
10
+ - [Cloudflare](/docs/deployment/serverless-platforms/cloudflare-deployer)
11
+ - [Netlify](/docs/deployment/serverless-platforms/netlify-deployer)
12
+ - [Vercel](/docs/deployment/serverless-platforms/vercel-deployer)
9
13
 
10
14
  Deployers **aren't** required when integrating Mastra with a framework. See [Web Framework Integration](/docs/deployment/web-framework) for more information.
11
15
 
@@ -47,12 +51,3 @@ export const weatherAgent = new Agent({
47
51
  - })
48
52
  });
49
53
  ```
50
-
51
- ## Serverless Platform Deployers
52
-
53
- Platform-specific deployers handle configuration and deployment for:
54
-
55
- - **[Cloudflare Workers](/reference/deployer/cloudflare)**
56
- - **[Vercel](/reference/deployer/vercel)**
57
- - **[Netlify](/reference/deployer/netlify)**
58
- - **[Mastra Cloud](/docs/mastra-cloud/overview)** _(beta)_. You can join the [cloud waitlist](https://mastra.ai/cloud-beta) for early access.
@@ -0,0 +1,94 @@
1
+ ---
2
+ title: "Netlify Deployer"
3
+ description: "Learn how to deploy a Mastra application to Netlify using the Mastra NetlifyDeployer"
4
+ ---
5
+
6
+ import { FileTree } from "nextra/components";
7
+
8
+ # NetlifyDeployer
9
+
10
+ The `NetlifyDeployer` class handles deployment of standalone Mastra applications to Netlify. It manages configuration, deployment, and extends the base [Deployer](/reference/deployer/deployer) class with Netlify specific functionality.
11
+
12
+ ## Installation
13
+
14
+ ```bash copy
15
+ npm install @mastra/deployer-netlify@latest
16
+ ```
17
+
18
+ ## Usage example
19
+
20
+ ```typescript filename="src/mastra/index.ts" showLineNumbers copy
21
+ import { Mastra } from "@mastra/core/mastra";
22
+ import { NetlifyDeployer } from "@mastra/deployer-netlify";
23
+
24
+ export const mastra = new Mastra({
25
+ // ...
26
+ deployer: new NetlifyDeployer()
27
+ });
28
+ ```
29
+
30
+ > See the [NetlifyDeployer](/reference/deployer/netlify) API reference for all available configuration options.
31
+
32
+ ## Continuous integration
33
+
34
+ After connecting your Mastra project’s Git repository to Netlify, update the project settings. In the Netlify dashboard, go to **Project configuration** > **Build & deploy** > **Continuous deployment**, and under **Build settings**, set the following:
35
+
36
+ - **Build command**: `npm run build` (optional)
37
+
38
+ ### Environment variables
39
+
40
+ Before your first deployment, make sure to add any environment variables used by your application. For example, if you're using OpenAI as the LLM, you'll need to set `OPENAI_API_KEY` in your Netlify project settings.
41
+
42
+ > See [Environment variables overview](https://docs.netlify.com/environment-variables/overview/) for more details.
43
+
44
+
45
+ Your project is now configured with automatic deployments which occur whenever you push to the configured branch of your GitHub repository.
46
+
47
+
48
+ ## Manual deployment
49
+
50
+ Manual deployments are also possible using the [Netlify CLI](https://docs.netlify.com/cli/get-started/). With the Netlify CLI installed run the following from your project root to deploy your application.
51
+
52
+ ```bash copy
53
+ netlify deploy --prod
54
+ ```
55
+
56
+ > You can also run `netlify dev` from your project root to test your Mastra application locally.
57
+
58
+ ## Build output
59
+
60
+ The build output for Mastra applications using the `NetlifyDeployer` includes all agents, tools, and workflows in your project, along with Mastra specific files required to run your application on Netlify.
61
+
62
+ <FileTree>
63
+ <FileTree.Folder name=".netlify" defaultOpen>
64
+ <FileTree.Folder name="v1" defaultOpen>
65
+ <FileTree.Folder name="functions" defaultOpen>
66
+ <FileTree.Folder name="api" defaultOpen>
67
+ <FileTree.File name="index.mjs" />
68
+ </FileTree.Folder>
69
+ </FileTree.Folder>
70
+ <FileTree.File name="config.json" />
71
+ </FileTree.Folder>
72
+ </FileTree.Folder>
73
+ <FileTree.File name="package.json" />
74
+ </FileTree>
75
+
76
+
77
+ The `NetlifyDeployer` automatically generates a `config.json` configuration file in `.netlify/v1` with the following settings:
78
+
79
+ ```json
80
+ {
81
+ "redirects": [
82
+ {
83
+ "force": true,
84
+ "from": "/*",
85
+ "to": "/.netlify/functions/api/:splat",
86
+ "status": 200
87
+ }
88
+ ]
89
+ }
90
+ ```
91
+
92
+ ## Next steps
93
+
94
+ - [Mastra Client SDK](/docs/client-js/overview)