@mastra/mcp-docs-server 1.2.3-alpha.1 → 1.2.3-alpha.3

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.
@@ -322,6 +322,29 @@ Use `createNotificationInboxTool()` to give agents one tool for inbox actions in
322
322
 
323
323
  `sendNotificationSignal()` requires a storage domain with `notifications` support. Use `sendSignal({ type: 'notification' })` only for lower-level notification-shaped context that should bypass inbox storage.
324
324
 
325
+ ## Distributed and serverless deployments
326
+
327
+ Signals coordinate runs through a pub/sub backend. When a signal arrives on a backend that implements `LeaseProvider`, Mastra acquires a lease on the target thread so a single process owns the conversation at a time, then either wakes the agent or routes the input into the running loop. Backends without leasing fall back to a no-op that always grants ownership, which is fine in a single process but not across instances.
328
+
329
+ The default in-memory pub/sub can't cross instance boundaries. On serverless platforms like Vercel, or any multi-instance deployment, a follow-up signal can land on a different instance than the one running the agent. Without a shared pub/sub, that instance can't reach the active run and starts its own, leaving the original run untouched and the thread processed twice.
330
+
331
+ Configure a shared pub/sub backed by Redis Streams on the `Mastra` instance so leases and signals coordinate across instances:
332
+
333
+ ```typescript
334
+ import { Mastra } from '@mastra/core'
335
+ import { RedisStreamsPubSub } from '@mastra/redis-streams'
336
+
337
+ export const mastra = new Mastra({
338
+ agents: { agent },
339
+ pubsub: new RedisStreamsPubSub({
340
+ url: process.env.REDIS_URL,
341
+ keyPrefix: 'mastra:my-app',
342
+ }),
343
+ })
344
+ ```
345
+
346
+ `RedisStreamsPubSub` implements both the event delivery contract and distributed leasing, so a single backend handles cross-instance signal delivery and lease ownership. Vercel's one-click Redis integration and Upstash Redis both work well. For more on when a distributed pub/sub is needed, see the [PubSub guide](https://mastra.ai/docs/server/pubsub) and the [`RedisStreamsPubSub` reference](https://mastra.ai/reference/pubsub/redis-streams).
347
+
325
348
  ## Compatibility and APIs
326
349
 
327
350
  ### Compatibility
