@mastra/mcp-docs-server 1.2.17-alpha.19 → 1.2.17-alpha.21

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 (39) hide show
  1. package/.docs/docs/storage.md +1 -0
  2. package/.docs/docs/workflows/control-flow.md +0 -4
  3. package/.docs/docs/workflows/human-in-the-loop.md +0 -4
  4. package/.docs/docs/workflows/suspend-and-resume.md +0 -4
  5. package/.docs/integrations/frameworks/astro.md +5 -1
  6. package/.docs/integrations/frameworks/next-js.md +5 -1
  7. package/.docs/integrations/frameworks/vite-react.md +5 -1
  8. package/.docs/integrations/sandboxes/railway.md +11 -0
  9. package/.docs/integrations.md +2 -0
  10. package/.docs/models/environment-variables.md +2 -2
  11. package/.docs/models/gateways/merge-gateway.md +212 -0
  12. package/.docs/models/gateways/openrouter.md +4 -1
  13. package/.docs/models/gateways/vercel.md +2 -1
  14. package/.docs/models/gateways.md +1 -0
  15. package/.docs/models/index.md +1 -1
  16. package/.docs/models/providers/ambient.md +2 -2
  17. package/.docs/models/providers/chutes.md +1 -1
  18. package/.docs/models/providers/edenai.md +5 -5
  19. package/.docs/models/providers/hetzner.md +6 -8
  20. package/.docs/models/providers/hyper.md +5 -5
  21. package/.docs/models/providers/kilo.md +5 -3
  22. package/.docs/models/providers/llmgateway.md +3 -3
  23. package/.docs/models/providers/scx-ai.md +76 -0
  24. package/.docs/models/providers/wandb.md +2 -1
  25. package/.docs/models/providers.md +1 -2
  26. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  27. package/.docs/reference/ai-sdk/handle-chat-stream.md +1 -1
  28. package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
  29. package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
  30. package/.docs/reference/ai-sdk/network-route.md +1 -1
  31. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
  32. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
  33. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  34. package/.docs/reference/editor/tool-provider.md +107 -0
  35. package/.docs/reference/rag/retrieval.md +26 -18
  36. package/.docs/reference/workspace/platform-sandbox.md +11 -0
  37. package/CHANGELOG.md +14 -0
  38. package/package.json +5 -5
  39. package/.docs/models/providers/merge-gateway.md +0 -268
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Kilo Gateway logo](https://models.dev/logos/kilo.svg)Kilo Gateway
4
4
 
5
- Access 358 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
5
+ Access 360 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Kilo Gateway documentation](https://kilo.ai).
8
8
 
@@ -40,7 +40,7 @@ for await (const chunk of stream) {
40
40
  | `kilo/~anthropic/claude-haiku-latest` | 200K | | | | | | $1 | $5 |
41
41
  | `kilo/~anthropic/claude-opus-latest` | 1.0M | | | | | | $5 | $25 |
42
42
  | `kilo/~anthropic/claude-sonnet-latest` | 1.0M | | | | | | $2 | $10 |
43
- | `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.08 | $0.16 |
43
+ | `kilo/~deepseek/deepseek-v4-flash-latest` | 262K | | | | | | $0.08 | $0.15 |
44
44
  | `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.38 | $2 |
45
45
  | `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
46
46
  | `kilo/~moonshotai/kimi-latest` | 975K | | | | | | $3 | $13 |
@@ -128,7 +128,7 @@ for await (const chunk of stream) {
128
128
  | `kilo/google/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
129
129
  | `kilo/google/gemini-3.5-flash-lite` | 1.0M | | | | | | $0.30 | $3 |
130
130
  | `kilo/google/gemini-3.6-flash` | 1.0M | | | | | | $0.75 | $4 |
131
- | `kilo/google/gemini-3.7-flash` | 1.0M | | | | | | $0.75 | $4 |
131
+ | `kilo/google/gemini-3.7-flash` | 1.0M | | | | | | $2 | $8 |
132
132
  | `kilo/google/gemma-2-27b-it` | 8K | | | | | | $0.65 | $0.65 |
133
133
  | `kilo/google/gemma-3-12b-it` | 131K | | | | | | $0.05 | $0.15 |
134
134
  | `kilo/google/gemma-3-27b-it` | 131K | | | | | | $0.08 | $0.16 |
@@ -154,6 +154,7 @@ for await (const chunk of stream) {
154
154
  | `kilo/kwaipilot/kat-coder-air-v2.5` | 256K | | | | | | $0.15 | $0.60 |
155
155
  | `kilo/kwaipilot/kat-coder-pro-v2` | 256K | | | | | | $0.30 | $1 |
156
156
  | `kilo/kwaipilot/kat-coder-pro-v2.5` | 256K | | | | | | $0.74 | $3 |
157
+ | `kilo/liquid/lfm-2.5-2.6b:free` | 128K | | | | | | — | — |
157
158
  | `kilo/mancer/weaver` | 8K | | | | | | $0.50 | $0.75 |
158
159
  | `kilo/meituan/longcat-2.0` | 1.0M | | | | | | $0.75 | $3 |
159
160
  | `kilo/meta-llama/llama-3.1-70b-instruct` | 131K | | | | | | $0.40 | $0.40 |
@@ -393,6 +394,7 @@ for await (const chunk of stream) {
393
394
  | `kilo/z-ai/glm-5-turbo` | 203K | | | | | | $1 | $4 |
394
395
  | `kilo/z-ai/glm-5.1` | 200K | | | | | | $1 | $4 |
395
396
  | `kilo/z-ai/glm-5.2` | 1.0M | | | | | | $1 | $4 |
397
+ | `kilo/z-ai/glm-5.3` | 1.0M | | | | | | $1 | $4 |
396
398
  | `kilo/z-ai/glm-5v-turbo` | 203K | | | | | | $1 | $4 |
397
399
 
398
400
  ## Advanced configuration
@@ -55,7 +55,7 @@ for await (const chunk of stream) {
55
55
  | `llmgateway/cosmos3-super-reasoner` | 262K | | | | | | $0.10 | $0.30 |
56
56
  | `llmgateway/custom` | 128K | | | | | | — | — |
57
57
  | `llmgateway/deepseek-v3.2` | 164K | | | | | | $0.26 | $0.38 |
58
- | `llmgateway/deepseek-v4-flash` | 1.1M | | | | | | $0.08 | $0.15 |
58
+ | `llmgateway/deepseek-v4-flash` | 1.1M | | | | | | $0.05 | $0.09 |
59
59
  | `llmgateway/deepseek-v4-pro` | 1.1M | | | | | | $0.43 | $0.87 |
60
60
  | `llmgateway/ernie-4.5-vl-424b-a47b` | 123K | | | | | | $0.42 | $1 |
61
61
  | `llmgateway/fugu-ultra` | 1.0M | | | | | | $5 | $30 |
@@ -176,7 +176,7 @@ for await (const chunk of stream) {
176
176
  | `llmgateway/nemotron-3-nano-30b` | 262K | | | | | | $0.06 | $0.24 |
177
177
  | `llmgateway/nemotron-3-nano-omni` | 262K | | | | | | $0.06 | $0.24 |
178
178
  | `llmgateway/nemotron-3-super-120b` | 262K | | | | | | $0.30 | $0.90 |
179
- | `llmgateway/nemotron-3-ultra-550b` | 1.0M | | | | | | $0.50 | $3 |
179
+ | `llmgateway/nemotron-3-ultra-550b` | 1.0M | | | | | | $0.50 | $2 |
180
180
  | `llmgateway/o1` | 200K | | | | | | $15 | $60 |
181
181
  | `llmgateway/o3` | 200K | | | | | | $2 | $8 |
182
182
  | `llmgateway/o3-mini` | 200K | | | | | | $1 | $4 |
@@ -194,7 +194,7 @@ for await (const chunk of stream) {
194
194
  | `llmgateway/qwen3-30b-a3b-instruct-2507` | 262K | | | | | | $0.10 | $0.30 |
195
195
  | `llmgateway/qwen3-32b` | 41K | | | | | | $0.10 | $0.30 |
196
196
  | `llmgateway/qwen3-coder-30b-a3b-instruct` | 262K | | | | | | $0.07 | $0.27 |
197
- | `llmgateway/qwen3-coder-480b-a35b-instruct` | 262K | | | | | | $0.30 | $1 |
197
+ | `llmgateway/qwen3-coder-480b-a35b-instruct` | 262K | | | | | | $0.38 | $2 |
198
198
  | `llmgateway/qwen3-coder-flash` | 1.0M | | | | | | $0.30 | $2 |
199
199
  | `llmgateway/qwen3-coder-next` | 262K | | | | | | $0.11 | $0.68 |
200
200
  | `llmgateway/qwen3-coder-plus` | 1.0M | | | | | | $6 | $60 |
@@ -0,0 +1,76 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # ![SCX.ai logo](https://models.dev/logos/scx-ai.svg)SCX.ai
4
+
5
+ Access 4 SCX.ai models through Mastra's model router. Authentication is handled automatically using the `SCX_API_KEY` environment variable.
6
+
7
+ Learn more in the [SCX.ai documentation](https://platform.scx.ai/docs).
8
+
9
+ ```bash
10
+ SCX_API_KEY=your-api-key
11
+ ```
12
+
13
+ ```typescript
14
+ import { Agent } from "@mastra/core/agent";
15
+
16
+ const agent = new Agent({
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "scx-ai/GLM-5.2"
21
+ });
22
+
23
+ // Generate a response
24
+ const response = await agent.generate("Hello!");
25
+
26
+ // Stream a response
27
+ const stream = await agent.stream("Tell me a story");
28
+ for await (const chunk of stream) {
29
+ console.log(chunk);
30
+ }
31
+ ```
32
+
33
+ > **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [SCX.ai documentation](https://platform.scx.ai/docs) for details.
34
+
35
+ ## Models
36
+
37
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
+ | --------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
+ | `scx-ai/GLM-5.2` | 1.0M | | | | | | $0.55 | $2 |
40
+ | `scx-ai/gpt-oss-120b` | 131K | | | | | | $0.17 | $0.55 |
41
+ | `scx-ai/MiniMax-M2.7` | 197K | | | | | | $0.48 | $2 |
42
+ | `scx-ai/Qwen3.8-Max` | 1.0M | | | | | | $2 | $5 |
43
+
44
+ ## Advanced configuration
45
+
46
+ ### Custom headers
47
+
48
+ ```typescript
49
+ const agent = new Agent({
50
+ id: "custom-agent",
51
+ name: "custom-agent",
52
+ model: {
53
+ url: "https://api.scx.ai/v1",
54
+ id: "scx-ai/GLM-5.2",
55
+ apiKey: process.env.SCX_API_KEY,
56
+ headers: {
57
+ "X-Custom-Header": "value"
58
+ }
59
+ }
60
+ });
61
+ ```
62
+
63
+ ### Dynamic model selection
64
+
65
+ ```typescript
66
+ const agent = new Agent({
67
+ id: "dynamic-agent",
68
+ name: "Dynamic Agent",
69
+ model: ({ requestContext }) => {
70
+ const useAdvanced = requestContext.task === "complex";
71
+ return useAdvanced
72
+ ? "scx-ai/gpt-oss-120b"
73
+ : "scx-ai/GLM-5.2";
74
+ }
75
+ });
76
+ ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Weights & Biases logo](https://models.dev/logos/wandb.svg)Weights & Biases
4
4
 
5
- Access 28 Weights & Biases models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
5
+ Access 29 Weights & Biases models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Weights & Biases documentation](https://docs.wandb.ai).
8
8
 
@@ -62,6 +62,7 @@ for await (const chunk of stream) {
62
62
  | `wandb/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.25 | $1 |
63
63
  | `wandb/Qwen/Qwen3.6-27B` | 262K | | | | | | $0.60 | $4 |
64
64
  | `wandb/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.25 | $1 |
65
+ | `wandb/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
65
66
  | `wandb/zai-org/GLM-5.1` | 203K | | | | | | $1 | $4 |
66
67
  | `wandb/zai-org/GLM-5.2` | 262K | | | | | | $0.76 | $2 |
67
68
 
@@ -91,7 +91,6 @@ Direct access to individual AI model providers. Each provider offers unique mode
91
91
  - [LucidQuery](https://mastra.ai/models/providers/lucidquery)
92
92
  - [Lynkr](https://mastra.ai/models/providers/lynkr)
93
93
  - [Meganova](https://mastra.ai/models/providers/meganova)
94
- - [Merge Gateway](https://mastra.ai/models/providers/merge-gateway)
95
94
  - [Meta](https://mastra.ai/models/providers/meta)
96
95
  - [MiniMax (minimax.io)](https://mastra.ai/models/providers/minimax)
97
96
  - [MiniMax (minimaxi.com)](https://mastra.ai/models/providers/minimax-cn)
@@ -135,7 +134,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
135
134
  - [Sarvam AI](https://mastra.ai/models/providers/sarvam)
136
135
  - [Scaleway](https://mastra.ai/models/providers/scaleway)
137
136
  - [SCNet Token Plan](https://mastra.ai/models/providers/scnet-token-plan)
138
- - [SCX.ai](https://mastra.ai/models/providers/scx)
137
+ - [SCX.ai](https://mastra.ai/models/providers/scx-ai)
139
138
  - [SiliconFlow](https://mastra.ai/models/providers/siliconflow)
140
139
  - [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn)
141
140
  - [Snowflake Cortex](https://mastra.ai/models/providers/snowflake-cortex)
@@ -51,7 +51,7 @@ export const mastra = new Mastra({
51
51
 
52
52
  ## Parameters
53
53
 
54
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
54
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
55
55
 
56
56
  **path** (`string`): The route path (e.g., /chat or /chat/:agentId). Include :agentId for dynamic agent routing. (Default: `'/chat/:agentId'`)
57
57
 
@@ -50,7 +50,7 @@ export async function POST(req: Request) {
50
50
 
51
51
  ## Parameters
52
52
 
53
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
53
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
54
54
 
55
55
  **mastra** (`Mastra`): The Mastra instance containing registered agents.
56
56
 
@@ -34,7 +34,7 @@ export async function POST(req: Request) {
34
34
 
35
35
  ## Parameters
36
36
 
37
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
37
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
38
38
 
39
39
  **mastra** (`Mastra`): The Mastra instance to use for agent lookup and execution.
40
40
 
@@ -36,7 +36,7 @@ export async function POST(req: Request) {
36
36
 
37
37
  ## Parameters
38
38
 
39
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
39
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
40
40
 
41
41
  **mastra** (`Mastra`): The Mastra instance containing registered workflows.
42
42
 
@@ -49,7 +49,7 @@ export const mastra = new Mastra({
49
49
 
50
50
  ## Parameters
51
51
 
52
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
52
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
53
53
 
54
54
  **path** (`string`): The route path (e.g., /network or /network/:agentId). Include :agentId for dynamic agent routing. (Default: `'/network/:agentId'`)
55
55
 
@@ -44,7 +44,7 @@ export default function Chat() {
44
44
 
45
45
  **messages** (`MessageListInput`): Messages to convert. Can be a string, array of strings, a single message object, or an array of message objects in any supported format.
46
46
 
47
- **options.version** (`'v5' | 'v6'`): Selects the AI SDK message type to return. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 useChat() message types.
47
+ **options.version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK message type to return. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 useChat() message types. Pass 'v7' when your app is typed against AI SDK v7.
48
48
 
49
49
  ## Returns
50
50
 
@@ -64,7 +64,7 @@ The first parameter is the Mastra stream to convert. It can be one of:
64
64
 
65
65
  The second parameter is an options object:
66
66
 
67
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
67
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
68
68
 
69
69
  **from** (`'agent' | 'network' | 'workflow'`): The type of Mastra stream being converted. (Default: `'agent'`)
70
70
 
@@ -51,7 +51,7 @@ export const mastra = new Mastra({
51
51
 
52
52
  ## Parameters
53
53
 
54
- **version** (`'v5' | 'v6'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. (Default: `'v5'`)
54
+ **version** (`'v5' | 'v6' | 'v7'`): Selects the AI SDK stream contract to emit. Omit it or pass 'v5' for the existing default behavior. Pass 'v6' when your app is typed against AI SDK v6 response helpers. Pass 'v7' when your app is typed against AI SDK v7. (Default: `'v5'`)
55
55
 
56
56
  **path** (`string`): The route path (e.g., /workflow or /workflow/:workflowId). Include :workflowId for dynamic workflow routing. (Default: `'/api/workflows/:workflowId/stream'`)
57
57
 
@@ -77,6 +77,8 @@ const editor = new MastraEditor({
77
77
 
78
78
  **defaultScope** (`'per-author' | 'caller-supplied'`): Connection identity scope. Defaults to per-author. (Default: `'per-author'`)
79
79
 
80
+ **userIdResolver** (`ComposioUserIdResolver`): Server-side resolver that derives the effective Composio userId from authenticated context fields. Used for invoker and caller-supplied execution. The exact connected account always comes from the stored connection pin.
81
+
80
82
  ### Tool slugs
81
83
 
82
84
  Composio tools use uppercase slug format: `GITHUB_CREATE_ISSUE`, `SLACK_SEND_MESSAGE`.
@@ -85,6 +87,111 @@ Composio tools use uppercase slug format: `GITHUB_CREATE_ISSUE`, `SLACK_SEND_MES
85
87
 
86
88
  Connections use per-author scope by default. Set `defaultScope: 'caller-supplied'` to bucket authorization by the caller identity resolved from `MASTRA_RESOURCE_ID_KEY` in request context. Ensure each authenticated request provides a stable, unique resource ID. When using `MastraAuthWorkos`, configure `mapUserToResourceId` to set this value from the authenticated user.
87
89
 
90
+ How the provider resolves the Composio user for a tool call depends on the connection:
91
+
92
+ - **Author-bound connections** (`kind: 'author'`) execute as the agent author's user against the pinned connected account.
93
+ - **Invoker-bound connections** (`kind: 'invoker'`) execute as the authenticated invoker against the exact pinned account, which may be an account another user shared with the invoker through Composio's access control list (ACL). The user ID comes from `userIdResolver` when configured, then the authenticated user, and never from the Memory `resourceId`. Invoker resolution fails when no authenticated user or resolver result exists.
94
+ - **Caller-supplied scope** (`scope: 'caller-supplied'`) uses `userIdResolver` when configured. Otherwise, it falls back to the legacy `resourceId` from request context for backward compatibility. When a specific connected account is pinned, execution routes to that exact account. Otherwise, Composio auto-resolves within the user's bucket.
95
+
96
+ ### Execute with a shared account
97
+
98
+ Bob needs to run a Salesforce tool with an account that Alice shared through Composio. Keep each identity separate:
99
+
100
+ | Identity | Value |
101
+ | ----------------- | --------------------- |
102
+ | Memory resource | `project_123` |
103
+ | Composio user ID | `bob` |
104
+ | Connected account | `ca_alice_salesforce` |
105
+
106
+ Register the provider normally. Mastra server authentication writes the authenticated user to request context, so most applications don't need a `userIdResolver`:
107
+
108
+ ```typescript
109
+ import { Mastra } from '@mastra/core/mastra'
110
+ import { MastraEditor } from '@mastra/editor'
111
+ import { ComposioToolProvider } from '@mastra/editor/composio'
112
+
113
+ const editor = new MastraEditor({
114
+ toolProviders: {
115
+ composio: new ComposioToolProvider({
116
+ apiKey: process.env.COMPOSIO_API_KEY!,
117
+ }),
118
+ },
119
+ })
120
+
121
+ export const mastra = new Mastra({ editor })
122
+ ```
123
+
124
+ Configure the agent with an invoker connection pinned to `ca_alice_salesforce`. When Bob invokes the agent, Mastra sends `bob` as the Composio user and the pinned account ID as the exact connected account. The Memory resource stays `project_123`. Composio then checks whether the account's ACL permits Bob to execute it.
125
+
126
+ ### Map application users to Composio users
127
+
128
+ Use `userIdResolver` when your Composio user IDs differ from the IDs returned by Mastra authentication, or when your application must authorize the stored account pin before execution.
129
+
130
+ ```typescript
131
+ type ComposioUserIdResolver = (
132
+ input: ComposioUserIdResolverInput,
133
+ ) => Promise<string | undefined> | string | undefined
134
+ ```
135
+
136
+ **requestContext** (`RequestContext`): Live per-request context. Client-provided non-reserved entries are untrusted. Derive identity and authorize connectedAccountId only from validated, server-populated fields such as MASTRA\_USER\_KEY, read with getRaw().
137
+
138
+ **toolkit** (`string`): Toolkit slug the identity is being resolved for, when known.
139
+
140
+ **connectedAccountId** (`string`): Stored connection pin being resolved, when one exists. Use it to validate that the invoker may use this exact account.
141
+
142
+ The resolver returns the Composio user ID, or `undefined` to use the provider's default resolution. Returning an empty string throws instead of silently falling back. The resolver can't replace the connected account.
143
+
144
+ This example namespaces the Composio user by organization and asks the application's authorization layer to approve the exact account pin:
145
+
146
+ ```typescript
147
+ import { MASTRA_USER_KEY } from '@mastra/server/auth'
148
+ import { ComposioToolProvider } from '@mastra/editor/composio'
149
+ import { canUseConnectedAccount } from './integration-authorization'
150
+
151
+ type AuthenticatedUser = {
152
+ id: string
153
+ organizationId: string
154
+ }
155
+
156
+ function isAuthenticatedUser(value: unknown): value is AuthenticatedUser {
157
+ return (
158
+ typeof value === 'object' &&
159
+ value !== null &&
160
+ 'id' in value &&
161
+ typeof value.id === 'string' &&
162
+ 'organizationId' in value &&
163
+ typeof value.organizationId === 'string'
164
+ )
165
+ }
166
+
167
+ const composio = new ComposioToolProvider({
168
+ apiKey: process.env.COMPOSIO_API_KEY!,
169
+ userIdResolver: async ({ requestContext, toolkit, connectedAccountId }) => {
170
+ const user = requestContext?.getRaw(MASTRA_USER_KEY)
171
+ if (!isAuthenticatedUser(user)) return undefined
172
+
173
+ if (connectedAccountId) {
174
+ const allowed = await canUseConnectedAccount({
175
+ actorId: user.id,
176
+ organizationId: user.organizationId,
177
+ provider: 'composio',
178
+ toolkit,
179
+ connectedAccountId,
180
+ })
181
+ if (!allowed) {
182
+ throw new Error('User cannot access this connected account')
183
+ }
184
+ }
185
+
186
+ return `${user.organizationId}:${user.id}`
187
+ },
188
+ })
189
+ ```
190
+
191
+ Use the same namespaced ID when creating Composio connections and shared-account ACL entries. For example, Bob's Composio user ID in this setup is `acme:bob`.
192
+
193
+ Throw from `userIdResolver` to deny the request. During stored-agent resolution, Mastra logs the failure and omits tools associated with that connection, so no tool call reaches Composio. Other connections continue to resolve. When calling `resolveToolsVNext()` directly, the error is returned to the caller instead.
194
+
88
195
  ### Connection management tools
89
196
 
90
197
  Composio provides tools for starting and monitoring authorization from an agent chat. When `allowedToolkits` is set, include `composio` to make these tools available:
@@ -266,6 +266,23 @@ For detailed configuration options and advanced usage, see the [Vector Query Too
266
266
 
267
267
  Vector store prompts define query patterns and filtering capabilities for each vector database implementation. When implementing filtering, these prompts are required in the agent's instructions to specify valid operators and syntax for each vector store implementation.
268
268
 
269
+ **MongoDB**:
270
+
271
+ ```ts
272
+ import { MONGODB_PROMPT } from '@mastra/mongodb'
273
+
274
+ export const ragAgent = new Agent({
275
+ id: 'rag-agent',
276
+ name: 'RAG Agent',
277
+ model: 'openai/gpt-5.6-sol',
278
+ instructions: `
279
+ Process queries using the provided context. Structure responses to be concise and relevant.
280
+ ${MONGODB_PROMPT}
281
+ `,
282
+ tools: { vectorQueryTool },
283
+ })
284
+ ```
285
+
269
286
  **pgVector**:
270
287
 
271
288
  ```ts
@@ -402,23 +419,6 @@ export const ragAgent = new Agent({
402
419
  })
403
420
  ```
404
421
 
405
- **MongoDB**:
406
-
407
- ```ts
408
- import { MONGODB_PROMPT } from '@mastra/mongodb'
409
-
410
- export const ragAgent = new Agent({
411
- id: 'rag-agent',
412
- name: 'RAG Agent',
413
- model: 'openai/gpt-5.6-sol',
414
- instructions: `
415
- Process queries using the provided context. Structure responses to be concise and relevant.
416
- ${MONGODB_PROMPT}
417
- `,
418
- tools: { vectorQueryTool },
419
- })
420
- ```
421
-
422
422
  **OpenSearch**:
423
423
 
424
424
  ```ts
@@ -520,7 +520,13 @@ The weights control how different factors influence the final ranking:
520
520
 
521
521
  > **Note:** For semantic scoring to work properly during re-ranking, each result must include the text content in its `metadata.text` field.
522
522
 
523
- You can also use other relevance score providers like Cohere or ZeroEntropy:
523
+ You can also use other relevance score providers like Voyage AI, Cohere, or ZeroEntropy:
524
+
525
+ ```ts
526
+ import { VoyageRelevanceScorer } from '@mastra/voyageai'
527
+
528
+ const relevanceProvider = new VoyageRelevanceScorer({ model: 'rerank-2.5' })
529
+ ```
524
530
 
525
531
  ```ts
526
532
  const relevanceProvider = new CohereRelevanceScorer('rerank-v3.5')
@@ -530,6 +536,8 @@ const relevanceProvider = new CohereRelevanceScorer('rerank-v3.5')
530
536
  const relevanceProvider = new ZeroEntropyRelevanceScorer('zerank-1')
531
537
  ```
532
538
 
539
+ Voyage AI provides dedicated reranking models: `rerank-2.5` and `rerank-2.5-lite` both allow up to 32,000 tokens for the query and any single document combined, and up to 600,000 tokens across a request. `VoyageRelevanceScorer` reads `VOYAGE_API_KEY` from the environment, or accepts an `apiKey` in its config.
540
+
533
541
  The re-ranked results combine vector similarity with semantic understanding to improve retrieval quality.
534
542
 
535
543
  For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
@@ -144,6 +144,15 @@ await sandbox.snapshot()
144
144
 
145
145
  Each `id` maps to one independent filesystem. Reusing the same `id` across unrelated sandboxes causes the platform to boot them from each other's checkpoint.
146
146
 
147
+ Set `seedCheckpointName` to provide a boot-only fallback when the checkpoint for `id` doesn't exist yet. The platform restores the checkpoint for `id` first when both exist. Later snapshots continue writing to the checkpoint for `id`, so the seed remains unchanged.
148
+
149
+ ```typescript
150
+ const sandbox = new PlatformSandbox({
151
+ id: `project-session-${sessionId}`,
152
+ seedCheckpointName: 'project-base',
153
+ })
154
+ ```
155
+
147
156
  ### Cloning for a fleet of sandboxes
148
157
 
149
158
  `clone()` returns an independent sibling `PlatformSandbox` that inherits credentials and defaults (access token, project, environment, network isolation, timeout, instructions, env, idle timeout) with per-instance overrides. The returned sandbox is unstarted and provisions on its own `start()`, so `clone()` performs no I/O:
@@ -187,6 +196,8 @@ console.log(result.exitCode)
187
196
 
188
197
  **sandboxId** (`string`): Existing sandbox ID to reattach to instead of creating a new sandbox. When set, environmentId is not required.
189
198
 
199
+ **seedCheckpointName** (`string`): Boot-only fallback checkpoint used when the primary recovery checkpoint for id has no stored state. Later snapshots continue writing to the checkpoint for id.
200
+
190
201
  **idleTimeoutMinutes** (`number`): How long the sandbox stays alive with no activity before the platform destroys it.
191
202
 
192
203
  **networkIsolation** (`'ISOLATED' | 'PRIVATE'`): Network mode. 'ISOLATED' (default) allows outbound internet only. 'PRIVATE' joins the platform environment's private network.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.17-alpha.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`58c43d3`](https://github.com/mastra-ai/mastra/commit/58c43d3f7cb2eeaeb8ac733ae71dde822348e588)]:
8
+ - @mastra/core@1.60.0-alpha.14
9
+
10
+ ## 1.2.17-alpha.20
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`c549e2f`](https://github.com/mastra-ai/mastra/commit/c549e2f40edc1cac5d9e74e82f90da22b48df084), [`c549e2f`](https://github.com/mastra-ai/mastra/commit/c549e2f40edc1cac5d9e74e82f90da22b48df084), [`2ef2f23`](https://github.com/mastra-ai/mastra/commit/2ef2f230a7aed342e7dc3b2000cd42e4c43e08a7), [`5740ec6`](https://github.com/mastra-ai/mastra/commit/5740ec60c760ffdfbfaa59d603d03b847c864e05)]:
15
+ - @mastra/core@1.60.0-alpha.13
16
+
3
17
  ## 1.2.17-alpha.19
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.17-alpha.19",
3
+ "version": "1.2.17-alpha.21",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,8 +28,8 @@
28
28
  "jsdom": "^26.1.0",
29
29
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
- "@mastra/core": "1.60.0-alpha.12",
32
- "@mastra/mcp": "^1.17.0-alpha.2"
31
+ "@mastra/mcp": "^1.17.0-alpha.2",
32
+ "@mastra/core": "1.60.0-alpha.14"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^2.0.0",
@@ -45,9 +45,9 @@
45
45
  "tsx": "^4.23.1",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "4.1.10",
48
+ "@internal/types-builder": "0.0.98",
48
49
  "@internal/lint": "0.0.123",
49
- "@mastra/core": "1.60.0-alpha.12",
50
- "@internal/types-builder": "0.0.98"
50
+ "@mastra/core": "1.60.0-alpha.14"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {