@mastra/mcp-docs-server 1.1.40-alpha.1 → 1.1.40-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/models/gateways/openrouter.md +2 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/opencode.md +2 -3
- package/.docs/models/providers/stepfun-ai.md +72 -0
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/client-js/agents.md +31 -0
- package/.docs/reference/observability/tracing/interfaces.md +13 -0
- package/CHANGELOG.md +7 -0
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenRouter
|
|
2
2
|
|
|
3
|
-
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access
|
|
3
|
+
OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 358 models through Mastra's model router.
|
|
4
4
|
|
|
5
5
|
Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
|
|
6
6
|
|
|
@@ -373,6 +373,7 @@ ANTHROPIC_API_KEY=ant-...
|
|
|
373
373
|
| `x-ai/grok-4.20` |
|
|
374
374
|
| `x-ai/grok-4.20-multi-agent` |
|
|
375
375
|
| `x-ai/grok-4.3` |
|
|
376
|
+
| `x-ai/grok-build-0.1` |
|
|
376
377
|
| `xiaomi/mimo-v2-flash` |
|
|
377
378
|
| `xiaomi/mimo-v2-omni` |
|
|
378
379
|
| `xiaomi/mimo-v2-pro` |
|
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 4209 models from 122 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenCode Zen
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 40 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [OpenCode Zen documentation](https://opencode.ai/docs/zen).
|
|
6
6
|
|
|
@@ -74,7 +74,6 @@ for await (const chunk of stream) {
|
|
|
74
74
|
| `opencode/nemotron-3-super-free` | 205K | | | | | | — | — |
|
|
75
75
|
| `opencode/qwen3.5-plus` | 262K | | | | | | $0.20 | $1 |
|
|
76
76
|
| `opencode/qwen3.6-plus` | 262K | | | | | | $0.50 | $3 |
|
|
77
|
-
| `opencode/qwen3.6-plus-free` | 262K | | | | | | — | — |
|
|
78
77
|
|
|
79
78
|
## Advanced configuration
|
|
80
79
|
|
|
@@ -104,7 +103,7 @@ const agent = new Agent({
|
|
|
104
103
|
model: ({ requestContext }) => {
|
|
105
104
|
const useAdvanced = requestContext.task === "complex";
|
|
106
105
|
return useAdvanced
|
|
107
|
-
? "opencode/qwen3.6-plus
|
|
106
|
+
? "opencode/qwen3.6-plus"
|
|
108
107
|
: "opencode/big-pickle";
|
|
109
108
|
}
|
|
110
109
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# StepFun
|
|
2
|
+
|
|
3
|
+
Access 2 StepFun models through Mastra's model router. Authentication is handled automatically using the `STEPFUN_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [StepFun documentation](https://platform.stepfun.ai/docs/en/step-plan/integrations/open-code).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
STEPFUN_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: "stepfun-ai/step-3.5-flash"
|
|
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 [StepFun documentation](https://platform.stepfun.ai/docs/en/step-plan/integrations/open-code) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| -------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `stepfun-ai/step-3.5-flash` | 256K | | | | | | $0.10 | $0.29 |
|
|
38
|
+
| `stepfun-ai/step-3.5-flash-2603` | 256K | | | | | | $0.10 | $0.30 |
|
|
39
|
+
|
|
40
|
+
## Advanced configuration
|
|
41
|
+
|
|
42
|
+
### Custom headers
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const agent = new Agent({
|
|
46
|
+
id: "custom-agent",
|
|
47
|
+
name: "custom-agent",
|
|
48
|
+
model: {
|
|
49
|
+
url: "https://api.stepfun.ai/step_plan/v1",
|
|
50
|
+
id: "stepfun-ai/step-3.5-flash",
|
|
51
|
+
apiKey: process.env.STEPFUN_API_KEY,
|
|
52
|
+
headers: {
|
|
53
|
+
"X-Custom-Header": "value"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Dynamic model selection
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
const agent = new Agent({
|
|
63
|
+
id: "dynamic-agent",
|
|
64
|
+
name: "Dynamic Agent",
|
|
65
|
+
model: ({ requestContext }) => {
|
|
66
|
+
const useAdvanced = requestContext.task === "complex";
|
|
67
|
+
return useAdvanced
|
|
68
|
+
? "stepfun-ai/step-3.5-flash-2603"
|
|
69
|
+
: "stepfun-ai/step-3.5-flash";
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
```
|
|
@@ -96,6 +96,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
96
96
|
- [SiliconFlow (China)](https://mastra.ai/models/providers/siliconflow-cn)
|
|
97
97
|
- [STACKIT](https://mastra.ai/models/providers/stackit)
|
|
98
98
|
- [StepFun](https://mastra.ai/models/providers/stepfun)
|
|
99
|
+
- [StepFun](https://mastra.ai/models/providers/stepfun-ai)
|
|
99
100
|
- [submodel](https://mastra.ai/models/providers/submodel)
|
|
100
101
|
- [Synthetic](https://mastra.ai/models/providers/synthetic)
|
|
101
102
|
- [Tencent Coding Plan (China)](https://mastra.ai/models/providers/tencent-coding-plan)
|
|
@@ -464,6 +464,37 @@ response.processDataStream({
|
|
|
464
464
|
})
|
|
465
465
|
```
|
|
466
466
|
|
|
467
|
+
### Tracing client tools
|
|
468
|
+
|
|
469
|
+
When `@mastra/observability` is installed and configured on the server, a client-side tool records a `CLIENT_TOOL_CALL` span as a child of the current `AGENT_RUN` span. The server creates that span when the model emits the client tool call, injects a W3C trace carrier into the outgoing tool-call chunk, and ends the span once the tool arguments are available. Without server-side observability configured, client tool tracing is a no-op.
|
|
470
|
+
|
|
471
|
+
The client SDK also measures the wall-clock duration of each client tool's `execute` function and ships it back to the server, where it's emitted as a `mastra_tool_duration_ms` metric with `toolType: "client"`.
|
|
472
|
+
|
|
473
|
+
For richer telemetry from inside your tool's `execute` function, use the `observe` helper on the execution context to add child spans and structured logs:
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
import { createTool } from '@mastra/client-js'
|
|
477
|
+
import { z } from 'zod'
|
|
478
|
+
|
|
479
|
+
const fetchUserTool = createTool({
|
|
480
|
+
id: 'fetchUser',
|
|
481
|
+
description: 'Fetches the current user profile',
|
|
482
|
+
inputSchema: z.object({ userId: z.string() }),
|
|
483
|
+
execute: async ({ userId }, { observe }) => {
|
|
484
|
+
observe.log('info', 'fetching user', { userId })
|
|
485
|
+
const user = await observe.span('http GET /users', async () => {
|
|
486
|
+
const res = await fetch(`/api/users/${userId}`)
|
|
487
|
+
return res.json()
|
|
488
|
+
})
|
|
489
|
+
return user
|
|
490
|
+
},
|
|
491
|
+
})
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
`observe` is always available — when no tracing context is active (e.g. running outside a traced agent), `span` runs the function directly and `log` is a no-op. No null-checking needed.
|
|
495
|
+
|
|
496
|
+
The SDK serializes everything the collector buffered as OTLP/JSON and ships it back in the next request body. The server's `@mastra/observability` package validates that the spans belong to the correct trace (preventing cross-trace injection) and forwards each span/log into the same observability bus that server-side telemetry uses. Your existing exporters pick them up automatically after observability is configured.
|
|
497
|
+
|
|
467
498
|
## Stored agents
|
|
468
499
|
|
|
469
500
|
Stored agents are agent configurations stored in a database that can be created, updated, and deleted at runtime. They reference primitives (tools, workflows, other agents, scorers) by key, which are resolved from the Mastra registry when the agent is instantiated. Memory is configured inline as a `SerializedMemoryConfig` object with options such as `lastMessages` and `semanticRecall`.
|
|
@@ -43,6 +43,7 @@ interface SpanTypeMap {
|
|
|
43
43
|
MODEL_STEP: ModelStepAttributes
|
|
44
44
|
MODEL_CHUNK: ModelChunkAttributes
|
|
45
45
|
TOOL_CALL: ToolCallAttributes
|
|
46
|
+
CLIENT_TOOL_CALL: ClientToolCallAttributes
|
|
46
47
|
MCP_TOOL_CALL: MCPToolCallAttributes
|
|
47
48
|
PROCESSOR_RUN: ProcessorRunAttributes
|
|
48
49
|
WORKFLOW_STEP: WorkflowStepAttributes
|
|
@@ -255,6 +256,18 @@ enum SpanType {
|
|
|
255
256
|
/** Function/tool execution with inputs, outputs, errors */
|
|
256
257
|
TOOL_CALL = 'tool_call',
|
|
257
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Client-side tool execution marker. The server creates this span
|
|
261
|
+
* when the model emits a client tool call, injects its W3C carrier
|
|
262
|
+
* into the outgoing tool-call chunk, then ends the span once tool
|
|
263
|
+
* args are available. Child spans/logs from the client SDK flow back
|
|
264
|
+
* as OTLP/JSON via the ClientObservabilityProxy interface in
|
|
265
|
+
* @mastra/observability and parent themselves under this span.
|
|
266
|
+
* See the "Client tools" section in the @mastra/client-js reference
|
|
267
|
+
* for the full flow.
|
|
268
|
+
*/
|
|
269
|
+
CLIENT_TOOL_CALL = 'client_tool_call',
|
|
270
|
+
|
|
258
271
|
/** Workflow run - root span for workflow processes */
|
|
259
272
|
WORKFLOW_RUN = 'workflow_run',
|
|
260
273
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.40-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`2f5f58a`](https://github.com/mastra-ai/mastra/commit/2f5f58a9a8bb13bcdc6789db221eef7c9bf1ff02)]:
|
|
8
|
+
- @mastra/core@1.37.0-alpha.1
|
|
9
|
+
|
|
3
10
|
## 1.1.40-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.40-alpha.
|
|
3
|
+
"version": "1.1.40-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.37.0-alpha.1",
|
|
33
|
+
"@mastra/mcp": "^1.8.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@hono/node-server": "^1.19.11",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"vitest": "4.1.5",
|
|
49
49
|
"@internal/lint": "0.0.97",
|
|
50
50
|
"@internal/types-builder": "0.0.72",
|
|
51
|
-
"@mastra/core": "1.
|
|
51
|
+
"@mastra/core": "1.37.0-alpha.1"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|