@mastra/mcp-docs-server 1.2.15-alpha.3 → 1.2.15-alpha.7

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 (42) hide show
  1. package/.docs/docs/agents/a2a.md +39 -0
  2. package/.docs/docs/agents/skills.md +15 -1
  3. package/.docs/docs/capabilities/channels/overview.md +19 -0
  4. package/.docs/docs/evals/overview.md +16 -4
  5. package/.docs/docs/index.md +1 -1
  6. package/.docs/docs/observability/feedback.md +16 -0
  7. package/.docs/guides/getting-started/quickstart.md +1 -1
  8. package/.docs/guides/voice/realtime-voice.md +28 -2
  9. package/.docs/models/gateways/neon.md +4 -1
  10. package/.docs/models/gateways/netlify.md +1 -2
  11. package/.docs/models/gateways/openrouter.md +1 -1
  12. package/.docs/models/gateways/vercel.md +8 -2
  13. package/.docs/models/index.md +1 -1
  14. package/.docs/models/providers/cortecs.md +2 -1
  15. package/.docs/models/providers/deepinfra.md +2 -2
  16. package/.docs/models/providers/digitalocean.md +3 -2
  17. package/.docs/models/providers/empiriolabs.md +6 -4
  18. package/.docs/models/providers/hyper.md +4 -5
  19. package/.docs/models/providers/kilo.md +3 -3
  20. package/.docs/models/providers/llmgateway.md +2 -2
  21. package/.docs/models/providers/nano-gpt.md +3 -2
  22. package/.docs/models/providers/neuralwatt.md +2 -1
  23. package/.docs/models/providers/ofox.md +74 -16
  24. package/.docs/models/providers/opencode-go.md +1 -1
  25. package/.docs/models/providers/opencode.md +2 -2
  26. package/.docs/models/providers/vivgrid.md +4 -2
  27. package/.docs/models/providers/wandb.md +1 -1
  28. package/.docs/reference/agents/channels.md +22 -1
  29. package/.docs/reference/channels/slack-provider.md +2 -0
  30. package/.docs/reference/client-js/workflows.md +13 -0
  31. package/.docs/reference/configuration.md +25 -0
  32. package/.docs/reference/file-based-agents/config.md +22 -21
  33. package/.docs/reference/file-based-agents/instructions.md +42 -17
  34. package/.docs/reference/index.md +1 -0
  35. package/.docs/reference/observability/metrics/automatic-metrics.md +10 -8
  36. package/.docs/reference/server/routes.md +25 -11
  37. package/.docs/reference/storage/composite.md +58 -0
  38. package/.docs/reference/tools/bedrock-kb-tool.md +117 -0
  39. package/.docs/reference/voice/google.md +19 -3
  40. package/.docs/reference/workflows/step.md +40 -0
  41. package/CHANGELOG.md +22 -0
  42. package/package.json +4 -4
