@mastra/mcp-docs-server 1.2.12-alpha.4 → 1.2.12

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.
@@ -9,14 +9,14 @@ Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
9
9
  ## Usage
10
10
 
11
11
  ```typescript
12
- import { Agent } from '@mastra/core/agent'
12
+ import { Agent } from "@mastra/core/agent";
13
13
 
14
14
  const agent = new Agent({
15
- id: 'my-agent',
16
- name: 'My Agent',
17
- instructions: 'You are a helpful assistant',
18
- model: 'openrouter/ai21/jamba-large-1.7',
19
- })
15
+ id: "my-agent",
16
+ name: "My Agent",
17
+ instructions: "You are a helpful assistant",
18
+ model: "openrouter/ai21/jamba-large-1.7"
19
+ });
20
20
  ```
21
21
 
22
22
  > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [OpenRouter documentation](https://openrouter.ai/models) for details.
@@ -9,14 +9,14 @@ Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-pro
9
9
  ## Usage
10
10
 
11
11
  ```typescript
12
- import { Agent } from '@mastra/core/agent'
12
+ import { Agent } from "@mastra/core/agent";
13
13
 
14
14
  const agent = new Agent({
15
- id: 'my-agent',
16
- name: 'My Agent',
17
- instructions: 'You are a helpful assistant',
18
- model: 'vercel/alibaba/qwen-3-14b',
19
- })
15
+ id: "my-agent",
16
+ name: "My Agent",
17
+ instructions: "You are a helpful assistant",
18
+ model: "vercel/alibaba/qwen-3-14b"
19
+ });
20
20
  ```
21
21
 
22
22
  > **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers) for details.
@@ -23,65 +23,65 @@ Mastra reads the relevant environment variable (e.g. `ANTHROPIC_API_KEY`) and ro
23
23
  **OpenAI**:
24
24
 
25
25
  ```typescript
26
- import { Agent } from '@mastra/core/agent'
26
+ import { Agent } from "@mastra/core/agent";
27
27
 
28
28
  const agent = new Agent({
29
- id: 'my-agent',
30
- name: 'My Agent',
31
- instructions: 'You are a helpful assistant',
32
- model: 'openai/gpt-5.6-sol',
29
+ id: "my-agent",
30
+ name: "My Agent",
31
+ instructions: "You are a helpful assistant",
32
+ model: "openai/gpt-5.6-sol"
33
33
  })
34
34
  ```
35
35
 
36
36
  **Anthropic**:
37
37
 
38
38
  ```typescript
39
- import { Agent } from '@mastra/core/agent'
39
+ import { Agent } from "@mastra/core/agent";
40
40
 
41
41
  const agent = new Agent({
42
- id: 'my-agent',
43
- name: 'My Agent',
44
- instructions: 'You are a helpful assistant',
45
- model: 'anthropic/claude-sonnet-4-6',
42
+ id: "my-agent",
43
+ name: "My Agent",
44
+ instructions: "You are a helpful assistant",
45
+ model: "anthropic/claude-sonnet-4-6"
46
46
  })
47
47
  ```
48
48
 
49
49
  **Google Gemini**:
50
50
 
51
51
  ```typescript
52
- import { Agent } from '@mastra/core/agent'
52
+ import { Agent } from "@mastra/core/agent";
53
53
 
54
54
  const agent = new Agent({
55
- id: 'my-agent',
56
- name: 'My Agent',
57
- instructions: 'You are a helpful assistant',
58
- model: 'google/gemini-2.5-flash',
55
+ id: "my-agent",
56
+ name: "My Agent",
57
+ instructions: "You are a helpful assistant",
58
+ model: "google/gemini-2.5-flash"
59
59
  })
60
60
  ```
61
61
 
62
62
  **xAI**:
63
63
 
64
64
  ```typescript
65
- import { Agent } from '@mastra/core/agent'
65
+ import { Agent } from "@mastra/core/agent";
66
66
 
67
67
  const agent = new Agent({
68
- id: 'my-agent',
69
- name: 'My Agent',
70
- instructions: 'You are a helpful assistant',
71
- model: 'xai/grok-4.3',
68
+ id: "my-agent",
69
+ name: "My Agent",
70
+ instructions: "You are a helpful assistant",
71
+ model: "xai/grok-4.3"
72
72
  })
73
73
  ```
74
74
 
75
75
  **OpenRouter**:
76
76
 
77
77
  ```typescript
78
- import { Agent } from '@mastra/core/agent'
78
+ import { Agent } from "@mastra/core/agent";
79
79
 
80
80
  const agent = new Agent({
81
- id: 'my-agent',
82
- name: 'My Agent',
83
- instructions: 'You are a helpful assistant',
84
- model: 'openrouter/anthropic/claude-haiku-4.5',
81
+ id: "my-agent",
82
+ name: "My Agent",
83
+ instructions: "You are a helpful assistant",
84
+ model: "openrouter/anthropic/claude-haiku-4.5"
85
85
  })
86
86
  ```
87
87
 
@@ -103,22 +103,22 @@ Alternatively, browse and test models in [Studio](https://mastra.ai/docs/studio/
103
103
  Some models are faster but less capable, while others offer larger context windows or stronger reasoning skills. Use different models from the same provider, or mix and match across providers to fit each task.
104
104
 
105
105
  ```typescript
106
- import { Agent } from '@mastra/core/agent'
106
+ import { Agent } from "@mastra/core/agent";
107
107
 
108
108
  // Use a cost-effective model for document processing
109
109
  const documentProcessor = new Agent({
110
- id: 'document-processor',
111
- name: 'Document Processor',
112
- instructions: 'Extract and summarize key information from documents',
113
- model: 'openai/gpt-5.6-sol',
110
+ id: "document-processor",
111
+ name: "Document Processor",
112
+ instructions: "Extract and summarize key information from documents",
113
+ model: "openai/gpt-5.6-sol"
114
114
  })
115
115
 
116
116
  // Use a powerful reasoning model for complex analysis
117
117
  const reasoningAgent = new Agent({
118
- id: 'reasoning-agent',
119
- name: 'Reasoning Agent',
120
- instructions: 'Analyze data and provide strategic recommendations',
121
- model: 'anthropic/claude-opus-4-7',
118
+ id: "reasoning-agent",
119
+ name: "Reasoning Agent",
120
+ instructions: "Analyze data and provide strategic recommendations",
121
+ model: "anthropic/claude-opus-4-7"
122
122
  })
123
123
  ```
124
124
 
@@ -128,14 +128,14 @@ Since models are just strings, you can select them dynamically based on [request
128
128
 
129
129
  ```typescript
130
130
  const agent = new Agent({
131
- id: 'dynamic-assistant',
132
- name: 'Dynamic Assistant',
131
+ id: "dynamic-assistant",
132
+ name: "Dynamic Assistant",
133
133
  model: ({ requestContext }) => {
134
- const provider = requestContext.get('provider-id')
135
- const model = requestContext.get('model-id')
136
- return `${provider}/${model}`
134
+ const provider = requestContext.get("provider-id");
135
+ const model = requestContext.get("model-id");
136
+ return `${provider}/${model}`;
137
137
  },
138
- })
138
+ });
139
139
  ```
140
140
 
141
141
  This enables powerful patterns:
@@ -151,30 +151,31 @@ Different model providers expose their own configuration options. With OpenAI, y
151
151
  ```typescript
152
152
  // Agent level (apply to all future messages)
153
153
  const planner = new Agent({
154
- id: 'planner',
155
- name: 'Planner',
154
+ id: "planner",
155
+ name: "Planner",
156
156
  instructions: {
157
- role: 'system',
158
- content: 'You are a helpful assistant.',
157
+ role: "system",
158
+ content: "You are a helpful assistant.",
159
159
  providerOptions: {
160
- openai: { reasoningEffort: 'low' },
161
- },
160
+ openai: { reasoningEffort: "low" }
161
+ }
162
162
  },
163
- model: 'openai/gpt-5.6-sol',
164
- })
163
+ model: "openai/gpt-5.6-sol",
164
+ });
165
165
 
166
- const lowEffort = await planner.generate('Plan a simple 3 item dinner menu')
166
+ const lowEffort =
167
+ await planner.generate("Plan a simple 3 item dinner menu");
167
168
 
168
169
  // Message level (apply only to this message)
169
170
  const highEffort = await planner.generate([
170
171
  {
171
- role: 'user',
172
- content: 'Plan a simple 3 item dinner menu for a celiac',
172
+ role: "user",
173
+ content: "Plan a simple 3 item dinner menu for a celiac",
173
174
  providerOptions: {
174
- openai: { reasoningEffort: 'high' },
175
- },
176
- },
177
- ])
175
+ openai: { reasoningEffort: "high" }
176
+ }
177
+ }
178
+ ]);
178
179
  ```
179
180
 
180
181
  ## Custom headers
@@ -183,16 +184,16 @@ If you need to specify custom headers, such as an organization ID or other provi
183
184
 
184
185
  ```typescript
185
186
  const agent = new Agent({
186
- id: 'custom-agent',
187
- name: 'Custom Agent',
187
+ id: "custom-agent",
188
+ name: "Custom Agent",
188
189
  model: {
189
- id: 'openai/gpt-5.6-sol',
190
+ id: "openai/gpt-5.6-sol",
190
191
  apiKey: process.env.OPENAI_API_KEY,
191
192
  headers: {
192
- 'OpenAI-Organization': 'org-abc123',
193
- },
194
- },
195
- })
193
+ "OpenAI-Organization": "org-abc123"
194
+ }
195
+ }
196
+ });
196
197
  ```
197
198
 
198
199
  > **Info:** Configuration differs by provider. See the provider pages in the left navigation for details on custom headers.
@@ -202,7 +203,7 @@ const agent = new Agent({
202
203
  Relying on a single model creates a single point of failure for your application. Model fallbacks provide automatic failover between models and providers. If the primary model becomes unavailable, requests are retried against the next configured fallback until one succeeds.
203
204
 
204
205
  ```typescript
205
- import { Agent } from '@mastra/core/agent'
206
+ import { Agent } from '@mastra/core/agent';
206
207
 
207
208
  const agent = new Agent({
208
209
  id: 'resilient-assistant',
@@ -210,19 +211,19 @@ const agent = new Agent({
210
211
  instructions: 'You are a helpful assistant.',
211
212
  model: [
212
213
  {
213
- model: 'openai/gpt-5.6-sol',
214
+ model: "openai/gpt-5.6-sol",
214
215
  maxRetries: 3,
215
216
  },
216
217
  {
217
- model: 'anthropic/claude-sonnet-4-6',
218
+ model: "anthropic/claude-sonnet-4-6",
218
219
  maxRetries: 2,
219
220
  },
220
221
  {
221
- model: 'google/gemini-2.5-pro',
222
+ model: "google/gemini-2.5-pro",
222
223
  maxRetries: 2,
223
224
  },
224
225
  ],
225
- })
226
+ });
226
227
  ```
227
228
 
228
229
  Mastra tries your primary model first. If it encounters a 500 error, rate limit, or timeout, it automatically switches to your first fallback. If that fails too, it moves to the next. Each model gets its own retry count before moving on.
@@ -234,7 +235,7 @@ Your users never experience the disruption - the response comes back with the sa
234
235
  Each fallback entry can carry its own `modelSettings`, `providerOptions`, and `headers` — useful when models in the chain need different temperatures or provider-specific knobs to produce comparable output.
235
236
 
236
237
  ```typescript
237
- import { Agent } from '@mastra/core/agent'
238
+ import { Agent } from '@mastra/core/agent';
238
239
 
239
240
  const agent = new Agent({
240
241
  id: 'tuned-resilient',
@@ -254,7 +255,7 @@ const agent = new Agent({
254
255
  providerOptions: { openai: { reasoningEffort: 'low' } },
255
256
  },
256
257
  ],
257
- })
258
+ });
258
259
  ```
259
260
 
260
261
  **Precedence:**
@@ -277,32 +278,32 @@ Use `gateway/provider/model` when the remote behaves like a model gateway and th
277
278
  For the `url` it's **important** that you use the base URL of the OpenAI-compatible endpoint with Mastra's `model` setting and not the individual chat endpoints.
278
279
 
279
280
  ```typescript
280
- import { Agent } from '@mastra/core/agent'
281
+ import { Agent } from "@mastra/core/agent";
281
282
 
282
283
  const agent = new Agent({
283
- id: 'my-agent',
284
- name: 'My Agent',
285
- instructions: 'You are a helpful assistant',
284
+ id: "my-agent",
285
+ name: "My Agent",
286
+ instructions: "You are a helpful assistant",
286
287
  model: {
287
- id: 'custom/my-qwen3-model',
288
- url: 'http://your-custom-openai-compatible-endpoint.com/v1',
289
- },
288
+ id: "custom/my-qwen3-model",
289
+ url: "http://your-custom-openai-compatible-endpoint.com/v1"
290
+ }
290
291
  })
291
292
  ```
292
293
 
293
294
  If the remote behaves like a model gateway, include the gateway prefix in `id`:
294
295
 
295
296
  ```typescript
296
- import { Agent } from '@mastra/core/agent'
297
+ import { Agent } from "@mastra/core/agent";
297
298
 
298
299
  const agent = new Agent({
299
- id: 'my-agent',
300
- name: 'My Agent',
301
- instructions: 'You are a helpful assistant',
300
+ id: "my-agent",
301
+ name: "My Agent",
302
+ instructions: "You are a helpful assistant",
302
303
  model: {
303
- id: 'mastra/google/gemini-2.5-flash',
304
- url: 'http://your-custom-openai-compatible-endpoint.com/v1',
305
- },
304
+ id: "mastra/google/gemini-2.5-flash",
305
+ url: "http://your-custom-openai-compatible-endpoint.com/v1"
306
+ }
306
307
  })
307
308
  ```
308
309
 
@@ -311,16 +312,16 @@ const agent = new Agent({
311
312
  After starting the LMStudio server, the local server is available at `http://localhost:1234` and it provides endpoints like `/v1/models`, `/v1/chat/completions`, etc. The `url` will be `http://localhost:1234/v1`. For the `id` you can use (`lmstudio/${modelId}`) which will be displayed in the LMStudio interface.
312
313
 
313
314
  ```typescript
314
- import { Agent } from '@mastra/core/agent'
315
+ import { Agent } from "@mastra/core/agent";
315
316
 
316
317
  const agent = new Agent({
317
- id: 'my-agent',
318
- name: 'My Agent',
319
- instructions: 'You are a helpful assistant',
318
+ id: "my-agent",
319
+ name: "My Agent",
320
+ instructions: "You are a helpful assistant",
320
321
  model: {
321
- id: 'lmstudio/qwen/qwen3-30b-a3b-2507',
322
- url: 'http://localhost:1234/v1',
323
- },
322
+ id: "lmstudio/qwen/qwen3-30b-a3b-2507",
323
+ url: "http://localhost:1234/v1"
324
+ }
324
325
  })
325
326
  ```
326
327
 
@@ -329,13 +330,13 @@ const agent = new Agent({
329
330
  Mastra supports AI SDK provider modules, should you need to use them directly.
330
331
 
331
332
  ```typescript
332
- import { groq } from '@ai-sdk/groq'
333
- import { Agent } from '@mastra/core/agent'
333
+ import { groq } from '@ai-sdk/groq';
334
+ import { Agent } from "@mastra/core/agent";
334
335
 
335
336
  const agent = new Agent({
336
- id: 'my-agent',
337
- name: 'My Agent',
338
- model: groq('gemma2-9b-it'),
337
+ id: "my-agent",
338
+ name: "My Agent",
339
+ model: groq('gemma2-9b-it')
339
340
  })
340
341
  ```
341
342
 
@@ -11,22 +11,22 @@ BASETEN_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'baseten/MiniMaxAI/MiniMax-M2.5',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "baseten/MiniMaxAI/MiniMax-M2.5"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -57,28 +57,30 @@ for await (const chunk of stream) {
57
57
 
58
58
  ```typescript
59
59
  const agent = new Agent({
60
- id: 'custom-agent',
61
- name: 'custom-agent',
60
+ id: "custom-agent",
61
+ name: "custom-agent",
62
62
  model: {
63
- url: 'https://inference.baseten.co/v1',
64
- id: 'baseten/MiniMaxAI/MiniMax-M2.5',
63
+ url: "https://inference.baseten.co/v1",
64
+ id: "baseten/MiniMaxAI/MiniMax-M2.5",
65
65
  apiKey: process.env.BASETEN_API_KEY,
66
66
  headers: {
67
- 'X-Custom-Header': 'value',
68
- },
69
- },
70
- })
67
+ "X-Custom-Header": "value"
68
+ }
69
+ }
70
+ });
71
71
  ```
72
72
 
73
73
  ### Dynamic model selection
74
74
 
75
75
  ```typescript
76
76
  const agent = new Agent({
77
- id: 'dynamic-agent',
78
- name: 'Dynamic Agent',
77
+ id: "dynamic-agent",
78
+ name: "Dynamic Agent",
79
79
  model: ({ requestContext }) => {
80
- const useAdvanced = requestContext.task === 'complex'
81
- return useAdvanced ? 'baseten/zai-org/GLM-5.2-Fast' : 'baseten/MiniMaxAI/MiniMax-M2.5'
82
- },
83
- })
80
+ const useAdvanced = requestContext.task === "complex";
81
+ return useAdvanced
82
+ ? "baseten/zai-org/GLM-5.2-Fast"
83
+ : "baseten/MiniMaxAI/MiniMax-M2.5";
84
+ }
85
+ });
84
86
  ```
@@ -11,22 +11,22 @@ CHUTES_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'chutes/MiniMaxAI/MiniMax-M2.5-TEE',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "chutes/MiniMaxAI/MiniMax-M2.5-TEE"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -58,28 +58,30 @@ for await (const chunk of stream) {
58
58
 
59
59
  ```typescript
60
60
  const agent = new Agent({
61
- id: 'custom-agent',
62
- name: 'custom-agent',
61
+ id: "custom-agent",
62
+ name: "custom-agent",
63
63
  model: {
64
- url: 'https://llm.chutes.ai/v1',
65
- id: 'chutes/MiniMaxAI/MiniMax-M2.5-TEE',
64
+ url: "https://llm.chutes.ai/v1",
65
+ id: "chutes/MiniMaxAI/MiniMax-M2.5-TEE",
66
66
  apiKey: process.env.CHUTES_API_KEY,
67
67
  headers: {
68
- 'X-Custom-Header': 'value',
69
- },
70
- },
71
- })
68
+ "X-Custom-Header": "value"
69
+ }
70
+ }
71
+ });
72
72
  ```
73
73
 
74
74
  ### Dynamic model selection
75
75
 
76
76
  ```typescript
77
77
  const agent = new Agent({
78
- id: 'dynamic-agent',
79
- name: 'Dynamic Agent',
78
+ id: "dynamic-agent",
79
+ name: "Dynamic Agent",
80
80
  model: ({ requestContext }) => {
81
- const useAdvanced = requestContext.task === 'complex'
82
- return useAdvanced ? 'chutes/zai-org/GLM-5.2-TEE' : 'chutes/MiniMaxAI/MiniMax-M2.5-TEE'
83
- },
84
- })
81
+ const useAdvanced = requestContext.task === "complex";
82
+ return useAdvanced
83
+ ? "chutes/zai-org/GLM-5.2-TEE"
84
+ : "chutes/MiniMaxAI/MiniMax-M2.5-TEE";
85
+ }
86
+ });
85
87
  ```
@@ -11,22 +11,22 @@ CROSSMODEL_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'crossmodel/anthropic/claude-fable-5',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "crossmodel/anthropic/claude-fable-5"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -89,28 +89,30 @@ for await (const chunk of stream) {
89
89
 
90
90
  ```typescript
91
91
  const agent = new Agent({
92
- id: 'custom-agent',
93
- name: 'custom-agent',
92
+ id: "custom-agent",
93
+ name: "custom-agent",
94
94
  model: {
95
- url: 'https://api.crossmodel.ai/v1',
96
- id: 'crossmodel/anthropic/claude-fable-5',
95
+ url: "https://api.crossmodel.ai/v1",
96
+ id: "crossmodel/anthropic/claude-fable-5",
97
97
  apiKey: process.env.CROSSMODEL_API_KEY,
98
98
  headers: {
99
- 'X-Custom-Header': 'value',
100
- },
101
- },
102
- })
99
+ "X-Custom-Header": "value"
100
+ }
101
+ }
102
+ });
103
103
  ```
104
104
 
105
105
  ### Dynamic model selection
106
106
 
107
107
  ```typescript
108
108
  const agent = new Agent({
109
- id: 'dynamic-agent',
110
- name: 'Dynamic Agent',
109
+ id: "dynamic-agent",
110
+ name: "Dynamic Agent",
111
111
  model: ({ requestContext }) => {
112
- const useAdvanced = requestContext.task === 'complex'
113
- return useAdvanced ? 'crossmodel/z-ai/glm-5.2' : 'crossmodel/anthropic/claude-fable-5'
114
- },
115
- })
112
+ const useAdvanced = requestContext.task === "complex";
113
+ return useAdvanced
114
+ ? "crossmodel/z-ai/glm-5.2"
115
+ : "crossmodel/anthropic/claude-fable-5";
116
+ }
117
+ });
116
118
  ```
@@ -11,22 +11,22 @@ DEEPINFRA_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'deepinfra/MiniMaxAI/MiniMax-M2.5',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "deepinfra/MiniMaxAI/MiniMax-M2.5"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -79,29 +79,31 @@ for await (const chunk of stream) {
79
79
 
80
80
  ```typescript
81
81
  const agent = new Agent({
82
- id: 'custom-agent',
83
- name: 'custom-agent',
82
+ id: "custom-agent",
83
+ name: "custom-agent",
84
84
  model: {
85
- id: 'deepinfra/MiniMaxAI/MiniMax-M2.5',
85
+ id: "deepinfra/MiniMaxAI/MiniMax-M2.5",
86
86
  apiKey: process.env.DEEPINFRA_API_KEY,
87
87
  headers: {
88
- 'X-Custom-Header': 'value',
89
- },
90
- },
91
- })
88
+ "X-Custom-Header": "value"
89
+ }
90
+ }
91
+ });
92
92
  ```
93
93
 
94
94
  ### Dynamic model selection
95
95
 
96
96
  ```typescript
97
97
  const agent = new Agent({
98
- id: 'dynamic-agent',
99
- name: 'Dynamic Agent',
98
+ id: "dynamic-agent",
99
+ name: "Dynamic Agent",
100
100
  model: ({ requestContext }) => {
101
- const useAdvanced = requestContext.task === 'complex'
102
- return useAdvanced ? 'deepinfra/zai-org/GLM-5.2' : 'deepinfra/MiniMaxAI/MiniMax-M2.5'
103
- },
104
- })
101
+ const useAdvanced = requestContext.task === "complex";
102
+ return useAdvanced
103
+ ? "deepinfra/zai-org/GLM-5.2"
104
+ : "deepinfra/MiniMaxAI/MiniMax-M2.5";
105
+ }
106
+ });
105
107
  ```
106
108
 
107
109
  ## Direct provider installation
@@ -11,22 +11,22 @@ HYPER_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'hyper/deepseek-v4-flash',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "hyper/deepseek-v4-flash"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -63,28 +63,30 @@ for await (const chunk of stream) {
63
63
 
64
64
  ```typescript
65
65
  const agent = new Agent({
66
- id: 'custom-agent',
67
- name: 'custom-agent',
66
+ id: "custom-agent",
67
+ name: "custom-agent",
68
68
  model: {
69
- url: 'https://hyper.charm.land/v1',
70
- id: 'hyper/deepseek-v4-flash',
69
+ url: "https://hyper.charm.land/v1",
70
+ id: "hyper/deepseek-v4-flash",
71
71
  apiKey: process.env.HYPER_API_KEY,
72
72
  headers: {
73
- 'X-Custom-Header': 'value',
74
- },
75
- },
76
- })
73
+ "X-Custom-Header": "value"
74
+ }
75
+ }
76
+ });
77
77
  ```
78
78
 
79
79
  ### Dynamic model selection
80
80
 
81
81
  ```typescript
82
82
  const agent = new Agent({
83
- id: 'dynamic-agent',
84
- name: 'Dynamic Agent',
83
+ id: "dynamic-agent",
84
+ name: "Dynamic Agent",
85
85
  model: ({ requestContext }) => {
86
- const useAdvanced = requestContext.task === 'complex'
87
- return useAdvanced ? 'hyper/qwen3.7-plus' : 'hyper/deepseek-v4-flash'
88
- },
89
- })
86
+ const useAdvanced = requestContext.task === "complex";
87
+ return useAdvanced
88
+ ? "hyper/qwen3.7-plus"
89
+ : "hyper/deepseek-v4-flash";
90
+ }
91
+ });
90
92
  ```
@@ -11,22 +11,22 @@ LLMGATEWAY_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'llmgateway/auto',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "llmgateway/auto"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -228,28 +228,30 @@ for await (const chunk of stream) {
228
228
 
229
229
  ```typescript
230
230
  const agent = new Agent({
231
- id: 'custom-agent',
232
- name: 'custom-agent',
231
+ id: "custom-agent",
232
+ name: "custom-agent",
233
233
  model: {
234
- url: 'https://api.llmgateway.io/v1',
235
- id: 'llmgateway/auto',
234
+ url: "https://api.llmgateway.io/v1",
235
+ id: "llmgateway/auto",
236
236
  apiKey: process.env.LLMGATEWAY_API_KEY,
237
237
  headers: {
238
- 'X-Custom-Header': 'value',
239
- },
240
- },
241
- })
238
+ "X-Custom-Header": "value"
239
+ }
240
+ }
241
+ });
242
242
  ```
243
243
 
244
244
  ### Dynamic model selection
245
245
 
246
246
  ```typescript
247
247
  const agent = new Agent({
248
- id: 'dynamic-agent',
249
- name: 'Dynamic Agent',
248
+ id: "dynamic-agent",
249
+ name: "Dynamic Agent",
250
250
  model: ({ requestContext }) => {
251
- const useAdvanced = requestContext.task === 'complex'
252
- return useAdvanced ? 'llmgateway/sonar-reasoning-pro' : 'llmgateway/auto'
253
- },
254
- })
251
+ const useAdvanced = requestContext.task === "complex";
252
+ return useAdvanced
253
+ ? "llmgateway/sonar-reasoning-pro"
254
+ : "llmgateway/auto";
255
+ }
256
+ });
255
257
  ```
@@ -11,22 +11,22 @@ WANDB_API_KEY=your-api-key
11
11
  ```
12
12
 
13
13
  ```typescript
14
- import { Agent } from '@mastra/core/agent'
14
+ import { Agent } from "@mastra/core/agent";
15
15
 
16
16
  const agent = new Agent({
17
- id: 'my-agent',
18
- name: 'My Agent',
19
- instructions: 'You are a helpful assistant',
20
- model: 'wandb/JetBrains/Mellum2-12B-A2.5B-Instruct',
21
- })
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct"
21
+ });
22
22
 
23
23
  // Generate a response
24
- const response = await agent.generate('Hello!')
24
+ const response = await agent.generate("Hello!");
25
25
 
26
26
  // Stream a response
27
- const stream = await agent.stream('Tell me a story')
27
+ const stream = await agent.stream("Tell me a story");
28
28
  for await (const chunk of stream) {
29
- console.log(chunk)
29
+ console.log(chunk);
30
30
  }
31
31
  ```
32
32
 
@@ -70,28 +70,30 @@ for await (const chunk of stream) {
70
70
 
71
71
  ```typescript
72
72
  const agent = new Agent({
73
- id: 'custom-agent',
74
- name: 'custom-agent',
73
+ id: "custom-agent",
74
+ name: "custom-agent",
75
75
  model: {
76
- url: 'https://api.inference.wandb.ai/v1',
77
- id: 'wandb/JetBrains/Mellum2-12B-A2.5B-Instruct',
76
+ url: "https://api.inference.wandb.ai/v1",
77
+ id: "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct",
78
78
  apiKey: process.env.WANDB_API_KEY,
79
79
  headers: {
80
- 'X-Custom-Header': 'value',
81
- },
82
- },
83
- })
80
+ "X-Custom-Header": "value"
81
+ }
82
+ }
83
+ });
84
84
  ```
85
85
 
86
86
  ### Dynamic model selection
87
87
 
88
88
  ```typescript
89
89
  const agent = new Agent({
90
- id: 'dynamic-agent',
91
- name: 'Dynamic Agent',
90
+ id: "dynamic-agent",
91
+ name: "Dynamic Agent",
92
92
  model: ({ requestContext }) => {
93
- const useAdvanced = requestContext.task === 'complex'
94
- return useAdvanced ? 'wandb/zai-org/GLM-5.2' : 'wandb/JetBrains/Mellum2-12B-A2.5B-Instruct'
95
- },
96
- })
93
+ const useAdvanced = requestContext.task === "complex";
94
+ return useAdvanced
95
+ ? "wandb/zai-org/GLM-5.2"
96
+ : "wandb/JetBrains/Mellum2-12B-A2.5B-Instruct";
97
+ }
98
+ });
97
99
  ```
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`3f472b4`](https://github.com/mastra-ai/mastra/commit/3f472b468892a1ff14ccb43cc0343b86f7d8fd7d), [`ba369f2`](https://github.com/mastra-ai/mastra/commit/ba369f2a0aaf998da0d6aa033d26f64f96bef8ac), [`35b929b`](https://github.com/mastra-ai/mastra/commit/35b929b7abc3d20d85c7985880960ac2d04a6c86), [`55c9e24`](https://github.com/mastra-ai/mastra/commit/55c9e248c27c1d72b5bb7e94ea6b8a3999eee49f), [`dcfed93`](https://github.com/mastra-ai/mastra/commit/dcfed93e1e256c6abfa792cbb7ca836f5d0e8638), [`2876e15`](https://github.com/mastra-ai/mastra/commit/2876e15b4d2f616a3bc1ed3af57d546c268384ce), [`9b3626a`](https://github.com/mastra-ai/mastra/commit/9b3626aeb1d16fcd34b0a8e94c114ddb80a3b240), [`4696963`](https://github.com/mastra-ai/mastra/commit/469696312ac4c618bc8475b0c5ed7949b8a3455e), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`07f5b4b`](https://github.com/mastra-ai/mastra/commit/07f5b4ba9d608d88865030732e580298296adf99), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`598080f`](https://github.com/mastra-ai/mastra/commit/598080f224edb3f0f5b801035b067fac50a56a03)]:
8
+ - @mastra/core@1.55.0
9
+
3
10
  ## 1.2.12-alpha.4
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.12-alpha.4",
3
+ "version": "1.2.12",
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/core": "1.55.0-alpha.3",
32
- "@mastra/mcp": "^1.15.0"
31
+ "@mastra/mcp": "^1.15.0",
32
+ "@mastra/core": "1.55.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^1.19.14",
@@ -45,9 +45,9 @@
45
45
  "tsx": "^4.23.1",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "4.1.10",
48
- "@internal/types-builder": "0.0.93",
49
- "@mastra/core": "1.55.0-alpha.3",
50
- "@internal/lint": "0.0.118"
48
+ "@internal/lint": "0.0.119",
49
+ "@internal/types-builder": "0.0.94",
50
+ "@mastra/core": "1.55.0"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {