@mastra/mcp-docs-server 1.2.15-alpha.11 → 1.2.15-alpha.13

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.
@@ -567,6 +567,25 @@ export const mastra = new Mastra({
567
567
  })
568
568
  ```
569
569
 
570
+ ### bundler.minify
571
+
572
+ **Type:** `boolean`\
573
+ **Default:** `false`
574
+
575
+ Minifies the bundled output, stripping comments and whitespace and shortening local identifiers. Exported names are preserved.
576
+
577
+ Off by default so build output stays readable and stack traces stay meaningful. Enable it when bundle size matters, such as packaging a container image for an on-prem deployment. `mastra dev` is never minified.
578
+
579
+ ```typescript
580
+ import { Mastra } from '@mastra/core'
581
+
582
+ export const mastra = new Mastra({
583
+ bundler: {
584
+ minify: true,
585
+ },
586
+ })
587
+ ```
588
+
570
589
  ### bundler.transpilePackages
571
590
 
572
591
  **Type:** `string[]`\
@@ -43,6 +43,24 @@ const filter = new RegexFilterProcessor({
43
43
  })
44
44
  ```
45
45
 
46
+ Raise the streaming carryover window for long custom matches (e.g. a fixed-length secret or a value that only matches once its closing delimiter arrives):
47
+
48
+ ```typescript
49
+ import { RegexFilterProcessor } from '@mastra/core/processors'
50
+
51
+ const filter = new RegexFilterProcessor({
52
+ rules: [
53
+ {
54
+ name: 'armored-key',
55
+ pattern: /-----BEGIN KEY-----[A-Z]+-----END KEY-----/g,
56
+ replacement: '[KEY]',
57
+ },
58
+ ],
59
+ strategy: 'redact',
60
+ streamCarryoverSize: 256,
61
+ })
62
+ ```
63
+
46
64
  Attach to an agent:
47
65
 
48
66
  ```typescript
@@ -80,6 +98,8 @@ const agent = new Agent({
80
98
 
81
99
  **includeRedactedValues** (`boolean`): Include the text that was redacted in each report entry. Off by default, because the values are the data the processor removes. (Default: `false`)
82
100
 
101
+ **streamCarryoverSize** (`number`): Trailing characters the streaming redact path holds back between chunks, so a match split across a chunk boundary is redacted whole. The default covers every built-in preset with a wide margin. Raise it for custom rules whose matches stay invisible to the rule until they complete, such as a fixed-length secret or a value with a closing delimiter, when such a match can be longer than the window. (Default: `128`)
102
+
83
103
  ## Returns
84
104
 
85
105
  **id** (`'regex-filter'`): Processor identifier.
@@ -29,6 +29,8 @@ const toolSearch = new ToolSearchProcessor({
29
29
 
30
30
  **options.tools** (`Record<string, Tool>`): All tools that can be searched and loaded dynamically. These tools are not immediately available to the agent — they must be discovered via search and loaded on demand.
31
31
 
32
+ **options.includeResolvedTools** (`boolean`): Also make the tools the agent resolved for this request (MCP tools requiring the caller's credentials, or anything returned by a dynamic tools function) searchable, and withhold them from the prompt until the agent loads them. The meta-tools are never withheld. Request-resolved tools are indexed per request, so each request searches and loads its own tool instances.
33
+
32
34
  **options.search** (`{ topK?: number; minScore?: number; autoLoad?: boolean }`): Configuration for the search behavior.
33
35
 
34
36
  **options.search.topK** (`number`): Maximum number of tools to return in search results.
@@ -120,7 +122,37 @@ The `phase` value describes where the filter is being applied:
120
122
  - `load`: Blocks `load_tool` from loading disallowed tools.
121
123
  - `active`: Hides already-loaded tools from the current request if they're no longer allowed.
122
124
 
123
- If the hook throws or rejects, `ToolSearchProcessor` treats the tool as disallowed for that request. The hook may run for every matching search candidate, so keep async policy checks cheap or cached. The `search_tools` meta-tool is always available. `load_tool` is available unless `search.autoLoad` is enabled. Tools passed directly through the agent or `processInputStep` remain available unless you filter them outside `ToolSearchProcessor`.
125
+ If the hook throws or rejects, `ToolSearchProcessor` treats the tool as disallowed for that request. The hook may run for every matching search candidate, so keep async policy checks cheap or cached. The `search_tools` meta-tool is always available. `load_tool` is available unless `search.autoLoad` is enabled. Tools passed directly through the agent or `processInputStep` remain available unless you filter them outside `ToolSearchProcessor`, or enable `includeResolvedTools`.
126
+
127
+ ## Searching request-resolved tools
128
+
129
+ The `tools` option is fixed at construction, so you can't list tools that only exist per request (MCP tools that need the caller's credentials, or anything returned by a dynamic `tools` function). By default those tools bypass search and occupy prompt space on every turn.
130
+
131
+ Set `includeResolvedTools: true` to index them for the request and withhold them from the prompt until the agent loads them:
132
+
133
+ ```typescript
134
+ import { Agent } from '@mastra/core/agent'
135
+ import { ToolSearchProcessor } from '@mastra/core/processors'
136
+
137
+ const toolSearch = new ToolSearchProcessor({
138
+ tools: staticTools,
139
+ includeResolvedTools: true,
140
+ })
141
+
142
+ const agent = new Agent({
143
+ id: 'mcp-agent',
144
+ name: 'mcp-agent',
145
+ instructions: 'Search for a tool when you need a capability you do not have.',
146
+ model: 'openai/gpt-5.6-sol',
147
+ // Resolved per request, then searchable alongside staticTools
148
+ tools: async ({ requestContext }) => mcpClient.getTools(requestContext.get('userToken')),
149
+ inputProcessors: [toolSearch],
150
+ })
151
+ ```
152
+
153
+ Each request is indexed on its own, so a tool loaded by one caller never resolves to another caller's instance of the same tool name.
154
+
155
+ This option applies to every tool resolved for the request, including memory, workspace, skill, and browser tools. Only the `search_tools` and `load_tool` meta-tools stay in the prompt, so any tool the agent relies on implicitly must be found through search before it can be called.
124
156
 
125
157
  ## Extended usage example
126
158
 
@@ -127,6 +127,24 @@ export const testWorkflow = createWorkflow({
127
127
 
128
128
  **options.pruneSnapshot** (`(params: { snapshot: WorkflowRunState; workflowStatus: WorkflowRunStatus }) => WorkflowRunState`): Optional hook to transform the workflow snapshot immediately before it is persisted. Must return JSON-serializable data and preserve everything the workflow needs to resume (suspended step suspendPayloads, suspendedPaths, executionPath, etc.). Used internally by agent runs to keep snapshots minimal; user workflows persist full snapshots by default.
129
129
 
130
+ **options.onStart** (`(info: WorkflowStartCallbackInfo) => void | Promise<void>`): Callback awaited before a run starts executing, and before any step runs. Fires only on initial start, not on resume, restart, or time travel. Unlike onFinish and onError, errors thrown here are propagated: they reject the start() or stream() call and the run never executes, so this can be used as a pre-flight gate such as a quota check. The run record created by createRun() stays at status pending.
131
+
132
+ **options.onStart.runId** (`string`): The workflow run ID
133
+
134
+ **options.onStart.workflowId** (`string`): The workflow identifier
135
+
136
+ **options.onStart.resourceId** (`string`): Resource or user identifier for multi-tenant scenarios
137
+
138
+ **options.onStart.getInitData** (`() => any`): Returns the initial workflow input data
139
+
140
+ **options.onStart.state** (`Record<string, any>`): The initial workflow state
141
+
142
+ **options.onStart.requestContext** (`RequestContext`): The request context for the run
143
+
144
+ **options.onStart.mastra** (`Mastra`): The Mastra instance, when the workflow is registered
145
+
146
+ **options.onStart.logger** (`IMastraLogger`): The Mastra logger
147
+
130
148
  **options.onFinish** (`(result: WorkflowFinishCallbackResult) => void | Promise<void>`): Callback invoked when workflow completes with any status (success, failed, suspended, tripwire). Receives the workflow result including status, output, error, and step results. Errors thrown in this callback are caught and logged, not propagated.
131
149
 
132
150
  **options.onFinish.status** (`WorkflowRunStatus`): The workflow status: 'success', 'failed', 'suspended', or 'tripwire'
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.15-alpha.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`1c75e32`](https://github.com/mastra-ai/mastra/commit/1c75e32f7fc0b9fb6f548b4407feaec8a1440212), [`c47165c`](https://github.com/mastra-ai/mastra/commit/c47165c983c87594c6952f1fd2fa51a90205034c), [`e08e789`](https://github.com/mastra-ai/mastra/commit/e08e789c1bf4cd2fe46363f7a4728536ceccc9bd), [`35cc901`](https://github.com/mastra-ai/mastra/commit/35cc90102cf834a84827acaf9eee0b6d6d1e2a3b), [`a8b4cf0`](https://github.com/mastra-ai/mastra/commit/a8b4cf02823cffebc4751a53337dfacf097c1ae1), [`f33264f`](https://github.com/mastra-ai/mastra/commit/f33264f517ae603279afd5c4251e2b40f6dd3618), [`689f2c4`](https://github.com/mastra-ai/mastra/commit/689f2c4b6c0835fe455702b01d21daa8abcd9331), [`eeae63e`](https://github.com/mastra-ai/mastra/commit/eeae63e7fbe8e1f237adc69bca6e2ac13c5ca907), [`4c186a0`](https://github.com/mastra-ai/mastra/commit/4c186a017275f45e6ed4c09de0f89550e2d09e8c), [`b0fa077`](https://github.com/mastra-ai/mastra/commit/b0fa077bcbc9b08551846fe372a0d3d15b71ed72)]:
8
+ - @mastra/core@1.58.0-alpha.8
9
+
3
10
  ## 1.2.15-alpha.11
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.2.15-alpha.11",
3
+ "version": "1.2.15-alpha.13",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "jsdom": "^26.1.0",
29
29
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
- "@mastra/core": "1.58.0-alpha.7",
31
+ "@mastra/core": "1.58.0-alpha.8",
32
32
  "@mastra/mcp": "^1.16.0-alpha.1"
33
33
  },
34
34
  "devDependencies": {
@@ -45,9 +45,9 @@
45
45
  "tsx": "^4.23.1",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "4.1.10",
48
- "@internal/lint": "0.0.121",
49
48
  "@internal/types-builder": "0.0.96",
50
- "@mastra/core": "1.58.0-alpha.7"
49
+ "@mastra/core": "1.58.0-alpha.8",
50
+ "@internal/lint": "0.0.121"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {