@mastra/mcp-docs-server 1.1.39-alpha.6 → 1.1.39-alpha.8

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.
@@ -25,6 +25,7 @@ const mastra = new Mastra({
25
25
  auth: new MastraAuthWorkos({
26
26
  /* ... */
27
27
  fetchMemberships: true,
28
+ mapUserToResourceId: user => user.teamId,
28
29
  }),
29
30
  fga: new MastraFGAWorkos({
30
31
  resourceMapping: {
@@ -39,6 +40,9 @@ const mastra = new Mastra({
39
40
  [MastraFGAPermissions.MEMORY_WRITE]: 'update',
40
41
  },
41
42
  }),
43
+ storedResources: {
44
+ scope: true,
45
+ },
42
46
  },
43
47
  });
44
48
  ```
@@ -47,6 +51,8 @@ When using `MastraFGAWorkos`, set `fetchMemberships: true` on `MastraAuthWorkos`
47
51
 
48
52
  Use `thread` as the resource-mapping key for memory authorization. `MastraFGAWorkos` still accepts the legacy alias `memory`, but new configs should prefer `thread`.
49
53
 
54
+ When `server.fga` is configured, Mastra enforces FGA on protected actions. If a protected action has no authenticated user, Mastra denies it. If `server.fga` is not configured, these FGA checks are skipped and Mastra keeps the previous behavior.
55
+
50
56
  ### Resource mapping
51
57
 
52
58
  The `resourceMapping` tells Mastra how to resolve FGA resource types and IDs from request context. Keys are Mastra resource types, values define the FGA resource type and how to derive the ID:
@@ -67,6 +73,7 @@ resourceMapping: {
67
73
  - `user` — the authenticated user
68
74
  - `resourceId` — the owning Mastra resource ID when available (for example, a thread's `resourceId`)
69
75
  - `requestContext` — the current request context for advanced tenant resolution
76
+ - `metadata` — provider-specific metadata for the attempted action
70
77
 
71
78
  Return `undefined` from `deriveId()` to fall back to the original Mastra resource ID.
72
79
 
@@ -89,9 +96,43 @@ If no mapping exists for a permission, the original string is passed through.
89
96
 
90
97
  Use `validatePermissions()` to validate the full set of permissions Mastra may emit at startup. Use this when a provider requires every Mastra permission to have an explicit provider permission slug.
91
98
 
99
+ ### Stored resource scoping
100
+
101
+ FGA authorizes access to a resource. It does not automatically filter stored records that live in shared storage. Enable stored resource scoping when the built-in stored resource APIs are used in a multi-tenant app.
102
+
103
+ ```typescript
104
+ const mastra = new Mastra({
105
+ server: {
106
+ auth: new MastraAuthWorkos({
107
+ /* ... */
108
+ mapUserToResourceId: user => user.teamId,
109
+ }),
110
+ storedResources: {
111
+ scope: true,
112
+ },
113
+ },
114
+ });
115
+ ```
116
+
117
+ With `scope: true`, Mastra reads `MASTRA_RESOURCE_ID_KEY` from the request context. `mapUserToResourceId()` sets this value after authentication. Stored resource handlers persist the scope in record metadata and filter list, read, update, publish, and delete operations by that scope.
118
+
119
+ Use an object when the scope needs custom request logic:
120
+
121
+ ```typescript
122
+ storedResources: {
123
+ scope: {
124
+ metadataKey: 'teamId',
125
+ resolve: ({ user }) => user.teamId,
126
+ requireScope: true,
127
+ },
128
+ },
129
+ ```
130
+
131
+ If `requireScope` is `true` or omitted, scoped stored resource routes fail when no scope can be resolved.
132
+
92
133
  ### Route policy coverage
93
134
 
94
- Mastra includes route-level FGA metadata for built-in resource routes, including agents, workflows, tools, MCP tools, memory threads, responses, and conversations. A route is checked when it has route-level `fga` metadata, when Mastra can derive built-in metadata for that route, or when the provider supplies metadata with `resolveRouteFGA()`.
135
+ Mastra includes route-level FGA metadata for built-in resource routes, including agents, workflows, tools, MCP tools, memory threads, responses, conversations, and stored resources. Stored resource route coverage includes `/stored/agents`, `/stored/mcp-clients`, `/stored/prompt-blocks`, `/stored/scorers`, `/stored/skills`, and `/stored/workspaces`. A route is checked when it has route-level `fga` metadata, when Mastra can derive built-in metadata for that route, or when the provider supplies metadata with `resolveRouteFGA()`.
95
136
 
96
137
  To deny protected routes that do not resolve FGA metadata, configure route policy coverage on the FGA provider:
97
138
 
@@ -159,16 +200,20 @@ const fga = new MastraFGAWorkos({
159
200
 
160
201
  When an FGA provider is configured, Mastra automatically checks authorization at these lifecycle points:
161
202
 
162
- | Lifecycle point | Permission checked | Resource |
163
- | -------------------------------------- | ---------------------------------------------- | -------------------------------------- |
164
- | Agent execution (`generate`, `stream`) | `agents:execute` | `{ type: 'agent', id: agentId }` |
165
- | Workflow execution | `workflows:execute` | `{ type: 'workflow', id: workflowId }` |
166
- | Tool execution | `tools:execute` | `{ type: 'tool', id: toolName }` |
167
- | Thread/memory access | `memory:read`, `memory:write`, `memory:delete` | `{ type: 'thread', id: threadId }` |
168
- | MCP tool execution | `tools:execute` | `{ type: 'tool', id: toolName }` |
169
- | HTTP resource routes | Configured per route | Configured per route |
203
+ | Lifecycle point | Permission checked | Resource type | Resource ID |
204
+ | ---------------------------------------------------------------- | ----------------------------------------------- | -------------------- | ------------------------------------------------------------------- |
205
+ | Agent execution (`generate`, `stream`) | `agents:execute` | `agent` | `agentId` |
206
+ | Built-in workflow HTTP execution routes and `Workflow.execute()` | `workflows:execute` | `workflow` | `workflowId` |
207
+ | Standalone tool execution | `tools:execute` | `tool` | `toolName` |
208
+ | Agent tool execution | `tools:execute` | `tool` | `${agentId}:${toolName}` |
209
+ | MCP tool execution | `tools:execute` | `tool` | `JSON.stringify([serverName, toolName])` |
210
+ | Thread and memory access | `memory:read`, `memory:write`, `memory:delete` | `thread` | `threadId` |
211
+ | Stored resource routes | Stored resource permission for the route action | Stored resource type | Route record ID, or the stored-resource scope for collection routes |
212
+ | HTTP resource routes | Configured per route | Configured per route | Configured per route |
213
+
214
+ Direct SDK calls to `createRun().start()`, `resume()`, or `restart()` are not independently checked by core FGA in this release. Make those calls from a protected route or guard them in application code. Pass a `requestContext` with an authenticated user when invoking protected entry points directly.
170
215
 
171
- All checks are **no-ops when FGA is not configured**, maintaining backward compatibility.
216
+ Core agent, internal workflow, tool, and memory checks also pass `requestContext` and action metadata to the FGA provider. Route checks pass `requestContext`. Thread checks pass the owning `resourceId` when available.
172
217
 
173
218
  ## Custom FGA provider
174
219
 
@@ -1,6 +1,6 @@
1
1
  # Model Providers
2
2
 
3
- Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 4182 models from 120 providers through a single API.
3
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 4219 models from 121 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -15,7 +15,7 @@ const agent = new Agent({
15
15
  id: "my-agent",
16
16
  name: "My Agent",
17
17
  instructions: "You are a helpful assistant",
18
- model: "novita-ai/Sao10K/L3-8B-Stheno-v3.2"
18
+ model: "novita-ai/baichuan/baichuan-m2-32b"
19
19
  });
20
20
 
21
21
  // Generate a response
@@ -118,10 +118,10 @@ for await (const chunk of stream) {
118
118
  | `novita-ai/qwen/qwen3.5-27b` | 262K | | | | | | $0.30 | $2 |
119
119
  | `novita-ai/qwen/qwen3.5-35b-a3b` | 262K | | | | | | $0.25 | $2 |
120
120
  | `novita-ai/qwen/qwen3.5-397b-a17b` | 262K | | | | | | $0.60 | $4 |
121
- | `novita-ai/sao10k/l3-70b-euryale-v2.1` | 8K | | | | | | $1 | $1 |
122
- | `novita-ai/sao10k/l3-8b-lunaris` | 8K | | | | | | $0.05 | $0.05 |
123
- | `novita-ai/Sao10K/L3-8B-Stheno-v3.2` | 8K | | | | | | $0.05 | $0.05 |
124
- | `novita-ai/sao10k/l31-70b-euryale-v2.2` | 8K | | | | | | $1 | $1 |
121
+ | `novita-ai/sao10K/l3-70b-euryale-v2.1` | 8K | | | | | | $1 | $1 |
122
+ | `novita-ai/sao10K/l3-8b-lunaris` | 8K | | | | | | $0.05 | $0.05 |
123
+ | `novita-ai/sao10K/L3-8B-stheno-v3.2` | 8K | | | | | | $0.05 | $0.05 |
124
+ | `novita-ai/sao10K/l31-70b-euryale-v2.2` | 8K | | | | | | $1 | $1 |
125
125
  | `novita-ai/xiaomimimo/mimo-v2-flash` | 262K | | | | | | $0.10 | $0.30 |
126
126
  | `novita-ai/zai-org/autoglm-phone-9b-multilingual` | 66K | | | | | | $0.04 | $0.14 |
127
127
  | `novita-ai/zai-org/glm-4.5` | 131K | | | | | | $0.60 | $2 |
@@ -144,7 +144,7 @@ const agent = new Agent({
144
144
  name: "custom-agent",
145
145
  model: {
146
146
  url: "https://api.novita.ai/openai",
147
- id: "novita-ai/Sao10K/L3-8B-Stheno-v3.2",
147
+ id: "novita-ai/baichuan/baichuan-m2-32b",
148
148
  apiKey: process.env.NOVITA_API_KEY,
149
149
  headers: {
150
150
  "X-Custom-Header": "value"
@@ -163,7 +163,7 @@ const agent = new Agent({
163
163
  const useAdvanced = requestContext.task === "complex";
164
164
  return useAdvanced
165
165
  ? "novita-ai/zai-org/glm-5.1"
166
- : "novita-ai/Sao10K/L3-8B-Stheno-v3.2";
166
+ : "novita-ai/baichuan/baichuan-m2-32b";
167
167
  }
168
168
  });
169
169
  ```
@@ -0,0 +1,107 @@
1
+ # ![routing.run logo](https://models.dev/logos/routing-run.svg)routing.run
2
+
3
+ Access 37 routing.run models through Mastra's model router. Authentication is handled automatically using the `ROUTING_RUN_API_KEY` environment variable.
4
+
5
+ Learn more in the [routing.run documentation](https://docs.routing.run).
6
+
7
+ ```bash
8
+ ROUTING_RUN_API_KEY=your-api-key
9
+ ```
10
+
11
+ ```typescript
12
+ import { Agent } from "@mastra/core/agent";
13
+
14
+ const agent = new Agent({
15
+ id: "my-agent",
16
+ name: "My Agent",
17
+ instructions: "You are a helpful assistant",
18
+ model: "routing-run/route/deepseek-v3.2"
19
+ });
20
+
21
+ // Generate a response
22
+ const response = await agent.generate("Hello!");
23
+
24
+ // Stream a response
25
+ const stream = await agent.stream("Tell me a story");
26
+ for await (const chunk of stream) {
27
+ console.log(chunk);
28
+ }
29
+ ```
30
+
31
+ > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [routing.run documentation](https://docs.routing.run) for details.
32
+
33
+ ## Models
34
+
35
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
+ | --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
+ | `routing-run/route/deepseek-v3.2` | 164K | | | | | | $0.49 | $0.74 |
38
+ | `routing-run/route/deepseek-v4-flash` | 1.0M | | | | | | $0.49 | $0.74 |
39
+ | `routing-run/route/deepseek-v4-flash-full` | 1.0M | | | | | | $0.49 | $0.74 |
40
+ | `routing-run/route/deepseek-v4-pro` | 1.0M | | | | | | $0.49 | $0.74 |
41
+ | `routing-run/route/deepseek-v4-pro-precision` | 1.0M | | | | | | $0.74 | $1 |
42
+ | `routing-run/route/gemma-4-31b-it` | 131K | | | | | | $0.10 | $0.30 |
43
+ | `routing-run/route/glm-4.7` | 128K | | | | | | $1 | $4 |
44
+ | `routing-run/route/glm-4.7-flash` | 128K | | | | | | $1 | $4 |
45
+ | `routing-run/route/glm-5` | 203K | | | | | | $0.79 | $3 |
46
+ | `routing-run/route/glm-5-highspeed` | 203K | | | | | | $1 | $4 |
47
+ | `routing-run/route/glm-5.1` | 203K | | | | | | $1 | $3 |
48
+ | `routing-run/route/glm-5.1-fp16` | 203K | | | | | | $1 | $4 |
49
+ | `routing-run/route/glm-5.1-full` | 203K | | | | | | $1 | $4 |
50
+ | `routing-run/route/glm-5.1-precision` | 203K | | | | | | $1 | $4 |
51
+ | `routing-run/route/kimi-k2.5` | 262K | | | | | | $0.46 | $2 |
52
+ | `routing-run/route/kimi-k2.5-highspeed` | 131K | | | | | | $0.65 | $3 |
53
+ | `routing-run/route/kimi-k2.6` | 262K | | | | | | $0.46 | $2 |
54
+ | `routing-run/route/kimi-k2.6-full` | 262K | | | | | | $0.46 | $2 |
55
+ | `routing-run/route/kimi-k2.6-precision` | 262K | | | | | | $0.65 | $3 |
56
+ | `routing-run/route/mimo-v2.5` | 256K | | | | | | $0.40 | $2 |
57
+ | `routing-run/route/mimo-v2.5-pro` | 1.0M | | | | | | $0.45 | $1 |
58
+ | `routing-run/route/mimo-v2.5-pro-precision` | 1.0M | | | | | | $0.45 | $1 |
59
+ | `routing-run/route/minimax-m2.5` | 100K | | | | | | $0.19 | $1 |
60
+ | `routing-run/route/minimax-m2.5-highspeed` | 100K | | | | | | $0.19 | $1 |
61
+ | `routing-run/route/minimax-m2.7` | 100K | | | | | | $0.33 | $1 |
62
+ | `routing-run/route/minimax-m2.7-highspeed` | 100K | | | | | | $0.33 | $1 |
63
+ | `routing-run/route/mistral-large-3` | 128K | | | | | | $0.50 | $2 |
64
+ | `routing-run/route/mistral-medium-2505` | 128K | | | | | | $0.40 | $2 |
65
+ | `routing-run/route/mistral-small-2503` | 128K | | | | | | $0.15 | $0.60 |
66
+ | `routing-run/route/qwen3.5-397b-a17b` | 262K | | | | | | $1 | $3 |
67
+ | `routing-run/route/qwen3.5-9b` | 262K | | | | | | $0.20 | $0.60 |
68
+ | `routing-run/route/qwen3.5-9b-chat` | 262K | | | | | | $0.20 | $0.60 |
69
+ | `routing-run/route/qwen3.6-27b` | 262K | | | | | | $1 | $3 |
70
+ | `routing-run/route/step-3.5-flash` | 262K | | | | | | $0.10 | $0.29 |
71
+ | `routing-run/route/step-3.5-flash-2603` | 262K | | | | | | $0.10 | $0.30 |
72
+ | `routing-run/route/step-3.5-flash-full` | 262K | | | | | | $0.10 | $0.29 |
73
+ | `routing-run/route/stepfun-3.5-flash` | 262K | | | | | | $0.10 | $0.29 |
74
+
75
+ ## Advanced configuration
76
+
77
+ ### Custom headers
78
+
79
+ ```typescript
80
+ const agent = new Agent({
81
+ id: "custom-agent",
82
+ name: "custom-agent",
83
+ model: {
84
+ url: "https://api.routing.run/v1",
85
+ id: "routing-run/route/deepseek-v3.2",
86
+ apiKey: process.env.ROUTING_RUN_API_KEY,
87
+ headers: {
88
+ "X-Custom-Header": "value"
89
+ }
90
+ }
91
+ });
92
+ ```
93
+
94
+ ### Dynamic model selection
95
+
96
+ ```typescript
97
+ const agent = new Agent({
98
+ id: "dynamic-agent",
99
+ name: "Dynamic Agent",
100
+ model: ({ requestContext }) => {
101
+ const useAdvanced = requestContext.task === "complex";
102
+ return useAdvanced
103
+ ? "routing-run/route/stepfun-3.5-flash"
104
+ : "routing-run/route/deepseek-v3.2";
105
+ }
106
+ });
107
+ ```
@@ -89,6 +89,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
89
89
  - [Qiniu](https://mastra.ai/models/providers/qiniu-ai)
90
90
  - [Regolo AI](https://mastra.ai/models/providers/regolo-ai)
91
91
  - [Requesty](https://mastra.ai/models/providers/requesty)
92
+ - [routing.run](https://mastra.ai/models/providers/routing-run)
92
93
  - [Sarvam AI](https://mastra.ai/models/providers/sarvam)
93
94
  - [Scaleway](https://mastra.ai/models/providers/scaleway)
94
95
  - [SiliconFlow](https://mastra.ai/models/providers/siliconflow)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.39-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`5ba7253`](https://github.com/mastra-ai/mastra/commit/5ba7253745c85e8df8012a76d954c640ffa336f7), [`f73980d`](https://github.com/mastra-ai/mastra/commit/f73980d651eb5f7f1ab20582de4615a1b6f10fce), [`9c88701`](https://github.com/mastra-ai/mastra/commit/9c8870195b41a38dc40b6ba2aa55eda04df8fa69), [`4e88dc6`](https://github.com/mastra-ai/mastra/commit/4e88dc6b89f154c0eae37221c8126be0c23c569f), [`19018f0`](https://github.com/mastra-ai/mastra/commit/19018f05722af74a5978781a7731a654b26f7f2a)]:
8
+ - @mastra/core@1.36.0-alpha.2
9
+
3
10
  ## 1.1.39-alpha.5
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.1.39-alpha.6",
3
+ "version": "1.1.39-alpha.8",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "jsdom": "^26.1.0",
30
30
  "local-pkg": "^1.1.2",
31
31
  "zod": "^4.3.6",
32
- "@mastra/core": "1.36.0-alpha.1",
32
+ "@mastra/core": "1.36.0-alpha.2",
33
33
  "@mastra/mcp": "^1.7.1-alpha.0"
34
34
  },
35
35
  "devDependencies": {
@@ -48,7 +48,7 @@
48
48
  "vitest": "4.1.5",
49
49
  "@internal/types-builder": "0.0.71",
50
50
  "@internal/lint": "0.0.96",
51
- "@mastra/core": "1.36.0-alpha.1"
51
+ "@mastra/core": "1.36.0-alpha.2"
52
52
  },
53
53
  "homepage": "https://mastra.ai",
54
54
  "repository": {