@@ -404,4 +427,5 @@ Use heartbeats together with client-side reconnect logic. Heartbeats reduce idle
404
427
  - [`client.getAgent().sendSignal()`](https://mastra.ai/reference/client-js/agents)
405
428
  - [Server agent routes](https://mastra.ai/reference/server/routes)
406
429
  - [`client.getAgent().subscribeToThread()`](https://mastra.ai/reference/client-js/agents)
407
- - [`client.getAgent().sendToolApproval()`](https://mastra.ai/reference/client-js/agents)
430
+ - [`client.getAgent().sendToolApproval()`](https://mastra.ai/reference/client-js/agents)
431
+ - [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams)
@@ -1,6 +1,6 @@
1
1
  # ![Vercel logo](https://models.dev/logos/vercel.svg)Vercel
2
2
 
3
- Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 293 models through Mastra's model router.
3
+ Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 294 models through Mastra's model router.
4
4
 
5
5
  Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
6
6
 
@@ -72,6 +72,7 @@ ANTHROPIC_API_KEY=ant-...
72
72
  | `amazon/nova-micro` |
73
73
  | `amazon/nova-pro` |
74
74
  | `amazon/titan-embed-text-v2` |
75
+ | `anthropic/claude-3.5-haiku` |
75
76
  | `anthropic/claude-haiku-4.5` |
76
77
  | `anthropic/claude-opus-4` |
77
78
  | `anthropic/claude-opus-4.1` |
@@ -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 4548 models from 134 providers through a single API.
3
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 4522 models from 134 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -1,6 +1,6 @@
1
1
  # ![Anthropic logo](https://models.dev/logos/anthropic.svg)Anthropic
2
2
 
3
- Access 18 Anthropic models through Mastra's model router. Authentication is handled automatically using the `ANTHROPIC_API_KEY` environment variable.
3
+ Access 17 Anthropic models through Mastra's model router. Authentication is handled automatically using the `ANTHROPIC_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models).
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: "anthropic/claude-3-5-haiku-latest"
18
+ model: "anthropic/claude-fable-5"
19
19
  });
20
20
 
21
21
  // Generate a response
@@ -32,7 +32,6 @@ for await (const chunk of stream) {
32
32
 
33
33
  | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
34
34
  | -------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
35
- | `anthropic/claude-3-5-haiku-latest` | 200K | | | | | | $0.80 | $4 |
36
35
  | `anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
37
36
  | `anthropic/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
38
37
  | `anthropic/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $5 |
@@ -60,7 +59,7 @@ const agent = new Agent({
60
59
  id: "custom-agent",
61
60
  name: "custom-agent",
62
61
  model: {
63
- id: "anthropic/claude-3-5-haiku-latest",
62
+ id: "anthropic/claude-fable-5",
64
63
  apiKey: process.env.ANTHROPIC_API_KEY,
65
64
  headers: {
66
65
  "X-Custom-Header": "value"
@@ -79,7 +78,7 @@ const agent = new Agent({
79
78
  const useAdvanced = requestContext.task === "complex";
80
79
  return useAdvanced
81
80
  ? "anthropic/claude-sonnet-4-6"
82
- : "anthropic/claude-3-5-haiku-latest";
81
+ : "anthropic/claude-fable-5";
83
82
  }
84
83
  });
85
84
  ```
@@ -1,6 +1,6 @@
1
1
  # ![Chutes logo](https://models.dev/logos/chutes.svg)Chutes
2
2
 
3
- Access 39 Chutes models through Mastra's model router. Authentication is handled automatically using the `CHUTES_API_KEY` environment variable.
3
+ Access 13 Chutes models through Mastra's model router. Authentication is handled automatically using the `CHUTES_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Chutes documentation](https://llm.chutes.ai).
6
6
 
@@ -32,47 +32,21 @@ for await (const chunk of stream) {
32
32
 
33
33
  ## Models
34
34
 
35
- | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
- | ------------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
- | `chutes/deepseek-ai/DeepSeek-R1-0528-TEE` | 164K | | | | | | $0.45 | $2 |
38
- | `chutes/deepseek-ai/DeepSeek-R1-Distill-Llama-70B` | 131K | | | | | | $0.03 | $0.11 |
39
- | `chutes/deepseek-ai/DeepSeek-V3-0324-TEE` | 164K | | | | | | $0.25 | $1 |
40
- | `chutes/deepseek-ai/DeepSeek-V3.1-TEE` | 164K | | | | | | $0.27 | $1 |
41
- | `chutes/deepseek-ai/DeepSeek-V3.2-TEE` | 131K | | | | | | $0.28 | $0.42 |
42
- | `chutes/google/gemma-4-31B-turbo-TEE` | 131K | | | | | | $0.13 | $0.38 |
43
- | `chutes/MiniMaxAI/MiniMax-M2.5-TEE` | 197K | | | | | | $0.15 | $1 |
44
- | `chutes/moonshotai/Kimi-K2.5-TEE` | 262K | | | | | | $0.44 | $2 |
45
- | `chutes/moonshotai/Kimi-K2.6-TEE` | 262K | | | | | | $0.95 | $4 |
46
- | `chutes/NousResearch/DeepHermes-3-Mistral-24B-Preview` | 33K | | | | | | $0.02 | $0.10 |
47
- | `chutes/NousResearch/Hermes-4-14B` | 41K | | | | | | $0.01 | $0.05 |
48
- | `chutes/openai/gpt-oss-120b-TEE` | 131K | | | | | | $0.09 | $0.36 |
49
- | `chutes/Qwen/Qwen2.5-72B-Instruct` | 33K | | | | | | $0.30 | $1 |
50
- | `chutes/Qwen/Qwen2.5-Coder-32B-Instruct` | 33K | | | | | | $0.03 | $0.11 |
51
- | `chutes/Qwen/Qwen2.5-VL-32B-Instruct` | 16K | | | | | | $0.05 | $0.22 |
52
- | `chutes/Qwen/Qwen3-235B-A22B-Instruct-2507-TEE` | 262K | | | | | | $0.10 | $0.60 |
53
- | `chutes/Qwen/Qwen3-235B-A22B-Thinking-2507` | 262K | | | | | | $0.11 | $0.60 |
54
- | `chutes/Qwen/Qwen3-30B-A3B` | 41K | | | | | | $0.06 | $0.22 |
55
- | `chutes/Qwen/Qwen3-32B-TEE` | 41K | | | | | | $0.08 | $0.24 |
56
- | `chutes/Qwen/Qwen3-Coder-Next-TEE` | 262K | | | | | | $0.12 | $0.75 |
57
- | `chutes/Qwen/Qwen3-Next-80B-A3B-Instruct` | 262K | | | | | | $0.10 | $0.80 |
58
- | `chutes/Qwen/Qwen3.5-397B-A17B-TEE` | 262K | | | | | | $0.39 | $2 |
59
- | `chutes/Qwen/Qwen3.6-27B-TEE` | 262K | | | | | | $0.20 | $2 |
60
- | `chutes/Qwen/Qwen3Guard-Gen-0.6B` | 33K | | | | | | $0.01 | $0.01 |
61
- | `chutes/rednote-hilab/dots.ocr` | 131K | | | | | | $0.01 | $0.01 |
62
- | `chutes/tngtech/DeepSeek-TNG-R1T2-Chimera-TEE` | 164K | | | | | | $0.30 | $1 |
63
- | `chutes/unsloth/gemma-3-12b-it` | 131K | | | | | | $0.03 | $0.10 |
64
- | `chutes/unsloth/gemma-3-27b-it` | 128K | | | | | | $0.03 | $0.11 |
65
- | `chutes/unsloth/gemma-3-4b-it` | 96K | | | | | | $0.01 | $0.03 |
66
- | `chutes/unsloth/Llama-3.2-1B-Instruct` | 16K | | | | | | $0.01 | $0.01 |
67
- | `chutes/unsloth/Llama-3.2-3B-Instruct` | 16K | | | | | | $0.01 | $0.01 |
68
- | `chutes/unsloth/Mistral-Nemo-Instruct-2407` | 131K | | | | | | $0.02 | $0.04 |
69
- | `chutes/XiaomiMiMo/MiMo-V2-Flash-TEE` | 262K | | | | | | $0.09 | $0.29 |
70
- | `chutes/zai-org/GLM-4.6V` | 131K | | | | | | $0.30 | $0.90 |
71
- | `chutes/zai-org/GLM-4.7-FP8` | 203K | | | | | | $0.30 | $1 |
72
- | `chutes/zai-org/GLM-4.7-TEE` | 203K | | | | | | $0.39 | $2 |
73
- | `chutes/zai-org/GLM-5-TEE` | 203K | | | | | | $0.95 | $3 |
74
- | `chutes/zai-org/GLM-5-Turbo` | 203K | | | | | | $0.49 | $2 |
75
- | `chutes/zai-org/GLM-5.1-TEE` | 203K | | | | | | $1 | $4 |
35
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
36
+ | ----------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
37
+ | `chutes/deepseek-ai/DeepSeek-V3.2-TEE` | 131K | | | | | | $1 | $1 |
38
+ | `chutes/google/gemma-4-31B-turbo-TEE` | 131K | | | | | | $0.12 | $0.37 |
39
+ | `chutes/MiniMaxAI/MiniMax-M2.5-TEE` | 197K | | | | | | $0.15 | $1 |
40
+ | `chutes/moonshotai/Kimi-K2.5-TEE` | 262K | | | | | | $0.44 | $2 |
41
+ | `chutes/moonshotai/Kimi-K2.6-TEE` | 262K | | | | | | $0.66 | $4 |
42
+ | `chutes/Qwen/Qwen3-235B-A22B-Thinking-2507-TEE` | 262K | | | | | | $0.30 | $1 |
43
+ | `chutes/Qwen/Qwen3-32B-TEE` | 41K | | | | | | $0.10 | $0.42 |
44
+ | `chutes/Qwen/Qwen3.5-397B-A17B-TEE` | 262K | | | | | | $0.45 | $3 |
45
+ | `chutes/Qwen/Qwen3.6-27B-TEE` | 262K | | | | | | $0.30 | $2 |
46
+ | `chutes/unsloth/Mistral-Nemo-Instruct-2407-TEE` | 131K | | | | | | $0.02 | $0.10 |
47
+ | `chutes/zai-org/GLM-5-TEE` | 203K | | | | | | $0.95 | $3 |
48
+ | `chutes/zai-org/GLM-5.1-TEE` | 203K | | | | | | $0.98 | $3 |
49
+ | `chutes/zai-org/GLM-5.2-TEE` | 1.0M | | | | | | $1 | $4 |
76
50
 
77
51
  ## Advanced configuration
78
52
 
@@ -102,7 +76,7 @@ const agent = new Agent({
102
76
  model: ({ requestContext }) => {
103
77
  const useAdvanced = requestContext.task === "complex";
104
78
  return useAdvanced
105
- ? "chutes/zai-org/GLM-5.1-TEE"
79
+ ? "chutes/zai-org/GLM-5.2-TEE"
106
80
  : "chutes/MiniMaxAI/MiniMax-M2.5-TEE";
107
81
  }
108
82
  });
@@ -211,6 +211,7 @@ The Reference section provides documentation of Mastra's API, including paramete
211
211
  - [CachingPubSub](https://mastra.ai/reference/pubsub/caching-pubsub)
212
212
  - [EventEmitterPubSub](https://mastra.ai/reference/pubsub/event-emitter)
213
213
  - [GoogleCloudPubSub](https://mastra.ai/reference/pubsub/google-cloud-pubsub)
214
+ - [LeaseProvider](https://mastra.ai/reference/pubsub/lease-provider)
214
215
  - [PubSub](https://mastra.ai/reference/pubsub/base)
215
216
  - [RedisStreamsPubSub](https://mastra.ai/reference/pubsub/redis-streams)
216
217
  - [UnixSocketPubSub](https://mastra.ai/reference/pubsub/unix-socket-pubsub)
@@ -0,0 +1,131 @@
1
+ # LeaseProvider
2
+
3
+ `LeaseProvider` is the distributed leasing contract, separate from event delivery ([`PubSub`](https://mastra.ai/reference/pubsub/base)). Mastra's [signals layer](https://mastra.ai/docs/agents/signals) uses it to elect a single owner across multiple processes (for example, serverless invocations) for a given resource, most commonly a thread key. The owner is the process that wakes and runs the agent stream, so other processes route follow-up work to it instead of starting a competing run.
4
+
5
+ Leasing is a distinct concern from pub/sub. A backend implements `LeaseProvider` only when it can genuinely coordinate a lock, such as Redis via atomic `SET`/Lua, or an in-memory map for single-process. Backends that cannot lease omit it; the signals runtime feature-detects the capability and falls back to a no-op provider, preserving single-process behavior.
6
+
7
+ The built-in [`RedisStreamsPubSub`](https://mastra.ai/reference/pubsub/redis-streams) implements `LeaseProvider`, which is what enables signals to coordinate across instances in distributed and serverless deployments.
8
+
9
+ ## Usage example
10
+
11
+ You don't construct a `LeaseProvider` directly. Configure a pub/sub backend that implements it (such as `RedisStreamsPubSub`) on the `Mastra` constructor, and the signals runtime uses it automatically for cross-process coordination.
12
+
13
+ ```typescript
14
+ import { Mastra } from '@mastra/core'
15
+ import { RedisStreamsPubSub } from '@mastra/redis-streams'
16
+
17
+ export const mastra = new Mastra({
18
+ // RedisStreamsPubSub implements both PubSub and LeaseProvider
19
+ pubsub: new RedisStreamsPubSub({
20
+ url: process.env.REDIS_URL,
21
+ }),
22
+ })
23
+ ```
24
+
25
+ To implement leasing in a custom backend, implement the methods below. The signals runtime detects the capability structurally (so it works across package boundaries) and only uses it when all methods are present.
26
+
27
+ ```typescript
28
+ import { PubSub } from '@mastra/core/events'
29
+ import type { LeaseProvider } from '@mastra/core/events'
30
+
31
+ export class CustomPubSub extends PubSub implements LeaseProvider {
32
+ async acquireLease(key: string, owner: string, ttlMs: number) {
33
+ // Atomically claim the lease, or report the current holder.
34
+ return { acquired: true, owner }
35
+ }
36
+
37
+ // ...getLeaseOwner, releaseLease, renewLease, transferLease
38
+ }
39
+ ```
40
+
41
+ ## Methods
42
+
43
+ ### Leasing
44
+
45
+ #### `acquireLease(key, owner, ttlMs)`
46
+
47
+ Atomically tries to acquire a lease on a key. Returns `{ acquired: true, owner }` if the caller claimed the lease, or `{ acquired: false, owner }` where `owner` is the current holder, so the caller can route follow-up work to them. The same owner can call `acquireLease` idempotently to renew or re-claim.
48
+
49
+ ```typescript
50
+ const result = await pubsub.acquireLease('thread:abc', runId, 15000)
51
+
52
+ if (result.acquired) {
53
+ // This process owns the thread, so wake and run the agent.
54
+ } else {
55
+ // result.owner holds the lease, so route the signal to them.
56
+ }
57
+ ```
58
+
59
+ Returns: `Promise<{ acquired: boolean; owner?: string }>`
60
+
61
+ **key** (`string`): The lease key, such as a thread key.
62
+
63
+ **owner** (`string`): Identifier for the owner, such as a \`runId\`. The same owner can call \`acquireLease\` idempotently to renew or release.
64
+
65
+ **ttlMs** (`number`): Time-to-live in milliseconds for the lease.
66
+
67
+ #### `getLeaseOwner(key)`
68
+
69
+ Reads the current owner of a lease, or `undefined` if no lease is held.
70
+
71
+ ```typescript
72
+ const owner = await pubsub.getLeaseOwner('thread:abc')
73
+ ```
74
+
75
+ Returns: `Promise<string | undefined>`
76
+
77
+ #### `releaseLease(key, owner)`
78
+
79
+ Releases a lease. This is a no-op if the caller is not the current owner: implementations check ownership atomically before releasing, so a concurrent renewal by another owner is never clobbered.
80
+
81
+ ```typescript
82
+ await pubsub.releaseLease('thread:abc', runId)
83
+ ```
84
+
85
+ Returns: `Promise<void>`
86
+
87
+ #### `renewLease(key, owner, ttlMs)`
88
+
89
+ Renews an existing lease owned by `owner`, extending its TTL. Returns `true` if the renewal succeeded and the caller still owns the lease, or `false` if the lease was lost (TTL expired or another owner took it).
90
+
91
+ ```typescript
92
+ const stillOwned = await pubsub.renewLease('thread:abc', runId, 15000)
93
+
94
+ if (!stillOwned) {
95
+ // Lost the lease, so stop renewing and let the new owner take over.
96
+ }
97
+ ```
98
+
99
+ Returns: `Promise<boolean>`
100
+
101
+ #### `transferLease(key, fromOwner, toOwner, ttlMs)`
102
+
103
+ Atomically hands a held lease from `fromOwner` to `toOwner`, refreshing its TTL, without releasing the key in between. This is the gap-free primitive used when one owner finishes but a follow-up owner must take over the same key immediately, for example when a thread run completes and a queued follow-up run drains on the same thread. A naive release-then-acquire would briefly leave the key empty, letting a racing process win the freed lease and start a competing run.
104
+
105
+ Returns `true` if `fromOwner` still held the lease and ownership moved to `toOwner`, or `false` if the lease was already lost, in which case the caller should fall back to a fresh `acquireLease`.
106
+
107
+ ```typescript
108
+ const transferred = await pubsub.transferLease('thread:abc', currentRunId, nextRunId, 15000)
109
+
110
+ if (!transferred) {
111
+ // Lease was lost, so acquire fresh instead.
112
+ await pubsub.acquireLease('thread:abc', nextRunId, 15000)
113
+ }
114
+ ```
115
+
116
+ Returns: `Promise<boolean>`
117
+
118
+ > **Warning:** Backends that cannot perform the transfer atomically must still implement it as a best-effort `releaseLease(fromOwner)` followed by `acquireLease(toOwner)`, and document that the swap is non-atomic, since a racing process can win the key in the gap. Keeping the method required means callers have a single code path and atomicity is an explicit per-backend decision.
119
+
120
+ ## Capability detection
121
+
122
+ The signals runtime detects `LeaseProvider` structurally rather than with `instanceof`, so detection works even when a separately published backend resolves a different copy of `@mastra/core`. A value is treated as a `LeaseProvider` when it exposes all five methods (`acquireLease`, `getLeaseOwner`, `releaseLease`, `renewLease`, `transferLease`).
123
+
124
+ When the configured pub/sub backend does not implement `LeaseProvider`, the runtime falls back to an always-win no-op provider. Every caller wins its own lease race, and release, renew, and transfer are inert, which preserves the expected single-process behavior.
125
+
126
+ ## Related
127
+
128
+ - [PubSub](https://mastra.ai/reference/pubsub/base): The event delivery contract, separate from leasing
129
+ - [RedisStreamsPubSub](https://mastra.ai/reference/pubsub/redis-streams): The built-in backend that implements `LeaseProvider`
130
+ - [Signals](https://mastra.ai/docs/agents/signals): The runtime that uses leasing to coordinate thread runs across processes
131
+ - [Channels](https://mastra.ai/docs/agents/channels): Uses leasing to coordinate agent runs in serverless and multi-instance deployments
@@ -1,6 +1,6 @@
1
1
  # RedisStreamsPubSub
2
2
 
3
- `RedisStreamsPubSub` is a [`PubSub`](https://mastra.ai/reference/pubsub/base) implementation backed by [Redis Streams](https://redis.io/docs/latest/develop/data-types/streams/). It delivers events across processes and hosts, with persistence, consumer groups, and redelivery on failure.
3
+ `RedisStreamsPubSub` is a [`PubSub`](https://mastra.ai/reference/pubsub/base) implementation backed by [Redis Streams](https://redis.io/docs/latest/develop/data-types/streams/). It delivers events across processes and hosts, with persistence, consumer groups, and redelivery on failure. It also implements [`LeaseProvider`](https://mastra.ai/reference/pubsub/lease-provider), so the signals layer can elect a single owner per resource across instances, which is what lets signals coordinate runs in distributed and serverless deployments.
4
4
 
5
5
  Use it for distributed deployments where several services share an event stream. For single-process delivery, use [`EventEmitterPubSub`](https://mastra.ai/reference/pubsub/event-emitter). For Google Cloud, use [`GoogleCloudPubSub`](https://mastra.ai/reference/pubsub/google-cloud-pubsub).
6
6
 
@@ -105,4 +105,12 @@ await pubsub.close()
105
105
 
106
106
  ## Redelivery and reclaim
107
107
 
108
- When a subscriber calls `nack`, the event is republished with an incremented `deliveryAttempt` and the original is acknowledged. Once an event reaches `maxDeliveryAttempts`, it's dropped instead of redelivered. Separately, each subscription periodically reclaims events that an earlier consumer in the group read but never acknowledged, controlled by `reclaimIntervalMs` and `reclaimIdleMs`.
108
+ When a subscriber calls `nack`, the event is republished with an incremented `deliveryAttempt` and the original is acknowledged. Once an event reaches `maxDeliveryAttempts`, it's dropped instead of redelivered. Separately, each subscription periodically reclaims events that an earlier consumer in the group read but never acknowledged, controlled by `reclaimIntervalMs` and `reclaimIdleMs`.
109
+
110
+ ## Distributed leasing
111
+
112
+ `RedisStreamsPubSub` implements the [`LeaseProvider`](https://mastra.ai/reference/pubsub/lease-provider) contract on top of the same Redis connection. The [signals runtime](https://mastra.ai/docs/agents/signals) uses it to elect a single owner (usually per thread key) so that across instances only one process wakes and runs the agent, and others route follow-up work to the holder. This is what makes signals work on serverless and multi-instance deployments; without a shared lease, each instance would start its own competing run.
113
+
114
+ Lease keys are namespaced under the same `keyPrefix` as topics, as `<keyPrefix>:lease:<key>`. All operations are atomic: `acquireLease` uses `SET NX PX` and refreshes its own TTL idempotently, while `releaseLease`, `renewLease`, and `transferLease` use Lua scripts that check ownership before mutating, so a concurrent renewal from another owner is never clobbered.
115
+
116
+ You don't call these methods directly. Configuring `RedisStreamsPubSub` as the `pubsub` backend is enough for the runtime to detect and use the capability. See [`LeaseProvider`](https://mastra.ai/reference/pubsub/lease-provider) for the full method contract.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.3-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`95857bc`](https://github.com/mastra-ai/mastra/commit/95857bcd6669da7193f503e803f0d72a2bd66be6), [`8e9c0fb`](https://github.com/mastra-ai/mastra/commit/8e9c0fb48fd58da2efcdff2cf1202ee41092c315)]:
8
+ - @mastra/core@1.48.0-alpha.1
9
+
3
10
  ## 1.2.3-alpha.0
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.3-alpha.1",
3
+ "version": "1.2.3-alpha.3",
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
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
31
  "@mastra/mcp": "^1.12.0",
32
- "@mastra/core": "1.48.0-alpha.0"
32
+ "@mastra/core": "1.48.0-alpha.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^1.19.11",
@@ -47,7 +47,7 @@
47
47
  "vitest": "4.1.8",
48
48
  "@internal/types-builder": "0.0.84",
49
49
  "@internal/lint": "0.0.109",
50
- "@mastra/core": "1.48.0-alpha.0"
50
+ "@mastra/core": "1.48.0-alpha.1"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {