@mastra/mcp-docs-server 1.1.26-alpha.22 → 1.1.26-alpha.23

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.
@@ -210,6 +210,28 @@ const response = await testAgent.generate('Tell me about TypeScript.', {
210
210
  })
211
211
  ```
212
212
 
213
+ If you want that structuring model to also see the current conversation history, set `useAgent: true` alongside `model`. Mastra will reuse the parent agent with the separate structuring model and attach read-only memory context when a thread is available.
214
+
215
+ ```typescript
216
+ const response = await testAgent.generate('Return my profile as structured data.', {
217
+ memory: {
218
+ thread: 'thread-123',
219
+ resource: 'user-123',
220
+ },
221
+ structuredOutput: {
222
+ schema: z.object({
223
+ favoriteColor: z.string(),
224
+ hometown: z.string(),
225
+ petName: z.string(),
226
+ }),
227
+ model: 'openai/gpt-5.4',
228
+ useAgent: true,
229
+ },
230
+ })
231
+ ```
232
+
233
+ Leave `useAgent` unset if you want the separate structuring model to work only from the current response and not inherit prior conversation memory.
234
+
213
235
  ### Multi-step approach with `prepareStep`
214
236
 
215
237
  For models that don't support tools and structured outputs together, you can use `prepareStep` to handle them in separate steps.
@@ -34,6 +34,7 @@ Each provider page includes installation instructions, configuration parameters,
34
34
  - [PostgreSQL](https://mastra.ai/reference/storage/postgresql)
35
35
  - [MongoDB](https://mastra.ai/reference/storage/mongodb)
36
36
  - [Upstash](https://mastra.ai/reference/storage/upstash)
37
+ - [Redis](https://mastra.ai/reference/storage/redis)
37
38
  - [Cloudflare D1](https://mastra.ai/reference/storage/cloudflare-d1)
38
39
  - [Cloudflare KV & Durable Objects](https://mastra.ai/reference/storage/cloudflare)
39
40
  - [Convex](https://mastra.ai/reference/storage/convex)
@@ -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 3675 models from 104 providers through a single API.
3
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3689 models from 104 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -1,6 +1,6 @@
1
1
  # ![Deep Infra logo](https://models.dev/logos/deepinfra.svg)Deep Infra
2
2
 
3
- Access 28 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
3
+ Access 31 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Deep Infra documentation](https://deepinfra.com/models).
6
6
 
@@ -54,6 +54,9 @@ for await (const chunk of stream) {
54
54
  | `deepinfra/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.14 |
55
55
  | `deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct` | 262K | | | | | | $0.40 | $2 |
56
56
  | `deepinfra/Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo` | 262K | | | | | | $0.30 | $1 |
57
+ | `deepinfra/Qwen/Qwen3.5-35B-A3B` | 262K | | | | | | $0.20 | $0.95 |
58
+ | `deepinfra/Qwen/Qwen3.5-397B-A17B` | 262K | | | | | | $0.54 | $3 |
59
+ | `deepinfra/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.20 | $1 |
57
60
  | `deepinfra/zai-org/GLM-4.6` | 205K | | | | | | $0.43 | $2 |
58
61
  | `deepinfra/zai-org/GLM-4.6V` | 205K | | | | | | $0.30 | $0.90 |
59
62
  | `deepinfra/zai-org/GLM-4.7` | 203K | | | | | | $0.43 | $2 |
@@ -1,6 +1,6 @@
1
1
  # ![Fireworks AI logo](https://models.dev/logos/fireworks-ai.svg)Fireworks AI
2
2
 
3
- Access 17 Fireworks AI models through Mastra's model router. Authentication is handled automatically using the `FIREWORKS_API_KEY` environment variable.
3
+ Access 18 Fireworks AI models through Mastra's model router. Authentication is handled automatically using the `FIREWORKS_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Fireworks AI documentation](https://fireworks.ai/docs/).
6
6
 
@@ -46,6 +46,7 @@ for await (const chunk of stream) {
46
46
  | `fireworks-ai/accounts/fireworks/models/kimi-k2-instruct` | 128K | | | | | | $1 | $3 |
47
47
  | `fireworks-ai/accounts/fireworks/models/kimi-k2-thinking` | 256K | | | | | | $0.60 | $3 |
48
48
  | `fireworks-ai/accounts/fireworks/models/kimi-k2p5` | 256K | | | | | | $0.60 | $3 |
49
+ | `fireworks-ai/accounts/fireworks/models/kimi-k2p6` | 262K | | | | | | $0.95 | $4 |
49
50
  | `fireworks-ai/accounts/fireworks/models/minimax-m2p1` | 200K | | | | | | $0.30 | $1 |
50
51
  | `fireworks-ai/accounts/fireworks/models/minimax-m2p5` | 197K | | | | | | $0.30 | $1 |
51
52
  | `fireworks-ai/accounts/fireworks/models/minimax-m2p7` | 197K | | | | | | $0.30 | $1 |
@@ -1,6 +1,6 @@
1
1
  # ![Kilo Gateway logo](https://models.dev/logos/kilo.svg)Kilo Gateway
2
2
 
3
- Access 334 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
3
+ Access 335 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Kilo Gateway documentation](https://kilo.ai).
6
6
 
@@ -189,6 +189,7 @@ for await (const chunk of stream) {
189
189
  | `kilo/moonshotai/kimi-k2-0905` | 131K | | | | | | $0.40 | $2 |
190
190
  | `kilo/moonshotai/kimi-k2-thinking` | 131K | | | | | | $0.47 | $2 |
191
191
  | `kilo/moonshotai/kimi-k2.5` | 262K | | | | | | $0.45 | $2 |
192
+ | `kilo/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
192
193
  | `kilo/morph/morph-v3-fast` | 82K | | | | | | $0.80 | $1 |
193
194
  | `kilo/morph/morph-v3-large` | 262K | | | | | | $0.90 | $2 |
194
195
  | `kilo/nex-agi/deepseek-v3.1-nex-n1` | 131K | | | | | | $0.27 | $1 |
@@ -1,6 +1,6 @@
1
1
  # ![Moonshot AI (China) logo](https://models.dev/logos/moonshotai-cn.svg)Moonshot AI (China)
2
2
 
3
- Access 6 Moonshot AI (China) models through Mastra's model router. Authentication is handled automatically using the `MOONSHOT_API_KEY` environment variable.
3
+ Access 7 Moonshot AI (China) models through Mastra's model router. Authentication is handled automatically using the `MOONSHOT_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Moonshot AI (China) documentation](https://platform.moonshot.cn).
6
6
 
@@ -40,6 +40,7 @@ for await (const chunk of stream) {
40
40
  | `moonshotai-cn/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
41
41
  | `moonshotai-cn/kimi-k2-turbo-preview` | 262K | | | | | | $2 | $10 |
42
42
  | `moonshotai-cn/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
43
+ | `moonshotai-cn/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
43
44
 
44
45
  ## Advanced configuration
45
46
 
@@ -69,7 +70,7 @@ const agent = new Agent({
69
70
  model: ({ requestContext }) => {
70
71
  const useAdvanced = requestContext.task === "complex";
71
72
  return useAdvanced
72
- ? "moonshotai-cn/kimi-k2.5"
73
+ ? "moonshotai-cn/kimi-k2.6"
73
74
  : "moonshotai-cn/kimi-k2-0711-preview";
74
75
  }
75
76
  });
@@ -1,6 +1,6 @@
1
1
  # ![NanoGPT logo](https://models.dev/logos/nano-gpt.svg)NanoGPT
2
2
 
3
- Access 518 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
3
+ Access 525 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
6
6
 
@@ -39,6 +39,7 @@ for await (const chunk of stream) {
39
39
  | `nano-gpt/aion-labs/aion-1.0-mini` | 131K | | | | | | $0.80 | $1 |
40
40
  | `nano-gpt/aion-labs/aion-rp-llama-3.1-8b` | 33K | | | | | | $0.20 | $0.20 |
41
41
  | `nano-gpt/Alibaba-NLP/Tongyi-DeepResearch-30B-A3B` | 128K | | | | | | $0.08 | $0.24 |
42
+ | `nano-gpt/alibaba/qwen3.6-flash` | 992K | | | | | | $0.19 | $1 |
42
43
  | `nano-gpt/allenai/molmo-2-8b` | 37K | | | | | | $0.20 | $0.20 |
43
44
  | `nano-gpt/allenai/olmo-3-32b-think` | 128K | | | | | | $0.30 | $0.45 |
44
45
  | `nano-gpt/allenai/olmo-3.1-32b-instruct` | 66K | | | | | | $0.20 | $0.60 |
@@ -367,6 +368,8 @@ for await (const chunk of stream) {
367
368
  | `nano-gpt/moonshotai/kimi-k2-thinking-turbo-original` | 256K | | | | | | $1 | $8 |
368
369
  | `nano-gpt/moonshotai/kimi-k2.5` | 256K | | | | | | $0.30 | $2 |
369
370
  | `nano-gpt/moonshotai/kimi-k2.5:thinking` | 256K | | | | | | $0.30 | $2 |
371
+ | `nano-gpt/moonshotai/kimi-k2.6` | 256K | | | | | | $0.53 | $3 |
372
+ | `nano-gpt/moonshotai/kimi-k2.6:thinking` | 256K | | | | | | $0.53 | $3 |
370
373
  | `nano-gpt/NeverSleep/Llama-3-Lumimaid-70B-v0.1` | 16K | | | | | | $2 | $2 |
371
374
  | `nano-gpt/NeverSleep/Lumimaid-v0.2-70B` | 16K | | | | | | $1 | $2 |
372
375
  | `nano-gpt/nex-agi/deepseek-v3.1-nex-n1` | 128K | | | | | | $0.28 | $0.42 |
@@ -432,12 +435,15 @@ for await (const chunk of stream) {
432
435
  | `nano-gpt/phi-4-mini-instruct` | 128K | | | | | | $0.17 | $0.68 |
433
436
  | `nano-gpt/phi-4-multimodal-instruct` | 128K | | | | | | $0.07 | $0.11 |
434
437
  | `nano-gpt/qvq-max` | 128K | | | | | | $1 | $5 |
438
+ | `nano-gpt/qwen-3.6-plus` | 992K | | | | | | $0.45 | $3 |
435
439
  | `nano-gpt/qwen-image` | — | | | | | | — | — |
436
440
  | `nano-gpt/qwen-long` | 10.0M | | | | | | $0.10 | $0.41 |
437
441
  | `nano-gpt/qwen-max` | 32K | | | | | | $2 | $6 |
438
442
  | `nano-gpt/qwen-plus` | 996K | | | | | | $0.40 | $1 |
439
443
  | `nano-gpt/qwen-turbo` | 1.0M | | | | | | $0.05 | $0.20 |
440
444
  | `nano-gpt/qwen/qwen3.5-397b-a17b` | 258K | | | | | | $0.60 | $4 |
445
+ | `nano-gpt/qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.29 | $2 |
446
+ | `nano-gpt/qwen/Qwen3.6-35B-A3B:thinking` | 262K | | | | | | $0.29 | $2 |
441
447
  | `nano-gpt/Qwen2.5-32B-EVA-v0.2` | 25K | | | | | | $0.49 | $0.49 |
442
448
  | `nano-gpt/qwen25-vl-72b-instruct` | 32K | | | | | | $0.70 | $0.70 |
443
449
  | `nano-gpt/qwen3-30b-a3b-instruct-2507` | 256K | | | | | | $0.20 | $0.50 |
@@ -445,6 +451,7 @@ for await (const chunk of stream) {
445
451
  | `nano-gpt/qwen3-max-2026-01-23` | 256K | | | | | | $1 | $6 |
446
452
  | `nano-gpt/qwen3-vl-235b-a22b-instruct-original` | 33K | | | | | | $0.50 | $1 |
447
453
  | `nano-gpt/qwen3-vl-235b-a22b-thinking` | 33K | | | | | | $0.50 | $6 |
454
+ | `nano-gpt/qwen3.6-max-preview` | 246K | | | | | | $1 | $8 |
448
455
  | `nano-gpt/qwq-32b` | 128K | | | | | | $0.26 | $0.30 |
449
456
  | `nano-gpt/QwQ-32B-ArliAI-RpR-v1` | 33K | | | | | | $0.20 | $0.20 |
450
457
  | `nano-gpt/raifle/sorcererlm-8x22b` | 16K | | | | | | $5 | $5 |
@@ -1,6 +1,6 @@
1
1
  # ![ZenMux logo](https://models.dev/logos/zenmux.svg)ZenMux
2
2
 
3
- Access 88 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
3
+ Access 89 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [ZenMux documentation](https://docs.zenmux.ai).
6
6
 
@@ -68,6 +68,7 @@ for await (const chunk of stream) {
68
68
  | `zenmux/moonshotai/kimi-k2-thinking` | 262K | | | | | | $0.60 | $3 |
69
69
  | `zenmux/moonshotai/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
70
70
  | `zenmux/moonshotai/kimi-k2.5` | 262K | | | | | | $0.58 | $3 |
71
+ | `zenmux/moonshotai/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
71
72
  | `zenmux/openai/gpt-5` | 400K | | | | | | $1 | $10 |
72
73
  | `zenmux/openai/gpt-5-codex` | 400K | | | | | | $1 | $10 |
73
74
  | `zenmux/openai/gpt-5.1` | 400K | | | | | | $1 | $10 |
@@ -201,6 +201,7 @@ The Reference section provides documentation of Mastra's API, including paramete
201
201
  - [MongoDB Storage](https://mastra.ai/reference/storage/mongodb)
202
202
  - [MSSQL Storage](https://mastra.ai/reference/storage/mssql)
203
203
  - [PostgreSQL Storage](https://mastra.ai/reference/storage/postgresql)
204
+ - [Redis Storage](https://mastra.ai/reference/storage/redis)
204
205
  - [Upstash Storage](https://mastra.ai/reference/storage/upstash)
205
206
  - [ChunkType](https://mastra.ai/reference/streaming/ChunkType)
206
207
  - [MastraModelOutput](https://mastra.ai/reference/streaming/agents/MastraModelOutput)
@@ -217,6 +218,7 @@ The Reference section provides documentation of Mastra's API, including paramete
217
218
  - [createVectorQueryTool()](https://mastra.ai/reference/tools/vector-query-tool)
218
219
  - [MCPClient](https://mastra.ai/reference/tools/mcp-client)
219
220
  - [MCPServer](https://mastra.ai/reference/tools/mcp-server)
221
+ - [Tavily Tools](https://mastra.ai/reference/tools/tavily)
220
222
  - [Amazon S3 Vector Store](https://mastra.ai/reference/vectors/s3vectors)
221
223
  - [Astra Vector Store](https://mastra.ai/reference/vectors/astra)
222
224
  - [Chroma Vector Store](https://mastra.ai/reference/vectors/chroma)
@@ -0,0 +1,266 @@
1
+ # Redis Storage
2
+
3
+ The Redis storage implementation provides a high-performance storage solution using direct Redis connections via [node-redis](https://github.com/redis/node-redis) (the official Redis client for Node.js). It supports standalone Redis, and through custom client configuration, Redis Sentinel and Cluster deployments.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/redis
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Using Connection String
14
+
15
+ ```typescript
16
+ import { RedisStore } from '@mastra/redis'
17
+
18
+ const storage = new RedisStore({
19
+ id: 'redis-storage',
20
+ connectionString: 'redis://localhost:6379',
21
+ })
22
+
23
+ await storage.init()
24
+ ```
25
+
26
+ ### Using Host/Port Configuration
27
+
28
+ ```typescript
29
+ import { RedisStore } from '@mastra/redis'
30
+
31
+ const storage = new RedisStore({
32
+ id: 'redis-storage',
33
+ host: 'localhost',
34
+ port: 6379,
35
+ password: 'your-password',
36
+ db: 0,
37
+ })
38
+
39
+ await storage.init()
40
+ ```
41
+
42
+ ### Using Pre-configured Client
43
+
44
+ For advanced configurations like Sentinel or Cluster, you can pass a pre-configured redis client:
45
+
46
+ ```typescript
47
+ import { RedisStore } from '@mastra/redis'
48
+ import { createClient } from 'redis'
49
+
50
+ const client = createClient({
51
+ url: 'redis://localhost:6379',
52
+ socket: {
53
+ reconnectStrategy: retries => Math.min(retries * 50, 2000),
54
+ },
55
+ })
56
+
57
+ // Connect the client before passing to RedisStore
58
+ await client.connect()
59
+
60
+ const storage = new RedisStore({
61
+ id: 'redis-storage',
62
+ client,
63
+ })
64
+ ```
65
+
66
+ ## Parameters
67
+
68
+ **id** (`string`): Unique identifier for the storage instance
69
+
70
+ **connectionString** (`string`): Redis connection URL (e.g., \`redis\://localhost:6379\` or \`redis\://:password\@localhost:6379\`)
71
+
72
+ **host** (`string`): Redis host address
73
+
74
+ **port** (`number`): Redis port number (Default: `6379`)
75
+
76
+ **password** (`string`): Redis password for authentication
77
+
78
+ **db** (`number`): Redis database number (Default: `0`)
79
+
80
+ **client** (`RedisClient`): Pre-configured redis client (from the \`redis\` package) for advanced setups
81
+
82
+ > **Note:** You must provide either `connectionString`, `host`, or `client`. These options are mutually exclusive.
83
+
84
+ ## Additional Notes
85
+
86
+ ### Key Structure
87
+
88
+ The Redis storage implementation uses the following key patterns:
89
+
90
+ - Threads: `mastra_threads:id:{threadId}`
91
+ - Messages: `mastra_messages:threadId:{threadId}:id:{messageId}`
92
+ - Message index: `msg-idx:{messageId}` (for fast lookups)
93
+ - Thread messages sorted set: `thread:{threadId}:messages`
94
+ - Workflow snapshots: `mastra_workflow_snapshot:namespace:{ns}:workflow_name:{name}:run_id:{id}`
95
+ - Scores: `mastra_scorers:id:{scoreId}`
96
+ - Resources: `mastra_resources:{resourceId}`
97
+
98
+ ### Redis Sentinel
99
+
100
+ For high-availability deployments using Redis Sentinel, create a custom client:
101
+
102
+ ```typescript
103
+ import { RedisStore } from '@mastra/redis'
104
+ import { createClient } from 'redis'
105
+
106
+ const client = createClient({
107
+ url: 'redis://sentinel-host:26379',
108
+ // Configure sentinel options as needed for your setup
109
+ })
110
+
111
+ await client.connect()
112
+
113
+ const storage = new RedisStore({
114
+ id: 'redis-sentinel-storage',
115
+ client,
116
+ })
117
+ ```
118
+
119
+ ### Redis Cluster
120
+
121
+ For Redis Cluster deployments, use the cluster client:
122
+
123
+ ```typescript
124
+ import { RedisStore } from '@mastra/redis'
125
+ import { createCluster } from 'redis'
126
+
127
+ const cluster = createCluster({
128
+ rootNodes: [
129
+ { url: 'redis://node-1:6379' },
130
+ { url: 'redis://node-2:6379' },
131
+ { url: 'redis://node-3:6379' },
132
+ ],
133
+ })
134
+
135
+ await cluster.connect()
136
+
137
+ const storage = new RedisStore({
138
+ id: 'redis-cluster-storage',
139
+ client: cluster,
140
+ })
141
+ ```
142
+
143
+ ### Accessing the Underlying Client
144
+
145
+ You can access the underlying redis client for custom operations:
146
+
147
+ ```typescript
148
+ const storage = new RedisStore({
149
+ id: 'redis-storage',
150
+ connectionString: 'redis://localhost:6379',
151
+ })
152
+
153
+ await storage.init()
154
+
155
+ const client = storage.getClient()
156
+
157
+ // Custom Redis operations
158
+ await client.set('custom-key', 'value')
159
+ const value = await client.get('custom-key')
160
+ ```
161
+
162
+ ### Closing Connections
163
+
164
+ When shutting down your application, close the Redis connection:
165
+
166
+ ```typescript
167
+ await storage.close()
168
+ ```
169
+
170
+ ## Usage Example
171
+
172
+ ### Adding memory to an agent
173
+
174
+ ```typescript
175
+ import { Memory } from '@mastra/memory'
176
+ import { Agent } from '@mastra/core/agent'
177
+ import { RedisStore } from '@mastra/redis'
178
+
179
+ export const redisAgent = new Agent({
180
+ id: 'redis-agent',
181
+ name: 'Redis Agent',
182
+ instructions:
183
+ 'You are an AI agent with the ability to automatically recall memories from previous interactions.',
184
+ model: 'openai/gpt-4o',
185
+ memory: new Memory({
186
+ storage: new RedisStore({
187
+ id: 'redis-agent-storage',
188
+ connectionString: process.env.REDIS_URL!,
189
+ }),
190
+ options: {
191
+ lastMessages: 10,
192
+ },
193
+ }),
194
+ })
195
+ ```
196
+
197
+ ### Using the agent
198
+
199
+ ```typescript
200
+ import 'dotenv/config'
201
+
202
+ import { mastra } from './mastra'
203
+
204
+ const threadId = '123'
205
+ const resourceId = 'user-456'
206
+
207
+ const agent = mastra.getAgent('redisAgent')
208
+
209
+ const message = await agent.stream('My name is Mastra', {
210
+ memory: {
211
+ thread: threadId,
212
+ resource: resourceId,
213
+ },
214
+ })
215
+
216
+ await message.textStream.pipeTo(new WritableStream())
217
+
218
+ const stream = await agent.stream("What's my name?", {
219
+ memory: {
220
+ thread: threadId,
221
+ resource: resourceId,
222
+ },
223
+ memoryOptions: {
224
+ lastMessages: 5,
225
+ },
226
+ })
227
+
228
+ for await (const chunk of stream.textStream) {
229
+ process.stdout.write(chunk)
230
+ }
231
+ ```
232
+
233
+ ### Using with Mastra instance
234
+
235
+ ```typescript
236
+ import { Mastra } from '@mastra/core'
237
+ import { RedisStore } from '@mastra/redis'
238
+
239
+ const storage = new RedisStore({
240
+ id: 'mastra-storage',
241
+ host: 'localhost',
242
+ port: 6379,
243
+ })
244
+
245
+ const mastra = new Mastra({
246
+ storage, // init() called automatically
247
+ })
248
+ ```
249
+
250
+ If using storage directly without Mastra, call `init()` explicitly:
251
+
252
+ ```typescript
253
+ import { RedisStore } from '@mastra/redis'
254
+
255
+ const storage = new RedisStore({
256
+ id: 'redis-storage',
257
+ host: 'localhost',
258
+ port: 6379,
259
+ })
260
+
261
+ await storage.init()
262
+
263
+ // Access domain-specific stores via getStore()
264
+ const memoryStore = await storage.getStore('memory')
265
+ const thread = await memoryStore?.getThreadById({ threadId: '...' })
266
+ ```
@@ -0,0 +1,307 @@
1
+ # Tavily tools
2
+
3
+ **Added in:** `@mastra/tavily@0.1.0-alpha.0`
4
+
5
+ The `@mastra/tavily` package wraps the [Tavily](https://app.tavily.com) API as Mastra-compatible tools. It exposes factory functions for search, extract, crawl, and map — each returning a tool created with [`createTool()`](https://mastra.ai/reference/tools/create-tool) that includes full Zod input/output schemas.
6
+
7
+ ## Installation
8
+
9
+ **npm**:
10
+
11
+ ```sh
12
+ npm install @mastra/tavily @tavily/core zod
13
+ ```
14
+
15
+ **pnpm**:
16
+
17
+ ```sh
18
+ pnpm add @mastra/tavily @tavily/core zod
19
+ ```
20
+
21
+ **Yarn**:
22
+
23
+ ```sh
24
+ yarn add @mastra/tavily @tavily/core zod
25
+ ```
26
+
27
+ **Bun**:
28
+
29
+ ```sh
30
+ bun add @mastra/tavily @tavily/core zod
31
+ ```
32
+
33
+ ## Quick start
34
+
35
+ Use `createTavilyTools()` to get all four tools with shared configuration:
36
+
37
+ ```typescript
38
+ import { createTavilyTools } from '@mastra/tavily'
39
+
40
+ const tools = createTavilyTools()
41
+ // Or pass an explicit API key:
42
+ // const tools = createTavilyTools({ apiKey: 'tvly-...' })
43
+ ```
44
+
45
+ Each tool can also be created individually:
46
+
47
+ ```typescript
48
+ import { createTavilySearchTool, createTavilyExtractTool } from '@mastra/tavily'
49
+
50
+ const searchTool = createTavilySearchTool()
51
+ const extractTool = createTavilyExtractTool({ apiKey: 'tvly-...' })
52
+ ```
53
+
54
+ By default, all tools read `TAVILY_API_KEY` from the environment. You can pass `{ apiKey }` explicitly to override.
55
+
56
+ ## Configuration
57
+
58
+ All factory functions accept `TavilyClientOptions` from `@tavily/core`:
59
+
60
+ **apiKey** (`string`): Tavily API key. Falls back to the \`TAVILY\_API\_KEY\` environment variable.
61
+
62
+ **clientSource** (`string`): Attribution string sent with each request. (Default: `'mastra'`)
63
+
64
+ **apiBaseURL** (`string`): Base URL for the Tavily API.
65
+
66
+ **proxies** (`object`): Proxy configuration passed to the underlying HTTP client.
67
+
68
+ **projectId** (`string`): Tavily project ID for request scoping.
69
+
70
+ ## `createTavilyTools()`
71
+
72
+ Returns an object containing all four tools with a shared configuration.
73
+
74
+ ```typescript
75
+ import { createTavilyTools } from '@mastra/tavily'
76
+
77
+ const tools = createTavilyTools({ apiKey: 'tvly-...' })
78
+ // tools.tavilySearch, tools.tavilyExtract, tools.tavilyCrawl, tools.tavilyMap
79
+ ```
80
+
81
+ **Returns:** `{ tavilySearch, tavilyExtract, tavilyCrawl, tavilyMap }`
82
+
83
+ ## `createTavilySearchTool()`
84
+
85
+ Creates a tool that searches the web using Tavily. Returns relevant results with content snippets, optional AI-generated answers, and images.
86
+
87
+ **Tool ID:** `tavily-search`
88
+
89
+ ```typescript
90
+ import { createTavilySearchTool } from '@mastra/tavily'
91
+
92
+ const searchTool = createTavilySearchTool()
93
+ ```
94
+
95
+ ### Input
96
+
97
+ **query** (`string`): The search query.
98
+
99
+ **searchDepth** (`'basic' | 'advanced' | 'fast' | 'ultra-fast'`): Search depth. Use 'basic' for standard results, 'advanced' for more thorough results, or 'fast'/'ultra-fast' for low latency.
100
+
101
+ **maxResults** (`number`): Maximum number of results to return (1-20).
102
+
103
+ **includeAnswer** (`boolean | 'basic' | 'advanced'`): Include an AI-generated answer summary.
104
+
105
+ **includeImages** (`boolean`): Include query-related images in the response.
106
+
107
+ **includeImageDescriptions** (`boolean`): Include descriptions for returned images.
108
+
109
+ **includeRawContent** (`false | 'markdown' | 'text'`): Include cleaned HTML content of each result. Pass false to disable, or 'markdown'/'text' for format.
110
+
111
+ **includeDomains** (`string[]`): Restrict results to these domains.
112
+
113
+ **excludeDomains** (`string[]`): Exclude results from these domains.
114
+
115
+ **timeRange** (`'day' | 'week' | 'month' | 'year'`): Filter results by recency.
116
+
117
+ ### Output
118
+
119
+ **query** (`string`): The original search query.
120
+
121
+ **answer** (`string`): AI-generated answer summary.
122
+
123
+ **images** (`{ url: string; description?: string }[]`): Related images.
124
+
125
+ **results** (`SearchResult[]`): Array of search results.
126
+
127
+ **results.title** (`string`): Result title.
128
+
129
+ **results.url** (`string`): Result URL.
130
+
131
+ **results.content** (`string`): Content snippet.
132
+
133
+ **results.score** (`number`): Relevance score.
134
+
135
+ **results.rawContent** (`string`): Full-page content (when requested).
136
+
137
+ **responseTime** (`number`): Server response time in seconds.
138
+
139
+ ## `createTavilyExtractTool()`
140
+
141
+ Creates a tool that extracts content from one or more URLs. Returns raw page content in markdown or text format with up to 20 URLs per request.
142
+
143
+ **Tool ID:** `tavily-extract`
144
+
145
+ ```typescript
146
+ import { createTavilyExtractTool } from '@mastra/tavily'
147
+
148
+ const extractTool = createTavilyExtractTool()
149
+ ```
150
+
151
+ ### Input
152
+
153
+ **urls** (`string[]`): URLs to extract content from (1-20).
154
+
155
+ **extractDepth** (`'basic' | 'advanced'`): Extraction depth. Use 'advanced' to retrieve tables and embedded content.
156
+
157
+ **query** (`string`): User intent for reranking extracted content chunks by relevance.
158
+
159
+ **includeImages** (`boolean`): Include images extracted from the pages.
160
+
161
+ **format** (`'markdown' | 'text'`): Output format for extracted content. (Default: `'markdown'`)
162
+
163
+ ### Output
164
+
165
+ **results** (`ExtractResult[]`): Successfully extracted pages.
166
+
167
+ **results.url** (`string`): Page URL.
168
+
169
+ **results.rawContent** (`string`): Extracted page content.
170
+
171
+ **results.images** (`string[]`): Extracted image URLs.
172
+
173
+ **failedResults** (`FailedResult[]`): URLs that failed extraction.
174
+
175
+ **failedResults.url** (`string`): Failed URL.
176
+
177
+ **failedResults.error** (`string`): Error message.
178
+
179
+ **responseTime** (`number`): Server response time in seconds.
180
+
181
+ ## `createTavilyCrawlTool()`
182
+
183
+ Creates a tool that crawls a website starting from a URL. Extracts content from discovered pages with configurable depth, breadth, and domain constraints.
184
+
185
+ **Tool ID:** `tavily-crawl`
186
+
187
+ ```typescript
188
+ import { createTavilyCrawlTool } from '@mastra/tavily'
189
+
190
+ const crawlTool = createTavilyCrawlTool()
191
+ ```
192
+
193
+ ### Input
194
+
195
+ **url** (`string`): The root URL to begin the crawl.
196
+
197
+ **maxDepth** (`number`): Maximum depth of the crawl from the base URL.
198
+
199
+ **maxBreadth** (`number`): Maximum number of links to follow per page.
200
+
201
+ **limit** (`number`): Total number of pages the crawler processes before stopping.
202
+
203
+ **instructions** (`string`): Natural language instructions for the crawler.
204
+
205
+ **selectPaths** (`string[]`): Regex patterns to select specific URL paths.
206
+
207
+ **selectDomains** (`string[]`): Regex patterns to restrict to specific domains.
208
+
209
+ **excludePaths** (`string[]`): Regex patterns to exclude specific URL paths.
210
+
211
+ **excludeDomains** (`string[]`): Regex patterns to exclude specific domains.
212
+
213
+ **allowExternal** (`boolean`): Whether to follow links to external domains.
214
+
215
+ **extractDepth** (`'basic' | 'advanced'`): Extraction depth. Use 'advanced' to retrieve tables and embedded content.
216
+
217
+ **includeImages** (`boolean`): Include images from crawled pages.
218
+
219
+ **format** (`'markdown' | 'text'`): Output format for extracted content. (Default: `'markdown'`)
220
+
221
+ ### Output
222
+
223
+ **baseUrl** (`string`): The root URL that was crawled.
224
+
225
+ **results** (`CrawlResult[]`): Content extracted from discovered pages.
226
+
227
+ **results.url** (`string`): Page URL.
228
+
229
+ **results.rawContent** (`string`): Extracted page content.
230
+
231
+ **results.images** (`string[]`): Image URLs found on the page.
232
+
233
+ **responseTime** (`number`): Server response time in seconds.
234
+
235
+ ## `createTavilyMapTool()`
236
+
237
+ Creates a tool that maps a website's structure starting from a URL. Discovers and returns a list of URLs without extracting page content. Use this to understand site structure before targeted extraction.
238
+
239
+ **Tool ID:** `tavily-map`
240
+
241
+ ```typescript
242
+ import { createTavilyMapTool } from '@mastra/tavily'
243
+
244
+ const mapTool = createTavilyMapTool()
245
+ ```
246
+
247
+ ### Input
248
+
249
+ **url** (`string`): The root URL to begin mapping.
250
+
251
+ **maxDepth** (`number`): Maximum depth of the mapping from the base URL.
252
+
253
+ **maxBreadth** (`number`): Maximum number of links to follow per page.
254
+
255
+ **limit** (`number`): Total number of links the mapper processes before stopping.
256
+
257
+ **instructions** (`string`): Natural language instructions for the mapper.
258
+
259
+ **selectPaths** (`string[]`): Regex patterns to select specific URL paths.
260
+
261
+ **selectDomains** (`string[]`): Regex patterns to restrict to specific domains.
262
+
263
+ **excludePaths** (`string[]`): Regex patterns to exclude specific URL paths.
264
+
265
+ **excludeDomains** (`string[]`): Regex patterns to exclude specific domains.
266
+
267
+ **allowExternal** (`boolean`): Whether to include external domain links.
268
+
269
+ ### Output
270
+
271
+ **baseUrl** (`string`): The root URL that was mapped.
272
+
273
+ **results** (`string[]`): Discovered URLs.
274
+
275
+ **responseTime** (`number`): Server response time in seconds.
276
+
277
+ ## Agent example
278
+
279
+ The following example demonstrates a research agent that combines search and extract:
280
+
281
+ ```typescript
282
+ import { Agent } from '@mastra/core/agent'
283
+ import { createTavilySearchTool, createTavilyExtractTool } from '@mastra/tavily'
284
+
285
+ const agent = new Agent({
286
+ id: 'web-search-agent',
287
+ name: 'Web Search Agent',
288
+ model: 'anthropic/claude-sonnet-4-6',
289
+ instructions:
290
+ 'You are a web search assistant. Use search tool to find relevant pages, then use extract tool to get full content from the best results.',
291
+ tools: {
292
+ search: createTavilySearchTool(),
293
+ extract: createTavilyExtractTool(),
294
+ },
295
+ })
296
+ ```
297
+
298
+ ## Environment variables
299
+
300
+ | Variable | Description |
301
+ | ---------------- | ------------------------------------------------------------------------------------------- |
302
+ | `TAVILY_API_KEY` | Your Tavily API key. Used as the default when `apiKey` is not passed to a factory function. |
303
+
304
+ ## Related
305
+
306
+ - [`createTool()`](https://mastra.ai/reference/tools/create-tool)
307
+ - [Tavily API documentation](https://docs.tavily.com)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.26-alpha.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`a371ac5`](https://github.com/mastra-ai/mastra/commit/a371ac534aa1bb368a1acf9d8b313378dfdc787e), [`47cee3e`](https://github.com/mastra-ai/mastra/commit/47cee3e137fe39109cf7fffd2a8cf47b76dc702e), [`c80dc16`](https://github.com/mastra-ai/mastra/commit/c80dc16e113e6cc159f510ffde501ad4711b2189), [`47cee3e`](https://github.com/mastra-ai/mastra/commit/47cee3e137fe39109cf7fffd2a8cf47b76dc702e)]:
8
+ - @mastra/core@1.26.0-alpha.12
9
+
3
10
  ## 1.1.26-alpha.21
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.26-alpha.22",
3
+ "version": "1.1.26-alpha.23",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,8 +29,8 @@
29
29
  "jsdom": "^26.1.0",
30
30
  "local-pkg": "^1.1.2",
31
31
  "zod": "^4.3.6",
32
- "@mastra/core": "1.26.0-alpha.11",
33
- "@mastra/mcp": "^1.5.1-alpha.1"
32
+ "@mastra/mcp": "^1.5.1-alpha.1",
33
+ "@mastra/core": "1.26.0-alpha.12"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@hono/node-server": "^1.19.11",
@@ -46,9 +46,9 @@
46
46
  "tsx": "^4.21.0",
47
47
  "typescript": "^5.9.3",
48
48
  "vitest": "4.1.4",
49
- "@internal/types-builder": "0.0.58",
50
49
  "@internal/lint": "0.0.83",
51
- "@mastra/core": "1.26.0-alpha.11"
50
+ "@internal/types-builder": "0.0.58",
51
+ "@mastra/core": "1.26.0-alpha.12"
52
52
  },
53
53
  "homepage": "https://mastra.ai",
54
54
  "repository": {