@mastra/mcp-docs-server 1.1.42-alpha.2 → 1.1.42-alpha.4

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.
@@ -88,6 +88,8 @@ When a user mentions the agent mid-conversation in a channel thread, the agent m
88
88
 
89
89
  Set `threadContext: { maxMessages: 0 }` to disable this behavior. This only applies to non-DM threads.
90
90
 
91
+ Mastra also adds a short system message telling the agent which channel and platform the request came from (DM vs public channel, platform name, bot display name). Set `threadContext: { addSystemMessage: false }` to skip it.
92
+
91
93
  ## Tool approval
92
94
 
93
95
  Tools with `requireApproval: true` render as interactive cards with Approve and Deny buttons:
@@ -117,6 +117,25 @@ const memory = new Memory({
117
117
 
118
118
  In this example, the top-level idle setting is disabled for observations, while reflections opt into idle and provider-change activation.
119
119
 
120
+ ### Buffer on idle
121
+
122
+ Set `observation.bufferOnIdle` to `true` to run background observation buffering when an agent turn ends and the agent becomes idle. This is useful for apps that want short turns to be observed without waiting for the next turn or the `messageTokens` threshold.
123
+
124
+ ```typescript
125
+ const memory = new Memory({
126
+ options: {
127
+ observationalMemory: {
128
+ model: 'openai/gpt-5-mini',
129
+ observation: {
130
+ bufferOnIdle: true,
131
+ },
132
+ },
133
+ },
134
+ })
135
+ ```
136
+
137
+ `bufferOnIdle` is off by default. It is separate from `bufferTokens`: `bufferTokens` controls step-time async buffering, while `bufferOnIdle` controls end-of-turn buffering for idle turns.
138
+
120
139
  See [the API reference](https://mastra.ai/reference/memory/observational-memory) for the full configuration shape.
121
140
 
122
141
  ## Benefits
@@ -431,6 +431,75 @@ export { handler as GET, handler as POST, handler as PUT }
431
431
 
432
432
  The `createServe` function works with any Inngest adapter. See the [Inngest serve documentation](https://www.inngest.com/docs/reference/serve) for a complete list of available adapters including AWS Lambda, Cloudflare Workers, and more.
433
433
 
434
+ ## Running as a Connect worker
435
+
436
+ `serve()` exposes an HTTP endpoint that Inngest calls into. As an alternative, `connect()` opens a long-lived outbound connection from your worker to Inngest, so the worker does not need a publicly reachable endpoint. Use this for long-running worker processes on runtimes such as Kubernetes, Docker, ECS, Fly.io, or Render.
437
+
438
+ > **Note:** Inngest Connect is in public beta. Serverless runtimes such as Vercel and AWS Lambda are not supported for Connect workers.
439
+
440
+ ### When to use `connect()` instead of `serve()`
441
+
442
+ - The worker process runs in a private network that only allows outbound connections.
443
+ - You want to keep heavy workflow execution out of the same process that serves user-facing HTTP traffic.
444
+ - You want to scale workers up and down independently of the Mastra HTTP server, with per-worker concurrency limits.
445
+
446
+ Use the same Mastra workflow definitions with either `serve()` or `connect()`. The collection behavior is the same for standard workflows, nested workflows, cron workflows, and additional Inngest functions.
447
+
448
+ ### Requirements
449
+
450
+ - `inngest@^4`
451
+ - Node.js `22.13.0` or later
452
+ - A long-running process for the worker
453
+
454
+ ### Setup
455
+
456
+ Run the Mastra server and the Connect worker as two processes. The Mastra server in this setup does not need to expose `/inngest/api`:
457
+
458
+ ```ts
459
+ import { Mastra } from '@mastra/core'
460
+ import { incrementWorkflow } from './workflows'
461
+ import { PinoLogger } from '@mastra/loggers'
462
+
463
+ export const mastra = new Mastra({
464
+ workflows: { incrementWorkflow },
465
+ logger: new PinoLogger({ name: 'Mastra', level: 'info' }),
466
+ })
467
+ ```
468
+
469
+ ```ts
470
+ import { connect } from '@mastra/inngest/connect'
471
+ import { mastra } from './mastra'
472
+ import { inngest } from './mastra/inngest'
473
+
474
+ await connect({
475
+ mastra,
476
+ inngest,
477
+ instanceId: process.env.INNGEST_CONNECT_INSTANCE_ID,
478
+ maxWorkerConcurrency: Number(process.env.INNGEST_CONNECT_MAX_WORKER_CONCURRENCY ?? 10),
479
+ })
480
+ ```
481
+
482
+ Start the worker with `INNGEST_DEV=1 node --import tsx src/worker.ts` during local development. The Inngest Dev Server discovers the worker through the outbound connection, so no `-u` flag is required.
483
+
484
+ In production, set `INNGEST_EVENT_KEY` and `INNGEST_SIGNING_KEY`. Set `appVersion` on the `Inngest` client to a deploy identifier, such as a commit SHA or image tag, so Inngest can manage rolling deploys.
485
+
486
+ When migrating an existing production app from `serve()` to `connect()`, test the worker with a separate Inngest app before moving traffic.
487
+
488
+ ### Options
489
+
490
+ `connect()` accepts the same options as Inngest's [`connect`](https://www.inngest.com/docs/setup/connect) plus the Mastra-specific fields. The most common ones:
491
+
492
+ - `mastra`: The Mastra instance whose workflows should be exposed.
493
+ - `inngest`: The Inngest client. Use the same client you would pass to `serve()`.
494
+ - `functions`: Optional array of additional Inngest functions to register alongside Mastra workflows.
495
+ - `instanceId`: Stable identifier for the worker, shown in the Inngest dashboard. Defaults to the machine hostname.
496
+ - `maxWorkerConcurrency`: Maximum number of steps the worker runs at a time. Defaults to unlimited.
497
+ - `registerOptions`: Forwarded to Inngest during app registration (for example `signingKey`). When a field is set both here and at the top level, `registerOptions` wins — this matches the behavior of `serve()`.
498
+
499
+ `connect()` returns Inngest's `WorkerConnection`. The Inngest SDK handles `SIGINT` and `SIGTERM` by default. Store the returned connection and call `.close()` only when your worker needs custom shutdown control.
500
+
501
+ If the Mastra instance has no `InngestWorkflow` and no additional `functions` are provided, `connect()` logs a warning because the worker would otherwise stay connected with nothing to execute. Register at least one workflow on Mastra or pass `functions: [...]`.
502
+
434
503
  ## Using a custom `apiPrefix`
435
504
 
436
505
  If you need to keep `/api/inngest` (for example to match Inngest's auto-discover convention without changing the dashboard URL), set `server.apiPrefix` to relocate Mastra's built-in routes:
@@ -41,7 +41,7 @@ export const supportAgent = new Agent({
41
41
 
42
42
  **userName** (`string`): Bot display name shown in platform messages. Defaults to the agent's \`name\`, or \`'Mastra'\` if no name is set. (Default: `` agent's `name` ``)
43
43
 
44
- **threadContext** (`{ maxMessages?: number }`): Fetch recent messages from the platform when the agent is first mentioned in a thread. Set \`maxMessages: 0\` to disable. Only applies to non-DM threads. (Default: `{ maxMessages: 10 }`)
44
+ **threadContext** (`{ maxMessages?: number; addSystemMessage?: boolean }`): How the agent picks up context about the current thread. \`maxMessages\` controls how many recent platform messages are fetched on first mention (set to \`0\` to disable; only applies to non-DM threads). \`addSystemMessage: false\` skips the built-in system message that tells the agent which channel/platform a request came from. (Default: `{ maxMessages: 10, addSystemMessage: true }`)
45
45
 
46
46
  **chatOptions** (`Omit<ChatConfig, 'adapters' | 'state' | 'userName'>`): Additional options passed directly to the \[Chat SDK]\(https\://chat-sdk.dev/docs/usage). Use for advanced configuration such as \`dedupeTtlMs\`, \`fallbackStreamingPlaceholderText\`, \`lockScope\`, and \`messageHistory\`.
47
47
 
@@ -49,6 +49,8 @@ const scorer = createScorer({
49
49
 
50
50
  **judge.instructions** (`string`): System prompt/instructions for the LLM.
51
51
 
52
+ **judge.jsonPromptInjection** (`boolean`): When true, inject the JSON schema into the prompt instead of using the provider's native \`response\_format\` API. Set this for models that don't support native structured output (e.g. some Groq Llama models) to avoid a wasted 400 call.
53
+
52
54
  **type** (`string`): Type specification for input/output. Use 'agent' for automatic agent types. For custom types, use the generic approach instead.
53
55
 
54
56
  **prepareRun** (`(run: ScorerRun) => ScorerRun | Promise<ScorerRun>`): Transform the scorer run data before the pipeline executes. Use this to filter messages, limit context size, or drop fields the scorer doesn't need. The \[\`filterRun()\`]\(/reference/evals/filter-run) utility creates this function from declarative options. Can be async.
@@ -68,6 +68,8 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
68
68
 
69
69
  **observation.bufferTokens** (`number | false`): Token interval for async background observation buffering. Can be an absolute token count (e.g. \`5000\`) or a fraction of \`messageTokens\` (e.g. \`0.25\` = buffer every 25% of threshold). When set, observations run in the background at this interval, storing results in a buffer. When the main \`messageTokens\` threshold is reached, buffered observations activate instantly without a blocking LLM call. Must resolve to less than \`messageTokens\`. Set to \`false\` to explicitly disable all async buffering (both observation and reflection).
70
70
 
71
+ **observation.bufferOnIdle** (`boolean`): Run background observation buffering when an agent turn ends and the agent becomes idle. This is separate from \`bufferTokens\`, which controls step-time async buffering. Set this to \`true\` to buffer short idle turns without waiting for the next turn or the \`messageTokens\` threshold.
72
+
71
73
  **observation.bufferActivation** (`number`): Controls how much of the message window to retain after activation. Accepts a ratio (0-1) or an absolute token count (≥ 1000). For example, \`0.8\` means: activate enough buffers to remove 80% of \`messageTokens\` and leave 20% as active message history. An absolute token count like \`4000\` targets a goal of keeping \~4k message tokens remaining after activation. Higher values remove more message history per activation when using a ratio. Higher values keep more message history when using a token count.
72
74
 
73
75
  **observation.activateAfterIdle** (`number | string | false | "auto"`): Time before buffered observations are forced to activate after inactivity. Accepts milliseconds, a duration string, \`"auto"\` for a provider-aware prompt cache TTL, or \`false\`. If unset, the top-level \`activateAfterIdle\` value is used for observations. Set \`false\` to disable the top-level idle setting for observations.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.42-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`d779de3`](https://github.com/mastra-ai/mastra/commit/d779de3cd9d2e7ed8110547190e2f15e786a0e41), [`1750c97`](https://github.com/mastra-ai/mastra/commit/1750c975d6179fbf6db2813b15229d4f8f23fc55), [`0e32507`](https://github.com/mastra-ai/mastra/commit/0e32507962cdfa5569b7bda5bc6fb3dd34e40b03), [`3a081c1`](https://github.com/mastra-ai/mastra/commit/3a081c1255c5ae8c99f6dad91cc612934ef6f2bd), [`fe9eacd`](https://github.com/mastra-ai/mastra/commit/fe9eacd9545a0a9d64aad31c9fa90294a425289e), [`db79c86`](https://github.com/mastra-ai/mastra/commit/db79c86c60723d57e02f9636ca2611bd4515f194)]:
8
+ - @mastra/core@1.38.0-alpha.2
9
+
3
10
  ## 1.1.42-alpha.2
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.42-alpha.2",
3
+ "version": "1.1.42-alpha.4",
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.4.3",
32
- "@mastra/core": "1.37.2-alpha.1",
32
+ "@mastra/core": "1.38.0-alpha.2",
33
33
  "@mastra/mcp": "^1.8.1"
34
34
  },
35
35
  "devDependencies": {
@@ -46,9 +46,9 @@
46
46
  "tsx": "^4.21.0",
47
47
  "typescript": "^6.0.3",
48
48
  "vitest": "4.1.5",
49
- "@internal/lint": "0.0.99",
50
49
  "@internal/types-builder": "0.0.74",
51
- "@mastra/core": "1.37.2-alpha.1"
50
+ "@internal/lint": "0.0.99",
51
+ "@mastra/core": "1.38.0-alpha.2"
52
52
  },
53
53
  "homepage": "https://mastra.ai",
54
54
  "repository": {