@mastra/mcp-docs-server 0.13.6 → 0.13.7-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.
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Flance.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +32 -32
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Frag.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +8 -8
- package/.docs/organized/changelogs/create-mastra.md +9 -9
- package/.docs/organized/changelogs/mastra.md +33 -33
- package/.docs/organized/code-examples/a2a.md +1 -1
- package/.docs/organized/code-examples/agui.md +2 -2
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
- package/.docs/organized/code-examples/ai-sdk-v5.md +1 -1
- package/.docs/organized/code-examples/assistant-ui.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
- package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
- package/.docs/organized/code-examples/client-side-tools.md +2 -2
- package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
- package/.docs/organized/code-examples/fireworks-r1.md +1 -1
- package/.docs/organized/code-examples/memory-with-mem0.md +1 -1
- package/.docs/organized/code-examples/memory-with-pg.md +1 -0
- package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
- package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
- package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
- package/.docs/raw/agents/runtime-variables.mdx +1 -1
- package/.docs/raw/auth/index.mdx +24 -0
- package/.docs/raw/auth/jwt.mdx +99 -0
- package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +6 -5
- package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +84 -14
- package/.docs/raw/evals/custom-eval.mdx +12 -12
- package/.docs/raw/index.mdx +2 -2
- package/.docs/raw/reference/auth/jwt.mdx +42 -0
- package/.docs/raw/reference/client-js/agents.mdx +3 -11
- package/.docs/raw/reference/client-js/error-handling.mdx +1 -21
- package/.docs/raw/reference/client-js/logs.mdx +2 -10
- package/.docs/raw/reference/client-js/mastra-client.mdx +141 -0
- package/.docs/raw/reference/client-js/memory.mdx +6 -18
- package/.docs/raw/reference/client-js/telemetry.mdx +1 -9
- package/.docs/raw/reference/client-js/tools.mdx +2 -10
- package/.docs/raw/reference/client-js/vectors.mdx +1 -9
- package/.docs/raw/reference/client-js/workflows-legacy.mdx +3 -11
- package/.docs/raw/reference/client-js/workflows.mdx +5 -13
- package/.docs/raw/reference/core/mastra-class.mdx +6 -0
- package/.docs/raw/reference/observability/providers/dash0.mdx +2 -2
- package/.docs/raw/reference/tools/vector-query-tool.mdx +29 -0
- package/.docs/raw/tools-mcp/overview.mdx +1 -1
- package/package.json +5 -5
- package/.docs/organized/changelogs/%40mastra%2Fagui.md +0 -302
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @mastra/voice-openai
|
|
2
2
|
|
|
3
|
+
## 0.10.6-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 063cd46: dependencies updates:
|
|
8
|
+
- Updated dependency [`openai@^5.10.1` ↗︎](https://www.npmjs.com/package/openai/v/5.10.1) (from `^4.104.0`, in `dependencies`)
|
|
9
|
+
- Updated dependencies [510e2c8]
|
|
10
|
+
- Updated dependencies [2f72fb2]
|
|
11
|
+
- Updated dependencies [3f89307]
|
|
12
|
+
- Updated dependencies [9eda7d4]
|
|
13
|
+
- Updated dependencies [9d49408]
|
|
14
|
+
- Updated dependencies [2ecf658]
|
|
15
|
+
- Updated dependencies [7a7754f]
|
|
16
|
+
- Updated dependencies [fc92d80]
|
|
17
|
+
- Updated dependencies [23a6a7c]
|
|
18
|
+
- Updated dependencies [09bca64]
|
|
19
|
+
- @mastra/core@0.12.0-alpha.0
|
|
20
|
+
|
|
21
|
+
## 0.10.5
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- ce088f5: Update all peerdeps to latest core
|
|
26
|
+
- @mastra/core@0.11.1
|
|
27
|
+
|
|
3
28
|
## 0.10.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -274,29 +299,4 @@
|
|
|
274
299
|
- Updated dependencies [edf1e88]
|
|
275
300
|
- @mastra/core@0.9.4-alpha.1
|
|
276
301
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
### Patch Changes
|
|
280
|
-
|
|
281
|
-
- Updated dependencies [daf942f]
|
|
282
|
-
- Updated dependencies [0b8b868]
|
|
283
|
-
- @mastra/core@0.9.4-alpha.0
|
|
284
|
-
|
|
285
|
-
## 0.1.18
|
|
286
|
-
|
|
287
|
-
### Patch Changes
|
|
288
|
-
|
|
289
|
-
- Updated dependencies [e450778]
|
|
290
|
-
- Updated dependencies [8902157]
|
|
291
|
-
- Updated dependencies [ca0dc88]
|
|
292
|
-
- Updated dependencies [526c570]
|
|
293
|
-
- Updated dependencies [d7a6a33]
|
|
294
|
-
- Updated dependencies [9cd1a46]
|
|
295
|
-
- Updated dependencies [b5d2de0]
|
|
296
|
-
- Updated dependencies [644f8ad]
|
|
297
|
-
- Updated dependencies [70dbf51]
|
|
298
|
-
- @mastra/core@0.9.3
|
|
299
|
-
|
|
300
|
-
## 0.1.18-alpha.1
|
|
301
|
-
|
|
302
|
-
... 993 more lines hidden. See full changelog in package directory.
|
|
302
|
+
... 1018 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/voice-playai
|
|
2
2
|
|
|
3
|
+
## 0.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ce088f5: Update all peerdeps to latest core
|
|
8
|
+
- @mastra/core@0.11.1
|
|
9
|
+
|
|
3
10
|
## 0.10.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -291,12 +298,5 @@
|
|
|
291
298
|
- Updated dependencies [70dbf51]
|
|
292
299
|
- @mastra/core@0.9.3-alpha.1
|
|
293
300
|
|
|
294
|
-
## 0.1.17-alpha.0
|
|
295
|
-
|
|
296
|
-
### Patch Changes
|
|
297
|
-
|
|
298
|
-
- Updated dependencies [526c570]
|
|
299
|
-
- Updated dependencies [b5d2de0]
|
|
300
|
-
- Updated dependencies [644f8ad]
|
|
301
301
|
|
|
302
|
-
...
|
|
302
|
+
... 989 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/voice-sarvam
|
|
2
2
|
|
|
3
|
+
## 0.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ce088f5: Update all peerdeps to latest core
|
|
8
|
+
- @mastra/core@0.11.1
|
|
9
|
+
|
|
3
10
|
## 0.10.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -291,12 +298,5 @@
|
|
|
291
298
|
- Updated dependencies [70dbf51]
|
|
292
299
|
- @mastra/core@0.9.3-alpha.1
|
|
293
300
|
|
|
294
|
-
## 0.1.12-alpha.0
|
|
295
|
-
|
|
296
|
-
### Patch Changes
|
|
297
|
-
|
|
298
|
-
- Updated dependencies [526c570]
|
|
299
|
-
- Updated dependencies [b5d2de0]
|
|
300
|
-
- Updated dependencies [644f8ad]
|
|
301
301
|
|
|
302
|
-
...
|
|
302
|
+
... 639 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/voice-speechify
|
|
2
2
|
|
|
3
|
+
## 0.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ce088f5: Update all peerdeps to latest core
|
|
8
|
+
- @mastra/core@0.11.1
|
|
9
|
+
|
|
3
10
|
## 0.10.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -291,12 +298,5 @@
|
|
|
291
298
|
- Updated dependencies [ca0dc88]
|
|
292
299
|
- Updated dependencies [526c570]
|
|
293
300
|
- Updated dependencies [d7a6a33]
|
|
294
|
-
- Updated dependencies [9cd1a46]
|
|
295
|
-
- Updated dependencies [b5d2de0]
|
|
296
|
-
- Updated dependencies [644f8ad]
|
|
297
|
-
- Updated dependencies [70dbf51]
|
|
298
|
-
- @mastra/core@0.9.3
|
|
299
|
-
|
|
300
|
-
## 0.1.17-alpha.1
|
|
301
301
|
|
|
302
|
-
...
|
|
302
|
+
... 993 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
+
## 0.10.14-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f442224: speech to text using voice config
|
|
8
|
+
- d8dec5e: add a cta to invite to deploy to cloud
|
|
9
|
+
- 89d2f4e: add TTS to the playground
|
|
10
|
+
|
|
3
11
|
## 0.10.13
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -291,12 +299,4 @@
|
|
|
291
299
|
|
|
292
300
|
## 0.10.3-alpha.1
|
|
293
301
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
- e719504: don't start posthog when the browser is Brave
|
|
297
|
-
|
|
298
|
-
## 0.10.3-alpha.0
|
|
299
|
-
|
|
300
|
-
### Patch Changes
|
|
301
|
-
|
|
302
|
-
... 1116 more lines hidden. See full changelog in package directory.
|
|
302
|
+
... 1124 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# mastra
|
|
2
2
|
|
|
3
|
+
## 0.10.16-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bc6b44a: Extract tools import from `createHonoServer`; the function now receives tools via a prop on the `options` parameter.
|
|
8
|
+
- f442224: speech to text using voice config
|
|
9
|
+
- 7a7754f: Fast follow scorers fixing input types, improve llm scorer reliability, fix ui to display scores that are 0
|
|
10
|
+
- d8dec5e: add a cta to invite to deploy to cloud
|
|
11
|
+
- 89d2f4e: add TTS to the playground
|
|
12
|
+
- Updated dependencies [510e2c8]
|
|
13
|
+
- Updated dependencies [2f72fb2]
|
|
14
|
+
- Updated dependencies [832691b]
|
|
15
|
+
- Updated dependencies [557bb9d]
|
|
16
|
+
- Updated dependencies [3f89307]
|
|
17
|
+
- Updated dependencies [9eda7d4]
|
|
18
|
+
- Updated dependencies [9d49408]
|
|
19
|
+
- Updated dependencies [bc6b44a]
|
|
20
|
+
- Updated dependencies [2ecf658]
|
|
21
|
+
- Updated dependencies [7a7754f]
|
|
22
|
+
- Updated dependencies [fc92d80]
|
|
23
|
+
- Updated dependencies [23a6a7c]
|
|
24
|
+
- Updated dependencies [09bca64]
|
|
25
|
+
- @mastra/core@0.12.0-alpha.0
|
|
26
|
+
- @mastra/deployer@0.12.0-alpha.0
|
|
27
|
+
|
|
28
|
+
## 0.10.15
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 1a45f3a: Fix peerdeps
|
|
33
|
+
|
|
3
34
|
## 0.10.14
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
|
@@ -267,36 +298,5 @@
|
|
|
267
298
|
- 2873c7f: dependencies updates:
|
|
268
299
|
- Updated dependency [`dotenv@^16.6.1` ↗︎](https://www.npmjs.com/package/dotenv/v/16.6.1) (from `^16.5.0`, in `dependencies`)
|
|
269
300
|
- a9f51e4: Fix plaground get tools not including x-mastra-dev-header"
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
- a7a836a: Highlight send event button
|
|
273
|
-
- Updated dependencies [2873c7f]
|
|
274
|
-
- Updated dependencies [1c1c6a1]
|
|
275
|
-
- Updated dependencies [bc40cdd]
|
|
276
|
-
- Updated dependencies [2873c7f]
|
|
277
|
-
- Updated dependencies [1c1c6a1]
|
|
278
|
-
- Updated dependencies [d9b26b5]
|
|
279
|
-
- Updated dependencies [f5ec3a4]
|
|
280
|
-
- Updated dependencies [f8ce2cc]
|
|
281
|
-
- Updated dependencies [ab3bbff]
|
|
282
|
-
- Updated dependencies [8c846b6]
|
|
283
|
-
- Updated dependencies [c7bbf1e]
|
|
284
|
-
- Updated dependencies [8722d53]
|
|
285
|
-
- Updated dependencies [565cc0c]
|
|
286
|
-
- Updated dependencies [b790fd1]
|
|
287
|
-
- Updated dependencies [132027f]
|
|
288
|
-
- Updated dependencies [0c85311]
|
|
289
|
-
- Updated dependencies [d7ed04d]
|
|
290
|
-
- Updated dependencies [c0ba5e2]
|
|
291
|
-
- Updated dependencies [18ca936]
|
|
292
|
-
- Updated dependencies [cb16baf]
|
|
293
|
-
- Updated dependencies [40cd025]
|
|
294
|
-
- Updated dependencies [f36e4f1]
|
|
295
|
-
- Updated dependencies [7f6e403]
|
|
296
|
-
- @mastra/core@0.10.11
|
|
297
|
-
- @mastra/deployer@0.10.11
|
|
298
|
-
- @mastra/mcp@0.10.6
|
|
299
|
-
|
|
300
|
-
## 0.10.11-alpha.3
|
|
301
|
-
|
|
302
|
-
... 4532 more lines hidden. See full changelog in package directory.
|
|
301
|
+
|
|
302
|
+
... 4563 more lines hidden. See full changelog in package directory.
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@eslint/js": "^9.25.0",
|
|
22
22
|
"@types/react": "^19.1.8",
|
|
23
23
|
"@types/react-dom": "^19.1.6",
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
25
|
-
"@typescript-eslint/parser": "^8.
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
25
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
26
26
|
"@vitejs/plugin-react": "^4.4.1",
|
|
27
27
|
"eslint": "^9.30.1",
|
|
28
28
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
20
20
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
21
21
|
"globals": "^15.15.0",
|
|
22
|
-
"typescript": "~5.
|
|
23
|
-
"typescript-eslint": "^8.
|
|
22
|
+
"typescript": "~5.8.3",
|
|
23
|
+
"typescript-eslint": "^8.38.0",
|
|
24
24
|
"vite": "^6.2.0"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@radix-ui/react-slot": "^1.2.3",
|
|
21
21
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
22
22
|
"@radix-ui/react-visually-hidden": "^1.2.3",
|
|
23
|
-
"@typescript-eslint/parser": "^8.
|
|
23
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
24
24
|
"@vercel/analytics": "^1.5.0",
|
|
25
25
|
"@vercel/blob": "^1.0.0",
|
|
26
26
|
"@vercel/postgres": "^0.10.0",
|
|
@@ -23,7 +23,7 @@ const agent = mastra.getAgent("weatherAgent");
|
|
|
23
23
|
|
|
24
24
|
// Define your runtimeContext's type structure
|
|
25
25
|
type WeatherRuntimeContext = {
|
|
26
|
-
"temperature-scale": "celsius" | "fahrenheit";
|
|
26
|
+
"temperature-scale": "celsius" | "fahrenheit";
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const runtimeContext = new RuntimeContext<WeatherRuntimeContext>();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Auth Overview
|
|
3
|
+
description: Learn about different Auth options for your Mastra applications
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Auth Overview
|
|
7
|
+
|
|
8
|
+
Mastra lets you choose how you handle authentication, so you can secure access to your application's endpoints using the identity system that fits your stack.
|
|
9
|
+
|
|
10
|
+
You can start with simple shared secret JWT authentication and switch to providers like Supabase, Firebase Auth, Auth0, Clerk, or WorkOS when you need more advanced identity features.
|
|
11
|
+
|
|
12
|
+
## Available providers
|
|
13
|
+
|
|
14
|
+
- [JSON Web Token (JWT)](/docs/auth/jwt)
|
|
15
|
+
|
|
16
|
+
### Coming soon
|
|
17
|
+
|
|
18
|
+
The following providers will be available soon:
|
|
19
|
+
|
|
20
|
+
- Supabase Auth
|
|
21
|
+
- Firebase Auth
|
|
22
|
+
- Auth0
|
|
23
|
+
- Clerk
|
|
24
|
+
- WorkOS
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MastraJwtAuth"
|
|
3
|
+
description: "Documentation for the MastraJwtAuth class, which authenticates Mastra applications using JSON Web Tokens."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { Tabs, Tab } from "@/components/tabs";
|
|
7
|
+
|
|
8
|
+
# MastraJwtAuth
|
|
9
|
+
|
|
10
|
+
The `MastraJwtAuth` class provides a lightweight authentication mechanism for Mastra using JSON Web Tokens (JWTs). It verifies incoming requests based on a shared secret and integrates with the Mastra server using the `experimental_auth` option.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash copy
|
|
15
|
+
npm install @mastra/auth
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage example
|
|
19
|
+
|
|
20
|
+
```typescript {2,7-9} filename="src/mastra/index.ts" showLineNumbers copy
|
|
21
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
22
|
+
import { MastraJwtAuth } from '@mastra/auth';
|
|
23
|
+
|
|
24
|
+
export const mastra = new Mastra({
|
|
25
|
+
// ..
|
|
26
|
+
server: {
|
|
27
|
+
experimental_auth: new MastraJwtAuth({
|
|
28
|
+
secret: process.env.MASTRA_JWT_SECRET
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> See the [MastraJwtAuth](/reference/auth/jwt.mdx) API reference for all available configuration options.
|
|
35
|
+
|
|
36
|
+
## Configuring `MastraClient`
|
|
37
|
+
|
|
38
|
+
When `experimental_auth` is enabled, all requests made with `MastraClient` must include a valid JWT in the `Authorization` header:
|
|
39
|
+
|
|
40
|
+
```typescript {6} filename="lib/mastra/mastra-client.ts" showLineNumbers copy
|
|
41
|
+
import { MastraClient } from "@mastra/client-js";
|
|
42
|
+
|
|
43
|
+
export const mastraClient = new MastraClient({
|
|
44
|
+
baseUrl: "https://<mastra-api-url>",
|
|
45
|
+
headers: {
|
|
46
|
+
Authorization: `Bearer ${process.env.MASTRA_JWT_TOKEN}`
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> See [Mastra Client SDK](/docs/server-db/mastra-client.mdx) for more configuration options.
|
|
52
|
+
|
|
53
|
+
### Making authenticated requests
|
|
54
|
+
|
|
55
|
+
Once `MastraClient` is configured, you can send authenticated requests from your frontend application, or use `curl` for quick local testing:
|
|
56
|
+
|
|
57
|
+
<Tabs items={["MastraClient", "curl"]}>
|
|
58
|
+
<Tab>
|
|
59
|
+
```tsx filename="src/components/test-agent.tsx" showLineNumbers copy
|
|
60
|
+
import { mastraClient } from "../../lib/mastra-client";
|
|
61
|
+
|
|
62
|
+
export const TestAgent = () => {
|
|
63
|
+
async function handleClick() {
|
|
64
|
+
const agent = mastraClient.getAgent("weatherAgent");
|
|
65
|
+
|
|
66
|
+
const response = await agent.generate({
|
|
67
|
+
messages: "Weather in London"
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
console.log(response);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return <button onClick={handleClick}>Test Agent</button>;
|
|
74
|
+
};
|
|
75
|
+
```
|
|
76
|
+
</Tab>
|
|
77
|
+
<Tab>
|
|
78
|
+
```bash copy
|
|
79
|
+
curl -X POST http://localhost:4111/api/agents/weatherAgent/generate \
|
|
80
|
+
-H "Content-Type: application/json" \
|
|
81
|
+
-H "Authorization: Bearer <your-jwt>" \
|
|
82
|
+
-d '{
|
|
83
|
+
"messages": "Weather in London"
|
|
84
|
+
}'
|
|
85
|
+
```
|
|
86
|
+
</Tab>
|
|
87
|
+
</Tabs>
|
|
88
|
+
|
|
89
|
+
## Creating a JWT
|
|
90
|
+
|
|
91
|
+
To authenticate requests to your Mastra server, you'll need a valid JSON Web Token (JWT) signed with your `MASTRA_JWT_SECRET`.
|
|
92
|
+
|
|
93
|
+
The easiest way to generate one is using [jwt.io](https://www.jwt.io/):
|
|
94
|
+
|
|
95
|
+
1. Select **JWT Encoder**.
|
|
96
|
+
2. Scroll down to the **Sign JWT: Secret** section.
|
|
97
|
+
3. Enter your secret (for example: `supersecretdevkeythatishs256safe!`).
|
|
98
|
+
4. Click **Generate example** to create a valid JWT.
|
|
99
|
+
5. Copy the generated token and set it as `MASTRA_JWT_TOKEN` in your `.env` file.
|
|
@@ -18,8 +18,8 @@ Deploy your Mastra applications to Azure App Services.
|
|
|
18
18
|
|
|
19
19
|
### Prerequisites
|
|
20
20
|
|
|
21
|
-
- An Azure account with an active subscription
|
|
22
|
-
- A GitHub repository containing your Mastra application
|
|
21
|
+
- An [Azure account](https://azure.microsoft.com/) with an active subscription
|
|
22
|
+
- A [GitHub repository](https://github.com/) containing your Mastra application
|
|
23
23
|
- Your Mastra application should be created using `npx create-mastra@latest`
|
|
24
24
|
|
|
25
25
|
### Deployment Steps
|
|
@@ -29,7 +29,7 @@ Deploy your Mastra applications to Azure App Services.
|
|
|
29
29
|
#### Create a new App Service
|
|
30
30
|
|
|
31
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
|
|
32
|
+
- Navigate to **[App Services](https://docs.microsoft.com/en-us/azure/app-service/)** or search for it in the top search bar
|
|
33
33
|
- Click **Create** to create a new App Service
|
|
34
34
|
- In the drop-down, select **Web App**
|
|
35
35
|
|
|
@@ -67,7 +67,7 @@ Before setting up deployment, configure your environment variables:
|
|
|
67
67
|
- Navigate to **Deployment Center** in the left sidebar
|
|
68
68
|
- Select **GitHub** as your source
|
|
69
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
|
|
70
|
+
- In this example, we will keep [GitHub Actions](https://docs.github.com/en/actions) as our provider
|
|
71
71
|
- Select your organization, repository, and branch
|
|
72
72
|
- Azure will generate a GitHub workflow file and you can preview it before proceeding
|
|
73
73
|
- Click **Save** (the save button is located at the top of the page)
|
|
@@ -84,7 +84,7 @@ Pull the latest changes to your local repository and modify the generated workfl
|
|
|
84
84
|
|
|
85
85
|
1. **Update the build step**: Find the step named "npm install, build, and test" and:
|
|
86
86
|
- Change the step name to "npm install and build"
|
|
87
|
-
-
|
|
87
|
+
- If you haven't set up proper tests in your Mastra application, remove the `npm test` command from the run section as the default test script will fail and disrupt deployment. If you have working tests, you can keep the test command.
|
|
88
88
|
|
|
89
89
|
2. **Update the zip artifact step**: Find the "Zip artifact for deployment" step and replace the zip command with:
|
|
90
90
|
|
|
@@ -133,4 +133,5 @@ such as `LibSQLStore` with a file URL. Consider using cloud-based storage soluti
|
|
|
133
133
|
- [Mastra Client SDK](/docs/client-js/overview)
|
|
134
134
|
- [Configure custom domains](https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain)
|
|
135
135
|
- [Enable HTTPS](https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-bindings)
|
|
136
|
+
- [Azure App Service documentation](https://docs.microsoft.com/en-us/azure/app-service/)
|
|
136
137
|
|