@@ -0,0 +1,117 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # createBedrockKBTool()
4
+
5
+ The `createBedrockKBTool()` function creates a tool that retrieves relevant documents from an Amazon Bedrock Knowledge Base. It supports both managed search configuration and agentic retrieval (query decomposition and managed reranking) with automatic fallback to standard retrieval.
6
+
7
+ ## Usage example
8
+
9
+ ```typescript
10
+ import { createBedrockKBTool } from '@mastra/rag'
11
+
12
+ const kbTool = createBedrockKBTool({
13
+ knowledgeBaseId: 'YOUR_KB_ID',
14
+ region: 'us-west-2',
15
+ numberOfResults: 5,
16
+ useAgenticRetrieval: true,
17
+ })
18
+ ```
19
+
20
+ ### With an Agent
21
+
22
+ ```typescript
23
+ import { Agent } from '@mastra/core/agent'
24
+ import { createBedrockKBTool } from '@mastra/rag'
25
+
26
+ const kbTool = createBedrockKBTool({
27
+ knowledgeBaseId: 'YOUR_KB_ID',
28
+ })
29
+
30
+ const agent = new Agent({
31
+ name: 'KnowledgeAssistant',
32
+ instructions: 'Use the knowledge base tool to answer questions.',
33
+ model: myModel,
34
+ tools: { kb: kbTool },
35
+ })
36
+ ```
37
+
38
+ ## Parameters
39
+
40
+ **knowledgeBaseId** (`string`): The ID of the Amazon Bedrock Knowledge Base to query.
41
+
42
+ **region** (`string`): AWS region where the Knowledge Base is deployed. Defaults to AWS\_REGION environment variable or us-east-1.
43
+
44
+ **numberOfResults** (`number`): Maximum number of results to return. Defaults to 5.
45
+
46
+ **useAgenticRetrieval** (`boolean`): Use AgenticRetrieveStream for complex queries with query decomposition and managed reranking. Falls back to standard Retrieve on failure. Defaults to true (disable with USE\_AGENTIC\_RETRIEVAL=false env var).
47
+
48
+ **userId** (`string`): Default AWS user ID for document-level access control. A userId in the Mastra request context takes precedence.
49
+
50
+ ## Input Schema
51
+
52
+ The tool accepts the following input when called by an agent:
53
+
54
+ **queryText** (`string`): The search query to find relevant documents in the knowledge base.
55
+
56
+ ## Output Schema
57
+
58
+ The tool returns an object with:
59
+
60
+ **results** (`BedrockKBResult[]`): Array of retrieval results. Standard retrieval includes source and score when Bedrock provides them; agentic retrieval may omit those fields.
61
+
62
+ ### BedrockKBResult
63
+
64
+ | Field | Type | Description |
65
+ | ---------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
66
+ | `content` | `string` | The text content of the retrieved passage. |
67
+ | `source` | `string \| undefined` | The source URI when Bedrock provides one. Agentic retrieval only includes this field when the result metadata contains `_source_uri`. |
68
+ | `score` | `number \| undefined` | The relevance score returned by standard retrieval. The agentic API doesn't return a score for result items. |
69
+ | `metadata` | `Record<string, unknown>` | Additional metadata from the retrieval result. |
70
+
71
+ ## Retrieval Modes
72
+
73
+ ### Agentic Retrieval (default)
74
+
75
+ When `useAgenticRetrieval` is `true` (default), the tool uses `AgenticRetrieveStreamCommand` which:
76
+
77
+ - Decomposes complex queries into sub-queries
78
+ - Retrieves across multiple passes
79
+ - Applies managed reranking for better results
80
+
81
+ If agentic retrieval fails (e.g., older SDK, permissions), it automatically falls back to standard managed retrieval.
82
+
83
+ ### Standard Managed Retrieval
84
+
85
+ When `useAgenticRetrieval` is `false`, the tool uses `RetrieveCommand` with `managedSearchConfiguration` for direct single-pass retrieval.
86
+
87
+ ## User-based access control
88
+
89
+ Set `userId` in the Mastra request context to forward it as the Bedrock `userContext.userId`. This supports knowledge bases that enforce document-level access control. The request context value overrides the default `userId` configured on the tool.
90
+
91
+ ```typescript
92
+ import { RequestContext } from '@mastra/core/request-context'
93
+
94
+ const requestContext = new RequestContext()
95
+ requestContext.set('userId', 'user-123')
96
+
97
+ await agent.generate('Find my private documents', { requestContext })
98
+ ```
99
+
100
+ ## Required IAM Permissions
101
+
102
+ ```json
103
+ {
104
+ "Version": "2012-10-17",
105
+ "Statement": [
106
+ {
107
+ "Effect": "Allow",
108
+ "Action": ["bedrock:Retrieve", "bedrock:AgenticRetrieveStream"],
109
+ "Resource": "arn:aws:bedrock:*:*:knowledge-base/*"
110
+ }
111
+ ]
112
+ }
113
+ ```
114
+
115
+ ## SDK Requirements
116
+
117
+ - `@aws-sdk/client-bedrock-agent-runtime` >= 3.1000 (AgenticRetrieveStreamCommand requires \~3.1000+)
@@ -109,7 +109,17 @@ Converts speech to text using Google Cloud Speech-to-Text service. Supports both
109
109
 
110
110
  Pass `v2: true` to use the Cloud Speech-to-Text v2 API, which supports additional audio formats like AAC-in-MP4 (iOS Safari).
111
111
 
112
+ The v2 `recognize` call is IAM-authorized and does not accept API-key-only authentication. Configure service account credentials on the `listeningModel` (or set `GOOGLE_APPLICATION_CREDENTIALS`) and set `GOOGLE_CLOUD_PROJECT` so the recognizer path can be resolved, even when `vertexAI` is not enabled.
113
+
112
114
  ```typescript
115
+ import { GoogleVoice } from '@mastra/voice-google'
116
+
117
+ // v2 listen() requires service account credentials, not just GOOGLE_API_KEY.
118
+ // Set GOOGLE_CLOUD_PROJECT so the recognizer path can be resolved.
119
+ const voice = new GoogleVoice({
120
+ listeningModel: { keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS },
121
+ })
122
+
113
123
  const transcript = await voice.listen(iosSafariAacStream, {
114
124
  v2: true,
115
125
  config: {
@@ -118,6 +128,8 @@ const transcript = await voice.listen(iosSafariAacStream, {
118
128
  })
119
129
  ```
120
130
 
131
+ > **Note:** `listen({ v2: true })` fails with `PERMISSION_DENIED` on `speech.recognizers.recognize` when only `GOOGLE_API_KEY` is set. An API-key request carries no OAuth identity, so granting `roles/speech.client` to a user account does not help — the role must be granted to the service account presented in the request. This applies regardless of the `vertexAI` setting; `speak()` and v1 `listen()` still work with an API key alone.
132
+
121
133
  **audioStream** (`NodeJS.ReadableStream`): Audio stream to transcribe
122
134
 
123
135
  **options** (`GoogleListenOptionsV2`): v2 recognition options
@@ -162,7 +174,7 @@ The Google Voice provider supports two authentication methods:
162
174
 
163
175
  ### Standard Mode (API Key)
164
176
 
165
- Uses a Google Cloud API key for authentication. Suitable for development and basic use cases.
177
+ Uses a Google Cloud API key for authentication. Covers `speak()` and v1 `listen()`. It does not cover `listen({ v2: true })`, which is IAM-authorized and requires service account credentials (see [v2](#v2)).
166
178
 
167
179
  ```typescript
168
180
  // Using environment variable (GOOGLE_API_KEY)
@@ -238,6 +250,8 @@ For Speech-to-Text:
238
250
 
239
251
  - `roles/speech.client` - Speech-to-Text Client
240
252
 
253
+ Grant `roles/speech.client` to the service account whose credentials the request presents (via `keyFilename`, `credentials`, or `GOOGLE_APPLICATION_CREDENTIALS`). This role is required for `listen({ v2: true })` specifically, not only for Vertex AI mode. Granting it to a user account has no effect on API-key-only requests, which carry no identity to authorize.
254
+
241
255
  #### OAuth Scopes
242
256
 
243
257
  For synchronous Text-to-Speech synthesis:
@@ -269,6 +283,8 @@ For long-audio Text-to-Speech operations:
269
283
 
270
284
  6. The `listen()` method supports various recognition configurations through the Google Cloud Speech-to-Text API.
271
285
 
272
- 7. Available voices can be filtered by language code using the `getSpeakers()` method.
286
+ 7. `listen({ v2: true })` requires service account credentials and `GOOGLE_CLOUD_PROJECT`; it fails with `PERMISSION_DENIED` when only `GOOGLE_API_KEY` is set. `speak()` and v1 `listen()` work with an API key alone.
287
+
288
+ 8. Available voices can be filtered by language code using the `getSpeakers()` method.
273
289
 
274
- 8. Vertex AI mode provides enterprise features including IAM control, audit logs, and project-level billing.
290
+ 9. Vertex AI mode provides enterprise features including IAM control, audit logs, and project-level billing.
@@ -191,8 +191,48 @@ const agentStep = createStep(testAgent, {
191
191
 
192
192
  **execute.retryCount** (`number`): The retry count for this specific step, it automatically increases each time the step is retried
193
193
 
194
+ **scorers** (`MastraScorers | (({ requestContext }) => MastraScorers | Promise<MastraScorers>)`): Scorers that run automatically after the step completes successfully. Each scorer evaluates the step's own input and output, and the results are stored and attached to the step's trace. Provide a map of { \[name]: { scorer, sampling? } }, or a function that returns one. Scoring runs asynchronously and doesn't block the workflow. See Scoring step output.
195
+
196
+ **retries** (`number`): Number of times to retry the step's execute function if it throws.
197
+
194
198
  **metadata** (`Record<string, any>`): Optional key-value pairs for storing additional step information. Values must be serializable (no functions, circular references, etc.).
195
199
 
200
+ ## Scoring step output
201
+
202
+ Attach `scorers` to a step to evaluate that step's output automatically, at the point it runs, instead of only scoring the workflow's final answer. This is useful for multi-step and RAG workflows, where you want to see which step degraded quality, for example whether a retrieval step returned relevant chunks before later steps reason over them.
203
+
204
+ Each scorer receives the step's own `input` and `output`. Scoring runs asynchronously after the step succeeds, and the result is stored against the step's trace. Use `sampling` to control how often a scorer runs.
205
+
206
+ The following example attaches a scorer to a retrieval step so every execution is scored:
207
+
208
+ ```typescript
209
+ import { createStep } from '@mastra/core/workflows'
210
+ import { z } from 'zod'
211
+ import { retrievalRelevanceScorer } from '../scorers/retrieval-relevance'
212
+
213
+ const retrievalStep = createStep({
214
+ id: 'retrieval',
215
+ inputSchema: z.object({ query: z.string() }),
216
+ outputSchema: z.object({ query: z.string(), chunks: z.array(z.string()) }),
217
+ scorers: {
218
+ retrievalRelevance: {
219
+ scorer: retrievalRelevanceScorer(),
220
+ sampling: { type: 'ratio', rate: 1 },
221
+ },
222
+ },
223
+ execute: async ({ inputData }) => {
224
+ const chunks = await retrieve(inputData.query)
225
+ return { query: inputData.query, chunks }
226
+ },
227
+ })
228
+ ```
229
+
230
+ Attach a scorer to each step you want to measure to build per-step scores across a multi-step workflow. Because scoring is scoped to a single step, you don't need a dedicated cross-step metric to see where quality changes.
231
+
232
+ Agent and tool steps added with [`Workflow.agent()`](https://mastra.ai/reference/workflows/workflow-methods/agent) and [`Workflow.tool()`](https://mastra.ai/reference/workflows/workflow-methods/tool) accept the same `scorers` option in their step options.
233
+
234
+ > **Note:** Visit the [Scorers overview](https://mastra.ai/docs/evals/overview) to learn how live evaluations run and where results are stored, and [Custom scorers](https://mastra.ai/docs/evals/custom-scorers) to build your own.
235
+
196
236
  ## Related
197
237
 
198
238
  - [Workflow state](https://mastra.ai/docs/workflows/workflow-state)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.15-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`76e5132`](https://github.com/mastra-ai/mastra/commit/76e51328dbc0749c8304e6b3f21e4401f451b081), [`0282e16`](https://github.com/mastra-ai/mastra/commit/0282e16115538c8e9b248b90f0748eb01cb5dc98)]:
8
+ - @mastra/core@1.58.0-alpha.4
9
+
10
+ ## 1.2.15-alpha.6
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`d7cf7fa`](https://github.com/mastra-ai/mastra/commit/d7cf7fafc1ae1b50bd8462dd0e6c671a8606db93), [`0f9a448`](https://github.com/mastra-ai/mastra/commit/0f9a448502157e59f7b76f24360ad497168f5ef8), [`289f4ce`](https://github.com/mastra-ai/mastra/commit/289f4ce16e3293370440172132c52ee787cbc09f), [`4f16ff8`](https://github.com/mastra-ai/mastra/commit/4f16ff824bf2f9b0ddc93f210477c10c8a4fb1ab), [`1c67d85`](https://github.com/mastra-ai/mastra/commit/1c67d85e9da8285662f4dbbf47e0378c3fee0747), [`ba24be6`](https://github.com/mastra-ai/mastra/commit/ba24be662439c331ab23a600041f93803c89eca8), [`842b5fe`](https://github.com/mastra-ai/mastra/commit/842b5fe22b6a7fa811bd14e48eb9af523ac989f2), [`80bdf3a`](https://github.com/mastra-ai/mastra/commit/80bdf3ae16ade6ff63bde0cb16fa2df8ab7dd4dd), [`9ba1247`](https://github.com/mastra-ai/mastra/commit/9ba12470c77f1c03642d720ce67e517e878f666e), [`fd96298`](https://github.com/mastra-ai/mastra/commit/fd96298a8367622f4ebfcaa97b5b6c1fbbd14564), [`6a84954`](https://github.com/mastra-ai/mastra/commit/6a84954a2667f85b6d59da652dab1bbff007ccb0), [`52d8ef0`](https://github.com/mastra-ai/mastra/commit/52d8ef03801f1deb7ee48532fc4190dd4a33916c), [`cdd5c33`](https://github.com/mastra-ai/mastra/commit/cdd5c33ac6c7118a9f139e6dc0e14e6a8ae31658), [`289f4ce`](https://github.com/mastra-ai/mastra/commit/289f4ce16e3293370440172132c52ee787cbc09f), [`efd5c81`](https://github.com/mastra-ai/mastra/commit/efd5c81cc25fde3c2ddd86fc1178deb4ec176e19), [`0976933`](https://github.com/mastra-ai/mastra/commit/0976933142333ec78451feef265b68bcb45aa5e7), [`242b945`](https://github.com/mastra-ai/mastra/commit/242b94558777bfbdeb42cbfea84afff0b6ad0633), [`fea5cae`](https://github.com/mastra-ai/mastra/commit/fea5caedc7e2cfea51784a15e015952692027abf), [`4b59f78`](https://github.com/mastra-ai/mastra/commit/4b59f786cbc9a7d1ef07a07517dbd4b96865e99d), [`9ba1247`](https://github.com/mastra-ai/mastra/commit/9ba12470c77f1c03642d720ce67e517e878f666e), [`7010c5d`](https://github.com/mastra-ai/mastra/commit/7010c5d15728bf9c5dfe4fb6b1bf80ce23bf143a)]:
15
+ - @mastra/core@1.58.0-alpha.3
16
+ - @mastra/mcp@1.16.0-alpha.1
17
+
18
+ ## 1.2.15-alpha.4
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`b4c89b4`](https://github.com/mastra-ai/mastra/commit/b4c89b4371b0c86da57403ad1a3b3ef0681f3128), [`e44e8f3`](https://github.com/mastra-ai/mastra/commit/e44e8f370b66c339ddcaba946d33da6d3c3f06cd), [`c967a5e`](https://github.com/mastra-ai/mastra/commit/c967a5eec150c5dc5418c4a4388982d1fb7ad27c), [`f53d5bd`](https://github.com/mastra-ai/mastra/commit/f53d5bd4885b29e4ac29a428a6044088ea8d6aa3), [`bda2235`](https://github.com/mastra-ai/mastra/commit/bda22353ee28f2df0eaea555f7cae1549f979c0b), [`a7eb4a1`](https://github.com/mastra-ai/mastra/commit/a7eb4a11450f6170274ed5141bffe821d4fdd5a6), [`2f9ef3f`](https://github.com/mastra-ai/mastra/commit/2f9ef3f4ca06fc2dcdd5088c26b7f4da6a016791), [`e7eefcb`](https://github.com/mastra-ai/mastra/commit/e7eefcb162cda7c493e8c3bf43050ead0efbcb2c), [`4d7aca2`](https://github.com/mastra-ai/mastra/commit/4d7aca2fe75f225c83d1502d63079568e6ec163f), [`c4ec889`](https://github.com/mastra-ai/mastra/commit/c4ec889561c0264c43f66d04d587bee4ce35e792), [`9be8878`](https://github.com/mastra-ai/mastra/commit/9be8878dcf0388e84fc4873e0eec27bd49b881a4)]:
23
+ - @mastra/core@1.58.0-alpha.2
24
+
3
25
  ## 1.2.15-alpha.2
4
26
 
5
27
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.15-alpha.3",
3
+ "version": "1.2.15-alpha.7",
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/mcp": "^1.16.0-alpha.0",
32
- "@mastra/core": "1.58.0-alpha.1"
31
+ "@mastra/mcp": "^1.16.0-alpha.1",
32
+ "@mastra/core": "1.58.0-alpha.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^2.0.0",
@@ -47,7 +47,7 @@
47
47
  "vitest": "4.1.10",
48
48
  "@internal/types-builder": "0.0.96",
49
49
  "@internal/lint": "0.0.121",
50
- "@mastra/core": "1.58.0-alpha.1"
50
+ "@mastra/core": "1.58.0-alpha.4"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {