@mastra/mcp-docs-server 1.1.20-alpha.3 → 1.1.20
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/index.md +1 -1
- package/.docs/models/providers/openai.md +8 -4
- package/.docs/models/providers/the-grid-ai.md +73 -0
- package/.docs/models/providers/zai-coding-plan.md +3 -2
- package/.docs/models/providers/zai.md +3 -2
- package/.docs/models/providers/zhipuai-coding-plan.md +3 -2
- package/.docs/models/providers/zhipuai.md +3 -2
- package/.docs/models/providers.md +1 -0
- package/.docs/reference/processors/token-limiter-processor.md +2 -0
- package/CHANGELOG.md +14 -0
- package/package.json +5 -5
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 3578 models from 95 providers through a single API.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenAI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 51 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [OpenAI documentation](https://platform.openai.com/docs/models).
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ const agent = new Agent({
|
|
|
15
15
|
id: "my-agent",
|
|
16
16
|
name: "My Agent",
|
|
17
17
|
instructions: "You are a helpful assistant",
|
|
18
|
-
model: "openai/
|
|
18
|
+
model: "openai/chatgpt-image-latest"
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// Generate a response
|
|
@@ -32,6 +32,7 @@ for await (const chunk of stream) {
|
|
|
32
32
|
|
|
33
33
|
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
34
34
|
| ------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
35
|
+
| `openai/chatgpt-image-latest` | — | | | | | | — | — |
|
|
35
36
|
| `openai/codex-mini-latest` | 200K | | | | | | $2 | $6 |
|
|
36
37
|
| `openai/gpt-3.5-turbo` | 16K | | | | | | $0.50 | $2 |
|
|
37
38
|
| `openai/gpt-4` | 8K | | | | | | $30 | $60 |
|
|
@@ -66,6 +67,9 @@ for await (const chunk of stream) {
|
|
|
66
67
|
| `openai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
|
|
67
68
|
| `openai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
|
|
68
69
|
| `openai/gpt-5.4-pro` | 1.1M | | | | | | $30 | $180 |
|
|
70
|
+
| `openai/gpt-image-1` | — | | | | | | — | — |
|
|
71
|
+
| `openai/gpt-image-1-mini` | — | | | | | | — | — |
|
|
72
|
+
| `openai/gpt-image-1.5` | — | | | | | | — | — |
|
|
69
73
|
| `openai/o1` | 200K | | | | | | $15 | $60 |
|
|
70
74
|
| `openai/o1-mini` | 128K | | | | | | $1 | $4 |
|
|
71
75
|
| `openai/o1-preview` | 128K | | | | | | $15 | $60 |
|
|
@@ -89,7 +93,7 @@ const agent = new Agent({
|
|
|
89
93
|
id: "custom-agent",
|
|
90
94
|
name: "custom-agent",
|
|
91
95
|
model: {
|
|
92
|
-
id: "openai/
|
|
96
|
+
id: "openai/chatgpt-image-latest",
|
|
93
97
|
apiKey: process.env.OPENAI_API_KEY,
|
|
94
98
|
headers: {
|
|
95
99
|
"X-Custom-Header": "value"
|
|
@@ -108,7 +112,7 @@ const agent = new Agent({
|
|
|
108
112
|
const useAdvanced = requestContext.task === "complex";
|
|
109
113
|
return useAdvanced
|
|
110
114
|
? "openai/text-embedding-ada-002"
|
|
111
|
-
: "openai/
|
|
115
|
+
: "openai/chatgpt-image-latest";
|
|
112
116
|
}
|
|
113
117
|
});
|
|
114
118
|
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# The Grid AI
|
|
2
|
+
|
|
3
|
+
Access 3 The Grid AI models through Mastra's model router. Authentication is handled automatically using the `THEGRIDAI_API_KEY` environment variable.
|
|
4
|
+
|
|
5
|
+
Learn more in the [The Grid AI documentation](https://thegrid.ai/docs).
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
THEGRIDAI_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: "the-grid-ai/text-max"
|
|
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 [The Grid AI documentation](https://thegrid.ai/docs) for details.
|
|
32
|
+
|
|
33
|
+
## Models
|
|
34
|
+
|
|
35
|
+
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|
|
36
|
+
| --------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
|
|
37
|
+
| `the-grid-ai/text-max` | 1.0M | | | | | | — | — |
|
|
38
|
+
| `the-grid-ai/text-prime` | 128K | | | | | | — | — |
|
|
39
|
+
| `the-grid-ai/text-standard` | 128K | | | | | | — | — |
|
|
40
|
+
|
|
41
|
+
## Advanced configuration
|
|
42
|
+
|
|
43
|
+
### Custom headers
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
const agent = new Agent({
|
|
47
|
+
id: "custom-agent",
|
|
48
|
+
name: "custom-agent",
|
|
49
|
+
model: {
|
|
50
|
+
url: "https://api.thegrid.ai/v1",
|
|
51
|
+
id: "the-grid-ai/text-max",
|
|
52
|
+
apiKey: process.env.THEGRIDAI_API_KEY,
|
|
53
|
+
headers: {
|
|
54
|
+
"X-Custom-Header": "value"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Dynamic model selection
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
const agent = new Agent({
|
|
64
|
+
id: "dynamic-agent",
|
|
65
|
+
name: "Dynamic Agent",
|
|
66
|
+
model: ({ requestContext }) => {
|
|
67
|
+
const useAdvanced = requestContext.task === "complex";
|
|
68
|
+
return useAdvanced
|
|
69
|
+
? "the-grid-ai/text-standard"
|
|
70
|
+
: "the-grid-ai/text-max";
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Z.AI Coding Plan
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 13 Z.AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Z.AI Coding Plan documentation](https://docs.z.ai/devpack/overview).
|
|
6
6
|
|
|
@@ -46,6 +46,7 @@ for await (const chunk of stream) {
|
|
|
46
46
|
| `zai-coding-plan/glm-5` | 205K | | | | | | — | — |
|
|
47
47
|
| `zai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
|
|
48
48
|
| `zai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
|
|
49
|
+
| `zai-coding-plan/glm-5v-turbo` | 200K | | | | | | — | — |
|
|
49
50
|
|
|
50
51
|
## Advanced configuration
|
|
51
52
|
|
|
@@ -75,7 +76,7 @@ const agent = new Agent({
|
|
|
75
76
|
model: ({ requestContext }) => {
|
|
76
77
|
const useAdvanced = requestContext.task === "complex";
|
|
77
78
|
return useAdvanced
|
|
78
|
-
? "zai-coding-plan/glm-
|
|
79
|
+
? "zai-coding-plan/glm-5v-turbo"
|
|
79
80
|
: "zai-coding-plan/glm-4.5";
|
|
80
81
|
}
|
|
81
82
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Z.AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 12 Z.AI models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Z.AI documentation](https://docs.z.ai/guides/overview/pricing).
|
|
6
6
|
|
|
@@ -45,6 +45,7 @@ for await (const chunk of stream) {
|
|
|
45
45
|
| `zai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
46
|
| `zai/glm-5` | 205K | | | | | | $1 | $3 |
|
|
47
47
|
| `zai/glm-5-turbo` | 200K | | | | | | $1 | $4 |
|
|
48
|
+
| `zai/glm-5v-turbo` | 200K | | | | | | $1 | $4 |
|
|
48
49
|
|
|
49
50
|
## Advanced configuration
|
|
50
51
|
|
|
@@ -74,7 +75,7 @@ const agent = new Agent({
|
|
|
74
75
|
model: ({ requestContext }) => {
|
|
75
76
|
const useAdvanced = requestContext.task === "complex";
|
|
76
77
|
return useAdvanced
|
|
77
|
-
? "zai/glm-
|
|
78
|
+
? "zai/glm-5v-turbo"
|
|
78
79
|
: "zai/glm-4.5";
|
|
79
80
|
}
|
|
80
81
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zhipu AI Coding Plan
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 14 Zhipu AI Coding Plan models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Zhipu AI Coding Plan documentation](https://docs.bigmodel.cn/cn/coding-plan/overview).
|
|
6
6
|
|
|
@@ -47,6 +47,7 @@ for await (const chunk of stream) {
|
|
|
47
47
|
| `zhipuai-coding-plan/glm-5` | 205K | | | | | | — | — |
|
|
48
48
|
| `zhipuai-coding-plan/glm-5-turbo` | 200K | | | | | | — | — |
|
|
49
49
|
| `zhipuai-coding-plan/glm-5.1` | 200K | | | | | | — | — |
|
|
50
|
+
| `zhipuai-coding-plan/glm-5v-turbo` | 200K | | | | | | — | — |
|
|
50
51
|
|
|
51
52
|
## Advanced configuration
|
|
52
53
|
|
|
@@ -76,7 +77,7 @@ const agent = new Agent({
|
|
|
76
77
|
model: ({ requestContext }) => {
|
|
77
78
|
const useAdvanced = requestContext.task === "complex";
|
|
78
79
|
return useAdvanced
|
|
79
|
-
? "zhipuai-coding-plan/glm-
|
|
80
|
+
? "zhipuai-coding-plan/glm-5v-turbo"
|
|
80
81
|
: "zhipuai-coding-plan/glm-4.5";
|
|
81
82
|
}
|
|
82
83
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zhipu AI
|
|
2
2
|
|
|
3
|
-
Access
|
|
3
|
+
Access 11 Zhipu AI models through Mastra's model router. Authentication is handled automatically using the `ZHIPU_API_KEY` environment variable.
|
|
4
4
|
|
|
5
5
|
Learn more in the [Zhipu AI documentation](https://docs.z.ai/guides/overview/pricing).
|
|
6
6
|
|
|
@@ -44,6 +44,7 @@ for await (const chunk of stream) {
|
|
|
44
44
|
| `zhipuai/glm-4.7-flash` | 200K | | | | | | — | — |
|
|
45
45
|
| `zhipuai/glm-4.7-flashx` | 200K | | | | | | $0.07 | $0.40 |
|
|
46
46
|
| `zhipuai/glm-5` | 205K | | | | | | $1 | $3 |
|
|
47
|
+
| `zhipuai/glm-5v-turbo` | 200K | | | | | | $5 | $22 |
|
|
47
48
|
|
|
48
49
|
## Advanced configuration
|
|
49
50
|
|
|
@@ -73,7 +74,7 @@ const agent = new Agent({
|
|
|
73
74
|
model: ({ requestContext }) => {
|
|
74
75
|
const useAdvanced = requestContext.task === "complex";
|
|
75
76
|
return useAdvanced
|
|
76
|
-
? "zhipuai/glm-
|
|
77
|
+
? "zhipuai/glm-5v-turbo"
|
|
77
78
|
: "zhipuai/glm-4.5";
|
|
78
79
|
}
|
|
79
80
|
});
|
|
@@ -81,6 +81,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
|
|
|
81
81
|
- [submodel](https://mastra.ai/models/providers/submodel)
|
|
82
82
|
- [Synthetic](https://mastra.ai/models/providers/synthetic)
|
|
83
83
|
- [Tencent Coding Plan (China)](https://mastra.ai/models/providers/tencent-coding-plan)
|
|
84
|
+
- [The Grid AI](https://mastra.ai/models/providers/the-grid-ai)
|
|
84
85
|
- [Together AI](https://mastra.ai/models/providers/togetherai)
|
|
85
86
|
- [Upstage](https://mastra.ai/models/providers/upstage)
|
|
86
87
|
- [Vivgrid](https://mastra.ai/models/providers/vivgrid)
|
|
@@ -30,6 +30,8 @@ const processor = new TokenLimiterProcessor({
|
|
|
30
30
|
|
|
31
31
|
**options.countMode** (`'cumulative' | 'part'`): Whether to count tokens from the beginning of the stream or just the current part: 'cumulative' counts all tokens from start, 'part' only counts tokens in current part
|
|
32
32
|
|
|
33
|
+
**options.trimMode** (`'best-fit' | 'contiguous'`): Controls how messages are trimmed when exceeding the token limit: 'best-fit' keeps as many messages as possible (may create gaps), 'contiguous' stops at the first message that does not fit, ensuring a continuous suffix of conversation history
|
|
34
|
+
|
|
33
35
|
## Returns
|
|
34
36
|
|
|
35
37
|
**id** (`string`): Processor identifier set to 'token-limiter'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.1.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`9a43b47`](https://github.com/mastra-ai/mastra/commit/9a43b476465e86c9aca381c2831066b5c33c999a), [`ec5c319`](https://github.com/mastra-ai/mastra/commit/ec5c3197a50d034cb8e9cc494eebfddc684b5d81), [`6517789`](https://github.com/mastra-ai/mastra/commit/65177895b74b5471fe2245c7292f0176d9b3385d), [`13f4327`](https://github.com/mastra-ai/mastra/commit/13f4327f052faebe199cefbe906d33bf90238767), [`9ad6aa6`](https://github.com/mastra-ai/mastra/commit/9ad6aa6dfe858afc6955d1df5f3f78c40bb96b9c), [`2862127`](https://github.com/mastra-ai/mastra/commit/2862127d0a7cbd28523120ad64fea067a95838e6), [`3d16814`](https://github.com/mastra-ai/mastra/commit/3d16814c395931373543728994ff45ac98093074), [`7f498d0`](https://github.com/mastra-ai/mastra/commit/7f498d099eacef64fd43ee412e3bd6f87965a8a6), [`8cf8a67`](https://github.com/mastra-ai/mastra/commit/8cf8a67b061b737cb06d501fb8c1967a98bbf3cb), [`d7827e3`](https://github.com/mastra-ai/mastra/commit/d7827e393937c6cb0c7a744dde4d31538cb542b7)]:
|
|
8
|
+
- @mastra/core@1.21.0
|
|
9
|
+
|
|
10
|
+
## 1.1.20-alpha.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`ec5c319`](https://github.com/mastra-ai/mastra/commit/ec5c3197a50d034cb8e9cc494eebfddc684b5d81), [`6517789`](https://github.com/mastra-ai/mastra/commit/65177895b74b5471fe2245c7292f0176d9b3385d), [`9ad6aa6`](https://github.com/mastra-ai/mastra/commit/9ad6aa6dfe858afc6955d1df5f3f78c40bb96b9c), [`2862127`](https://github.com/mastra-ai/mastra/commit/2862127d0a7cbd28523120ad64fea067a95838e6), [`3d16814`](https://github.com/mastra-ai/mastra/commit/3d16814c395931373543728994ff45ac98093074), [`7f498d0`](https://github.com/mastra-ai/mastra/commit/7f498d099eacef64fd43ee412e3bd6f87965a8a6), [`8cf8a67`](https://github.com/mastra-ai/mastra/commit/8cf8a67b061b737cb06d501fb8c1967a98bbf3cb), [`d7827e3`](https://github.com/mastra-ai/mastra/commit/d7827e393937c6cb0c7a744dde4d31538cb542b7)]:
|
|
15
|
+
- @mastra/core@1.21.0-alpha.2
|
|
16
|
+
|
|
3
17
|
## 1.1.20-alpha.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.1.20
|
|
3
|
+
"version": "1.1.20",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"local-pkg": "^1.1.2",
|
|
31
31
|
"zod": "^4.3.6",
|
|
32
|
-
"@mastra/core": "1.21.0
|
|
32
|
+
"@mastra/core": "1.21.0",
|
|
33
33
|
"@mastra/mcp": "^1.4.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"tsx": "^4.21.0",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "4.0.18",
|
|
49
|
-
"@internal/lint": "0.0.
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
49
|
+
"@internal/lint": "0.0.78",
|
|
50
|
+
"@mastra/core": "1.21.0",
|
|
51
|
+
"@internal/types-builder": "0.0.53"
|
|
52
52
|
},
|
|
53
53
|
"homepage": "https://mastra.ai",
|
|
54
54
|
"repository": {
|