@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.
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +10 -0
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +40 -40
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +53 -53
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flance.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Frag.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +11 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +10 -10
- package/.docs/organized/changelogs/create-mastra.md +7 -7
- package/.docs/organized/changelogs/mastra.md +49 -49
- package/.docs/organized/code-examples/weather-agent.md +11 -4
- package/.docs/raw/agents/overview.mdx +1 -1
- package/.docs/raw/auth/firebase.mdx +285 -0
- package/.docs/raw/auth/index.mdx +3 -3
- package/.docs/raw/deployment/overview.mdx +7 -1
- package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +108 -0
- package/.docs/raw/getting-started/installation.mdx +0 -1
- package/.docs/raw/memory/overview.mdx +1 -1
- package/.docs/raw/reference/agents/ChunkType.mdx +8 -8
- package/.docs/raw/reference/auth/firebase.mdx +128 -0
- package/.docs/raw/reference/cli/dev.mdx +7 -1
- package/.docs/raw/reference/client-js/agents.mdx +3 -3
- package/.docs/raw/reference/client-js/memory.mdx +1 -1
- package/.docs/raw/reference/client-js/tools.mdx +1 -1
- package/.docs/raw/reference/core/getWorkflow.mdx +0 -1
- package/.docs/raw/reference/core/getWorkflows.mdx +0 -1
- package/.docs/raw/reference/core/setTelemetry.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +2 -2
- package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +3 -3
- package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/map.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
- package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
- package/.docs/raw/server-db/local-dev-playground.mdx +31 -9
- package/.docs/raw/server-db/mastra-client.mdx +189 -73
- package/CHANGELOG.md +10 -0
- package/package.json +5 -5
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +0 -302
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +0 -302
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +0 -302
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +0 -302
- package/.docs/organized/code-examples/memory-with-mem0.md +0 -108
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MastraAuthFirebase Class"
|
|
3
|
+
description: "API reference for the MastraAuthFirebase class, which authenticates Mastra applications using Firebase Authentication."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# MastraAuthFirebase Class
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
## Usage examples
|
|
11
|
+
|
|
12
|
+
### Basic usage with environment variables
|
|
13
|
+
|
|
14
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
15
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
16
|
+
import { MastraAuthFirebase } from '@mastra/auth-firebase';
|
|
17
|
+
|
|
18
|
+
// Automatically uses FIREBASE_SERVICE_ACCOUNT and FIRESTORE_DATABASE_ID env vars
|
|
19
|
+
export const mastra = new Mastra({
|
|
20
|
+
// ..
|
|
21
|
+
server: {
|
|
22
|
+
experimental_auth: new MastraAuthFirebase(),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Custom configuration
|
|
28
|
+
|
|
29
|
+
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
30
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
31
|
+
import { MastraAuthFirebase } from '@mastra/auth-firebase';
|
|
32
|
+
|
|
33
|
+
export const mastra = new Mastra({
|
|
34
|
+
// ..
|
|
35
|
+
server: {
|
|
36
|
+
experimental_auth: new MastraAuthFirebase({
|
|
37
|
+
serviceAccount: "/path/to/service-account-key.json",
|
|
38
|
+
databaseId: "your-database-id"
|
|
39
|
+
}),
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Constructor parameters
|
|
45
|
+
|
|
46
|
+
<PropertiesTable
|
|
47
|
+
content={[
|
|
48
|
+
{
|
|
49
|
+
name: "serviceAccount",
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Path to the Firebase service account JSON file. This file contains the credentials needed to verify Firebase ID tokens on the server side.",
|
|
52
|
+
isOptional: true,
|
|
53
|
+
defaultValue: "process.env.FIREBASE_SERVICE_ACCOUNT"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "databaseId",
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "The Firestore database ID to use. Typically '(default)' for the default database.",
|
|
59
|
+
isOptional: true,
|
|
60
|
+
defaultValue: "process.env.FIRESTORE_DATABASE_ID || process.env.FIREBASE_DATABASE_ID"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "name",
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "Custom name for the auth provider instance.",
|
|
66
|
+
isOptional: true,
|
|
67
|
+
defaultValue: '"firebase"'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "authorizeUser",
|
|
71
|
+
type: "(user: FirebaseUser) => Promise<boolean> | boolean",
|
|
72
|
+
description: "Custom authorization function to determine if a user should be granted access. Called after token verification. By default, checks for the presence of a document in the 'user_access' collection keyed by the user's UID.",
|
|
73
|
+
isOptional: true,
|
|
74
|
+
},
|
|
75
|
+
]}
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
## Environment Variables
|
|
79
|
+
|
|
80
|
+
The following environment variables are automatically used when constructor options are not provided:
|
|
81
|
+
|
|
82
|
+
<PropertiesTable
|
|
83
|
+
content={[
|
|
84
|
+
{
|
|
85
|
+
name: "FIREBASE_SERVICE_ACCOUNT",
|
|
86
|
+
type: "string",
|
|
87
|
+
description: "Path to Firebase service account JSON file. Used if serviceAccount option is not provided.",
|
|
88
|
+
isOptional: true,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "FIRESTORE_DATABASE_ID",
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Firestore database ID. Primary environment variable for database configuration.",
|
|
94
|
+
isOptional: true,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "FIREBASE_DATABASE_ID",
|
|
98
|
+
type: "string",
|
|
99
|
+
description: "Alternative environment variable for Firestore database ID. Used if FIRESTORE_DATABASE_ID is not set.",
|
|
100
|
+
isOptional: true,
|
|
101
|
+
},
|
|
102
|
+
]}
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
## Default Authorization Behavior
|
|
106
|
+
|
|
107
|
+
By default, `MastraAuthFirebase` uses Firestore to manage user access:
|
|
108
|
+
|
|
109
|
+
1. After successfully verifying a Firebase ID token, the `authorizeUser` method is called
|
|
110
|
+
2. It checks for the existence of a document in the `user_access` collection with the user's UID as the document ID
|
|
111
|
+
3. If the document exists, the user is authorized; otherwise, access is denied
|
|
112
|
+
4. The Firestore database used is determined by the `databaseId` parameter or environment variables
|
|
113
|
+
|
|
114
|
+
## Firebase User Type
|
|
115
|
+
|
|
116
|
+
The `FirebaseUser` type used in the `authorizeUser` function corresponds to Firebase's `DecodedIdToken` interface, which includes:
|
|
117
|
+
|
|
118
|
+
- `uid`: The user's unique identifier
|
|
119
|
+
- `email`: The user's email address (if available)
|
|
120
|
+
- `email_verified`: Whether the email is verified
|
|
121
|
+
- `name`: The user's display name (if available)
|
|
122
|
+
- `picture`: URL to the user's profile picture (if available)
|
|
123
|
+
- `auth_time`: When the user authenticated
|
|
124
|
+
- And other standard JWT claims
|
|
125
|
+
|
|
126
|
+
## Related
|
|
127
|
+
|
|
128
|
+
[MastraAuthFirebase Class](/docs/auth/firebase.mdx)
|
|
@@ -72,6 +72,12 @@ mastra dev [options]
|
|
|
72
72
|
description: "display help for command",
|
|
73
73
|
isOptional: true,
|
|
74
74
|
},
|
|
75
|
+
{
|
|
76
|
+
name: "--https",
|
|
77
|
+
type: "boolean",
|
|
78
|
+
description: "Enable local HTTPS",
|
|
79
|
+
isOptional: true,
|
|
80
|
+
},
|
|
75
81
|
]}
|
|
76
82
|
/>
|
|
77
83
|
|
|
@@ -161,7 +167,7 @@ Workflows are expected to be exported from `src/mastra/workflows` (or the config
|
|
|
161
167
|
|
|
162
168
|
## Additional Notes
|
|
163
169
|
|
|
164
|
-
The port defaults to 4111
|
|
170
|
+
The port defaults to `4111`. The port, hostname, and HTTPS settings can also be configured via the Mastra server configuration. See [Launch Development Server](/docs/server-db/local-dev-playground) for configuration details.
|
|
165
171
|
|
|
166
172
|
Make sure you have your environment variables set up in your `.env.development` or `.env` file for any providers you use (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.).
|
|
167
173
|
|
|
@@ -47,7 +47,7 @@ const response = await agent.generate({
|
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
49
|
threadId: "thread-1", // Optional: Thread ID for conversation context
|
|
50
|
-
|
|
50
|
+
resourceId: "resource-1", // Optional: Resource ID
|
|
51
51
|
output: {}, // Optional: Output configuration
|
|
52
52
|
});
|
|
53
53
|
```
|
|
@@ -207,7 +207,7 @@ const response = await agent.generateVNext(
|
|
|
207
207
|
"Hello, how are you?",
|
|
208
208
|
{
|
|
209
209
|
threadId: "thread-1",
|
|
210
|
-
|
|
210
|
+
resourceId: "resource-1",
|
|
211
211
|
}
|
|
212
212
|
);
|
|
213
|
-
```
|
|
213
|
+
```
|
|
@@ -31,5 +31,5 @@ This method does not return a value.
|
|
|
31
31
|
|
|
32
32
|
## Related
|
|
33
33
|
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
34
|
+
- [Logging](../../docs/observability/logging.mdx)
|
|
35
|
+
- [PinoLogger](../../reference/observability/logger.mdx)
|
|
@@ -44,5 +44,5 @@ workflow.branch([
|
|
|
44
44
|
|
|
45
45
|
## Related
|
|
46
46
|
|
|
47
|
-
- [Conditional
|
|
48
|
-
- [Conditional
|
|
47
|
+
- [Conditional Branching Logic](../../../docs/workflows/control-flow#conditional-logic-with-branch)
|
|
48
|
+
- [Conditional Branching Example](../../../examples/workflows/conditional-branching)
|
|
@@ -10,7 +10,7 @@ import { Callout } from "nextra/components";
|
|
|
10
10
|
The `.createRunAsync()` method creates a new workflow run instance, allowing you to execute the workflow with specific input data. This is the current API that returns a `Run` instance.
|
|
11
11
|
|
|
12
12
|
<Callout>
|
|
13
|
-
For the legacy `createRun()` method that returns an object with methods, see the [Legacy Workflows](
|
|
13
|
+
For the legacy `createRun()` method that returns an object with methods, see the [Legacy Workflows](../../legacyWorkflows/createRun.mdx) section.
|
|
14
14
|
</Callout>
|
|
15
15
|
|
|
16
16
|
## Usage example
|
|
@@ -61,5 +61,5 @@ const result = await run.start({
|
|
|
61
61
|
|
|
62
62
|
## Related
|
|
63
63
|
|
|
64
|
-
- [Run Class](
|
|
65
|
-
- [Running workflows](
|
|
64
|
+
- [Run Class](../run.mdx)
|
|
65
|
+
- [Running workflows](../../../examples/workflows/running-workflows.mdx)
|
|
@@ -126,11 +126,10 @@ The local development server includes an OpenAPI specification available at: [ht
|
|
|
126
126
|
|
|
127
127
|
To include OpenAPI documentation in your production server, enable it in the Mastra instance:
|
|
128
128
|
|
|
129
|
-
```typescript {
|
|
129
|
+
```typescript {6} filename="src/mastra/index.ts" copy
|
|
130
130
|
import { Mastra } from "@mastra/core/mastra";
|
|
131
131
|
|
|
132
132
|
export const mastra = new Mastra({
|
|
133
|
-
// ...
|
|
134
133
|
server: {
|
|
135
134
|
build: {
|
|
136
135
|
openAPIDocs: true
|
|
@@ -145,11 +144,10 @@ The local development server includes an interactive Swagger UI - API explorer a
|
|
|
145
144
|
|
|
146
145
|
To include Swagger UI in your production server, enable it in the Mastra instance:
|
|
147
146
|
|
|
148
|
-
```typescript {
|
|
147
|
+
```typescript {6} filename="src/mastra/index.ts" copy
|
|
149
148
|
import { Mastra } from "@mastra/core/mastra";
|
|
150
149
|
|
|
151
150
|
export const mastra = new Mastra({
|
|
152
|
-
// ...
|
|
153
151
|
server: {
|
|
154
152
|
build: {
|
|
155
153
|
swaggerUI: true
|
|
@@ -170,13 +168,12 @@ This setup lets you start developing immediately with production-like behavior,
|
|
|
170
168
|
|
|
171
169
|
## Configuration
|
|
172
170
|
|
|
173
|
-
By default, the server runs on port `4111`. You can customize the host and port through the Mastra server configuration.
|
|
171
|
+
By default, the server runs on port `4111`. You can customize the `host` and `port` through the Mastra server configuration.
|
|
174
172
|
|
|
175
|
-
```typescript {6
|
|
173
|
+
```typescript {5,6} filename="src/mastra/index.ts" copy
|
|
176
174
|
import { Mastra } from "@mastra/core/mastra";
|
|
177
175
|
|
|
178
176
|
export const mastra = new Mastra({
|
|
179
|
-
// ...
|
|
180
177
|
server: {
|
|
181
178
|
port: 8080,
|
|
182
179
|
host: "0.0.0.0",
|
|
@@ -184,15 +181,40 @@ export const mastra = new Mastra({
|
|
|
184
181
|
});
|
|
185
182
|
```
|
|
186
183
|
|
|
184
|
+
### Local HTTPS
|
|
185
|
+
|
|
186
|
+
Mastra provides a way to use a local HTTPS server for `mastra dev` (through [expo/devcert](https://github.com/expo/devcert)). When you use the `--https` flag, a private key and certificate will be created and used for your project. By default, certificates are issued for `localhost` unless you defined another `host` value.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
mastra dev --https
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
You can provide your own key and cert file by specifying the `server.https` option in the Mastra server configuration.
|
|
193
|
+
|
|
194
|
+
```typescript {2,6-9} filename="src/mastra/index.ts" copy
|
|
195
|
+
import { Mastra } from "@mastra/core/mastra";
|
|
196
|
+
import fs from 'node:fs'
|
|
197
|
+
|
|
198
|
+
export const mastra = new Mastra({
|
|
199
|
+
server: {
|
|
200
|
+
https: {
|
|
201
|
+
key: fs.readFileSync('path/to/key.pem'),
|
|
202
|
+
cert: fs.readFileSync('path/to/cert.pem')
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
When you provide both `--https` and `server.https` the latter will take precedence.
|
|
209
|
+
|
|
187
210
|
## Bundler options
|
|
188
211
|
|
|
189
212
|
Use `transpilePackages` to compile TypeScript packages or libraries. Use `externals` to exclude dependencies resolved at runtime, and `sourcemap` to emit readable stack traces.
|
|
190
213
|
|
|
191
|
-
```typescript filename="src/mastra/index.ts"
|
|
214
|
+
```typescript filename="src/mastra/index.ts" copy
|
|
192
215
|
import { Mastra } from "@mastra/core/mastra";
|
|
193
216
|
|
|
194
217
|
export const mastra = new Mastra({
|
|
195
|
-
// ...
|
|
196
218
|
bundler: {
|
|
197
219
|
transpilePackages: ["utils"],
|
|
198
220
|
externals: ["ui"],
|