@mastra/mcp-docs-server 0.13.22-alpha.2 → 0.13.22-alpha.3

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 (92) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +10 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +9 -0
  3. package/.docs/organized/changelogs/%40mastra%2Fastra.md +11 -11
  4. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +13 -13
  5. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +10 -10
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +10 -10
  7. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +12 -12
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +10 -10
  9. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +10 -10
  10. package/.docs/organized/changelogs/%40mastra%2Fcore.md +40 -40
  11. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +23 -23
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +28 -28
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +22 -22
  15. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +23 -23
  16. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +53 -53
  17. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +10 -10
  18. package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
  19. package/.docs/organized/changelogs/%40mastra%2Flance.md +11 -11
  20. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +11 -11
  21. package/.docs/organized/changelogs/%40mastra%2Floggers.md +11 -11
  22. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +11 -11
  23. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
  24. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
  25. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
  26. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +10 -10
  27. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +10 -10
  28. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
  29. package/.docs/organized/changelogs/%40mastra%2Fpg.md +13 -13
  30. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
  31. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +31 -31
  32. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +11 -11
  33. package/.docs/organized/changelogs/%40mastra%2Frag.md +16 -16
  34. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +11 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fserver.md +12 -12
  36. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +10 -10
  37. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +11 -11
  38. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
  39. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +10 -10
  40. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +11 -11
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +10 -10
  42. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +10 -10
  43. package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +9 -0
  44. package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +9 -0
  45. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +10 -10
  46. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +10 -10
  47. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +10 -10
  48. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
  49. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +10 -10
  50. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +10 -10
  51. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +10 -10
  52. package/.docs/organized/changelogs/create-mastra.md +7 -7
  53. package/.docs/organized/changelogs/mastra.md +49 -49
  54. package/.docs/organized/code-examples/weather-agent.md +11 -4
  55. package/.docs/raw/agents/overview.mdx +1 -1
  56. package/.docs/raw/auth/firebase.mdx +285 -0
  57. package/.docs/raw/auth/index.mdx +3 -3
  58. package/.docs/raw/deployment/overview.mdx +7 -1
  59. package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +108 -0
  60. package/.docs/raw/getting-started/installation.mdx +0 -1
  61. package/.docs/raw/memory/overview.mdx +1 -1
  62. package/.docs/raw/reference/agents/ChunkType.mdx +8 -8
  63. package/.docs/raw/reference/auth/firebase.mdx +128 -0
  64. package/.docs/raw/reference/cli/dev.mdx +7 -1
  65. package/.docs/raw/reference/client-js/agents.mdx +3 -3
  66. package/.docs/raw/reference/client-js/memory.mdx +1 -1
  67. package/.docs/raw/reference/client-js/tools.mdx +1 -1
  68. package/.docs/raw/reference/core/getWorkflow.mdx +0 -1
  69. package/.docs/raw/reference/core/getWorkflows.mdx +0 -1
  70. package/.docs/raw/reference/core/setTelemetry.mdx +2 -2
  71. package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +2 -2
  72. package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
  73. package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
  74. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
  75. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
  76. package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
  77. package/.docs/raw/reference/workflows/workflow-methods/map.mdx +1 -1
  78. package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
  79. package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +1 -1
  80. package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
  81. package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
  82. package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
  83. package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
  84. package/.docs/raw/server-db/local-dev-playground.mdx +31 -9
  85. package/.docs/raw/server-db/mastra-client.mdx +189 -73
  86. package/CHANGELOG.md +10 -0
  87. package/package.json +5 -5
  88. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +0 -302
  89. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +0 -302
  90. package/.docs/organized/changelogs/%40mastra%2Fmem0.md +0 -302
  91. package/.docs/organized/changelogs/%40mastra%2Fragie.md +0 -302
  92. package/.docs/organized/code-examples/memory-with-mem0.md +0 -108
@@ -1,5 +1,53 @@
1
1
  # mastra
2
2
 
