@mastra/mcp-docs-server 1.1.36-alpha.1 → 1.1.36-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.
- package/.docs/docs/agents/a2a.md +235 -0
- package/.docs/docs/agents/response-caching.md +11 -11
- package/.docs/docs/agents/signals.md +1 -1
- package/.docs/docs/server/mastra-client.md +1 -0
- package/.docs/docs/server/mastra-server.md +2 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/auriko.md +85 -0
- package/.docs/models/providers.md +1 -0
- package/CHANGELOG.md +7 -0
- package/package.json +5 -5
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# A2A (Agent-to-Agent)
|
|
2
|
+
|
|
3
|
+
Mastra supports the Agent-to-Agent (A2A) protocol for exposing agents as remote agents that other agents and services can discover, call, and track over time. A2A is useful when an agent needs to cross a network boundary without exposing the remote agent's internal tools, memory, prompts, or implementation.
|
|
4
|
+
|
|
5
|
+
## When to use A2A
|
|
6
|
+
|
|
7
|
+
- A parent agent should delegate work to a specialized agent owned by another service or team.
|
|
8
|
+
- A remote agent should keep its tools, prompts, memory, workflows, and infrastructure private.
|
|
9
|
+
- A backend, browser app, or another A2A-compatible system needs programmatic access to a Mastra agent.
|
|
10
|
+
- Long-running remote work needs task IDs, status updates, artifacts, cancellation, resubscription, or push notifications.
|
|
11
|
+
|
|
12
|
+
## How A2A works
|
|
13
|
+
|
|
14
|
+
A2A maps to the roles described in the [A2A core concepts](https://a2a-protocol.org/latest/topics/key-concepts/):
|
|
15
|
+
|
|
16
|
+
- **User**: The human, service, or process that asks for work.
|
|
17
|
+
- **Client agent**: The caller that discovers a remote agent, sends messages, and listens for task updates.
|
|
18
|
+
- **Remote agent**: The Mastra agent running behind an A2A endpoint.
|
|
19
|
+
|
|
20
|
+
Any registered Mastra agent can be called as an A2A remote agent. It keeps using its own instructions, tools, memory, workflows, and server configuration; A2A changes how the agent is reached, not how it's authored.
|
|
21
|
+
|
|
22
|
+
The flow is:
|
|
23
|
+
|
|
24
|
+
1. Register a standard Mastra agent in your `Mastra` instance.
|
|
25
|
+
2. Start Mastra Server or mount Mastra routes into your own server.
|
|
26
|
+
3. Mastra exposes the agent through an agent card at `/.well-known/:agentId/agent-card.json` and an execution endpoint at `/a2a/:agentId`.
|
|
27
|
+
4. A client reads the card, sends A2A JSON-RPC methods such as `message/send`, `message/stream`, `tasks/get`, `tasks/cancel`, or `tasks/resubscribe`, then receives task, artifact, and status events.
|
|
28
|
+
|
|
29
|
+
Agent cards describe the remote agent's name, description, provider, endpoint URL, capabilities, security metadata, and skills. Capabilities advertise features such as streaming and push notifications. Skills describe what the remote agent can do so callers can decide whether it fits the task.
|
|
30
|
+
|
|
31
|
+
A2A represents work as messages and tasks. Messages carry text, file, or structured data parts. Tasks are stateful units of work with IDs and lifecycle states, so clients can follow long-running work, send follow-up turns, cancel work, or resubscribe after a disconnect. Remote agents can also return artifacts, such as text, files, or structured data, during or after a task.
|
|
32
|
+
|
|
33
|
+
## Quickstart
|
|
34
|
+
|
|
35
|
+
Start with any agent registered in your `Mastra` instance. When Mastra Server runs, the agent is available as a remote A2A agent through its registered ID.
|
|
36
|
+
|
|
37
|
+
For an agent registered as `research-agent`, Mastra exposes:
|
|
38
|
+
|
|
39
|
+
- Agent card: `/.well-known/research-agent/agent-card.json`
|
|
40
|
+
- Execution endpoint: `/a2a/research-agent`
|
|
41
|
+
|
|
42
|
+
Use `MastraClient.getA2A()` to fetch the agent card and call the remote agent:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { MastraClient } from '@mastra/client-js'
|
|
46
|
+
|
|
47
|
+
const client = new MastraClient({
|
|
48
|
+
baseUrl: 'https://agent.example.com',
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const a2a = client.getA2A('research-agent')
|
|
52
|
+
const card = await a2a.getAgentCard()
|
|
53
|
+
|
|
54
|
+
console.log(card.name, card.capabilities)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Discover and call remote agents
|
|
58
|
+
|
|
59
|
+
A2A discovery starts with the agent card. The [A2A discovery guide](https://a2a-protocol.org/latest/topics/agent-discovery/) describes well-known URI discovery, registries, and direct configuration. Mastra supports the well-known route for registered agents at `/.well-known/:agentId/agent-card.json`.
|
|
60
|
+
|
|
61
|
+
Use `sendMessageStream()` to receive task status and artifact updates over Server-Sent Events (SSE):
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
const stream = a2a.sendMessageStream({
|
|
65
|
+
message: {
|
|
66
|
+
kind: 'message',
|
|
67
|
+
role: 'user',
|
|
68
|
+
messageId: crypto.randomUUID(),
|
|
69
|
+
parts: [{ kind: 'text', text: 'Summarize this incident report.' }],
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
for await (const event of stream) {
|
|
74
|
+
if (event.kind === 'artifact-update') {
|
|
75
|
+
console.log(event.artifact.parts)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If a stream disconnects while a task is still running, use `resubscribeTask()` to receive live updates for the in-progress task:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
const updates = a2a.resubscribeTask({
|
|
84
|
+
id: 'task-123',
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
for await (const event of updates) {
|
|
88
|
+
console.log(event)
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Agent cards can contain sensitive information, such as internal URLs or private skill descriptions. Protect restricted cards with access controls, and use agent card verification when a client needs to validate that a card came from a trusted source.
|
|
93
|
+
|
|
94
|
+
## Push notifications
|
|
95
|
+
|
|
96
|
+
Mastra supports A2A push notifications for remote agents that advertise `capabilities.pushNotifications`. Use push notifications when a client can't keep a stream open, or when a long-running task should update a callback URL after the original request ends.
|
|
97
|
+
|
|
98
|
+
After a client has a task ID, it can register a callback URL for that task:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
await a2a.setTaskPushNotificationConfig({
|
|
102
|
+
taskId: 'task-123',
|
|
103
|
+
pushNotificationConfig: {
|
|
104
|
+
url: 'https://app.example.com/a2a/tasks',
|
|
105
|
+
token: process.env.A2A_WEBHOOK_TOKEN,
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Mastra Server sends the current task snapshot to registered callbacks when the task reaches `completed`, `failed`, `canceled`, or `input-required`. Push notification delivery is best-effort. Protect callback URLs, validate notification tokens, and avoid exposing internal network targets as push notification destinations.
|
|
111
|
+
|
|
112
|
+
## Sign and verify agent cards
|
|
113
|
+
|
|
114
|
+
Mastra supports signed A2A agent cards so clients can verify that a discovered card came from a trusted publisher and wasn't changed in transit. Configure signing on the Mastra server that exposes the remote agent:
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
118
|
+
|
|
119
|
+
export const mastra = new Mastra({
|
|
120
|
+
server: {
|
|
121
|
+
a2a: {
|
|
122
|
+
agentCardSigning: {
|
|
123
|
+
privateKey: process.env.A2A_AGENT_CARD_PRIVATE_KEY!,
|
|
124
|
+
protectedHeader: {
|
|
125
|
+
alg: 'ES256',
|
|
126
|
+
kid: 'agent-card-key',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
})
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
When signing is configured, Mastra includes a `signatures` array on the agent card. Client verification is opt-in, and unsigned cards still return unchanged.
|
|
135
|
+
|
|
136
|
+
Verify a signed card with `MastraClient.getA2A()`:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const card = await a2a.getAgentCard({
|
|
140
|
+
verifySignature: {
|
|
141
|
+
algorithms: ['ES256'],
|
|
142
|
+
keyProvider: async ({ kid, jku }) => {
|
|
143
|
+
return fetchTrustedPublicJwk({ kid, jku })
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Use client-side signature verification to enforce trusted keys before calling the remote agent.
|
|
150
|
+
|
|
151
|
+
## Use remote agents as subagents
|
|
152
|
+
|
|
153
|
+
Use `A2AAgent` when a Mastra parent agent should call a remote A2A agent as a subagent. Create an `A2AAgent` with a remote agent card URL or single-agent domain, then register it in the parent agent's `agents` map.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { Agent } from '@mastra/core/agent'
|
|
157
|
+
import { A2AAgent } from '@mastra/core/a2a'
|
|
158
|
+
|
|
159
|
+
const remoteWeatherAgent = new A2AAgent({
|
|
160
|
+
url: 'https://weather.example.com',
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
export const supportAgent = new Agent({
|
|
164
|
+
id: 'support-agent',
|
|
165
|
+
name: 'Support Agent',
|
|
166
|
+
instructions: 'Answer user questions and delegate weather questions when needed.',
|
|
167
|
+
model: 'openai/gpt-5.4',
|
|
168
|
+
agents: {
|
|
169
|
+
remoteWeatherAgent,
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
> **Tip:** If `url` points to a domain, `A2AAgent` fetches the agent card from `/.well-known/agent-card.json`. Use this for single-agent servers. For multi-agent servers, pass the explicit card URL, such as `https://agent.example.com/.well-known/:agentId/agent-card.json`. If `url` already ends with `/agent-card.json`, Mastra uses that URL directly. `A2AAgent` doesn't discover agent IDs beyond the URL you provide.
|
|
175
|
+
|
|
176
|
+
`A2AAgent` implements Mastra's subagent interface. The parent agent can call it like any other subagent, while `A2AAgent` handles the protocol details.
|
|
177
|
+
|
|
178
|
+
During execution, `A2AAgent`:
|
|
179
|
+
|
|
180
|
+
- Fetches and caches the remote agent card.
|
|
181
|
+
- Reads the execution URL and capabilities from the card.
|
|
182
|
+
- Calls `message/send` for non-streaming runs or `message/stream` when streaming is supported.
|
|
183
|
+
- Converts remote messages, tasks, artifacts, and status updates into Mastra subagent results.
|
|
184
|
+
- Supports `resumeGenerate()` and `resumeStream()` when the remote task requires follow-up input or resubscription.
|
|
185
|
+
|
|
186
|
+
If the remote card doesn't advertise streaming support, `A2AAgent.stream()` falls back to the non-streaming generate path and returns a buffered stream result.
|
|
187
|
+
|
|
188
|
+
## Configure subagent calls
|
|
189
|
+
|
|
190
|
+
`A2AAgent` accepts request options for authenticated or constrained environments:
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
import { A2AAgent } from '@mastra/core/a2a'
|
|
194
|
+
|
|
195
|
+
const remoteWeatherAgent = new A2AAgent({
|
|
196
|
+
url: 'https://weather.example.com',
|
|
197
|
+
headers: {
|
|
198
|
+
Authorization: `Bearer ${process.env.WEATHER_AGENT_TOKEN}`,
|
|
199
|
+
},
|
|
200
|
+
retries: 2,
|
|
201
|
+
backoffMs: 250,
|
|
202
|
+
maxBackoffMs: 1000,
|
|
203
|
+
timeoutMs: 30_000,
|
|
204
|
+
})
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
You can also pass `credentials`, `fetch`, and `abortSignal` when the runtime needs custom fetch behavior or request cancellation.
|
|
208
|
+
|
|
209
|
+
## Verify subagent cards
|
|
210
|
+
|
|
211
|
+
Use `verifyAgentCard` when a parent agent should validate a remote agent before delegating work to it. The verification hook receives the fetched agent card and context about where and when it was fetched.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { A2AAgent } from '@mastra/core/a2a'
|
|
215
|
+
|
|
216
|
+
const remoteWeatherAgent = new A2AAgent({
|
|
217
|
+
url: 'https://weather.example.com/.well-known/agent-card.json',
|
|
218
|
+
verifyAgentCard: {
|
|
219
|
+
verify: async (card, context) => {
|
|
220
|
+
if (card.provider?.organization !== 'Weather Inc') {
|
|
221
|
+
throw new Error(`Unexpected provider for ${context.cardUrl}`)
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
})
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Use this hook to enforce expected providers, expected endpoints, certificate-bound identities, signed cards, or other trust requirements before a parent agent delegates to the remote agent.
|
|
229
|
+
|
|
230
|
+
## Related
|
|
231
|
+
|
|
232
|
+
- [Agent reference](https://mastra.ai/reference/agents/agent)
|
|
233
|
+
- [JavaScript client agents reference](https://mastra.ai/reference/client-js/agents)
|
|
234
|
+
- [A2A core concepts](https://a2a-protocol.org/latest/topics/key-concepts/)
|
|
235
|
+
- [A2A discovery guide](https://a2a-protocol.org/latest/topics/agent-discovery/)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Response
|
|
1
|
+
# Response Caching
|
|
2
2
|
|
|
3
|
-
Response caching skips the LLM call and replays a previously cached response when an agent receives an identical request. Use it to
|
|
3
|
+
Response caching skips the LLM call and replays a previously cached response when an agent receives an identical request. Use it to reduce latency and avoid paying for repeated calls.
|
|
4
4
|
|
|
5
|
-
Caching is implemented as the [`ResponseCache`](https://mastra.ai/reference/processors/response-cache) input processor.
|
|
5
|
+
Caching is implemented as the [`ResponseCache`](https://mastra.ai/reference/processors/response-cache) input processor. Mastra doesn't provide an agent-level option. To enable caching, register the processor explicitly. This keeps the API surface small while Mastra collects feedback; per-call overrides flow through `RequestContext`.
|
|
6
6
|
|
|
7
7
|
## When to use response caching
|
|
8
8
|
|
|
@@ -51,15 +51,15 @@ await agent.stream('hello', { requestContext: ctx })
|
|
|
51
51
|
|
|
52
52
|
Three fields are overridable per call:
|
|
53
53
|
|
|
54
|
-
- `key
|
|
55
|
-
- `scope
|
|
56
|
-
- `bust
|
|
54
|
+
- `key`: String or function. Overrides the auto-derived cache key for this request only.
|
|
55
|
+
- `scope`: String or `null`. Overrides the tenant/user scope for this request only. `null` opts out of scoping.
|
|
56
|
+
- `bust`: Boolean. Skips the cache read but still writes on completion (useful for "force refresh" buttons).
|
|
57
57
|
|
|
58
|
-
`cache`, `ttl`, and `agentId` stay on the constructor
|
|
58
|
+
`cache`, `ttl`, and `agentId` stay on the constructor. They're instance-level concerns and not safe to vary per call.
|
|
59
59
|
|
|
60
60
|
## Tenant scoping
|
|
61
61
|
|
|
62
|
-
By default, `ResponseCache` looks up `MASTRA_RESOURCE_ID_KEY` on the request context and uses it as the cache scope. This means an agent that already populates the resource id (e.g. via memory) gets per-user isolation automatically
|
|
62
|
+
By default, `ResponseCache` looks up `MASTRA_RESOURCE_ID_KEY` on the request context and uses it as the cache scope. This means an agent that already populates the resource id (e.g. via memory) gets per-user isolation automatically. Two users never see each other's cached responses.
|
|
63
63
|
|
|
64
64
|
Override explicitly when you need a different scope:
|
|
65
65
|
|
|
@@ -75,7 +75,7 @@ new Agent({
|
|
|
75
75
|
})
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Pass `scope: null` to deliberately share entries across all callers
|
|
78
|
+
Pass `scope: null` to deliberately share entries across all callers. Only use this for known-public, non-personalized content.
|
|
79
79
|
|
|
80
80
|
## Custom cache backend
|
|
81
81
|
|
|
@@ -102,7 +102,7 @@ For a custom backend, extend `MastraServerCache` and implement its abstract meth
|
|
|
102
102
|
|
|
103
103
|
`ResponseCache` hooks into `processLLMRequest` (cache lookup, short-circuits on hit) and `processLLMResponse` (cache write on completion). Both run inside the agentic loop _after_ memory has loaded and earlier input processors have transformed the prompt.
|
|
104
104
|
|
|
105
|
-
This means the cache key is derived from the resolved `LanguageModelV2Prompt` Mastra is about to send to the model
|
|
105
|
+
This means the cache key is derived from the resolved `LanguageModelV2Prompt` Mastra is about to send to the model. The key is created _after_ memory has loaded and earlier input processors have run, and each step in an agentic tool loop is independently cached.
|
|
106
106
|
|
|
107
107
|
## What's in the cache key
|
|
108
108
|
|
|
@@ -137,7 +137,7 @@ If the function throws, the processor falls back to the default key derivation s
|
|
|
137
137
|
|
|
138
138
|
When the processor finds a cache hit, it short-circuits the LLM call by returning the cached chunks from `processLLMRequest`. The agentic loop synthesizes a stream from those chunks instead of calling the model. `agent.generate()` collects them into a `FullOutput`; `agent.stream()` returns a `MastraModelOutput` whose chunks come from the cached buffer, so consumers iterating `fullStream` or awaiting `text`, `usage`, and `finishReason` see the cached values.
|
|
139
139
|
|
|
140
|
-
Cache writes happen after the response completes. Failed runs (errors, tripwire activations)
|
|
140
|
+
Cache writes happen after the response completes. Failed runs (errors, tripwire activations) aren't cached, so the next call retries cleanly.
|
|
141
141
|
|
|
142
142
|
## Related
|
|
143
143
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Signals
|
|
2
2
|
|
|
3
|
-
> **Experimental:** Agent signals are experimental.
|
|
3
|
+
> **Experimental:** Agent signals are experimental. Breaking changes may occur without a major version bump until the API is stable.
|
|
4
4
|
|
|
5
5
|
Signals are a way to interact with an agent through a thread. Instead of starting every interaction with `agent.stream()`, subscribe to a thread and send signals. Mastra either wakes the agent when the thread is idle or drops the signal into the running agent loop.
|
|
6
6
|
|
|
@@ -57,6 +57,7 @@ export const mastraClient = new MastraClient({
|
|
|
57
57
|
The Mastra Client SDK exposes all resources served by the Mastra Server.
|
|
58
58
|
|
|
59
59
|
- **[Agents](https://mastra.ai/reference/client-js/agents)**: Generate responses and stream conversations.
|
|
60
|
+
- **[A2A](https://mastra.ai/docs/agents/a2a)**: Discover agents through agent cards and work with task-based A2A streams.
|
|
60
61
|
- **[Memory](https://mastra.ai/reference/client-js/memory)**: Manage conversation threads and message history.
|
|
61
62
|
- **[Tools](https://mastra.ai/reference/client-js/tools)**: Executed and managed tools.
|
|
62
63
|
- **[Workflows](https://mastra.ai/reference/client-js/workflows)**: Trigger workflows and track their execution.
|
|
@@ -12,6 +12,7 @@ Mastra runs as an HTTP server that exposes your agents, workflows, and other fun
|
|
|
12
12
|
- **[Server Adapters](https://mastra.ai/docs/server/server-adapters)**: Run Mastra with Express, Hono, or your own HTTP server instead of the generated server.
|
|
13
13
|
- **[Custom Adapters](https://mastra.ai/docs/server/custom-adapters)**: Build adapters for frameworks not officially supported.
|
|
14
14
|
- **[Mastra Client SDK](https://mastra.ai/docs/server/mastra-client)**: Type-safe client for calling agents, workflows, and tools from browser or server environments.
|
|
15
|
+
- **[A2A](https://mastra.ai/docs/agents/a2a)**: Expose agents through A2A agent cards, task streams, and push notifications.
|
|
15
16
|
- **[Authentication](https://mastra.ai/docs/server/auth)**: Secure endpoints with JWT, Clerk, Supabase, Firebase, Auth0, or WorkOS.
|
|
16
17
|
|
|
17
18
|
## Configuration
|
|
@@ -33,7 +34,7 @@ export const mastra = new Mastra({
|
|
|
33
34
|
|
|
34
35
|
## Deploy your server
|
|
35
36
|
|
|
36
|
-
Mastra servers can be deployed to any Node.js-compatible environment. Deploy it to production using the [Mastra platform](https://mastra.ai/docs/mastra-platform/overview) or your own
|
|
37
|
+
Mastra servers can be deployed to any Node.js-compatible environment. Deploy it to production using the [Mastra platform](https://mastra.ai/docs/mastra-platform/overview) or your own infrastructure. Visit the [deployment docs](https://mastra.ai/docs/deployment/overview) to learn how.
|
|
37
38
|
|
|
38
39
|
## Server architecture
|
|
39
40
|
|
package/.docs/models/index.md
CHANGED
|
@@ -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
|
|
3
|
+
Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3911 models from 112 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Auriko
|
|
2
|
+
|
|
3
|
+
Access 15 Auriko models through Mastra's model router. Authentication is handled automatically using the `AURIKO_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [Auriko documentation](https://docs.auriko.ai).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
AURIKO_API_KEY=your-api-key
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { Agent } from "@mastra/core/agent";
|
|
13
|
+
|
|
14
|
+
const agent = new Agent({
|
|
15
|
+
id: "my-agent",
|
|
16
|
+
name: "My Agent",
|
|
17
|
+
instructions: "You are a helpful assistant",
|
|
18
|
+
model: "auriko/claude-opus-4-6"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Generate a response
|
|
22
|
+
const response = await agent.generate("Hello!");
|
|
23
|
+
|
|
24
|
+
// Stream a response
|
|
25
|
+
const stream = await agent.stream("Tell me a story");
|
|
26
|
+
for await (const chunk of stream) {
|
|
27
|
+
console.log(chunk);
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> **Info:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Auriko documentation](https://docs.auriko.ai) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| ------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `auriko/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 |
|
|
38
|
+
| `auriko/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 |
|
|
39
|
+
| `auriko/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
|
|
40
|
+
| `auriko/deepseek-v4-flash` | 1.0M | | | | | | $0.14 | $0.28 |
|
|
41
|
+
| `auriko/deepseek-v4-pro` | 1.0M | | | | | | $0.43 | $0.87 |
|
|
42
|
+
| `auriko/gemini-2.5-flash` | 1.0M | | | | | | $0.30 | $3 |
|
|
43
|
+
| `auriko/gemini-2.5-pro` | 1.0M | | | | | | $1 | $10 |
|
|
44
|
+
| `auriko/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
|
|
45
|
+
| `auriko/glm-5.1` | 200K | | | | | | $1 | $4 |
|
|
46
|
+
| `auriko/grok-4.3` | 1.0M | | | | | | $1 | $3 |
|
|
47
|
+
| `auriko/kimi-k2.5` | 262K | | | | | | $0.50 | $3 |
|
|
48
|
+
| `auriko/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
|
|
49
|
+
| `auriko/minimax-m2-7` | 205K | | | | | | $0.30 | $1 |
|
|
50
|
+
| `auriko/minimax-m2-7-highspeed` | 205K | | | | | | $0.60 | $2 |
|
|
51
|
+
| `auriko/qwen-3.6-plus` | 1.0M | | | | | | $0.50 | $3 |
|
|
52
|
+
|
|
53
|
+
## Advanced configuration
|
|
54
|
+
|
|
55
|
+
### Custom headers
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
const agent = new Agent({
|
|
59
|
+
id: "custom-agent",
|
|
60
|
+
name: "custom-agent",
|
|
61
|
+
model: {
|
|
62
|
+
url: "https://api.auriko.ai/v1",
|
|
63
|
+
id: "auriko/claude-opus-4-6",
|
|
64
|
+
apiKey: process.env.AURIKO_API_KEY,
|
|
65
|
+
headers: {
|
|
66
|
+
"X-Custom-Header": "value"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Dynamic model selection
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
const agent = new Agent({
|
|
76
|
+
id: "dynamic-agent",
|
|
77
|
+
name: "Dynamic Agent",
|
|
78
|
+
model: ({ requestContext }) => {
|
|
79
|
+
const useAdvanced = requestContext.task === "complex";
|
|
80
|
+
return useAdvanced
|
|
81
|
+
? "auriko/qwen-3.6-plus"
|
|
82
|
+
: "auriko/claude-opus-4-6";
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
```
|
|
@@ -16,6 +16,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
16
16
|
- [Alibaba (China)](https://mastra.ai/models/providers/alibaba-cn)
|
|
17
17
|
- [Alibaba Coding Plan](https://mastra.ai/models/providers/alibaba-coding-plan)
|
|
18
18
|
- [Alibaba Coding Plan (China)](https://mastra.ai/models/providers/alibaba-coding-plan-cn)
|
|
19
|
+
- [Auriko](https://mastra.ai/models/providers/auriko)
|
|
19
20
|
- [Bailing](https://mastra.ai/models/providers/bailing)
|
|
20
21
|
- [Baseten](https://mastra.ai/models/providers/baseten)
|
|
21
22
|
- [Berget.AI](https://mastra.ai/models/providers/berget)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.36-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`3e63fca`](https://github.com/mastra-ai/mastra/commit/3e63fca7aa41269b2a9518effdd09b8ab8f1ff04), [`bc386e0`](https://github.com/mastra-ai/mastra/commit/bc386e08249dd30f3e66cf59de0c151a8dc26afb)]:
|
|
8
|
+
- @mastra/core@1.33.1-alpha.1
|
|
9
|
+
|
|
3
10
|
## 1.1.36-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.1.36-alpha.
|
|
3
|
+
"version": "1.1.36-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,8 +29,8 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@mastra/
|
|
33
|
-
"@mastra/
|
|
32
|
+
"@mastra/core": "1.33.1-alpha.1",
|
|
33
|
+
"@mastra/mcp": "^1.7.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@hono/node-server": "^1.19.11",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"typescript": "^6.0.3",
|
|
48
48
|
"vitest": "4.1.5",
|
|
49
49
|
"@internal/lint": "0.0.93",
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
50
|
+
"@mastra/core": "1.33.1-alpha.1",
|
|
51
|
+
"@internal/types-builder": "0.0.68"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|