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

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.
@@ -4,10 +4,6 @@ In this guide, you'll build a tool-calling AI agent using Mastra, then connect i
4
4
 
5
5
  You'll use [AI SDK UI](https://ai-sdk.dev/docs/ai-sdk-ui/overview) and [AI Elements](https://ai-sdk.dev/elements) to create a beautiful, interactive chat experience.
6
6
 
7
- ![Screenshot of a chat-style web app displaying a completed \"weatherTool\" tool call, answering \"What is the weather in London?\" with a JSON result. A message suggests offering activity ideas, and a text input field is at the bottom.](/assets/images/nextjs-quickstart-11fce4f78d172367bb97a14f132d701f.png)
8
-
9
- What you'll build: an agent that can call a weather tool, display the JSON result, stream a weather summary in the chat UI, and persist conversation history across reloads.
10
-
11
7
  ## Before you begin
12
8
 
13
9
  - You'll need an API key from a supported [model provider](https://mastra.ai/models). If you don't have a preference, use [OpenAI](https://mastra.ai/models/providers/openai).
@@ -1,6 +1,6 @@
1
1
  # ![OpenRouter logo](https://models.dev/logos/openrouter.svg)OpenRouter
2
2
 
3
- OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 171 models through Mastra's model router.
3
+ OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 172 models through Mastra's model router.
4
4
 
5
5
  Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
6
6
 
@@ -117,6 +117,7 @@ ANTHROPIC_API_KEY=ant-...
117
117
  | `moonshotai/kimi-k2-0905:exacto` |
118
118
  | `moonshotai/kimi-k2-thinking` |
119
119
  | `moonshotai/kimi-k2.5` |
120
+ | `moonshotai/kimi-k2.6` |
120
121
  | `nousresearch/hermes-3-llama-3.1-405b:free` |
121
122
  | `nousresearch/hermes-4-405b` |
122
123
  | `nousresearch/hermes-4-70b` |
@@ -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 3670 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 3675 models from 104 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -1,6 +1,6 @@
1
1
  # ![Moonshot AI logo](https://models.dev/logos/moonshotai.svg)Moonshot AI
2
2
 
3
- Access 6 Moonshot AI models through Mastra's model router. Authentication is handled automatically using the `MOONSHOT_API_KEY` environment variable.
3
+ Access 7 Moonshot AI 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 documentation](https://platform.moonshot.ai).
6
6
 
@@ -40,6 +40,7 @@ for await (const chunk of stream) {
40
40
  | `moonshotai/kimi-k2-thinking-turbo` | 262K | | | | | | $1 | $8 |
41
41
  | `moonshotai/kimi-k2-turbo-preview` | 262K | | | | | | $2 | $10 |
42
42
  | `moonshotai/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
43
+ | `moonshotai/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/kimi-k2.5"
73
+ ? "moonshotai/kimi-k2.6"
73
74
  : "moonshotai/kimi-k2-0711-preview";
74
75
  }
75
76
  });
@@ -1,6 +1,6 @@
1
1
  # ![Ollama Cloud logo](https://models.dev/logos/ollama-cloud.svg)Ollama Cloud
2
2
 
3
- Access 36 Ollama Cloud models through Mastra's model router. Authentication is handled automatically using the `OLLAMA_API_KEY` environment variable.
3
+ Access 37 Ollama Cloud models through Mastra's model router. Authentication is handled automatically using the `OLLAMA_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Ollama Cloud documentation](https://docs.ollama.com/cloud).
6
6
 
@@ -53,6 +53,7 @@ for await (const chunk of stream) {
53
53
  | `ollama-cloud/kimi-k2-thinking` | 262K | | | | | | — | — |
54
54
  | `ollama-cloud/kimi-k2:1t` | 262K | | | | | | — | — |
55
55
  | `ollama-cloud/kimi-k2.5` | 262K | | | | | | — | — |
56
+ | `ollama-cloud/kimi-k2.6:cloud` | 262K | | | | | | — | — |
56
57
  | `ollama-cloud/minimax-m2` | 205K | | | | | | — | — |
57
58
  | `ollama-cloud/minimax-m2.1` | 205K | | | | | | — | — |
58
59
  | `ollama-cloud/minimax-m2.5` | 205K | | | | | | — | — |
@@ -37,7 +37,7 @@ for await (const chunk of stream) {
37
37
  | `opencode-go/glm-5` | 205K | | | | | | $1 | $3 |
38
38
  | `opencode-go/glm-5.1` | 205K | | | | | | $1 | $4 |
39
39
  | `opencode-go/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
40
- | `opencode-go/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
40
+ | `opencode-go/kimi-k2.6` | 262K | | | | | | $0.32 | $1 |
41
41
  | `opencode-go/mimo-v2-omni` | 262K | | | | | | $0.40 | $2 |
42
42
  | `opencode-go/mimo-v2-pro` | 1.0M | | | | | | $1 | $3 |
43
43
  | `opencode-go/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
@@ -1,6 +1,6 @@
1
1
  # ![OpenCode Zen logo](https://models.dev/logos/opencode.svg)OpenCode Zen
2
2
 
3
- Access 35 OpenCode Zen models through Mastra's model router. Authentication is handled automatically using the `OPENCODE_API_KEY` environment variable.
3
+ Access 37 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
 
@@ -64,8 +64,10 @@ for await (const chunk of stream) {
64
64
  | `opencode/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
65
65
  | `opencode/gpt-5.4-pro` | 1.1M | | | | | | $30 | $180 |
66
66
  | `opencode/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
67
+ | `opencode/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
67
68
  | `opencode/minimax-m2.5` | 205K | | | | | | $0.30 | $1 |
68
69
  | `opencode/minimax-m2.5-free` | 205K | | | | | | — | — |
70
+ | `opencode/minimax-m2.7` | 205K | | | | | | $0.30 | $1 |
69
71
  | `opencode/nemotron-3-super-free` | 205K | | | | | | — | — |
70
72
  | `opencode/qwen3.5-plus` | 262K | | | | | | $0.20 | $1 |
71
73
  | `opencode/qwen3.6-plus` | 262K | | | | | | $0.50 | $3 |
@@ -117,4 +117,17 @@ export const mastra = new Mastra({
117
117
  ],
118
118
  },
119
119
  })
120
- ```
120
+ ```
121
+
122
+ > **Keep bindings inline inside new Mastra({...}):** Mastra's Babel plugin defers `new Mastra(...)` so that `env` is available when it runs. Code outside that call evaluates at module load before `env` is populated.
123
+ >
124
+ > ```typescript
125
+ > // ✅ Works — binding is inside new Mastra(), so it's deferred
126
+ > export const mastra = new Mastra({
127
+ > storage: new D1Store({ binding: env.DB }),
128
+ > })
129
+ >
130
+ > // ❌ Breaks — env.DB is undefined at module load
131
+ > const storage = new D1Store({ binding: env.DB })
132
+ > export const mastra = new Mastra({ storage })
133
+ > ```
@@ -34,59 +34,59 @@ bun add @mastra/cloudflare-d1@latest
34
34
 
35
35
  ## Usage
36
36
 
37
- ### Using with Cloudflare Workers
37
+ ### Using with Mastra CloudflareDeployer
38
38
 
39
- When using D1Store in a Cloudflare Worker, you need to access the D1 binding from the worker's `env` parameter at runtime. The `D1Database` in your type definition is only for TypeScript type checking—the actual binding is provided by the Workers runtime.
39
+ The standard way to use D1Store with Mastra on Cloudflare is with `CloudflareDeployer`. Import `env` from `cloudflare:workers` and initialize `D1Store` inline inside `new Mastra({...})`.
40
40
 
41
41
  ```typescript
42
+ import { env } from 'cloudflare:workers'
42
43
  import { D1Store } from '@mastra/cloudflare-d1'
43
44
  import { Mastra } from '@mastra/core'
44
45
  import { CloudflareDeployer } from '@mastra/deployer-cloudflare'
45
46
 
46
- type Env = {
47
- D1Database: D1Database // TypeScript type definition
48
- }
47
+ export const mastra = new Mastra({
48
+ storage: new D1Store({ binding: env.DB }),
49
+ deployer: new CloudflareDeployer({
50
+ name: 'my-worker',
51
+ d1_databases: [
52
+ {
53
+ binding: 'DB',
54
+ database_name: 'your-database-name',
55
+ database_id: 'your-database-id',
56
+ },
57
+ ],
58
+ }),
59
+ })
60
+ ```
61
+
62
+ > **Note:** When using `import { env } from 'cloudflare:workers'`, `D1Store` must be initialized inline inside `new Mastra({...})` — not extracted to a module-level variable. Alternatively, initialize `D1Store` inside the `fetch` handler after `env` is available. See [CloudflareDeployer reference](https://mastra.ai/reference/deployer/cloudflare) for details.
49
63
 
50
- // Factory function to create Mastra with D1 binding
51
- function createMastra(env: Env) {
52
- const storage = new D1Store({
53
- binding: env.D1Database, // ✅ Access the actual binding from env
54
- tablePrefix: 'dev_', // Optional: isolate tables per environment
55
- })
56
-
57
- return new Mastra({
58
- storage,
59
- deployer: new CloudflareDeployer({
60
- name: 'my-worker',
61
- d1_databases: [
62
- {
63
- binding: 'D1Database', // Must match the property name in Env type
64
- database_name: 'your-database-name',
65
- database_id: 'your-database-id',
66
- },
67
- ],
68
- }),
69
- })
64
+ ### Using in a Cloudflare Worker without HTTP routes
65
+
66
+ If you want to call Mastra directly in a Worker — for example, to run an agent or trigger a workflow — without serving HTTP routes, you don't need `CloudflareDeployer`. Access the D1 binding from the worker's `env` parameter and call Mastra programmatically.
67
+
68
+ ```typescript
69
+ import { D1Store } from '@mastra/cloudflare-d1'
70
+ import { Mastra } from '@mastra/core'
71
+
72
+ type Env = {
73
+ DB: D1Database
70
74
  }
71
75
 
72
- // Cloudflare Worker export
73
76
  export default {
74
77
  async fetch(request: Request, env: Env, ctx: ExecutionContext) {
75
- const mastra = createMastra(env)
78
+ const mastra = new Mastra({
79
+ storage: new D1Store({ binding: env.DB }),
80
+ })
76
81
 
77
- // Your handler logic here
78
- return new Response('Hello from Mastra with D1!')
82
+ const agent = mastra.getAgent('my-agent')
83
+ const result = await agent.generate('Hello')
84
+
85
+ return Response.json({ text: result.text })
79
86
  },
80
87
  }
81
88
  ```
82
89
 
83
- > **Important: Understanding D1 Bindings:** In the `Env` type definition, `D1Database: D1Database` serves two purposes:
84
- >
85
- > - The **property name** (`D1Database`) must match the `binding` name in your `wrangler.toml`
86
- > - The **type** (`: D1Database`) is from `@cloudflare/workers-types` for TypeScript type checking
87
- >
88
- > At runtime, Cloudflare Workers provides the actual D1 database instance via `env.D1Database`. You can't use `D1Database` directly outside of the worker's context.
89
-
90
90
  ### Using with REST API
91
91
 
92
92
  For non-Workers environments (Node.js, serverless functions, etc.), use the REST API approach:
@@ -108,7 +108,7 @@ Add the D1 database binding to your `wrangler.toml`:
108
108
 
109
109
  ```toml
110
110
  [[d1_databases]]
111
- binding = "D1Database" # Must match the property name in your Env type
111
+ binding = "DB"
112
112
  database_name = "your-database-name"
113
113
  database_id = "your-database-id"
114
114
  ```
@@ -119,7 +119,7 @@ Or in `wrangler.jsonc`:
119
119
  {
120
120
  "d1_databases": [
121
121
  {
122
- "binding": "D1Database",
122
+ "binding": "DB",
123
123
  "database_name": "your-database-name",
124
124
  "database_id": "your-database-id",
125
125
  },
@@ -158,14 +158,14 @@ import { Mastra } from '@mastra/core'
158
158
  import { D1Store } from '@mastra/cloudflare-d1'
159
159
 
160
160
  type Env = {
161
- D1Database: D1Database
161
+ DB: D1Database
162
162
  }
163
163
 
164
164
  // In a Cloudflare Worker
165
165
  export default {
166
166
  async fetch(request: Request, env: Env, ctx: ExecutionContext) {
167
167
  const storage = new D1Store({
168
- binding: env.D1Database, // ✅ Use env.D1Database
168
+ binding: env.DB,
169
169
  })
170
170
 
171
171
  const mastra = new Mastra({
@@ -184,7 +184,7 @@ If you're using storage directly without Mastra, you must call `init()` explicit
184
184
  import { D1Store } from '@mastra/cloudflare-d1'
185
185
 
186
186
  type Env = {
187
- D1Database: D1Database
187
+ DB: D1Database
188
188
  }
189
189
 
190
190
  // In a Cloudflare Worker
@@ -192,7 +192,7 @@ export default {
192
192
  async fetch(request: Request, env: Env, ctx: ExecutionContext) {
193
193
  const storage = new D1Store({
194
194
  id: 'd1-storage',
195
- binding: env.D1Database, // ✅ Use env.D1Database
195
+ binding: env.DB,
196
196
  })
197
197
 
198
198
  // Required when using storage directly
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.26-alpha.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`20f59b8`](https://github.com/mastra-ai/mastra/commit/20f59b876cf91199efbc49a0e36b391240708f08), [`e2687a7`](https://github.com/mastra-ai/mastra/commit/e2687a7408790c384563816a9a28ed06735684c9), [`8f1b280`](https://github.com/mastra-ai/mastra/commit/8f1b280b7fe6999ec654f160cb69c1a8719e7a57), [`12df98c`](https://github.com/mastra-ai/mastra/commit/12df98c4904643d9481f5c78f3bed443725b4c96)]:
8
+ - @mastra/core@1.26.0-alpha.11
9
+
3
10
  ## 1.1.26-alpha.19
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.20",
3
+ "version": "1.1.26-alpha.22",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,26 +29,26 @@
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.10",
32
+ "@mastra/core": "1.26.0-alpha.11",
33
33
  "@mastra/mcp": "^1.5.1-alpha.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@hono/node-server": "^1.19.11",
37
37
  "@types/jsdom": "^21.1.7",
38
38
  "@types/node": "22.19.15",
39
- "@vitest/coverage-v8": "4.0.18",
40
- "@vitest/ui": "4.0.18",
39
+ "@vitest/coverage-v8": "4.1.4",
40
+ "@vitest/ui": "4.1.4",
41
41
  "@wong2/mcp-cli": "^1.13.0",
42
42
  "cross-env": "^10.1.0",
43
- "eslint": "^9.39.4",
43
+ "eslint": "^10.2.1",
44
44
  "hono": "^4.12.8",
45
45
  "tsup": "^8.5.1",
46
46
  "tsx": "^4.21.0",
47
47
  "typescript": "^5.9.3",
48
- "vitest": "4.0.18",
49
- "@internal/lint": "0.0.83",
48
+ "vitest": "4.1.4",
50
49
  "@internal/types-builder": "0.0.58",
51
- "@mastra/core": "1.26.0-alpha.10"
50
+ "@internal/lint": "0.0.83",
51
+ "@mastra/core": "1.26.0-alpha.11"
52
52
  },
53
53
  "homepage": "https://mastra.ai",
54
54
  "repository": {