@mastra/mcp-docs-server 1.1.35-alpha.2 → 1.1.35-alpha.5

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.
@@ -458,4 +458,5 @@ In practical terms, OM replaces both working memory and message history, and has
458
458
  - [Observational Memory Reference](https://mastra.ai/reference/memory/observational-memory)
459
459
  - [Memory Overview](https://mastra.ai/docs/memory/overview)
460
460
  - [Message History](https://mastra.ai/docs/memory/message-history)
461
- - [Memory Processors](https://mastra.ai/docs/memory/memory-processors)
461
+ - [Memory Processors](https://mastra.ai/docs/memory/memory-processors)
462
+ - [Mastra Code](https://code.mastra.ai/): A coding agent using Observational Memory
@@ -237,4 +237,5 @@ export const memoryAgent = new Agent({
237
237
 
238
238
  - [`Memory` reference](https://mastra.ai/reference/memory/memory-class)
239
239
  - [Tracing](https://mastra.ai/docs/observability/tracing/overview)
240
- - [Request Context](https://mastra.ai/docs/server/request-context)
240
+ - [Request Context](https://mastra.ai/docs/server/request-context)
241
+ - [Mastra Code](https://code.mastra.ai/): A coding agent using Mastra's memory system
@@ -21,27 +21,29 @@ Install the required packages:
21
21
  **npm**:
22
22
 
23
23
  ```bash
24
- npm install @mastra/inngest@latest inngest @inngest/realtime
24
+ npm install @mastra/inngest@latest inngest
25
25
  ```
26
26
 
27
27
  **pnpm**:
28
28
 
29
29
  ```bash
30
- pnpm add @mastra/inngest@latest inngest @inngest/realtime
30
+ pnpm add @mastra/inngest@latest inngest
31
31
  ```
32
32
 
33
33
  **Yarn**:
34
34
 
35
35
  ```bash
36
- yarn add @mastra/inngest@latest inngest @inngest/realtime
36
+ yarn add @mastra/inngest@latest inngest
37
37
  ```
38
38
 
39
39
  **Bun**:
40
40
 
41
41
  ```bash
42
- bun add @mastra/inngest@latest inngest @inngest/realtime
42
+ bun add @mastra/inngest@latest inngest
43
43
  ```
44
44
 
45
+ > **Note:** Requires `inngest@^4` and Inngest Dev Server `v1.18.0` or later. Realtime is built into the SDK in v4, so `@inngest/realtime` and `realtimeMiddleware` are no longer used.
46
+
45
47
  ## Building an Inngest workflow
46
48
 
47
49
  This guide walks through creating a workflow with Inngest and Mastra, demonstrating a counter application that increments a value until it reaches 10.
@@ -54,13 +56,11 @@ In development:
54
56
 
55
57
  ```ts
56
58
  import { Inngest } from 'inngest'
57
- import { realtimeMiddleware } from '@inngest/realtime/middleware'
58
59
 
59
60
  export const inngest = new Inngest({
60
61
  id: 'mastra',
61
62
  baseUrl: 'http://localhost:8288',
62
63
  isDev: true,
63
- middleware: [realtimeMiddleware()],
64
64
  })
65
65
  ```
66
66
 
@@ -68,11 +68,9 @@ In production:
68
68
 
69
69
  ```ts
70
70
  import { Inngest } from 'inngest'
71
- import { realtimeMiddleware } from '@inngest/realtime/middleware'
72
71
 
73
72
  export const inngest = new Inngest({
74
73
  id: 'mastra',
75
- middleware: [realtimeMiddleware()],
76
74
  })
77
75
  ```
78
76
 
@@ -1,6 +1,6 @@
1
1
  # Netlify
2
2
 
3
- Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 66 models through Mastra's model router.
3
+ Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 67 models through Mastra's model router.
4
4
 
5
5
  Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
6
6
 
@@ -62,6 +62,7 @@ ANTHROPIC_API_KEY=ant-...
62
62
  | `gemini/gemini-3.1-pro-preview-customtools` |
63
63
  | `gemini/gemini-flash-latest` |
64
64
  | `gemini/gemini-flash-lite-latest` |
65
+ | `openai/chat-latest` |
65
66
  | `openai/gpt-4.1` |
66
67
  | `openai/gpt-4.1-mini` |
67
68
  | `openai/gpt-4.1-nano` |
@@ -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 185 models through Mastra's model router.
3
+ OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 186 models through Mastra's model router.
4
4
 
5
5
  Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
6
6
 
@@ -172,6 +172,7 @@ ANTHROPIC_API_KEY=ant-...
172
172
  | `poolside/laguna-xs.2:free` |
173
173
  | `prime-intellect/intellect-3` |
174
174
  | `qwen/qwen-2.5-coder-32b-instruct` |
175
+ | `qwen/qwen-3.6-27b` |
175
176
  | `qwen/qwen2.5-vl-72b-instruct` |
176
177
  | `qwen/qwen3-235b-a22b-07-25` |
177
178
  | `qwen/qwen3-235b-a22b-thinking-2507` |
@@ -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 3875 models from 107 providers through a single API.
3
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3879 models from 107 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -1,6 +1,6 @@
1
1
  # ![Deep Infra logo](https://models.dev/logos/deepinfra.svg)Deep Infra
2
2
 
3
- Access 35 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
3
+ Access 36 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Deep Infra documentation](https://deepinfra.com/models).
6
6
 
@@ -36,6 +36,7 @@ for await (const chunk of stream) {
36
36
  | `deepinfra/anthropic/claude-4-opus` | 200K | | | | | | $17 | $83 |
37
37
  | `deepinfra/deepseek-ai/DeepSeek-R1-0528` | 164K | | | | | | $0.50 | $2 |
38
38
  | `deepinfra/deepseek-ai/DeepSeek-V3.2` | 164K | | | | | | $0.26 | $0.38 |
39
+ | `deepinfra/deepseek-ai/DeepSeek-V4-Flash` | 1.0M | | | | | | $0.14 | $0.28 |
39
40
  | `deepinfra/deepseek-ai/DeepSeek-V4-Pro` | 66K | | | | | | $2 | $3 |
40
41
  | `deepinfra/google/gemma-4-26B-A4B-it` | 256K | | | | | | $0.07 | $0.34 |
41
42
  | `deepinfra/google/gemma-4-31B-it` | 256K | | | | | | $0.13 | $0.38 |
@@ -1,6 +1,6 @@
1
1
  # ![DigitalOcean logo](https://models.dev/logos/digitalocean.svg)DigitalOcean
2
2
 
3
- Access 63 DigitalOcean models through Mastra's model router. Authentication is handled automatically using the `DIGITALOCEAN_ACCESS_TOKEN` environment variable.
3
+ Access 64 DigitalOcean models through Mastra's model router. Authentication is handled automatically using the `DIGITALOCEAN_ACCESS_TOKEN` environment variable.
4
4
 
5
5
  Learn more in the [DigitalOcean documentation](https://docs.digitalocean.com/products/gradient-ai-platform/details/models/).
6
6
 
@@ -60,6 +60,7 @@ for await (const chunk of stream) {
60
60
  | `digitalocean/glm-5` | 203K | | | | | | $1 | $3 |
61
61
  | `digitalocean/gte-large-en-v1.5` | 8K | | | | | | $0.09 | — |
62
62
  | `digitalocean/kimi-k2.5` | 262K | | | | | | $0.50 | $3 |
63
+ | `digitalocean/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
63
64
  | `digitalocean/llama-4-maverick` | 1.0M | | | | | | $0.25 | $0.87 |
64
65
  | `digitalocean/llama-guard-4-12b` | 128K | | | | | | — | — |
65
66
  | `digitalocean/llama3.3-70b-instruct` | 128K | | | | | | $0.65 | $0.65 |
@@ -39,7 +39,7 @@ for await (const chunk of stream) {
39
39
  | `opencode-go/glm-5` | 203K | | | | | | $1 | $3 |
40
40
  | `opencode-go/glm-5.1` | 203K | | | | | | $1 | $4 |
41
41
  | `opencode-go/kimi-k2.5` | 262K | | | | | | $0.60 | $3 |
42
- | `opencode-go/kimi-k2.6` | 262K | | | | | | $0.32 | $1 |
42
+ | `opencode-go/kimi-k2.6` | 262K | | | | | | $0.95 | $4 |
43
43
  | `opencode-go/mimo-v2-omni` | 262K | | | | | | $0.40 | $2 |
44
44
  | `opencode-go/mimo-v2-pro` | 1.0M | | | | | | $1 | $3 |
45
45
  | `opencode-go/mimo-v2.5` | 1.0M | | | | | | $0.40 | $2 |
@@ -3,6 +3,8 @@
3
3
  **Added in:** `@mastra/core@1.5.0`
4
4
 
5
5
  > **Warning:** The `Harness` class is in alpha stage and subject to change. It won't follow semantic versioning guarantees until it graduates from experimental status. Use with caution and expect breaking changes in minor versions.
6
+ >
7
+ > [Mastra Code](https://code.mastra.ai/) is the flagship implementation of the `Harness` class, showcasing how it can be used to build a powerful terminal-based coding agent with multi-model support, persistent conversations, and built-in tools.
6
8
 
7
9
  The `Harness` class orchestrates multiple agent modes, shared state, memory, and storage. It provides a control layer that a TUI or other UI can drive to manage threads, switch models and modes, send messages, handle tool approvals, and track events.
8
10
 
@@ -987,6 +987,53 @@ await agent.generate('Hello!', {
987
987
  })
988
988
  ```
989
989
 
990
+ ## Handling auth failures inside custom fetch
991
+
992
+ A custom `fetch` should not `throw` when authentication is unavailable. The Streamable HTTP transport in the MCP SDK opens a long-lived `GET /mcp` "standalone listener" stream in the background to receive server-pushed notifications. Errors on that stream are retried with exponential backoff, and a thrown `fetch` or a cleanly-closed stream can produce an indefinite reconnect loop at roughly one attempt per second.
993
+
994
+ Return a synthetic `Response` instead. The [MCP Streamable HTTP specification](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports) defines `405 Method Not Allowed` as the signal a server returns when it does not offer the GET SSE stream, and the SDK honors it as a terminal status that stops the listener cleanly. Use this to disable the listener when your server does not push notifications.
995
+
996
+ The following pattern waits for an auth token on POST requests, attaches it to outgoing headers, and short-circuits the GET listener with a synthetic 405:
997
+
998
+ ```typescript
999
+ async function waitForToken(timeoutMs = 5000): Promise<string | null> {
1000
+ // Replace with your token lookup. Return null if no token is available.
1001
+ return getAuthToken({ timeoutMs })
1002
+ }
1003
+
1004
+ const mcpClient = new MCPClient({
1005
+ servers: {
1006
+ apiServer: {
1007
+ url: new URL('https://api.example.com/mcp'),
1008
+ fetch: async (url, init) => {
1009
+ const method = (init?.method || 'GET').toUpperCase()
1010
+
1011
+ // The SDK opens a background GET stream for server-pushed notifications.
1012
+ // If your server does not use it, short-circuit with 405 to stop reconnect attempts.
1013
+ if (method === 'GET') {
1014
+ return new Response(null, { status: 405, statusText: 'Method Not Allowed' })
1015
+ }
1016
+
1017
+ // POST: wait for the token, then forward the request with an Authorization header.
1018
+ const token = await waitForToken()
1019
+ if (!token) {
1020
+ // Forward the request without a token and let the server reject it.
1021
+ // The SDK surfaces non-2xx POST responses as errors to the caller of
1022
+ // tools/list, tools/call, etc., which is the desired behavior here.
1023
+ return fetch(url, init)
1024
+ }
1025
+
1026
+ const headers = new Headers(init?.headers)
1027
+ headers.set('authorization', `Bearer ${token}`)
1028
+ return fetch(url, { ...init, headers })
1029
+ },
1030
+ },
1031
+ },
1032
+ })
1033
+ ```
1034
+
1035
+ Return `405` for the GET listener only when your server does not push notifications back to the client. If your server uses the standalone GET stream, attach the auth token on `GET` requests as well and let the request through.
1036
+
990
1037
  ## Using SSE request headers
991
1038
 
992
1039
  When using the legacy SSE MCP transport, you must configure both `requestInit` and `eventSourceInit` due to a bug in the MCP SDK. Alternatively, you can use a custom `fetch` function which will be automatically used for both POST requests and SSE connections:
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.35-alpha.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`dccd8f1`](https://github.com/mastra-ai/mastra/commit/dccd8f1f8b8f1ad203b77556207e5529567c616d)]:
8
+ - @mastra/core@1.33.0-alpha.1
9
+
3
10
  ## 1.1.35-alpha.1
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.35-alpha.2",
3
+ "version": "1.1.35-alpha.5",
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.33.0-alpha.0",
32
+ "@mastra/core": "1.33.0-alpha.1",
33
33
  "@mastra/mcp": "^1.7.0"
34
34
  },
35
35
  "devDependencies": {
@@ -48,7 +48,7 @@
48
48
  "vitest": "4.1.5",
49
49
  "@internal/lint": "0.0.92",
50
50
  "@internal/types-builder": "0.0.67",
51
- "@mastra/core": "1.33.0-alpha.0"
51
+ "@mastra/core": "1.33.0-alpha.1"
52
52
  },
53
53
  "homepage": "https://mastra.ai",
54
54
  "repository": {