@mastra/mcp-docs-server 0.13.5 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +76 -76
- package/.docs/organized/changelogs/%40mastra%2Fagui.md +61 -61
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +54 -54
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +194 -194
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +75 -75
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +91 -91
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +171 -171
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +237 -237
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +143 -143
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +143 -143
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +233 -233
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +84 -84
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +62 -62
- package/.docs/organized/changelogs/%40mastra%2Flance.md +55 -0
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +119 -119
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +58 -58
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +69 -0
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +119 -119
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +244 -244
- package/.docs/organized/changelogs/%40mastra%2Frag.md +61 -61
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +18 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +195 -195
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +76 -76
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +44 -44
- package/.docs/organized/changelogs/create-mastra.md +119 -119
- package/.docs/organized/changelogs/mastra.md +256 -256
- package/.docs/organized/code-examples/agent.md +6 -0
- package/.docs/organized/code-examples/agui.md +3 -3
- package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
- package/.docs/organized/code-examples/ai-sdk-v5.md +201 -0
- package/.docs/organized/code-examples/assistant-ui.md +2 -2
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +2 -2
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +2 -2
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/organized/code-examples/crypto-chatbot.md +5 -5
- package/.docs/organized/code-examples/openapi-spec-writer.md +2 -2
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +181 -0
- package/.docs/raw/agents/agent-memory.mdx +126 -0
- package/.docs/raw/agents/dynamic-agents.mdx +34 -2
- package/.docs/raw/agents/overview.mdx +5 -0
- package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +60 -26
- package/.docs/raw/deployment/cloud-providers/index.mdx +44 -9
- package/.docs/raw/deployment/serverless-platforms/cloudflare-deployer.mdx +9 -30
- package/.docs/raw/deployment/serverless-platforms/index.mdx +13 -13
- package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +291 -216
- package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +0 -34
- package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +162 -181
- package/.docs/raw/frameworks/servers/express.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/astro.mdx +2 -2
- package/.docs/raw/frameworks/web-frameworks/next-js.mdx +1 -1
- package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +4 -4
- package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +1 -1
- package/.docs/raw/getting-started/installation.mdx +10 -7
- package/.docs/raw/getting-started/model-capability.mdx +1 -1
- package/.docs/raw/memory/overview.mdx +8 -0
- package/.docs/raw/memory/semantic-recall.mdx +6 -0
- package/.docs/raw/observability/tracing.mdx +30 -0
- package/.docs/raw/reference/agents/agent.mdx +2 -2
- package/.docs/raw/reference/cli/create-mastra.mdx +7 -0
- package/.docs/raw/reference/cli/dev.mdx +4 -3
- package/.docs/raw/reference/client-js/agents.mdx +8 -0
- package/.docs/raw/reference/memory/query.mdx +35 -14
- package/.docs/raw/reference/observability/providers/keywordsai.mdx +73 -0
- package/.docs/raw/reference/storage/mssql.mdx +108 -0
- package/.docs/raw/server-db/custom-api-routes.mdx +38 -26
- package/.docs/raw/tools-mcp/mcp-overview.mdx +24 -1
- package/.docs/raw/workflows/control-flow.mdx +85 -87
- package/.docs/raw/workflows/input-data-mapping.mdx +31 -43
- package/.docs/raw/workflows/overview.mdx +22 -12
- package/.docs/raw/workflows/pausing-execution.mdx +49 -4
- package/.docs/raw/workflows/suspend-and-resume.mdx +17 -16
- package/.docs/raw/workflows/using-with-agents-and-tools.mdx +16 -13
- package/.docs/raw/workflows-legacy/overview.mdx +11 -0
- package/package.json +6 -8
- package/.docs/raw/frameworks/ai-sdk-v5.mdx +0 -91
|
@@ -3,8 +3,7 @@ title: "Amazon EC2"
|
|
|
3
3
|
description: "Deploy your Mastra applications to Amazon EC2."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { Callout, Steps } from "nextra/components";
|
|
7
|
-
import ServerConfig from "@/components/content-blocks/server-config.mdx";
|
|
6
|
+
import { Callout, Steps, Tabs } from "nextra/components";
|
|
8
7
|
|
|
9
8
|
## Amazon EC2
|
|
10
9
|
|
|
@@ -17,50 +16,85 @@ Deploy your Mastra applications to Amazon EC2 (Elastic Cloud Compute).
|
|
|
17
16
|
refer to our [getting started guide](/docs/getting-started/installation)
|
|
18
17
|
</Callout>
|
|
19
18
|
|
|
20
|
-
###
|
|
19
|
+
### Prerequisites
|
|
20
|
+
|
|
21
|
+
- An AWS account with [EC2](https://aws.amazon.com/ec2/) access
|
|
22
|
+
- An EC2 instance running Ubuntu 24+ or Amazon Linux
|
|
23
|
+
- A domain name with an A record pointing to your instance
|
|
24
|
+
- A reverse proxy configured (e.g., using [nginx](https://nginx.org/))
|
|
25
|
+
- SSL certificate configured (e.g., using [Let's Encrypt](https://letsencrypt.org/))
|
|
26
|
+
- Node.js 18+ installed on your instance
|
|
27
|
+
|
|
28
|
+
### Deployment Steps
|
|
21
29
|
|
|
22
30
|
<Steps>
|
|
23
31
|
|
|
24
|
-
####
|
|
32
|
+
#### Clone your Mastra application
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
Connect to your EC2 instance and clone your repository:
|
|
27
35
|
|
|
28
|
-
|
|
36
|
+
<Tabs items={["Public Repository", "Private Repository"]}>
|
|
37
|
+
<Tabs.Tab>
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
```bash copy
|
|
40
|
+
git clone https://github.com/<your-username>/<your-repository>.git
|
|
41
|
+
```
|
|
31
42
|
|
|
32
|
-
|
|
43
|
+
</Tabs.Tab>
|
|
33
44
|
|
|
34
|
-
|
|
45
|
+
<Tabs.Tab>
|
|
46
|
+
|
|
47
|
+
```bash copy
|
|
48
|
+
git clone https://<your-username>:<your-personal-access-token>@github.com/<your-username>/<your-repository>.git
|
|
49
|
+
```
|
|
35
50
|
|
|
36
|
-
|
|
51
|
+
</Tabs.Tab>
|
|
52
|
+
</Tabs>
|
|
37
53
|
|
|
38
|
-
|
|
54
|
+
Navigate to the repository directory:
|
|
39
55
|
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
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
|
|
56
|
+
```bash copy
|
|
57
|
+
cd "<your-repository>"
|
|
58
|
+
```
|
|
45
59
|
|
|
46
|
-
####
|
|
60
|
+
#### Install dependencies
|
|
47
61
|
|
|
48
|
-
|
|
62
|
+
```bash copy
|
|
63
|
+
npm install
|
|
64
|
+
```
|
|
49
65
|
|
|
50
|
-
####
|
|
66
|
+
#### Set up environment variables
|
|
51
67
|
|
|
52
|
-
|
|
68
|
+
Create a `.env` file and add your environment variables:
|
|
53
69
|
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
```bash copy
|
|
71
|
+
touch .env
|
|
72
|
+
```
|
|
56
73
|
|
|
57
|
-
|
|
74
|
+
Edit the `.env` file and add your environment variables:
|
|
58
75
|
|
|
59
|
-
|
|
76
|
+
```bash copy
|
|
77
|
+
OPENAI_API_KEY=<your-openai-api-key>
|
|
78
|
+
# Add other required environment variables
|
|
79
|
+
```
|
|
60
80
|
|
|
61
|
-
|
|
81
|
+
#### Build the application
|
|
62
82
|
|
|
63
|
-
|
|
83
|
+
```bash copy
|
|
84
|
+
npm run build
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Run the application
|
|
88
|
+
|
|
89
|
+
```bash copy
|
|
90
|
+
node --import=./.mastra/output/instrumentation.mjs --env-file=".env" .mastra/output/index.mjs
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
<Callout>
|
|
94
|
+
Your Mastra application will run on port 4111 by default. Ensure your reverse proxy is configured to forward requests to this port.
|
|
95
|
+
</Callout>
|
|
96
|
+
|
|
97
|
+
</Steps>
|
|
64
98
|
|
|
65
99
|
### Connect to your Mastra server
|
|
66
100
|
|
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Cloud Providers"
|
|
3
3
|
description: "Deploy your Mastra applications to popular cloud providers."
|
|
4
|
-
asIndexPage: true
|
|
5
4
|
---
|
|
6
5
|
|
|
7
|
-
import { CardGrid, CardGridItem } from "@/components/cards/card-grid";
|
|
8
|
-
|
|
9
6
|
## Cloud Providers
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
Standalone Mastra applications can be deployed to popular cloud providers, see one of the following guides for more information:
|
|
9
|
+
|
|
10
|
+
- [Amazon EC2](/docs/deployment/cloud-providers/amazon-ec2)
|
|
11
|
+
- [AWS Lambda](/docs/deployment/cloud-providers/aws-lambda)
|
|
12
|
+
- [Digital Ocean](/docs/deployment/cloud-providers/digital-ocean)
|
|
13
|
+
- [Azure App Services](/docs/deployment/cloud-providers/azure-app-services)
|
|
14
|
+
|
|
15
|
+
For self-hosted Node.js server deployment, see the [Creating A Mastra Server](/docs/deployment/server) guide.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
Before deploying to a cloud provider, ensure you have:
|
|
20
|
+
|
|
21
|
+
- A [Mastra application](/docs/getting-started/installation)
|
|
22
|
+
- Node.js `v20.0` or higher
|
|
23
|
+
- A GitHub repository for your application (required for most CI/CD setups)
|
|
24
|
+
- Domain name management access (for SSL and HTTPS)
|
|
25
|
+
- Basic familiarity with server setup (e.g. Nginx, environment variables)
|
|
26
|
+
|
|
27
|
+
## LibSQLStore
|
|
28
|
+
|
|
29
|
+
`LibSQLStore` writes to the local filesystem, which is not supported in cloud environments that use ephemeral file systems. If you're deploying to platforms like **AWS Lambda**, **Azure App Services**, or **Digital Ocean App Platform**, you **must remove** all usage of `LibSQLStore`.
|
|
30
|
+
|
|
31
|
+
Specifically, ensure you've removed it from both `src/mastra/index.ts` and `src/mastra/agents/weather-agent.ts`:
|
|
32
|
+
|
|
33
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers
|
|
34
|
+
export const mastra = new Mastra({
|
|
35
|
+
// ...
|
|
36
|
+
storage: new LibSQLStore({ // [!code --]
|
|
37
|
+
// stores telemetry, evals, ... into memory storage, if it needs to persist, change to file:../mastra.db // [!code --]
|
|
38
|
+
url: ":memory:", // [!code --]
|
|
39
|
+
})//[!code --]
|
|
40
|
+
});
|
|
41
|
+
```
|
|
12
42
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
43
|
+
```typescript filename="src/mastra/agents/weather-agent.ts" showLineNumbers
|
|
44
|
+
export const weatherAgent = new Agent({
|
|
45
|
+
// ..
|
|
46
|
+
memory: new Memory({ // [!code --]
|
|
47
|
+
storage: new LibSQLStore({ // [!code --]
|
|
48
|
+
url: "file:../mastra.db" // path is relative to the .mastra/output directory // [!code --]
|
|
49
|
+
}) // [!code --]
|
|
50
|
+
})// [!code --]
|
|
51
|
+
});
|
|
52
|
+
```
|
|
@@ -24,6 +24,7 @@ import { CloudflareDeployer } from "@mastra/deployer-cloudflare";
|
|
|
24
24
|
export const mastra = new Mastra({
|
|
25
25
|
// ...
|
|
26
26
|
deployer: new CloudflareDeployer({
|
|
27
|
+
scope: "your-account-id",
|
|
27
28
|
projectName: "hello-mastra",
|
|
28
29
|
scope: "",
|
|
29
30
|
auth: {
|
|
@@ -36,44 +37,23 @@ export const mastra = new Mastra({
|
|
|
36
37
|
|
|
37
38
|
> See the [CloudflareDeployer](/reference/deployer/cloudflare) API reference for all available configuration options.
|
|
38
39
|
|
|
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
40
|
## Manual deployment
|
|
54
41
|
|
|
55
42
|
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
43
|
|
|
44
|
+
With the Wrangler CLI installed, login and authenticate with your Cloudflare logins:
|
|
45
|
+
|
|
57
46
|
```bash copy
|
|
58
|
-
|
|
47
|
+
npx wrangler login
|
|
59
48
|
```
|
|
60
49
|
|
|
61
|
-
|
|
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:
|
|
50
|
+
Run the following to build and deploy your application to Cloudflare
|
|
69
51
|
|
|
70
52
|
```bash copy
|
|
71
|
-
|
|
53
|
+
npm run build && wrangler deploy --config .mastra/output/wrangler.json
|
|
72
54
|
```
|
|
73
55
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
> For more details on managing secrets, see [Environment Variables and Secrets](https://developers.cloudflare.com/workers/configuration/secrets/) in the Cloudflare documentation.
|
|
56
|
+
> You can also run `wrangler dev --config .mastra/output/wrangler.json` from your project root to test your Mastra application locally.
|
|
77
57
|
|
|
78
58
|
## Build output
|
|
79
59
|
|
|
@@ -99,13 +79,12 @@ The `CloudflareDeployer` automatically generates a `wrangler.json` configuration
|
|
|
99
79
|
"compatibility_flags": ["nodejs_compat", "nodejs_compat_populate_process_env"],
|
|
100
80
|
"observability": { "logs": { "enabled": true } },
|
|
101
81
|
"vars": {
|
|
102
|
-
"OPENAI_API_KEY": "
|
|
82
|
+
"OPENAI_API_KEY": "...",
|
|
103
83
|
"CLOUDFLARE_API_TOKEN": "..."
|
|
104
84
|
}
|
|
105
85
|
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
86
|
|
|
87
|
+
```
|
|
109
88
|
## Next steps
|
|
110
89
|
|
|
111
90
|
- [Mastra Client SDK](/docs/client-js/overview)
|
|
@@ -19,7 +19,7 @@ For self-hosted Node.js server deployment, see the [Creating A Mastra Server](/d
|
|
|
19
19
|
|
|
20
20
|
Before you begin, ensure you have:
|
|
21
21
|
|
|
22
|
-
-
|
|
22
|
+
- Node.js `v20.0` or higher
|
|
23
23
|
- If using a platform-specific deployer:
|
|
24
24
|
- An account with your chosen platform
|
|
25
25
|
- Required API keys or credentials
|
|
@@ -30,23 +30,23 @@ Before you begin, ensure you have:
|
|
|
30
30
|
|
|
31
31
|
Specifically, ensure you've removed it from both `src/mastra/index.ts` and `src/mastra/agents/weather-agent.ts`:
|
|
32
32
|
|
|
33
|
-
```
|
|
33
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers
|
|
34
34
|
export const mastra = new Mastra({
|
|
35
35
|
// ...
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
storage: new LibSQLStore({ // [!code --]
|
|
37
|
+
// stores telemetry, evals, ... into memory storage, if it needs to persist, change to file:../mastra.db // [!code --]
|
|
38
|
+
url: ":memory:", // [!code --]
|
|
39
|
+
})//[!code --]
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
```
|
|
43
|
+
```typescript filename="src/mastra/agents/weather-agent.ts" showLineNumbers
|
|
44
44
|
export const weatherAgent = new Agent({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
// ..
|
|
46
|
+
memory: new Memory({ // [!code --]
|
|
47
|
+
storage: new LibSQLStore({ // [!code --]
|
|
48
|
+
url: "file:../mastra.db" // path is relative to the .mastra/output directory // [!code --]
|
|
49
|
+
}) // [!code --]
|
|
50
|
+
})// [!code --]
|
|
51
51
|
});
|
|
52
52
|
```
|