@mastra/mcp-docs-server 1.2.27-alpha.11 → 1.2.27-alpha.15
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/docs/agents/structured-output.md +2 -1
- package/.docs/docs/evals/custom-scorers.md +36 -0
- package/.docs/docs/evals/gates-and-verdicts.md +1 -1
- package/.docs/docs/evals/overview.md +1 -1
- package/.docs/docs/harness/agent-controller.md +4 -2
- package/.docs/docs/mastra-platform/api.md +21 -3
- package/.docs/docs/mastra-platform/environments.md +1 -1
- package/.docs/docs/mastra-platform/observability.md +1 -1
- package/.docs/docs/mastra-platform/system-environment-variables.md +70 -0
- package/.docs/docs/memory/message-history.md +37 -0
- package/.docs/docs/observability/feedback.md +2 -2
- package/.docs/models/environment-variables.md +2 -1
- package/.docs/models/gateways/openrouter.md +2 -1
- package/.docs/models/gateways/vercel.md +2 -5
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/alibaba-cn.md +2 -1
- package/.docs/models/providers/edenai.md +4 -4
- package/.docs/models/providers/kilo.md +7 -6
- package/.docs/models/providers/kimi-code-plan-cn.md +80 -0
- package/.docs/models/providers/kimi-code-plan-global.md +80 -0
- package/.docs/models/providers/llmgateway-providers.md +5 -5
- package/.docs/models/providers/llmgateway.md +1 -1
- package/.docs/models/providers/nano-gpt.md +3 -2
- package/.docs/models/providers/opencode.md +1 -1
- package/.docs/models/providers/ovhcloud.md +1 -2
- package/.docs/models/providers/vivgrid.md +4 -1
- package/.docs/models/providers.md +2 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +70 -2
- package/.docs/reference/agents/durable-agent.md +9 -3
- package/.docs/reference/agents/generate.md +2 -0
- package/.docs/reference/cli/mastra.md +1 -1
- package/.docs/reference/client-js/agent-controller.md +77 -16
- package/.docs/reference/client-js/observability.md +3 -1
- package/.docs/reference/evals/mastra-scorer.md +3 -1
- package/.docs/reference/evals/not-scorable.md +58 -0
- package/.docs/reference/evals/run-evals.md +3 -1
- package/.docs/reference/index.md +2 -0
- package/.docs/reference/memory/memory-class.md +1 -1
- package/.docs/reference/memory/serialized-memory-config.md +1 -1
- package/.docs/reference/migrations/mcp-v2.md +268 -0
- package/.docs/reference/observability/feedback.md +31 -1
- package/.docs/reference/streaming/agents/stream.md +1 -1
- package/.docs/reference/tools/mcp-client.md +36 -14
- package/.docs/reference/tools/mcp-server.md +24 -83
- package/.docs/reference/workspace/process-manager.md +2 -0
- package/package.json +4 -4
|
@@ -51,6 +51,12 @@ const server = new MCPServer({
|
|
|
51
51
|
})
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## Tool schemas and structured results
|
|
55
|
+
|
|
56
|
+
MCP tool input and output schemas are advertised as JSON Schema 2020-12, the dialect the `2026-07-28` revision assumes, with the dialect declared in `$schema`. Advertised Mastra tool schemas preserve supported references, composition keywords, and tuple (`prefixItems`) shapes.
|
|
57
|
+
|
|
58
|
+
A tool with an `outputSchema` can return any JSON value, including an object, array, string, number, boolean, or `null`. The value is sent as `structuredContent` without wrapping it in an object. The server validates successful structured output against the tool's output schema before returning it.
|
|
59
|
+
|
|
54
60
|
### Configuration Properties
|
|
55
61
|
|
|
56
62
|
The constructor accepts an `MCPServerConfig` object with the following properties:
|
|
@@ -386,32 +392,27 @@ async startHTTP({
|
|
|
386
392
|
httpPath,
|
|
387
393
|
req,
|
|
388
394
|
res,
|
|
389
|
-
options
|
|
395
|
+
options,
|
|
390
396
|
}: {
|
|
391
397
|
url: URL;
|
|
392
398
|
httpPath: string;
|
|
393
399
|
req: http.IncomingMessage;
|
|
394
400
|
res: http.ServerResponse<http.IncomingMessage>;
|
|
395
|
-
options?:
|
|
401
|
+
options?: MCPServerHTTPRequestOptions;
|
|
396
402
|
}): Promise<void>
|
|
397
403
|
```
|
|
398
404
|
|
|
399
|
-
|
|
405
|
+
Every request is self-contained: there is no session to create or resume, so `options` only carries request guards.
|
|
400
406
|
|
|
401
|
-
|
|
407
|
+
| Option | Behavior |
|
|
408
|
+
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
409
|
+
| `enableDnsRebindingProtection` | When `true`, the `Host` header is checked against `allowedHosts` and the `Origin` header against `allowedOrigins` before the request is handled. A check only runs when its list is non-empty. A rejected request receives a `403` JSON-RPC error. |
|
|
410
|
+
| `allowedHosts` | Hostnames accepted in the `Host` header. Matching is port-agnostic: `localhost:3000` in the list allows any port on `localhost`. Write IPv6 addresses with brackets (`[::1]`). |
|
|
411
|
+
| `allowedOrigins` | Origins accepted in the `Origin` header. Only the hostname is compared, so `https://app.example.com:8443` allows every scheme and port on `app.example.com`. Requests without an `Origin` header pass because non-browser MCP clients don't send one. |
|
|
402
412
|
|
|
403
|
-
|
|
404
|
-
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
405
|
-
| `serverless: true`, `serverlessStreaming: true`, `sessionIdGenerator: undefined` | Accepted because the modern handler already provides stateless requests and automatic request-scoped streaming. |
|
|
406
|
-
| `allowedHosts`, `allowedOrigins`, `enableDnsRebindingProtection` | Enforced before the request reaches the modern handler. Host and origin lists are active when `enableDnsRebindingProtection` is `true`. |
|
|
407
|
-
| `sessionIdGenerator` with a function, session callbacks, or `eventStore` | Rejected because the modern protocol doesn't create HTTP sessions. |
|
|
408
|
-
| `enableJsonResponse`, `retryInterval`, `keepAliveMs`, or `supportedProtocolVersions` | Rejected because these values configure a shared handler and can't vary between requests. |
|
|
409
|
-
| `serverless: false` or `serverlessStreaming: false` | Rejected because these values request behavior that differs from the modern handler. |
|
|
410
|
-
| Unknown options | Rejected instead of being ignored. |
|
|
413
|
+
Omit `options` when you don't need request guards.
|
|
411
414
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
Here's an example of how you might use `startHTTP` within an HTTP server request handler. In this example an MCP client could connect to your MCP server at `http://localhost:1234/http`:
|
|
415
|
+
Here's an example of how you might use `startHTTP` within an HTTP server request handler. In this example an MCP client could connect to your MCP server at `http://localhost:1234/mcp`:
|
|
415
416
|
|
|
416
417
|
```typescript
|
|
417
418
|
import http from 'http'
|
|
@@ -422,9 +423,6 @@ const httpServer = http.createServer(async (req, res) => {
|
|
|
422
423
|
httpPath: `/mcp`,
|
|
423
424
|
req,
|
|
424
425
|
res,
|
|
425
|
-
options: {
|
|
426
|
-
sessionIdGenerator: () => randomUUID(),
|
|
427
|
-
},
|
|
428
426
|
})
|
|
429
427
|
})
|
|
430
428
|
|
|
@@ -433,7 +431,7 @@ httpServer.listen(PORT, () => {
|
|
|
433
431
|
})
|
|
434
432
|
```
|
|
435
433
|
|
|
436
|
-
|
|
434
|
+
Because every request is self-contained, nothing needs to persist between invocations, so `startHTTP` works in serverless environments (Supabase Edge Functions, Cloudflare Workers, Vercel Edge, AWS Lambda, Deno Deploy). The method still takes Node-style `http.IncomingMessage` and `http.ServerResponse` objects, so a Fetch-based runtime has to convert its `Request` with an adapter such as `fetch-to-node` and turn the result back into a `Response`:
|
|
437
435
|
|
|
438
436
|
```typescript
|
|
439
437
|
// Supabase Edge Function example
|
|
@@ -456,15 +454,7 @@ serve(async req => {
|
|
|
456
454
|
// Convert Deno Request to Node.js-compatible format
|
|
457
455
|
const { req: nodeReq, res: nodeRes } = toReqRes(req)
|
|
458
456
|
|
|
459
|
-
await server.startHTTP({
|
|
460
|
-
url,
|
|
461
|
-
httpPath: '/mcp',
|
|
462
|
-
req: nodeReq,
|
|
463
|
-
res: nodeRes,
|
|
464
|
-
options: {
|
|
465
|
-
serverless: true, // ← Enable stateless mode for serverless
|
|
466
|
-
},
|
|
467
|
-
})
|
|
457
|
+
await server.startHTTP({ url, httpPath: '/mcp', req: nodeReq, res: nodeRes })
|
|
468
458
|
|
|
469
459
|
return toFetchResponse(nodeRes)
|
|
470
460
|
}
|
|
@@ -473,50 +463,7 @@ serve(async req => {
|
|
|
473
463
|
})
|
|
474
464
|
```
|
|
475
465
|
|
|
476
|
-
|
|
477
|
-
>
|
|
478
|
-
> - Supabase Edge Functions
|
|
479
|
-
> - Cloudflare Workers
|
|
480
|
-
> - Vercel Edge Functions
|
|
481
|
-
> - Netlify Edge Functions
|
|
482
|
-
> - AWS Lambda
|
|
483
|
-
> - Deno Deploy
|
|
484
|
-
>
|
|
485
|
-
> Use the default session-based mode (without `serverless: true`) for:
|
|
486
|
-
>
|
|
487
|
-
> - Long-lived Node.js servers
|
|
488
|
-
> - Docker containers
|
|
489
|
-
> - Traditional hosting (VPS, dedicated servers)
|
|
490
|
-
>
|
|
491
|
-
> 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.
|
|
492
|
-
>
|
|
493
|
-
> By default, serverless mode buffers each request into a single JSON response, so `notifications/progress` sent by a tool never reach the client. Set `serverlessStreaming: true` to handle the request with request-scoped SSE streaming instead, which delivers progress notifications before the final result:
|
|
494
|
-
>
|
|
495
|
-
> ```typescript
|
|
496
|
-
> await server.startHTTP({
|
|
497
|
-
> url,
|
|
498
|
-
> httpPath: '/mcp',
|
|
499
|
-
> req: nodeReq,
|
|
500
|
-
> res: nodeRes,
|
|
501
|
-
> options: {
|
|
502
|
-
> serverless: true,
|
|
503
|
-
> serverlessStreaming: true, // ← Stream request-scoped notifications/progress
|
|
504
|
-
> },
|
|
505
|
-
> })
|
|
506
|
-
> ```
|
|
507
|
-
>
|
|
508
|
-
> This is still stateless: no `mcp-session-id` is required or persisted. It only enables notifications scoped to the current request (such as progress). The session-dependent features below remain unavailable.
|
|
509
|
-
>
|
|
510
|
-
> On the legacy protocol path, the following MCP features require session state or persistent connections and **won't work** in serverless mode (including with `serverlessStreaming: true`):
|
|
511
|
-
>
|
|
512
|
-
> - **Elicitation** - Interactive user input requests during tool execution require session management to route responses back to the correct client
|
|
513
|
-
> - **Resource subscriptions** - `resources/subscribe` and `resources/unsubscribe` need persistent connections to maintain subscription state
|
|
514
|
-
> - **Resource update notifications** - `resources.notifyUpdated()` requires active subscriptions and persistent connections to notify clients
|
|
515
|
-
> - **Prompt list change notifications** - `prompts.notifyListChanged()` requires persistent connections to push updates to clients
|
|
516
|
-
> - **Tool list change notifications** - `toolActions.notifyListChanged()` requires persistent connections to push updates to clients
|
|
517
|
-
> - **Server log notifications** - `sendLoggingMessage()` requires persistent connections to push log messages to clients
|
|
518
|
-
>
|
|
519
|
-
> These features work normally in long-lived server environments (Node.js servers, Docker containers, etc.).
|
|
466
|
+
Request-scoped features (`input_required` rounds, progress, per-request logs) stream inside the request that triggered them. Notifications that outlive a request (`resources.notifyUpdated()`, `prompts.notifyListChanged()`, `toolActions.notifyListChanged()`) are delivered on the `subscriptions/listen` stream a client keeps open, so they only reach clients while that stream is served by a running instance.
|
|
520
467
|
|
|
521
468
|
Here are the details for the values needed by the `startHTTP` method:
|
|
522
469
|
|
|
@@ -528,21 +475,15 @@ Here are the details for the values needed by the `startHTTP` method:
|
|
|
528
475
|
|
|
529
476
|
**res** (`http.ServerResponse`): The response object from your web server, used to send data back.
|
|
530
477
|
|
|
531
|
-
**options** (`
|
|
532
|
-
|
|
533
|
-
The `StreamableHTTPServerTransportOptions` object allows you to customize the behavior of the HTTP transport. Here are the available options:
|
|
534
|
-
|
|
535
|
-
**serverless** (`boolean`): 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.
|
|
536
|
-
|
|
537
|
-
**serverlessStreaming** (`boolean`): If true, serverless requests use request-scoped SSE streaming instead of a buffered JSON response, allowing in-request notifications/progress to reach the client before the final result. Only takes effect together with serverless: true. Defaults to false (buffered JSON responses), which preserves backward-compatible behavior. It enables only request-scoped notifications such as progress; elicitation, subscriptions, and out-of-request notifications still require session state.
|
|
478
|
+
**options** (`MCPServerHTTPRequestOptions`): Optional request guards. See the options table below for more details.
|
|
538
479
|
|
|
539
|
-
|
|
480
|
+
The `MCPServerHTTPRequestOptions` object carries request guards:
|
|
540
481
|
|
|
541
|
-
**
|
|
482
|
+
**enableDnsRebindingProtection** (`boolean`): If true, the Host and Origin headers are validated against allowedHosts and allowedOrigins before the request is handled. Defaults to false.
|
|
542
483
|
|
|
543
|
-
**
|
|
484
|
+
**allowedHosts** (`string[]`): Hosts (host\[:port]) accepted when DNS rebinding protection is enabled.
|
|
544
485
|
|
|
545
|
-
**
|
|
486
|
+
**allowedOrigins** (`string[]`): Origins accepted when DNS rebinding protection is enabled.
|
|
546
487
|
|
|
547
488
|
### `close()`
|
|
548
489
|
|
|
@@ -68,6 +68,8 @@ const handle = await sandbox.processes.spawn('npm run dev', {
|
|
|
68
68
|
|
|
69
69
|
**options.abortSignal** (`AbortSignal`): Signal to abort the process. When aborted, the process is killed.
|
|
70
70
|
|
|
71
|
+
**options.stdinMode** (`'pipe' | 'ignore'`): How stdin is wired. 'pipe' (default) opens a writable stdin for sendStdin() and writer. 'ignore' closes stdin so commands that read it see immediate EOF. Honored by the local, Docker, and E2B providers.
|
|
72
|
+
|
|
71
73
|
**Returns:** `Promise<ProcessHandle>`
|
|
72
74
|
|
|
73
75
|
### `list()`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.2.27-alpha.
|
|
3
|
+
"version": "1.2.27-alpha.15",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@mastra/mcp": "^1.18.0",
|
|
26
27
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
27
28
|
"local-pkg": "^1.1.2",
|
|
28
29
|
"zod": "^4.6.4",
|
|
29
|
-
"@mastra/core": "1.68.0-alpha.
|
|
30
|
-
"@mastra/mcp": "^1.18.1-alpha.3"
|
|
30
|
+
"@mastra/core": "1.68.0-alpha.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.0.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vitest": "4.1.11",
|
|
45
45
|
"@internal/lint": "0.0.133",
|
|
46
46
|
"@internal/types-builder": "0.0.108",
|
|
47
|
-
"@mastra/core": "1.68.0-alpha.
|
|
47
|
+
"@mastra/core": "1.68.0-alpha.7"
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://mastra.ai",
|
|
50
50
|
"repository": {
|