@mastra/mcp-docs-server 0.13.46-alpha.1 → 0.13.46-alpha.2
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/organized/changelogs/%40mastra%2Fclient-js.md +14 -14
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +9 -9
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Freact.md +8 -8
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +8 -8
- package/.docs/raw/agents/overview.mdx +17 -2
- package/.docs/raw/mcp/overview.mdx +6 -0
- package/.docs/raw/reference/tools/mcp-server.mdx +72 -1
- package/CHANGELOG.md +8 -0
- package/package.json +4 -4
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.17.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The client-js package had its own simpler zodToJsonSchema implementation that was missing critical features from schema-compat. This could cause issues when users pass Zod schemas with `z.record()` or `z.date()` through the MastraClient. ([#10925](https://github.com/mastra-ai/mastra/pull/10925))
|
|
8
|
+
|
|
9
|
+
Now the client uses the same implementation as the rest of the codebase, which includes the Zod v4 `z.record()` bug fix, date-time format conversion for `z.date()`, and proper handling of unrepresentable types.
|
|
10
|
+
|
|
11
|
+
Also removes the now-unused `zod-to-json-schema` dependency from client-js.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
14
|
+
- @mastra/core@0.24.7-alpha.2
|
|
15
|
+
|
|
3
16
|
## 0.17.0-alpha.1
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -486,17 +499,4 @@
|
|
|
486
499
|
|
|
487
500
|
## 0.15.0-alpha.0
|
|
488
501
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
- Breaking change to move the agent.streamVNext/generateVNext implementation to the default stream/generate. The old stream/generate have now been moved to streamLegacy and generateLegacy ([#8097](https://github.com/mastra-ai/mastra/pull/8097))
|
|
492
|
-
|
|
493
|
-
### Patch Changes
|
|
494
|
-
|
|
495
|
-
- Fix an issue preventing showing working memory and semantic recall in the playground ([#8358](https://github.com/mastra-ai/mastra/pull/8358))
|
|
496
|
-
|
|
497
|
-
- Add observe strean to get streans after workflow has been interrupted ([#8318](https://github.com/mastra-ai/mastra/pull/8318))
|
|
498
|
-
|
|
499
|
-
- Updated dependencies [[`00cb6bd`](https://github.com/mastra-ai/mastra/commit/00cb6bdf78737c0fac14a5a0c7b532a11e38558a), [`869ba22`](https://github.com/mastra-ai/mastra/commit/869ba222e1d6b58fc1b65e7c9fd55ca4e01b8c2f), [`1b73665`](https://github.com/mastra-ai/mastra/commit/1b73665e8e23f5c09d49fcf3e7d709c75259259e), [`f7d7475`](https://github.com/mastra-ai/mastra/commit/f7d747507341aef60ed39e4b49318db1f86034a6), [`084b77b`](https://github.com/mastra-ai/mastra/commit/084b77b2955960e0190af8db3f77138aa83ed65c), [`a93ff84`](https://github.com/mastra-ai/mastra/commit/a93ff84b5e1af07ee236ac8873dac9b49aa5d501), [`bc5aacb`](https://github.com/mastra-ai/mastra/commit/bc5aacb646d468d325327e36117129f28cd13bf6), [`6b5af12`](https://github.com/mastra-ai/mastra/commit/6b5af12ce9e09066e0c32e821c203a6954498bea), [`bf60e4a`](https://github.com/mastra-ai/mastra/commit/bf60e4a89c515afd9570b7b79f33b95e7d07c397), [`d41aee5`](https://github.com/mastra-ai/mastra/commit/d41aee526d124e35f42720a08e64043229193679), [`e8fe13c`](https://github.com/mastra-ai/mastra/commit/e8fe13c4b4c255a42520127797ec394310f7c919), [`3ca833d`](https://github.com/mastra-ai/mastra/commit/3ca833dc994c38e3c9b4f9b4478a61cd8e07b32a), [`1edb8d1`](https://github.com/mastra-ai/mastra/commit/1edb8d1cfb963e72a12412990fb9170936c9904c), [`fbf6e32`](https://github.com/mastra-ai/mastra/commit/fbf6e324946332d0f5ed8930bf9d4d4479cefd7a), [`4753027`](https://github.com/mastra-ai/mastra/commit/4753027ee889288775c6958bdfeda03ff909af67)]:
|
|
500
|
-
- @mastra/core@0.20.0-alpha.0
|
|
501
|
-
|
|
502
|
-
... 3043 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 3056 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/core
|
|
2
2
|
|
|
3
|
+
## 0.24.7-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix writer.custom not working during workflow resume operations ([#10921](https://github.com/mastra-ai/mastra/pull/10921))
|
|
8
|
+
|
|
9
|
+
When a workflow step is resumed, the writer parameter was not being properly passed through, causing writer.custom() calls to fail. This fix ensures the writableStream parameter is correctly passed to both run.resume() and run.start() calls in the workflow execution engine, allowing custom events to be emitted properly during resume operations.
|
|
10
|
+
|
|
3
11
|
## 0.24.7-alpha.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -490,13 +498,5 @@
|
|
|
490
498
|
|
|
491
499
|
**Backend changes (@mastra/core):**
|
|
492
500
|
- Add assistant messages to messageList immediately after LLM execution
|
|
493
|
-
- Flush messages synchronously before suspension to persist state
|
|
494
|
-
- Create thread if it doesn't exist before flushing
|
|
495
|
-
- Add metadata helpers to persist and remove tool approval state
|
|
496
|
-
- Pass saveQueueManager and memory context through workflow for immediate persistence
|
|
497
|
-
|
|
498
|
-
**Frontend changes (@mastra/react):**
|
|
499
|
-
- Extract runId from pending approvals to enable resumption after refresh
|
|
500
|
-
- Convert `pendingToolApprovals` (DB format) to `requireApprovalMetadata` (runtime format)
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 5407 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/deployer-cloud
|
|
2
2
|
|
|
3
|
+
## 0.24.7-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
8
|
+
- @mastra/core@0.24.7-alpha.2
|
|
9
|
+
- @mastra/deployer@0.24.7-alpha.2
|
|
10
|
+
|
|
3
11
|
## 0.24.7-alpha.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -491,12 +499,4 @@
|
|
|
491
499
|
|
|
492
500
|
### Patch Changes
|
|
493
501
|
|
|
494
|
-
|
|
495
|
-
- @mastra/core@0.19.1-alpha.1
|
|
496
|
-
- @mastra/deployer@0.19.1-alpha.1
|
|
497
|
-
|
|
498
|
-
## 0.19.1-alpha.0
|
|
499
|
-
|
|
500
|
-
### Patch Changes
|
|
501
|
-
|
|
502
|
-
... 579 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 587 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/deployer
|
|
2
2
|
|
|
3
|
+
## 0.24.7-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
8
|
+
- @mastra/core@0.24.7-alpha.2
|
|
9
|
+
- @mastra/server@0.24.7-alpha.2
|
|
10
|
+
|
|
3
11
|
## 0.24.7-alpha.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -491,12 +499,4 @@
|
|
|
491
499
|
|
|
492
500
|
## 0.21.0-alpha.1
|
|
493
501
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
- Add typescript to global externals to reduce bundling OOM ([#8789](https://github.com/mastra-ai/mastra/pull/8789))
|
|
497
|
-
|
|
498
|
-
- Improve error handling formatting in dev/build bundling. ([#8792](https://github.com/mastra-ai/mastra/pull/8792))
|
|
499
|
-
|
|
500
|
-
- Remove validation step in bundling process ([#8778](https://github.com/mastra-ai/mastra/pull/8778))
|
|
501
|
-
|
|
502
|
-
... 4946 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 4954 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 0.13.46-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6c38116`](https://github.com/mastra-ai/mastra/commit/6c381162fc107bfe1271284a90a507d9e3304241), [`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
8
|
+
- @mastra/mcp@0.14.5-alpha.0
|
|
9
|
+
- @mastra/core@0.24.7-alpha.2
|
|
10
|
+
|
|
3
11
|
## 0.13.46-alpha.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -491,12 +499,4 @@
|
|
|
491
499
|
- @mastra/core@0.17.0
|
|
492
500
|
- @mastra/mcp@0.13.0
|
|
493
501
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
### Patch Changes
|
|
497
|
-
|
|
498
|
-
- Updated dependencies [[`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a)]:
|
|
499
|
-
- @mastra/core@0.17.0-alpha.8
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
... 2087 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 2095 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/mcp
|
|
2
2
|
|
|
3
|
+
## 0.14.5-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- add flag to skip sessions and streaming in serverless mcp ([#10927](https://github.com/mastra-ai/mastra/pull/10927))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
10
|
+
- @mastra/core@0.24.7-alpha.2
|
|
11
|
+
|
|
3
12
|
## 0.14.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -489,14 +498,5 @@
|
|
|
489
498
|
- e1aed55: Fixed an issue where keep-alive messages were interfering with endpoint messages on initial SSE connection
|
|
490
499
|
- 03997ae: Update peerdeps
|
|
491
500
|
- Updated dependencies [227c7e6]
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
- Updated dependencies [6faaee5]
|
|
495
|
-
- Updated dependencies [4232b14]
|
|
496
|
-
- Updated dependencies [a89de7e]
|
|
497
|
-
- Updated dependencies [5a37d0c]
|
|
498
|
-
- Updated dependencies [4bde0cb]
|
|
499
|
-
- Updated dependencies [cf4f357]
|
|
500
|
-
- Updated dependencies [ad888a2]
|
|
501
|
-
|
|
502
|
-
... 2354 more lines hidden. See full changelog in package directory.
|
|
501
|
+
|
|
502
|
+
... 2363 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/playground-ui
|
|
2
2
|
|
|
3
|
+
## 7.0.0-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`461f5f7`](https://github.com/mastra-ai/mastra/commit/461f5f747ce07d77dc048cf0f5df44744183c3c3), [`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
8
|
+
- @mastra/client-js@0.17.0-alpha.2
|
|
9
|
+
- @mastra/core@0.24.7-alpha.2
|
|
10
|
+
- @mastra/react@0.0.22-alpha.2
|
|
11
|
+
|
|
3
12
|
## 7.0.0-alpha.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -489,14 +498,5 @@
|
|
|
489
498
|
|
|
490
499
|
- Add div wrapper around entity tables to fix table vertical position ([#8758](https://github.com/mastra-ai/mastra/pull/8758))
|
|
491
500
|
|
|
492
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8557](https://github.com/mastra-ai/mastra/pull/8557))
|
|
493
|
-
|
|
494
|
-
- handle error case in react sdk ([#8676](https://github.com/mastra-ai/mastra/pull/8676))
|
|
495
|
-
|
|
496
|
-
- Make sure to convert the agent instructions when showing them ([#8702](https://github.com/mastra-ai/mastra/pull/8702))
|
|
497
|
-
|
|
498
|
-
- Update peer dependencies to match core package version bump (0.21.0) ([#8626](https://github.com/mastra-ai/mastra/pull/8626))
|
|
499
|
-
|
|
500
|
-
- Customize AITraces type to seamlessly work on Cloud too ([#8759](https://github.com/mastra-ai/mastra/pull/8759))
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 3958 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/react-hooks
|
|
2
2
|
|
|
3
|
+
## 0.0.22-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`461f5f7`](https://github.com/mastra-ai/mastra/commit/461f5f747ce07d77dc048cf0f5df44744183c3c3)]:
|
|
8
|
+
- @mastra/client-js@0.17.0-alpha.2
|
|
9
|
+
|
|
3
10
|
## 0.0.22-alpha.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -491,12 +498,5 @@
|
|
|
491
498
|
|
|
492
499
|
## 0.0.2-alpha.1
|
|
493
500
|
|
|
494
|
-
### Patch Changes
|
|
495
|
-
|
|
496
|
-
- Updated dependencies []:
|
|
497
|
-
- @mastra/client-js@0.14.1-alpha.1
|
|
498
|
-
|
|
499
|
-
## 0.0.2-alpha.0
|
|
500
|
-
|
|
501
501
|
|
|
502
|
-
...
|
|
502
|
+
... 37 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 0.24.7-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
8
|
+
- @mastra/core@0.24.7-alpha.2
|
|
9
|
+
|
|
3
10
|
## 0.24.7-alpha.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -492,11 +499,4 @@
|
|
|
492
499
|
|
|
493
500
|
### Patch Changes
|
|
494
501
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
Also adds deprecation warning to Agent import from root path to encourage using the recommended subpath import.
|
|
498
|
-
|
|
499
|
-
- Updated dependencies [[`a6d69c5`](https://github.com/mastra-ai/mastra/commit/a6d69c5fb50c0875b46275811fece5862f03c6a0), [`84199af`](https://github.com/mastra-ai/mastra/commit/84199af8673f6f9cb59286ffb5477a41932775de), [`7f431af`](https://github.com/mastra-ai/mastra/commit/7f431afd586b7d3265075e73106eb73167edbb86)]:
|
|
500
|
-
- @mastra/core@0.20.1-alpha.3
|
|
501
|
-
|
|
502
|
-
... 3913 more lines hidden. See full changelog in package directory.
|
|
502
|
+
... 3920 more lines hidden. See full changelog in package directory.
|
|
@@ -355,9 +355,9 @@ const response = await testAgent.generate(
|
|
|
355
355
|
console.log(response.object);
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
-
###
|
|
358
|
+
### Structuring sub agent
|
|
359
359
|
|
|
360
|
-
Use the `model` property to
|
|
360
|
+
Use the `model` property to have a separate agent generate the structured output for you.
|
|
361
361
|
|
|
362
362
|
```typescript showLineNumbers copy
|
|
363
363
|
import { z } from "zod";
|
|
@@ -420,6 +420,21 @@ const response = await testAgentThatDoesntSupportStructuredOutput.generate(
|
|
|
420
420
|
console.log(response.object);
|
|
421
421
|
```
|
|
422
422
|
|
|
423
|
+
:::info[Gemini 2.5 with tools]
|
|
424
|
+
|
|
425
|
+
Gemini 2.5 models do not support combining `response_format` (structured output) with function calling (tools) in the same API call. If your agent has tools and you're using `structuredOutput` with a Gemini 2.5 model, you must set `jsonPromptInjection: true` to avoid the error `Function calling with a response mime type: 'application/json' is unsupported`.
|
|
426
|
+
|
|
427
|
+
```typescript
|
|
428
|
+
const response = await agentWithTools.generate("Your prompt", {
|
|
429
|
+
structuredOutput: {
|
|
430
|
+
schema: yourSchema,
|
|
431
|
+
jsonPromptInjection: true, // Required for Gemini 2.5 when tools are present
|
|
432
|
+
},
|
|
433
|
+
});
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
:::
|
|
437
|
+
|
|
423
438
|
## Using tools
|
|
424
439
|
|
|
425
440
|
Agents can use tools to go beyond language generation, enabling structured interactions with external APIs and services. Tools allow agents to access data and perform clearly defined operations in a reliable, repeatable way.
|
|
@@ -99,6 +99,12 @@ export const testMcpServer = new MCPServer({
|
|
|
99
99
|
|
|
100
100
|
> See [MCPServer](/reference/tools/mcp-server) for a full list of configuration options.
|
|
101
101
|
|
|
102
|
+
### Serverless deployments
|
|
103
|
+
|
|
104
|
+
`MCPServer` can be deployed in serverless environments (Cloudflare Workers, Vercel Edge Functions, AWS Lambda, etc.) by enabling the `serverless: true` option in `startHTTP()`. This runs the server in stateless mode, where each request is handled independently without session management.
|
|
105
|
+
|
|
106
|
+
**Note:** Some MCP features require persistent connections and won't work in serverless mode, including elicitation, resource subscriptions, and update notifications. See the [serverless section](/reference/tools/mcp-server#starthttp) in the API reference for full details and limitations.
|
|
107
|
+
|
|
102
108
|
## Registering an `MCPServer`
|
|
103
109
|
|
|
104
110
|
To make an MCP server available to other systems or agents that support the protocol, register it in the main `Mastra` instance using `mcpServers`.
|
|
@@ -387,7 +387,7 @@ const httpServer = http.createServer(async (req, res) => {
|
|
|
387
387
|
req,
|
|
388
388
|
res,
|
|
389
389
|
options: {
|
|
390
|
-
sessionIdGenerator:
|
|
390
|
+
sessionIdGenerator: () => randomUUID(),
|
|
391
391
|
},
|
|
392
392
|
});
|
|
393
393
|
});
|
|
@@ -397,6 +397,70 @@ httpServer.listen(PORT, () => {
|
|
|
397
397
|
});
|
|
398
398
|
```
|
|
399
399
|
|
|
400
|
+
For **serverless environments** (Supabase Edge Functions, Cloudflare Workers, Vercel Edge, etc.), use `serverless: true` to enable stateless operation:
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
// Supabase Edge Function example
|
|
404
|
+
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
|
405
|
+
import { MCPServer } from "@mastra/mcp";
|
|
406
|
+
// Note: You will need to convert req/res format from Deno to Node
|
|
407
|
+
import { toReqRes, toFetchResponse } from "fetch-to-node";
|
|
408
|
+
|
|
409
|
+
const server = new MCPServer({
|
|
410
|
+
name: "my-serverless-mcp",
|
|
411
|
+
version: "1.0.0",
|
|
412
|
+
tools: { /* your tools */ },
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
serve(async (req) => {
|
|
416
|
+
const url = new URL(req.url);
|
|
417
|
+
|
|
418
|
+
if (url.pathname === "/mcp") {
|
|
419
|
+
// Convert Deno Request to Node.js-compatible format
|
|
420
|
+
const { req: nodeReq, res: nodeRes } = toReqRes(req);
|
|
421
|
+
|
|
422
|
+
await server.startHTTP({
|
|
423
|
+
url,
|
|
424
|
+
httpPath: "/mcp",
|
|
425
|
+
req: nodeReq,
|
|
426
|
+
res: nodeRes,
|
|
427
|
+
options: {
|
|
428
|
+
serverless: true, // ← Enable stateless mode for serverless
|
|
429
|
+
},
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
return toFetchResponse(nodeRes);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return new Response("Not found", { status: 404 });
|
|
436
|
+
});
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
> **When to use `serverless: true`**
|
|
440
|
+
>
|
|
441
|
+
> Use `serverless: true` when deploying to environments where each request runs in a fresh, stateless execution context:
|
|
442
|
+
> - Supabase Edge Functions
|
|
443
|
+
> - Cloudflare Workers
|
|
444
|
+
> - Vercel Edge Functions
|
|
445
|
+
> - Netlify Edge Functions
|
|
446
|
+
> - AWS Lambda
|
|
447
|
+
> - Deno Deploy
|
|
448
|
+
>
|
|
449
|
+
> Use the default session-based mode (without `serverless: true`) for:
|
|
450
|
+
> - Long-lived Node.js servers
|
|
451
|
+
> - Docker containers
|
|
452
|
+
> - Traditional hosting (VPS, dedicated servers)
|
|
453
|
+
>
|
|
454
|
+
> The serverless mode disables session management and creates fresh server instances per request, which is necessary for stateless environments where memory doesn't persist between invocations.
|
|
455
|
+
>
|
|
456
|
+
> **Note:** The following MCP features require session state or persistent connections and will **not work** in serverless mode:
|
|
457
|
+
> - **Elicitation** - Interactive user input requests during tool execution require session management to route responses back to the correct client
|
|
458
|
+
> - **Resource subscriptions** - `resources/subscribe` and `resources/unsubscribe` need persistent connections to maintain subscription state
|
|
459
|
+
> - **Resource update notifications** - `resources.notifyUpdated()` requires active subscriptions and persistent connections to notify clients
|
|
460
|
+
> - **Prompt list change notifications** - `prompts.notifyListChanged()` requires persistent connections to push updates to clients
|
|
461
|
+
>
|
|
462
|
+
> These features work normally in long-lived server environments (Node.js servers, Docker containers, etc.).
|
|
463
|
+
|
|
400
464
|
Here are the details for the values needed by the `startHTTP` method:
|
|
401
465
|
|
|
402
466
|
<PropertiesTable
|
|
@@ -437,6 +501,13 @@ The `StreamableHTTPServerTransportOptions` object allows you to customize the be
|
|
|
437
501
|
|
|
438
502
|
<PropertiesTable
|
|
439
503
|
content={[
|
|
504
|
+
{
|
|
505
|
+
name: "serverless",
|
|
506
|
+
type: "boolean",
|
|
507
|
+
description:
|
|
508
|
+
"If `true`, runs in stateless mode without session management. Each request is handled independently with a fresh server instance. Essential for serverless environments (Cloudflare Workers, Supabase Edge Functions, Vercel Edge, etc.) where sessions cannot persist between invocations. Defaults to `false`.",
|
|
509
|
+
optional: true,
|
|
510
|
+
},
|
|
440
511
|
{
|
|
441
512
|
name: "sessionIdGenerator",
|
|
442
513
|
type: "(() => string) | undefined",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 0.13.46-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6c38116`](https://github.com/mastra-ai/mastra/commit/6c381162fc107bfe1271284a90a507d9e3304241), [`b685c9c`](https://github.com/mastra-ai/mastra/commit/b685c9c0b89f49e0d4542c4ac72569682db69794)]:
|
|
8
|
+
- @mastra/mcp@0.14.5-alpha.0
|
|
9
|
+
- @mastra/core@0.24.7-alpha.2
|
|
10
|
+
|
|
3
11
|
## 0.13.46-alpha.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "0.13.46-alpha.
|
|
3
|
+
"version": "0.13.46-alpha.2",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"uuid": "^11.1.0",
|
|
34
34
|
"zod": "^3.25.76",
|
|
35
35
|
"zod-to-json-schema": "^3.24.6",
|
|
36
|
-
"@mastra/core": "0.24.7-alpha.
|
|
37
|
-
"@mastra/mcp": "^0.14.
|
|
36
|
+
"@mastra/core": "0.24.7-alpha.2",
|
|
37
|
+
"@mastra/mcp": "^0.14.5-alpha.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hono/node-server": "^1.19.5",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"typescript": "^5.8.3",
|
|
51
51
|
"vitest": "^3.2.4",
|
|
52
52
|
"@internal/lint": "0.0.64",
|
|
53
|
-
"@mastra/core": "0.24.7-alpha.
|
|
53
|
+
"@mastra/core": "0.24.7-alpha.2"
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://mastra.ai",
|
|
56
56
|
"repository": {
|