@mastra/mcp-docs-server 1.2.27-alpha.24 → 1.2.28-alpha.1

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.
Files changed (34) hide show
  1. package/.docs/docs/connections/mcp.md +15 -9
  2. package/.docs/docs/server/server-adapters.md +16 -18
  3. package/.docs/models/gateways/openrouter.md +3 -2
  4. package/.docs/models/gateways/vercel.md +4 -1
  5. package/.docs/models/index.md +1 -1
  6. package/.docs/models/providers/alibaba-cn.md +3 -3
  7. package/.docs/models/providers/coralbricks.md +10 -10
  8. package/.docs/models/providers/crossmodel.md +4 -1
  9. package/.docs/models/providers/digitalocean.md +9 -9
  10. package/.docs/models/providers/edenai.md +6 -5
  11. package/.docs/models/providers/empiriolabs.md +2 -1
  12. package/.docs/models/providers/kilo.md +8 -7
  13. package/.docs/models/providers/llmgateway-providers.md +3 -1
  14. package/.docs/models/providers/llmgateway.md +3 -1
  15. package/.docs/models/providers/nano-gpt.md +7 -4
  16. package/.docs/models/providers/opencode.md +0 -1
  17. package/.docs/models/providers/tempr.md +33 -18
  18. package/.docs/models/providers/wandb.md +2 -1
  19. package/.docs/models/providers/xiaomi-token-plan-ams.md +4 -2
  20. package/.docs/models/providers/xiaomi-token-plan-cn.md +4 -2
  21. package/.docs/models/providers/xiaomi-token-plan-sgp.md +4 -2
  22. package/.docs/models/providers/xiaomi.md +5 -2
  23. package/.docs/reference/configuration.md +10 -6
  24. package/.docs/reference/core/getMCPServer.md +6 -10
  25. package/.docs/reference/observability/tracing/exporters/mastra-platform-exporter.md +10 -0
  26. package/.docs/reference/server/elysia-adapter.md +2 -2
  27. package/.docs/reference/server/express-adapter.md +1 -1
  28. package/.docs/reference/server/fastify-adapter.md +1 -1
  29. package/.docs/reference/server/hono-adapter.md +1 -1
  30. package/.docs/reference/server/koa-adapter.md +1 -1
  31. package/.docs/reference/server/nestjs-adapter.md +0 -2
  32. package/.docs/reference/tools/mcp-client.md +77 -276
  33. package/.docs/reference/tools/mcp-server.md +205 -537
  34. package/package.json +5 -5
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Tempr logo](https://models.dev/logos/tempr.svg)Tempr
6
6
 
7
- Access 14 Tempr models through Mastra's model router. Authentication is handled automatically using the `TEMPR_API_KEY` environment variable.
7
+ Access 29 Tempr models through Mastra's model router. Authentication is handled automatically using the `TEMPR_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Tempr documentation](https://temprhq.io/docs/gateway-reference.html).
10
10
 
@@ -36,22 +36,37 @@ for await (const chunk of stream) {
36
36
 
37
37
  ## Models
38
38
 
39
- | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
- | -------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
- | `tempr/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
42
- | `tempr/anthropic/claude-fable-5-1` | 1.0M | | | | | | $10 | $50 |
43
- | `tempr/anthropic/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
44
- | `tempr/anthropic/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $5 |
45
- | `tempr/anthropic/claude-opus-4-5` | 200K | | | | | | $5 | $25 |
46
- | `tempr/anthropic/claude-opus-4-5-20251101` | 200K | | | | | | $5 | $25 |
47
- | `tempr/anthropic/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 |
48
- | `tempr/anthropic/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 |
49
- | `tempr/anthropic/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 |
50
- | `tempr/anthropic/claude-opus-5` | 1.0M | | | | | | $5 | $25 |
51
- | `tempr/anthropic/claude-sonnet-4-5` | 200K | | | | | | $3 | $15 |
52
- | `tempr/anthropic/claude-sonnet-4-5-20250929` | 200K | | | | | | $3 | $15 |
53
- | `tempr/anthropic/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
54
- | `tempr/anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
39
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
40
+ | ------------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
+ | `tempr/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
42
+ | `tempr/anthropic/claude-fable-5-1` | 1.0M | | | | | | $10 | $50 |
43
+ | `tempr/anthropic/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
44
+ | `tempr/anthropic/claude-haiku-4-5-20251001` | 200K | | | | | | $1 | $5 |
45
+ | `tempr/anthropic/claude-opus-4-5` | 200K | | | | | | $5 | $25 |
46
+ | `tempr/anthropic/claude-opus-4-5-20251101` | 200K | | | | | | $5 | $25 |
47
+ | `tempr/anthropic/claude-opus-4-6` | 1.0M | | | | | | $5 | $25 |
48
+ | `tempr/anthropic/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 |
49
+ | `tempr/anthropic/claude-opus-4-8` | 1.0M | | | | | | $5 | $25 |
50
+ | `tempr/anthropic/claude-opus-5` | 1.0M | | | | | | $5 | $25 |
51
+ | `tempr/anthropic/claude-sonnet-4-5` | 200K | | | | | | $3 | $15 |
52
+ | `tempr/anthropic/claude-sonnet-4-5-20250929` | 200K | | | | | | $3 | $15 |
53
+ | `tempr/anthropic/claude-sonnet-4-6` | 1.0M | | | | | | $3 | $15 |
54
+ | `tempr/anthropic/claude-sonnet-5` | 1.0M | | | | | | $2 | $10 |
55
+ | `tempr/google/gemini-3-flash-preview` | 1.0M | | | | | | $0.50 | $3 |
56
+ | `tempr/google/gemini-3.1-flash-lite` | 1.0M | | | | | | $0.25 | $2 |
57
+ | `tempr/google/gemini-3.1-pro-preview` | 1.0M | | | | | | $2 | $12 |
58
+ | `tempr/google/gemini-3.1-pro-preview-customtools` | 1.0M | | | | | | $2 | $12 |
59
+ | `tempr/google/gemini-3.5-flash` | 1.0M | | | | | | $2 | $9 |
60
+ | `tempr/google/gemini-3.5-flash-lite` | 1.0M | | | | | | $0.30 | $3 |
61
+ | `tempr/google/gemini-3.6-flash` | 1.0M | | | | | | $0.75 | $4 |
62
+ | `tempr/google/gemini-3.7-flash` | 1.0M | | | | | | $0.75 | $4 |
63
+ | `tempr/google/gemini-3.8-flash` | 1.0M | | | | | | $0.75 | $4 |
64
+ | `tempr/google/gemini-embedding-001` | 2K | | | | | | $0.15 | — |
65
+ | `tempr/google/gemini-embedding-2` | 8K | | | | | | $0.20 | — |
66
+ | `tempr/google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
67
+ | `tempr/google/gemini-flash-lite-latest` | 1.0M | | | | | | $0.30 | $3 |
68
+ | `tempr/google/gemma-4-26b-a4b-it` | 262K | | | | | | — | — |
69
+ | `tempr/google/gemma-4-31b-it` | 262K | | | | | | — | — |
55
70
 
56
71
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
57
72
 
@@ -83,7 +98,7 @@ const agent = new Agent({
83
98
  model: ({ requestContext }) => {
84
99
  const useAdvanced = requestContext.task === "complex";
85
100
  return useAdvanced
86
- ? "tempr/anthropic/claude-sonnet-5"
101
+ ? "tempr/google/gemma-4-31b-it"
87
102
  : "tempr/anthropic/claude-fable-5";
88
103
  }
89
104
  });
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![CoreWeave logo](https://models.dev/logos/wandb.svg)CoreWeave
6
6
 
7
- Access 27 CoreWeave models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
7
+ Access 28 CoreWeave models through Mastra's model router. Authentication is handled automatically using the `WANDB_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [CoreWeave documentation](https://docs.wandb.ai).
10
10
 
@@ -43,6 +43,7 @@ for await (const chunk of stream) {
43
43
  | `wandb/deepseek-ai/DeepSeek-V4-Flash-0731` | 262K | | | | | | $0.13 | $0.28 |
44
44
  | `wandb/deepseek-ai/DeepSeek-V4-Pro` | 1.0M | | | | | | $1 | $3 |
45
45
  | `wandb/deepseek-ai/DeepSeek-V4-Pro-0813` | 1.0M | | | | | | $1 | $4 |
46
+ | `wandb/deepseek-ai/DeepSeek-V4.1-Flash` | 1.0M | | | | | | $0.20 | $0.65 |
46
47
  | `wandb/google/gemma-4-31B-it` | 262K | | | | | | $0.10 | $0.34 |
47
48
  | `wandb/ibm-granite/granite-4.1-8b` | 131K | | | | | | $0.05 | $0.10 |
48
49
  | `wandb/ibm-granite/granite-4.2-8b` | 131K | | | | | | $0.10 | $0.15 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Xiaomi Token Plan (Europe) logo](https://models.dev/logos/xiaomi-token-plan-ams.svg)Xiaomi Token Plan (Europe)
6
6
 
7
- Access 7 Xiaomi Token Plan (Europe) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
7
+ Access 9 Xiaomi Token Plan (Europe) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Xiaomi Token Plan (Europe) documentation](https://platform.xiaomimimo.com/#/docs).
10
10
 
@@ -44,6 +44,8 @@ for await (const chunk of stream) {
44
44
  | `xiaomi-token-plan-ams/mimo-v2.5-tts` | 8K | | | | | | — | — |
45
45
  | `xiaomi-token-plan-ams/mimo-v2.5-tts-voiceclone` | 8K | | | | | | — | — |
46
46
  | `xiaomi-token-plan-ams/mimo-v2.5-tts-voicedesign` | 8K | | | | | | — | — |
47
+ | `xiaomi-token-plan-ams/mimo-v2.6-flash` | 1.0M | | | | | | — | — |
48
+ | `xiaomi-token-plan-ams/mimo-v2.6-pro` | 1.0M | | | | | | — | — |
47
49
 
48
50
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
49
51
 
@@ -75,7 +77,7 @@ const agent = new Agent({
75
77
  model: ({ requestContext }) => {
76
78
  const useAdvanced = requestContext.task === "complex";
77
79
  return useAdvanced
78
- ? "xiaomi-token-plan-ams/mimo-v2.5-tts-voicedesign"
80
+ ? "xiaomi-token-plan-ams/mimo-v2.6-pro"
79
81
  : "xiaomi-token-plan-ams/mimo-v2-pro";
80
82
  }
81
83
  });
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Xiaomi Token Plan (China) logo](https://models.dev/logos/xiaomi-token-plan-cn.svg)Xiaomi Token Plan (China)
6
6
 
7
- Access 7 Xiaomi Token Plan (China) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
7
+ Access 9 Xiaomi Token Plan (China) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Xiaomi Token Plan (China) documentation](https://platform.xiaomimimo.com/#/docs).
10
10
 
@@ -44,6 +44,8 @@ for await (const chunk of stream) {
44
44
  | `xiaomi-token-plan-cn/mimo-v2.5-tts` | 8K | | | | | | — | — |
45
45
  | `xiaomi-token-plan-cn/mimo-v2.5-tts-voiceclone` | 8K | | | | | | — | — |
46
46
  | `xiaomi-token-plan-cn/mimo-v2.5-tts-voicedesign` | 8K | | | | | | — | — |
47
+ | `xiaomi-token-plan-cn/mimo-v2.6-flash` | 1.0M | | | | | | — | — |
48
+ | `xiaomi-token-plan-cn/mimo-v2.6-pro` | 1.0M | | | | | | — | — |
47
49
 
48
50
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
49
51
 
@@ -75,7 +77,7 @@ const agent = new Agent({
75
77
  model: ({ requestContext }) => {
76
78
  const useAdvanced = requestContext.task === "complex";
77
79
  return useAdvanced
78
- ? "xiaomi-token-plan-cn/mimo-v2.5-tts-voicedesign"
80
+ ? "xiaomi-token-plan-cn/mimo-v2.6-pro"
79
81
  : "xiaomi-token-plan-cn/mimo-v2-pro";
80
82
  }
81
83
  });
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Xiaomi Token Plan (Singapore) logo](https://models.dev/logos/xiaomi-token-plan-sgp.svg)Xiaomi Token Plan (Singapore)
6
6
 
7
- Access 7 Xiaomi Token Plan (Singapore) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
7
+ Access 9 Xiaomi Token Plan (Singapore) models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Xiaomi Token Plan (Singapore) documentation](https://platform.xiaomimimo.com/#/docs).
10
10
 
@@ -44,6 +44,8 @@ for await (const chunk of stream) {
44
44
  | `xiaomi-token-plan-sgp/mimo-v2.5-tts` | 8K | | | | | | — | — |
45
45
  | `xiaomi-token-plan-sgp/mimo-v2.5-tts-voiceclone` | 8K | | | | | | — | — |
46
46
  | `xiaomi-token-plan-sgp/mimo-v2.5-tts-voicedesign` | 8K | | | | | | — | — |
47
+ | `xiaomi-token-plan-sgp/mimo-v2.6-flash` | 1.0M | | | | | | — | — |
48
+ | `xiaomi-token-plan-sgp/mimo-v2.6-pro` | 1.0M | | | | | | — | — |
47
49
 
48
50
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
49
51
 
@@ -75,7 +77,7 @@ const agent = new Agent({
75
77
  model: ({ requestContext }) => {
76
78
  const useAdvanced = requestContext.task === "complex";
77
79
  return useAdvanced
78
- ? "xiaomi-token-plan-sgp/mimo-v2.5-tts-voicedesign"
80
+ ? "xiaomi-token-plan-sgp/mimo-v2.6-pro"
79
81
  : "xiaomi-token-plan-sgp/mimo-v2-pro";
80
82
  }
81
83
  });
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Xiaomi logo](https://models.dev/logos/xiaomi.svg)Xiaomi
6
6
 
7
- Access 6 Xiaomi models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
7
+ Access 9 Xiaomi models through Mastra's model router. Authentication is handled automatically using the `XIAOMI_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [Xiaomi documentation](https://platform.xiaomimimo.com/#/docs).
10
10
 
@@ -41,6 +41,9 @@ for await (const chunk of stream) {
41
41
  | `xiaomi/mimo-v2.5` | 1.0M | | | | | | $0.14 | $0.28 |
42
42
  | `xiaomi/mimo-v2.5-pro` | 1.0M | | | | | | $0.43 | $0.87 |
43
43
  | `xiaomi/mimo-v2.5-pro-ultraspeed` | 1.0M | | | | | | $1 | $3 |
44
+ | `xiaomi/mimo-v2.6-flash` | 1.0M | | | | | | $0.14 | $0.28 |
45
+ | `xiaomi/mimo-v2.6-pro` | 1.0M | | | | | | $0.43 | $0.87 |
46
+ | `xiaomi/mimo-v2.6-pro-ultraspeed` | 1.0M | | | | | | $4 | $9 |
44
47
 
45
48
  Model availability, capabilities, context windows, and pricing are sourced from [models.dev](https://models.dev) and may change.
46
49
 
@@ -72,7 +75,7 @@ const agent = new Agent({
72
75
  model: ({ requestContext }) => {
73
76
  const useAdvanced = requestContext.task === "complex";
74
77
  return useAdvanced
75
- ? "xiaomi/mimo-v2.5-pro-ultraspeed"
78
+ ? "xiaomi/mimo-v2.6-pro-ultraspeed"
76
79
  : "xiaomi/mimo-v2-flash";
77
80
  }
78
81
  });
@@ -660,12 +660,13 @@ export const mastra = new Mastra({
660
660
  **Type:** `object`\
661
661
  **Default:** `undefined`
662
662
 
663
- MCP transport options applied to all MCP HTTP and SSE routes. Use this to enable stateless mode for serverless environments (Cloudflare Workers, Vercel Edge, AWS Lambda, etc.) where persistent connections and in-memory session state aren't available.
663
+ Options applied to every MCP HTTP route. MCP requests are self-contained, so no session state is kept between them and the routes run unchanged in serverless environments (Cloudflare Workers, Vercel Edge, AWS Lambda, etc.).
664
664
 
665
- | Property | Type | Default | Description |
666
- | -------------------- | -------------- | ----------- | ---------------------------------------------------- |
667
- | `serverless` | `boolean` | `false` | Run MCP in stateless mode without session management |
668
- | `sessionIdGenerator` | `() => string` | `undefined` | Custom session ID generator function |
665
+ | Property | Type | Default | Description |
666
+ | -------------------- | ------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
667
+ | `setRequestAuth` | `(req, requestContext) => void \| Promise<void>` | `undefined` | Sets `req.auth` on the request handed to the MCP transport, which surfaces as `context.mcp.extra.authInfo` in tools. When omitted, the principal resolved by `server.auth` is bridged automatically. |
668
+ | `serverless` | `boolean` | `false` | Accepted for compatibility. Has no effect: every MCP request is already stateless. |
669
+ | `sessionIdGenerator` | `() => string` | `undefined` | Accepted for compatibility. Has no effect: MCP requests carry no session. |
669
670
 
670
671
  ```typescript
671
672
  import { Mastra } from '@mastra/core'
@@ -673,7 +674,10 @@ import { Mastra } from '@mastra/core'
673
674
  export const mastra = new Mastra({
674
675
  server: {
675
676
  mcpOptions: {
676
- serverless: true,
677
+ setRequestAuth: (req, requestContext) => {
678
+ const payload = requestContext.get('bearerPayload')
679
+ req.auth = { token: payload.token, clientId: payload.sub, scopes: [] }
680
+ },
677
681
  },
678
682
  },
679
683
  })
@@ -38,15 +38,13 @@ const serverById = mastra.getMCPServerById('my-mcp-server')
38
38
 
39
39
  **server** (`MCPServerBase | undefined`): The MCP server instance with the specified registry key, or undefined if not found.
40
40
 
41
- ## MCP 1.x and 2026-07-28 servers
41
+ ## The `MCPServerBase` contract
42
42
 
43
- Both `@mastra/mcp` 1.x and 2.x servers extend the same `MCPServerBase` from `@mastra/core/mcp`. A 2.x server sets `mcpVersion` to `2`, while 1.x servers leave it undefined and need no new properties or methods. The differences are limited to what the 2026-07-28 protocol changed: `startSSE` and `startHonoSSE` are no longer abstract and throw unless a 1.x server overrides them (only 1.x implements the standalone SSE transport, and both are deprecated), and a server with `mcpVersion` set to `2` resolves `executeTool` to a `MCPToolExecutionResultV2` that reports a suspended tool rather than a bare result.
44
-
45
- The 1.x-only surfaces are marked `@deprecated` and are removed in the next major release of `@mastra/core`: `startSSE`, `startHonoSSE`, `MCPServerSSEOptions`, `MCPServerHonoSSEOptions`, `MCPServerHTTPOptions.options`, and on `context.mcp` the members `elicitation`, `extra.sendNotification` and `extra.sendRequest`.
43
+ Every registered server extends `MCPServerBase` from `@mastra/core/mcp`. The `MCPServer` class in `@mastra/mcp` implements it for the MCP `2026-07-28` protocol and sets `mcpVersion` to `2`. Tool execution, suspension, and the `context.mcp` shape described below are the parts of the contract a tool author sees. For the 1.x-only members that remain on the base class as deprecated stubs, see the [migration guide](https://mastra.ai/reference/migrations/mcp-v2).
46
44
 
47
45
  ### Tools that ask for input
48
46
 
49
- A 2026-07-28 server runs ordinary `createTool` definitions. A tool that needs something from the user before it can finish declares `suspendSchema` and `resumeSchema` and calls `suspend()`, exactly as it would for an agent or a workflow. Core reports the suspension as `{ status: 'suspended', suspendPayload, resumeSchema }` from `executeTool`. An `@mastra/mcp` 2.x server turns that into an `input_required` round on the wire, and resumes the tool with the answer in `resumeData`.
47
+ An MCP server runs ordinary `createTool` definitions. A tool that needs something from the user before it can finish declares `suspendSchema` and `resumeSchema` and calls `suspend()`, exactly as it would for an agent or a workflow. Core reports the suspension as `{ status: 'suspended', suspendPayload, resumeSchema }` from `executeTool`. `MCPServer` turns that into an `input_required` round on the wire, and resumes the tool with the answer in `resumeData`.
50
48
 
51
49
  ```typescript
52
50
  import { createTool } from '@mastra/core/tools'
@@ -69,19 +67,17 @@ const confirm = createTool({
69
67
  })
70
68
  ```
71
69
 
72
- On a 2026-07-28 server and in direct execution, `suspend`, `resumeData` and `suspendPayload` sit at the top level of the tool context. Agents and workflows still nest them under `context.agent` and `context.workflow` until the next major release of `@mastra/core`. `resumeSchema` must be a flat object of primitive fields so it can be presented as an input form.
70
+ On an MCP server and in direct execution, `suspend`, `resumeData` and `suspendPayload` sit at the top level of the tool context. Agents and workflows still nest them under `context.agent` and `context.workflow` until the next major release of `@mastra/core`. `resumeSchema` must be a flat object of primitive fields so it can be presented as an input form.
73
71
 
74
72
  Each round is a separate request. `resumeData` carries only the current round's answer, validated against `resumeSchema`, and `suspendPayload` carries what the tool last suspended with. Because the framework never replays earlier rounds, handlers branch on explicit named phases, every round is re-authorized, and writes rely on domain-owned idempotency. `suspendPayload` is also handed back to tools resumed by agents and workflows.
75
73
 
76
74
  ### The `mcp` context
77
75
 
78
- Both server versions hand a tool the same `context.mcp` (`MCPToolExecutionContext`): `extra` with the request's `signal`, `requestId`, `authInfo` and `_meta`, plus `log(level, message, data?)` and `progress({ progress, total?, message? })`. A tool that only uses these works unchanged on either version. A 2026-07-28 server also sets `context.mcp.protocolVersion` to `'2026-07-28'`.
79
-
80
- The 2026-07-28 protocol removed server-initiated requests, so on a 2.x server the deprecated members `elicitation.sendRequest`, `extra.sendRequest` and `extra.sendNotification` throw with a message naming the replacement instead of doing nothing. A 1.x server keeps providing them as before. To ask the user for input, call `context.suspend()` and read `context.resumeData`.
76
+ Tools receive `context.mcp` (`MCPToolExecutionContext`): `extra` with the request's `signal`, `requestId`, `authInfo` and `_meta`, plus `log(level, message, data?)`, `progress({ progress, total?, message? })` and `protocolVersion` (`'2026-07-28'`). To ask the user for input, call `context.suspend()` and read `context.resumeData`. Server-initiated requests don't exist in the protocol, so the deprecated `elicitation.sendRequest`, `extra.sendRequest` and `extra.sendNotification` members throw with a message naming the replacement.
81
77
 
82
78
  ### Registration and execution
83
79
 
84
- Tools are registered on the Mastra instance exactly as a 1.x server registers them. On a server with `mcpVersion` set to `2`, `executeTool(toolId, args, context?)` returns `{ status: 'completed', output }` or, when the tool suspended, `{ status: 'suspended', suspendPayload, resumeSchema }` with `resumeSchema` as JSON Schema. The result has no failure variant: a tool that throws, or input or resume data that fails its schema, rejects the promise. Shared REST execution endpoints return the suspended shape instead of pretending the tool finished, and accept `resumeData` plus the echoed `suspendPayload` on the next call to continue the tool. Legacy SSE routes remain available only to 1.x servers. A server with `mcpVersion` set to `2` gets a 404 there.
80
+ Tools are registered on the Mastra instance when the server is registered. `executeTool(toolId, args, context?)` returns `{ status: 'completed', output }` or, when the tool suspended, `{ status: 'suspended', suspendPayload, resumeSchema }` with `resumeSchema` as JSON Schema. The result has no failure variant: a tool that throws, or input or resume data that fails its schema, rejects the promise. The REST execution endpoint returns the suspended shape instead of pretending the tool finished, and accepts `resumeData` plus the echoed `suspendPayload` on the next call to continue the tool.
85
81
 
86
82
  Registering another server under an occupied registry key keeps the existing instance. Registry keys and intrinsic server IDs remain distinct.
87
83
 
@@ -52,6 +52,14 @@ interface MastraPlatformExporterConfig extends BaseExporterConfig {
52
52
 
53
53
  /** Explicit feedback endpoint override */
54
54
  feedbackEndpoint?: string
55
+
56
+ /**
57
+ * When false, `accessToken`, `projectId` and the traces endpoint are taken
58
+ * from config only and the environment variables below are ignored. Use this
59
+ * when embedding Mastra in another tool so a user project's `.env` cannot
60
+ * redirect the host's own telemetry. Default: true
61
+ */
62
+ resolveFromEnv?: boolean
55
63
  }
56
64
  ```
57
65
 
@@ -69,6 +77,8 @@ The exporter reads these environment variables if not provided in config:
69
77
  - `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` - Observability endpoint override, read by the exporter in `@mastra/observability@1.17.4` and later. Pass either a base origin such as `https://observability.eu.mastra.ai` or a full traces publish URL ending in `/spans/publish`. The other signal endpoints are derived from it. Defaults to `https://observability.mastra.ai`
70
78
  - `MASTRA_CLOUD_TRACES_ENDPOINT` - Legacy traces endpoint override. Takes precedence over `MASTRA_PLATFORM_OBSERVABILITY_ENDPOINT` when both are set
71
79
 
80
+ All of these are ignored when `resolveFromEnv` is `false`.
81
+
72
82
  ## Properties
73
83
 
74
84
  ```typescript
@@ -73,7 +73,7 @@ console.log('Server running on http://localhost:3000')
73
73
 
74
74
  **taskStore** (`InMemoryTaskStore`): Task store for A2A (Agent-to-Agent) operations
75
75
 
76
- **mcpOptions** (`MCPOptions`): MCP transport options. Set serverless: true for stateless environments like Vercel Edge.
76
+ **mcpOptions** (`MCPOptions`): MCP transport options, such as setRequestAuth to control what tools see as context.mcp.extra.authInfo.
77
77
 
78
78
  ## Adding custom routes
79
79
 
@@ -179,7 +179,7 @@ Call `clearMastraOpenAPICache(server)` if you need to regenerate the cached docu
179
179
 
180
180
  ## MCP support
181
181
 
182
- The Elysia adapter supports both MCP HTTP and MCP SSE transports.
182
+ The Elysia adapter serves each registered MCP server over Streamable HTTP at `/api/mcp/:serverId/mcp`.
183
183
 
184
184
  ## Manual initialization
185
185
 
@@ -74,7 +74,7 @@ app.listen(4111, () => {
74
74
 
75
75
  **taskStore** (`InMemoryTaskStore`): Task store for A2A (Agent-to-Agent) operations
76
76
 
77
- **mcpOptions** (`MCPOptions`): MCP transport options. Set serverless: true for stateless environments like Cloudflare Workers or Vercel Edge.
77
+ **mcpOptions** (`MCPOptions`): MCP transport options, such as setRequestAuth to control what tools see as context.mcp.extra.authInfo.
78
78
 
79
79
  ## Differences from Hono
80
80
 
@@ -75,7 +75,7 @@ app.listen({ port: 3000 }, (err, address) => {
75
75
 
76
76
  **taskStore** (`InMemoryTaskStore`): Task store for A2A (Agent-to-Agent) operations
77
77
 
78
- **mcpOptions** (`MCPOptions`): MCP transport options. Set serverless: true for stateless environments like Cloudflare Workers or Vercel Edge.
78
+ **mcpOptions** (`MCPOptions`): MCP transport options, such as setRequestAuth to control what tools see as context.mcp.extra.authInfo.
79
79
 
80
80
  ## Protecting raw routes
81
81
 
@@ -69,7 +69,7 @@ export default app
69
69
 
70
70
  **taskStore** (`InMemoryTaskStore`): Task store for A2A (Agent-to-Agent) operations
71
71
 
72
- **mcpOptions** (`MCPOptions`): MCP transport options. Set serverless: true for stateless environments like Cloudflare Workers or Vercel Edge.
72
+ **mcpOptions** (`MCPOptions`): MCP transport options, such as setRequestAuth to control what tools see as context.mcp.extra.authInfo.
73
73
 
74
74
  ## Adding custom routes
75
75
 
@@ -74,7 +74,7 @@ app.listen(3000, () => {
74
74
 
75
75
  **taskStore** (`InMemoryTaskStore`): Task store for A2A (Agent-to-Agent) operations
76
76
 
77
- **mcpOptions** (`MCPOptions`): MCP transport options. Set serverless: true for stateless environments like Cloudflare Workers or Vercel Edge.
77
+ **mcpOptions** (`MCPOptions`): MCP transport options, such as setRequestAuth to control what tools see as context.mcp.extra.authInfo.
78
78
 
79
79
  ## Error handling
80
80
 
@@ -154,8 +154,6 @@ export class WorkflowService {
154
154
  MCP endpoints are exposed under the API prefix:
155
155
 
156
156
  - `POST /api/mcp/:serverId/mcp`
157
- - `GET /api/mcp/:serverId/sse`
158
- - `POST /api/mcp/:serverId/messages`
159
157
 
160
158
  ## Health routes
161
159