3
+ ## 0.13.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - Improved workspace dependency resolution during development and builds. This makes the build process more reliable when working with monorepos and workspace packages, reducing potential bundling errors and improving development experience. ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
8
+
9
+ ### Patch Changes
10
+
11
+ - Improve the `mastra init` CLI. ([#7837](https://github.com/mastra-ai/mastra/pull/7837))
12
+
13
+ Previously, when you ran `mastra init` in a directory without a `package.json` file you'd receive no output. Now the CLI shows an error with next steps. Additionally, `mastra init` now also installs `zod` if not present already.
14
+
15
+ - Add support for running the Mastra dev server over HTTPS for local development. ([#7871](https://github.com/mastra-ai/mastra/pull/7871))
16
+ - Add `--https` flag for `mastra dev`. This automatically creates a local key and certificate for you.
17
+ - Alternatively, you can provide your own key and cert through `server.https`:
18
+
19
+ ```ts
20
+ // src/mastra/index.ts
21
+ import { Mastra } from '@mastra/core/mastra';
22
+ import fs from 'node:fs';
23
+
24
+ export const mastra = new Mastra({
25
+ server: {
26
+ https: {
27
+ key: fs.readFileSync('path/to/key.pem'),
28
+ cert: fs.readFileSync('path/to/cert.pem'),
29
+ },
30
+ },
31
+ });
32
+ ```
33
+
34
+ - avoid refetching on error when resolving a workflow in cloud ([#7842](https://github.com/mastra-ai/mastra/pull/7842))
35
+
36
+ - dependencies updates: ([#7810](https://github.com/mastra-ai/mastra/pull/7810))
37
+ - Updated dependency [`strip-json-comments@^5.0.3` ↗︎](https://www.npmjs.com/package/strip-json-comments/v/5.0.3) (from `^5.0.2`, in `dependencies`)
38
+
39
+ - fix markdown rendering in agent in agent text-delta ([#7851](https://github.com/mastra-ai/mastra/pull/7851))
40
+
41
+ - fix workflows runs fetching and displaying ([#7852](https://github.com/mastra-ai/mastra/pull/7852))
42
+
43
+ - fix empty state for scorers on agent page ([#7846](https://github.com/mastra-ai/mastra/pull/7846))
44
+
45
+ - Updated dependencies [[`b1c155b`](https://github.com/mastra-ai/mastra/commit/b1c155b57ce702674f207f1d4c6a4ebf94225f44), [`790f7d1`](https://github.com/mastra-ai/mastra/commit/790f7d17895d7a5f75b6b5d2d794c2e820b99d4c), [`3cd6538`](https://github.com/mastra-ai/mastra/commit/3cd6538811fc94f84a19dbd1064f46cb42e38c1d), [`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`7e82fbf`](https://github.com/mastra-ai/mastra/commit/7e82fbf3715175e274d2015eb59fb7f57dc9b09d), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
46
+ - @mastra/deployer@0.17.0-alpha.3
47
+ - @mastra/core@0.17.0-alpha.3
48
+ - @mastra/loggers@0.10.12-alpha.0
49
+ - @mastra/mcp@0.12.1-alpha.0
50
+
3
51
  ## 0.12.4-alpha.0
4
52
 
5
53
  ### Patch Changes
@@ -250,53 +298,5 @@
250
298
  - Updated dependencies [0ce418a]
251
299
  - Updated dependencies [3e0153a]
252
300
  - Updated dependencies [af90672]
253
- - Updated dependencies [8387952]
254
- - Updated dependencies [7f3b8da]
255
- - Updated dependencies [905352b]
256
- - Updated dependencies [599d04c]
257
- - Updated dependencies [a6e2254]
258
- - Updated dependencies [56041d0]
259
- - Updated dependencies [3412597]
260
- - Updated dependencies [5eca5d2]
261
- - Updated dependencies [8f22a2c]
262
- - Updated dependencies [f2cda47]
263
- - Updated dependencies [5de1555]
264
- - Updated dependencies [cfd377a]
265
- - Updated dependencies [1ed5a3e]
266
- - Updated dependencies [03d0c39]
267
- - @mastra/core@0.15.3
268
- - @mastra/deployer@0.15.3
269
- - @mastra/loggers@0.10.10
270
- - @mastra/mcp@0.11.3
271
-
272
- ## 0.11.3-alpha.4
273
-
274
- ### Patch Changes
275
-
276
- - [#7358](https://github.com/mastra-ai/mastra/pull/7358) [`2f55297`](https://github.com/mastra-ai/mastra/commit/2f552975f4eb602f24c9e811c18587a65f620d72) Thanks [@LekoArts](https://github.com/LekoArts)! - Fix issue when using `yarn dlx create-mastra`
277
-
278
- - [#7357](https://github.com/mastra-ai/mastra/pull/7357) [`01264f1`](https://github.com/mastra-ai/mastra/commit/01264f1280db040d1bd1ac9b8d29cfcaac3d6cbc) Thanks [@TheIsrael1](https://github.com/TheIsrael1)! - Mastra dev- load env vars before watch
279
-
280
- - Updated dependencies [[`c19bcf7`](https://github.com/mastra-ai/mastra/commit/c19bcf7b43542b02157b5e17303e519933a153ab), [`b42a961`](https://github.com/mastra-ai/mastra/commit/b42a961a5aefd19d6e938a7705fc0ecc90e8f756), [`45e4d39`](https://github.com/mastra-ai/mastra/commit/45e4d391a2a09fc70c48e4d60f505586ada1ba0e), [`3b8972b`](https://github.com/mastra-ai/mastra/commit/3b8972bab8161d9fd96f6a41f57181443636cd43), [`0302f50`](https://github.com/mastra-ai/mastra/commit/0302f50861a53c66ff28801fc371b37c5f97e41e), [`74db265`](https://github.com/mastra-ai/mastra/commit/74db265b96aa01a72ffd91dcae0bc3b346cca0f2), [`6cffb99`](https://github.com/mastra-ai/mastra/commit/6cffb99030dc46256e4c3c0e6730565a2825d7a4), [`7f3b8da`](https://github.com/mastra-ai/mastra/commit/7f3b8da6dd21c35d3672e44b4f5dd3502b8f8f92), [`905352b`](https://github.com/mastra-ai/mastra/commit/905352bcda134552400eb252bca1cb05a7975c14), [`f2cda47`](https://github.com/mastra-ai/mastra/commit/f2cda47ae911038c5d5489f54c36517d6f15bdcc), [`cfd377a`](https://github.com/mastra-ai/mastra/commit/cfd377a3a33a9c88b644f6540feed9cd9832db47), [`03d0c39`](https://github.com/mastra-ai/mastra/commit/03d0c3963a748294577dd232a53ee01e1e5bcc12)]:
281
- - @mastra/core@0.15.3-alpha.6
282
- - @mastra/mcp@0.11.3-alpha.3
283
- - @mastra/deployer@0.15.3-alpha.6
284
-
285
- ## 0.11.3-alpha.3
286
-
287
- ### Patch Changes
288
-
289
- - [#7343](https://github.com/mastra-ai/mastra/pull/7343) [`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e) Thanks [@LekoArts](https://github.com/LekoArts)! - Update the `package.json` file to include additional fields like `repository`, `homepage` or `files`.
290
-
291
- - Updated dependencies [[`2b64943`](https://github.com/mastra-ai/mastra/commit/2b64943a282c99988c2e5b6e1269bfaca60e6fe3), [`85ef90b`](https://github.com/mastra-ai/mastra/commit/85ef90bb2cd4ae4df855c7ac175f7d392c55c1bf), [`de3cbc6`](https://github.com/mastra-ai/mastra/commit/de3cbc61079211431bd30487982ea3653517278e)]:
292
- - @mastra/deployer@0.15.3-alpha.5
293
- - @mastra/core@0.15.3-alpha.5
294
- - @mastra/loggers@0.10.10-alpha.0
295
- - @mastra/mcp@0.11.3-alpha.2
296
-
297
- ## 0.11.3-alpha.2
298
-
299
- ### Patch Changes
300
-
301
301
 
302
- ... 5486 more lines hidden. See full changelog in package directory.
302
+ ... 5534 more lines hidden. See full changelog in package directory.
@@ -3,7 +3,8 @@
3
3
  {
4
4
  "name": "examples-weather-agent",
5
5
  "dependencies": {
6
- "@ai-sdk/openai": "^1.3.24",
6
+ "@ai-sdk/anthropic": "^2.0.9",
7
+ "@ai-sdk/openai": "^2.0.23",
7
8
  "@mastra/core": "latest",
8
9
  "@mastra/libsql": "latest",
9
10
  "zod": "^3.25.76"
@@ -14,6 +15,7 @@
14
15
  ### mastra/agents/index.ts
15
16
  ```typescript
16
17
  import { openai } from '@ai-sdk/openai';
18
+ import { anthropic } from '@ai-sdk/anthropic';
17
19
  import { Agent } from '@mastra/core/agent';
18
20
  // import { Memory } from '@mastra/memory';
19
21
  import { LibSQLStore } from '@mastra/libsql';
@@ -42,7 +44,12 @@ Your primary function is to help users get weather details for specific location
42
44
  - Keep responses concise but informative
43
45
 
44
46
  Use the weatherTool to fetch current weather data.`,
45
- model: openai('gpt-4o'),
47
+ model: [
48
+ { model: anthropic('claude-3-5-sonnet-20241022') },
49
+ { model: openai('gpt-4o') },
50
+ { model: openai('gpt-4o-mini') },
51
+ ],
52
+ maxRetries: 3,
46
53
  tools: { weatherTool },
47
54
  // memory,
48
55
  // voice,
@@ -64,7 +71,7 @@ export const weatherReporterAgent = new Agent({
64
71
  import { Mastra } from '@mastra/core';
65
72
  import { LibSQLStore } from '@mastra/libsql';
66
73
 
67
- import { weatherAgent } from './agents';
74
+ import { weatherAgent, weatherReporterAgent } from './agents';
68
75
  import { weatherWorkflow as legacyWeatherWorkflow } from './workflows';
69
76
  import { weatherWorkflow, weatherWorkflow2 } from './workflows/new-workflow';
70
77
 
@@ -72,7 +79,7 @@ export const mastra = new Mastra({
72
79
  storage: new LibSQLStore({
73
80
  url: 'file:./mastra.db',
74
81
  }),
75
- agents: { weatherAgent },
82
+ agents: { weatherAgent, weatherReporterAgent },
76
83
  legacy_workflows: { legacyWeatherWorkflow },
77
84
  workflows: { weatherWorkflow, weatherWorkflow2 },
78
85
  });
@@ -120,7 +120,7 @@ Use `.stream()` for real-time responses. Pass a single string for simple prompts
120
120
 
121
121
  ### Streaming text
122
122
 
123
- Call `.stream()` with an array of message objects that include `role` and `content`:
123
+ Use `.stream()` with an array of message objects that include `role` and `content`:
124
124
 
125
125
  ```typescript showLineNumbers copy
126
126
  const stream = await testAgent.stream([
@@ -0,0 +1,285 @@
1
+ ---
2
+ title: "MastraAuthFirebase Class"
3
+ description: "Documentation for the MastraAuthFirebase class, which authenticates Mastra applications using Firebase Authentication."
4
+ ---
5
+
6
+ import { Tabs, Tab } from "@/components/tabs";
7
+
8
+ # MastraAuthFirebase Class
9
+
10
+ The `MastraAuthFirebase` class provides authentication for Mastra using Firebase Authentication. It verifies incoming requests using Firebase ID tokens and integrates with the Mastra server using the `experimental_auth` option.
11
+
12
+ ## Prerequisites
13
+
14
+ This example uses Firebase Authentication. Make sure to:
15
+
16
+ 1. Create a Firebase project in the [Firebase Console](https://console.firebase.google.com/)
17
+ 2. Enable Authentication and configure your preferred sign-in methods (Google, Email/Password, etc.)
18
+ 3. Generate a service account key from Project Settings > Service Accounts
19
+ 4. Download the service account JSON file
20
+
21
+ ```env filename=".env" copy
22
+ FIREBASE_SERVICE_ACCOUNT=/path/to/your/service-account-key.json
23
+ FIRESTORE_DATABASE_ID=(default)
24
+ # Alternative environment variable names:
25
+ # FIREBASE_DATABASE_ID=(default)
26
+ ```
27
+
28
+ > **Note:** Store your service account JSON file securely and never commit it to version control.
29
+
30
+ ## Installation
31
+
32
+ Before you can use the `MastraAuthFirebase` class you have to install the `@mastra/auth-firebase` package.
33
+
34
+ ```bash copy
35
+ npm install @mastra/auth-firebase@latest
36
+ ```
37
+
38
+ ## Usage examples
39
+
40
+ ### Basic usage with environment variables
41
+
42
+ If you set the required environment variables (`FIREBASE_SERVICE_ACCOUNT` and `FIRESTORE_DATABASE_ID`), you can initialize `MastraAuthFirebase` without any constructor arguments. The class will automatically read these environment variables as configuration:
43
+
44
+ ```typescript {2,7} filename="src/mastra/index.ts" showLineNumbers copy
45
+ import { Mastra } from "@mastra/core/mastra";
46
+ import { MastraAuthFirebase } from '@mastra/auth-firebase';
47
+
48
+ // Automatically uses FIREBASE_SERVICE_ACCOUNT and FIRESTORE_DATABASE_ID env vars
49
+ export const mastra = new Mastra({
50
+ // ..
51
+ server: {
52
+ experimental_auth: new MastraAuthFirebase(),
53
+ },
54
+ });
55
+ ```
56
+
57
+ ### Custom configuration
58
+
59
+ ```typescript {2,7-10} filename="src/mastra/index.ts" showLineNumbers copy
60
+ import { Mastra } from "@mastra/core/mastra";
61
+ import { MastraAuthFirebase } from '@mastra/auth-firebase';
62
+
63
+ export const mastra = new Mastra({
64
+ // ..
65
+ server: {
66
+ experimental_auth: new MastraAuthFirebase({
67
+ serviceAccount: '/path/to/service-account.json',
68
+ databaseId: 'your-database-id'
69
+ }),
70
+ },
71
+ });
72
+ ```
73
+
74
+ ## Configuration
75
+
76
+ The `MastraAuthFirebase` class can be configured through constructor options or environment variables.
77
+
78
+ ### Environment Variables
79
+
80
+ - `FIREBASE_SERVICE_ACCOUNT`: Path to Firebase service account JSON file
81
+ - `FIRESTORE_DATABASE_ID` or `FIREBASE_DATABASE_ID`: Firestore database ID
82
+
83
+ > **Note:** When constructor options are not provided, the class automatically reads these environment variables. This means you can simply call `new MastraAuthFirebase()` without any arguments if your environment variables are properly configured.
84
+
85
+ ### User Authorization
86
+
87
+ By default, `MastraAuthFirebase` uses Firestore to manage user access. It expects a collection named `user_access` with documents keyed by user UIDs. The presence of a document in this collection determines whether a user is authorized.
88
+
89
+ ```typescript filename="firestore-structure.txt" copy
90
+ user_access/
91
+ {user_uid_1}/ // Document exists = user authorized
92
+ {user_uid_2}/ // Document exists = user authorized
93
+ ```
94
+
95
+ To customize user authorization, provide a custom `authorizeUser` function:
96
+
97
+ ```typescript filename="src/mastra/auth.ts" showLineNumbers copy
98
+ import { MastraAuthFirebase } from '@mastra/auth-firebase';
99
+
100
+ const firebaseAuth = new MastraAuthFirebase({
101
+ authorizeUser: async (user) => {
102
+ // Custom authorization logic
103
+ return user.email?.endsWith('@yourcompany.com') || false;
104
+ }
105
+ });
106
+ ```
107
+
108
+ > See the [MastraAuthFirebase](/reference/auth/firebase.mdx) API reference for all available configuration options.
109
+
110
+ ## Client-side setup
111
+
112
+ When using Firebase auth, you'll need to initialize Firebase on the client side, authenticate users, and retrieve their ID tokens to pass to your Mastra requests.
113
+
114
+ ### Setting up Firebase on the client
115
+
116
+ First, initialize Firebase in your client application:
117
+
118
+ ```typescript filename="lib/firebase.ts" showLineNumbers copy
119
+ import { initializeApp } from 'firebase/app';
120
+ import { getAuth, GoogleAuthProvider } from 'firebase/auth';
121
+
122
+ const firebaseConfig = {
123
+ apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
124
+ authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
125
+ projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
126
+ };
127
+
128
+ const app = initializeApp(firebaseConfig);
129
+ export const auth = getAuth(app);
130
+ export const googleProvider = new GoogleAuthProvider();
131
+ ```
132
+
133
+ ### Authenticating users and retrieving tokens
134
+
135
+ Use Firebase authentication to sign in users and retrieve their ID tokens:
136
+
137
+ ```typescript filename="lib/auth.ts" showLineNumbers copy
138
+ import { signInWithPopup, signOut, User } from 'firebase/auth';
139
+ import { auth, googleProvider } from './firebase';
140
+
141
+ export const signInWithGoogle = async () => {
142
+ try {
143
+ const result = await signInWithPopup(auth, googleProvider);
144
+ return result.user;
145
+ } catch (error) {
146
+ console.error('Error signing in:', error);
147
+ throw error;
148
+ }
149
+ };
150
+
151
+ export const getIdToken = async (user: User) => {
152
+ try {
153
+ const idToken = await user.getIdToken();
154
+ return idToken;
155
+ } catch (error) {
156
+ console.error('Error getting ID token:', error);
157
+ throw error;
158
+ }
159
+ };
160
+
161
+ export const signOutUser = async () => {
162
+ try {
163
+ await signOut(auth);
164
+ } catch (error) {
165
+ console.error('Error signing out:', error);
166
+ throw error;
167
+ }
168
+ };
169
+ ```
170
+
171
+ > Refer to the [Firebase documentation](https://firebase.google.com/docs/auth) for other authentication methods like email/password, phone authentication, and more.
172
+
173
+ ## Configuring `MastraClient`
174
+
175
+ When `experimental_auth` is enabled, all requests made with `MastraClient` must include a valid Firebase ID token in the `Authorization` header:
176
+
177
+ ```typescript {6} filename="lib/mastra/mastra-client.ts" showLineNumbers copy
178
+ import { MastraClient } from "@mastra/client-js";
179
+
180
+ export const createMastraClient = (idToken: string) => {
181
+ return new MastraClient({
182
+ baseUrl: "https://<mastra-api-url>",
183
+ headers: {
184
+ Authorization: `Bearer ${idToken}`
185
+ }
186
+ });
187
+ };
188
+ ```
189
+
190
+ > **Note:** The ID token must be prefixed with `Bearer` in the Authorization header.
191
+
192
+ > See [Mastra Client SDK](/docs/server-db/mastra-client.mdx) for more configuration options.
193
+
194
+ ### Making authenticated requests
195
+
196
+ Once `MastraClient` is configured with the Firebase ID token, you can send authenticated requests:
197
+
198
+ <Tabs items={["React Component", "Node.js Server", "curl"]}>
199
+ <Tab>
200
+ ```tsx filename="src/components/test-agent.tsx" showLineNumbers copy
201
+ "use client";
202
+
203
+ import { useAuthState } from 'react-firebase-hooks/auth';
204
+ import { MastraClient } from "@mastra/client-js";
205
+ import { auth } from '../lib/firebase';
206
+ import { getIdToken } from '../lib/auth';
207
+
208
+ export const TestAgent = () => {
209
+ const [user] = useAuthState(auth);
210
+
211
+ async function handleClick() {
212
+ if (!user) return;
213
+
214
+ const token = await getIdToken(user);
215
+ const client = createMastraClient(token);
216
+
217
+ const weatherAgent = client.getAgent("weatherAgent");
218
+ const response = await weatherAgent.generate({
219
+ messages: "What's the weather like in New York",
220
+ });
221
+
222
+ console.log({ response });
223
+ }
224
+
225
+ return (
226
+ <button onClick={handleClick} disabled={!user}>
227
+ Test Agent
228
+ </button>
229
+ );
230
+ };
231
+ ```
232
+ </Tab>
233
+ <Tab>
234
+ ```typescript filename="server.js" showLineNumbers copy
235
+ const express = require('express');
236
+ const admin = require('firebase-admin');
237
+ const { MastraClient } = require('@mastra/client-js');
238
+
239
+ // Initialize Firebase Admin
240
+ admin.initializeApp({
241
+ credential: admin.credential.cert({
242
+ // Your service account credentials
243
+ })
244
+ });
245
+
246
+ const app = express();
247
+ app.use(express.json());
248
+
249
+ app.post('/generate', async (req, res) => {
250
+ try {
251
+ const { idToken } = req.body;
252
+
253
+ // Verify the token
254
+ await admin.auth().verifyIdToken(idToken);
255
+
256
+ const mastra = new MastraClient({
257
+ baseUrl: "http://localhost:4111",
258
+ headers: {
259
+ Authorization: `Bearer ${idToken}`
260
+ }
261
+ });
262
+
263
+ const weatherAgent = mastra.getAgent("weatherAgent");
264
+ const response = await weatherAgent.generate({
265
+ messages: "What's the weather like in Nairobi"
266
+ });
267
+
268
+ res.json({ response: response.text });
269
+ } catch (error) {
270
+ res.status(401).json({ error: 'Unauthorized' });
271
+ }
272
+ });
273
+ ```
274
+ </Tab>
275
+ <Tab>
276
+ ```bash copy
277
+ curl -X POST http://localhost:4111/api/agents/weatherAgent/generate \
278
+ -H "Content-Type: application/json" \
279
+ -H "Authorization: Bearer <your-firebase-id-token>" \
280
+ -d '{
281
+ "messages": "Weather in London"
282
+ }'
283
+ ```
284
+ </Tab>
285
+ </Tabs>
@@ -12,13 +12,13 @@ You can start with simple shared secret JWT authentication and switch to provide
12
12
  ## Available providers
13
13
 
14
14
  - [JSON Web Token (JWT)](/docs/auth/jwt)
15
+ - [Clerk](/docs/auth/clerk)
16
+ - [Supabase](/docs/auth/supabase)
17
+ - [Firebase](/docs/auth/firebase)
15
18
 
16
19
  ### Coming soon
17
20
 
18
21
  The following providers will be available soon:
19
22
 
20
- - Supabase Auth
21
- - Firebase Auth
22
23
  - Auth0
23
- - Clerk
24
24
  - WorkOS
@@ -9,6 +9,13 @@ Mastra offers multiple deployment options to suit your application's needs, from
9
9
 
10
10
  ## Deployment Options
11
11
 
12
+ ### Runtime support
13
+
14
+ - Node.js `v20.0` or higher
15
+ - Bun
16
+ - Deno
17
+ - [Cloudflare](../deployment/serverless-platforms/cloudflare-deployer.mdx)
18
+
12
19
  ### Mastra Cloud
13
20
 
14
21
  Mastra Cloud is a deployment platform that connects to your GitHub repository, automatically deploys on code changes, and provides monitoring tools. It includes:
@@ -21,7 +28,6 @@ Mastra Cloud is a deployment platform that connects to your GitHub repository, a
21
28
 
22
29
  [View Mastra Cloud documentation →](../mastra-cloud/overview.mdx)
23
30
 
24
-
25
31
  ### With a Web Framework
26
32
 
27
33
  Mastra can be integrated with a variety of web frameworks. For example, see one of the following for a detailed guide.
@@ -0,0 +1,108 @@
1
+ ---
2
+ title: 'Cedar-OS Integration'
3
+ description: 'Build AI-native frontends for your Mastra agents with Cedar-OS'
4
+ ---
5
+
6
+
7
+ import { Tabs, Steps } from "nextra/components";
8
+
9
+ # Integrate Cedar-OS with Mastra
10
+
11
+ Cedar-OS is an open-source agentic UI framework designed specifically for building the most ambitious AI-native applications. We built Cedar with Mastra in mind.
12
+
13
+ ## Should you use Cedar?
14
+
15
+ There are a few pillars we care about strongly that you can read more about [here](https://docs.cedarcopilot.com/introduction/philosophy):
16
+
17
+ #### 1. Developer experience
18
+ - **Every single component is downloaded shadcn-style** – You own all the code and can style it however you want
19
+ - **Works out of the box** – Just drop in our chat component, and it'll work
20
+ - **Fully extensible** - Built on a [Zustand store architecture](https://docs.cedarcopilot.com/introduction/architecture) that you can customize completely. Every single internal function can be overridden in one line.
21
+
22
+ #### 2. Enabling truly AI-native applications
23
+ For the first time in history, products can come to life. We want to help you build something with life.
24
+ - **[Spells](https://docs.cedarcopilot.com/spells/spells#what-are-spells)** - Users can trigger AI from keyboard shortcuts, mouse events, text selection, and other components
25
+ - **[State Diff Management](https://docs.cedarcopilot.com/state-diff/using-state-diff)** - Give users control over accepting/rejecting agent outputs
26
+ - **[Voice Integration](https://docs.cedarcopilot.com/voice/voice-integration)** - Let users control your app with their voice
27
+
28
+ ## Quick Start
29
+
30
+ <Steps>
31
+ ### Set up your project
32
+
33
+ Run Cedar's CLI command:
34
+ ``` bash
35
+ npx cedar-os-cli plant-seed
36
+ ```
37
+
38
+ If starting from scratch, select the **Mastra starter** template for a complete setup with both frontend and backend in a monorepo
39
+
40
+ If you already have a Mastra backend, use the **blank frontend cedar repo** option instead.
41
+ - This will give you the option to download components and download all dependencies for Cedar. We recommend at least downloading one of the chat components to get started.
42
+
43
+ ### Wrap your app with CedarCopilot
44
+
45
+ Wrap your application with the CedarCopilot provider to connect to your Mastra backend:
46
+
47
+ ```tsx
48
+ import { CedarCopilot } from 'cedar-os';
49
+
50
+ function App() {
51
+ return (
52
+ <CedarCopilot
53
+ llmProvider={{
54
+ provider: 'mastra',
55
+ baseURL: 'http://localhost:4111', // default dev port for Mastra
56
+ apiKey: process.env.NEXT_PUBLIC_MASTRA_API_KEY, // optional — only for backend auth
57
+ }}>
58
+ <YourApp />
59
+ </CedarCopilot>
60
+ );
61
+ }
62
+ ```
63
+
64
+ ### Configure Mastra endpoints
65
+
66
+ Configure your Mastra backend to work with Cedar by following the [Mastra Configuration Options](https://docs.cedarcopilot.com/agent-backend-connection/agent-backend-connection#mastra-configuration-options).
67
+
68
+ [Register API routes](https://mastra.ai/en/examples/deployment/custom-api-route) in your Mastra server (or NextJS serverless routes if in a monorepo):
69
+
70
+ ```ts mastra/src/index.ts
71
+ import { registerApiRoute } from '@mastra/core/server';
72
+
73
+ // POST /chat
74
+ // The chat's non-streaming default endpoint
75
+ registerApiRoute('/chat', {
76
+ method: 'POST',
77
+ // …validate input w/ zod
78
+ handler: async (c) => {
79
+ /* your agent.generate() logic */
80
+ },
81
+ });
82
+
83
+ // POST /chat/stream (SSE)
84
+ // The chat's streaming default endpoint
85
+ registerApiRoute('/chat/stream', {
86
+ method: 'POST',
87
+ handler: async (c) => {
88
+ /* stream agent output in SSE format */
89
+ },
90
+ });
91
+ ```
92
+
93
+ ### Add Cedar components
94
+
95
+ Drop Cedar components into your frontend – see [Chat Overview](https://docs.cedarcopilot.com/chat/chat-overview).
96
+
97
+ Your backend and frontend are now linked! You're ready to start building AI-native experiences with your Mastra agents.
98
+ </Steps>
99
+
100
+
101
+ ## More information
102
+
103
+ - Check out the [detailed Mastra integration guide](https://docs.cedarcopilot.com/agent-backend-connection/mastra#extending-mastra) for more configuration options (or for manual installation instructions if something goes wrong)
104
+ - Explore Mastra-specific optimizations and features we've built
105
+ - **Seamless event streaming** - Automatic rendering of [Mastra streamed events](https://docs.cedarcopilot.com/chat/custom-message-rendering#mastra-event-renderer)
106
+ - **Voice endpoint support** - Built-in [voice backend integration](https://docs.cedarcopilot.com/voice/agentic-backend#endpoint-configuration)
107
+ - **End-to-End type safety** - [Types](https://docs.cedarcopilot.com/type-safety/typing-agent-requests) for communicating between your app and Mastra backend
108
+ - [Join our Discord!](https://discord.gg/4AWawRjNdZ) We're excited to have you :)
@@ -12,7 +12,6 @@ To get started with Mastra, you’ll need access to a large language model (LLM)
12
12
 
13
13
  Mastra also supports other LLM providers. For a full list of supported models and setup instructions, see [Model Providers](/docs/getting-started/model-providers).
14
14
 
15
-
16
15
  ## Prerequisites
17
16
 
18
17
  - Node.js `v20.0` or higher
@@ -26,7 +26,7 @@ All memory types are [thread-scoped](./working-memory.mdx#thread-scoped-memory-d
26
26
 
27
27
  ### Working memory
28
28
 
29
- Stores persistent user-specific details such as names, preferences, goals, and other structured data. Uses [Markdown templates](./working-memory-template.mdx) or [Zod schemas](./working-memory-schema.mdx) to define structure.
29
+ Stores persistent user-specific details such as names, preferences, goals, and other structured data. Uses [Markdown templates](./working-memory.mdx) or [Zod schemas](./working-memory.mdx#structured-working-memory) to define structure.
30
30
 
31
31
  ### Conversation history
32
32
 
@@ -5,7 +5,7 @@ description: "Documentation for the ChunkType type used in Mastra streaming resp
5
5
 
6
6
  import { Callout } from "nextra/components";
7
7
  import { PropertiesTable } from "@/components/properties-table";
8
-
8
+
9
9
  # ChunkType
10
10
 
11
11
  <Callout type="warning">
@@ -826,24 +826,24 @@ for await (const chunk of stream.fullStream) {
826
826
  case 'text-delta':
827
827
  console.log('Text:', chunk.payload.text);
828
828
  break;
829
-
829
+
830
830
  case 'tool-call':
831
831
  console.log('Calling tool:', chunk.payload.toolName);
832
832
  break;
833
-
833
+
834
834
  case 'tool-result':
835
835
  console.log('Tool result:', chunk.payload.result);
836
836
  break;
837
-
837
+
838
838
  case 'reasoning-delta':
839
839
  console.log('Reasoning:', chunk.payload.text);
840
840
  break;
841
-
841
+
842
842
  case 'finish':
843
843
  console.log('Finished:', chunk.payload.stepResult.reason);
844
844
  console.log('Usage:', chunk.payload.output.usage);
845
845
  break;
846
-
846
+
847
847
  case 'error':
848
848
  console.error('Error:', chunk.payload.error);
849
849
  break;
@@ -853,5 +853,5 @@ for await (const chunk of stream.fullStream) {
853
853
 
854
854
  ## Related Types
855
855
 
856
- - [MastraModelOutput](/reference/agents/MastraModelOutput) - The stream object that emits these chunks
857
- - [Agent.streamVNext()](/reference/agents/streamVNext) - Method that returns streams emitting these chunks
856
+ - [MastraModelOutput](./MastraModelOutput.mdx) - The stream object that emits these chunks
857
+ - [Agent.streamVNext()](./streamVNext.mdx) - Method that returns streams emitting these chunks