@mastra/mcp-docs-server 1.3.8-alpha.0 → 1.3.8-alpha.11
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/processors.md +2 -0
- package/.docs/docs/agents/tools.md +3 -2
- package/.docs/docs/connections/mcp.md +2 -0
- package/.docs/docs/guides/mcp-authentication-authorization.md +10 -1
- package/.docs/docs/harness/agent-controller.md +2 -1
- package/.docs/docs/harness/signals.md +22 -0
- package/.docs/docs/mastra-platform/connect/providers.md +28 -113
- package/.docs/docs/mastra-platform/observability.md +23 -2
- package/.docs/docs/server/middleware.md +4 -0
- package/.docs/integrations/databases/clickhouse.md +1 -1
- package/.docs/models/environment-variables.md +2 -0
- package/.docs/models/gateways/neon.md +11 -1
- package/.docs/models/gateways/netlify.md +3 -1
- package/.docs/models/gateways/openrouter.md +1 -1
- package/.docs/models/index.md +3 -1
- package/.docs/models/providers/agnes.md +3 -3
- package/.docs/models/providers/aimlapi.md +3 -7
- package/.docs/models/providers/aixy.md +17 -13
- package/.docs/models/providers/boundless.md +96 -0
- package/.docs/models/providers/cortecs.md +2 -1
- package/.docs/models/providers/crossmodel.md +2 -1
- package/.docs/models/providers/digitalocean.md +1 -1
- package/.docs/models/providers/edenai.md +15 -11
- package/.docs/models/providers/kilo.md +18 -17
- package/.docs/models/providers/llmgateway-providers.md +5 -13
- package/.docs/models/providers/llmgateway.md +5 -6
- package/.docs/models/providers/lowrouter.md +21 -2
- package/.docs/models/providers/nano-gpt.md +11 -16
- package/.docs/models/providers/nvidia.md +1 -1
- package/.docs/models/providers/ofox.md +2 -1
- package/.docs/models/providers/opencode-go.md +34 -35
- package/.docs/models/providers/opencode.md +2 -4
- package/.docs/models/providers/ovhcloud.md +1 -2
- package/.docs/models/providers/poe.md +6 -1
- package/.docs/models/providers/prime.md +2 -1
- package/.docs/models/providers/sambanova.md +82 -0
- package/.docs/models/providers/scaleway.md +2 -1
- package/.docs/models/providers/sensenova.md +2 -1
- package/.docs/models/providers/wandb.md +2 -2
- package/.docs/models/providers.md +2 -0
- package/.docs/reference/agent-controller/session.md +13 -0
- package/.docs/reference/agents/agent.md +20 -2
- package/.docs/reference/cli/mastra.md +12 -4
- package/.docs/reference/client-js/agents.md +17 -0
- package/.docs/reference/client-js/observability.md +11 -92
- package/.docs/reference/code-sdk/mount-agent-controller.md +2 -0
- package/.docs/reference/index.md +1 -1
- package/.docs/reference/memory/observational-memory.md +13 -0
- package/.docs/reference/observability/tracing/trace-query.md +198 -443
- package/.docs/reference/processors/provider-history-compat.md +1 -1
- package/.docs/reference/processors/stream-error-retry-processor.md +1 -1
- package/.docs/reference/processors/tool-search-processor.md +3 -3
- package/.docs/reference/server/routes.md +17 -6
- package/.docs/reference/storage/retention.md +15 -12
- package/.docs/reference/streaming/ChunkType.md +4 -0
- package/.docs/reference/tools/create-tool.md +2 -0
- package/.docs/reference/tools/mcp-server.md +1 -1
- package/package.json +5 -5
|
@@ -29,7 +29,7 @@ A supplied `ProviderHistoryCompat` is used instead of the default. The default i
|
|
|
29
29
|
|
|
30
30
|
The placement decides which half of the processor works:
|
|
31
31
|
|
|
32
|
-
- **Reactive rules need `errorProcessors`.**
|
|
32
|
+
- **Reactive rules need `errorProcessors`.** An agent wraps its input processors in a single processor workflow, and the API-error pass only runs `processAPIError` on error processors, so an instance registered only in `inputProcessors` never runs its reactive rules.
|
|
33
33
|
- **Preemptive rules run from either list.** `processLLMRequest` runs over the input processors and over the resolved error processors, so a `ProviderHistoryCompat` in `errorProcessors` gets its prompt rewrites as well as its reactive recovery. An instance registered in `inputProcessors` runs once, in its input position.
|
|
34
34
|
|
|
35
35
|
Registering in `errorProcessors` alone, as the example above does, covers both halves. Double registration can't cause a double retry: the runner stops at the first processor that asks for one, and each reactive rule bails once `retryCount` is above zero, so a repaired turn is attempted exactly once more.
|
|
@@ -28,7 +28,7 @@ export const agent = new Agent({
|
|
|
28
28
|
|
|
29
29
|
Set `maxProcessorRetries` alongside a `maxRetries` above `3`, because the agent stops error-processor retries at `3` when it's unset. See [Retry limits](#retry-limits).
|
|
30
30
|
|
|
31
|
-
To run only the processors you configure, with none of the defaults merged in, set `errorProcessorDefaults: false`. Without an `errorProcessors` list, the agent then runs
|
|
31
|
+
To run only the processors you configure, with none of the defaults merged in, set `errorProcessorDefaults: false`. Without an `errorProcessors` list, the agent then runs only the error processors its memory contributes, if any. When memory contributes one, the retry cap of `3` applies. See [Error processors are enabled by default](https://mastra.ai/docs/agents/processors). An empty agent-level `errorProcessors` list still gets the defaults. A call-time `errorProcessors: []` replaces the resolved list instead, though the agent still runs the error processors its memory contributes. Supplying your own processor for all three default ids replaces every default with your own implementation.
|
|
32
32
|
|
|
33
33
|
## How it works
|
|
34
34
|
|
|
@@ -41,7 +41,7 @@ const toolSearch = new ToolSearchProcessor({
|
|
|
41
41
|
|
|
42
42
|
**options.search.autoLoad** (`boolean`): When true, tools returned by search\_tools are activated immediately as part of the search. The load\_tool meta-tool is not exposed, collapsing the two-step search then load flow into a single search step. Discovered tools become available on the next turn. Keep topK conservative since every match is activated.
|
|
43
43
|
|
|
44
|
-
**options.storage** (`'in-memory' | 'context'`): Where loaded-tool state lives. 'in-memory' (default) tracks loaded tools in an in-memory map per thread with TTL cleanup (see ttl); state is lost on restart and anonymous requests share a 'default' entry. 'context' derives loaded state from the conversation messages — a tool is loaded while a search\_tools/load\_tool result naming it remains in the messages; it
|
|
44
|
+
**options.storage** (`'in-memory' | 'context'`): Where loaded-tool state lives. 'in-memory' (default) tracks loaded tools in an in-memory map per thread with TTL cleanup (see ttl); state is lost on restart and anonymous requests share a 'default' entry. 'context' derives loaded state from the conversation messages — a tool is loaded while a search\_tools/load\_tool result naming it remains in the messages; it works without memory (same-process only, and only for requests with a real thread ID), survives a restart whenever the messages are available again (memory with message history, or the caller resending the conversation), and de-loads automatically once that result is no longer present in the messages. The 'context' store is opt-in.
|
|
45
45
|
|
|
46
46
|
**options.ttl** (`number`): Time-to-live for in-memory thread state, in milliseconds. Only applies to the default storage: 'in-memory' store; after this duration of inactivity thread state is cleaned up. Set to 0 to disable cleanup. Ignored by the 'context' store.
|
|
47
47
|
|
|
@@ -238,8 +238,8 @@ Use `clearState`, `clearAllState`, `getStateStats`, and `cleanupNow` to inspect
|
|
|
238
238
|
|
|
239
239
|
Loaded state is derived from the conversation messages: a tool is loaded while a `search_tools` or `load_tool` result naming it remains in the messages. This mode:
|
|
240
240
|
|
|
241
|
-
-
|
|
242
|
-
-
|
|
241
|
+
- Works without memory configuration. Without memory, loaded tools are kept for the current process only, and only for requests with a real thread ID; anonymous requests retain nothing between calls unless the caller resends the relevant messages.
|
|
242
|
+
- Survives a restart whenever the messages are available again: from memory with message history, or because the caller resends the conversation. Without memory, a restart restores only what's in the messages the caller sends.
|
|
243
243
|
- De-loads a tool automatically once that result is no longer present in the messages.
|
|
244
244
|
|
|
245
245
|
```typescript
|
|
@@ -16,6 +16,7 @@ Server adapters register these routes when you call `server.init()`. All routes
|
|
|
16
16
|
| `POST` | `/api/agents/:agentId/stream` | Stream agent response |
|
|
17
17
|
| `POST` | `/api/agents/:agentId/send-message` | Send a user message to an active or idle thread |
|
|
18
18
|
| `POST` | `/api/agents/:agentId/queue-message` | Queue a user message for the next thread turn |
|
|
19
|
+
| `POST` | `/api/agents/:agentId/queue-signal` | Queue a typed signal for the next thread turn |
|
|
19
20
|
| `POST` | `/api/agents/:agentId/signals` | Send a lower-level signal to an active or idle thread |
|
|
20
21
|
| `POST` | `/api/agents/:agentId/threads/subscribe` | Subscribe to a thread stream |
|
|
21
22
|
| `POST` | `/api/agents/:agentId/threads/abort` | Abort a thread, optionally clearing pending signals |
|
|
@@ -83,6 +84,8 @@ GET /api/agents/my-agent?versionId=abc123
|
|
|
83
84
|
|
|
84
85
|
Use `POST /api/agents/:agentId/send-message` to send a user message to the active agent loop or wake an idle thread. Use `POST /api/agents/:agentId/queue-message` when the active run should finish before Mastra starts a follow-up run.
|
|
85
86
|
|
|
87
|
+
To queue a typed signal with the same ordering, use `POST /api/agents/:agentId/queue-signal` with a `signal` field in place of `message`. The `signal` field takes the same shape as `POST /api/agents/:agentId/signals`.
|
|
88
|
+
|
|
86
89
|
Both routes accept the same request body:
|
|
87
90
|
|
|
88
91
|
```typescript
|
|
@@ -542,12 +545,20 @@ Returns the persisted experiment result row.
|
|
|
542
545
|
|
|
543
546
|
## MCP
|
|
544
547
|
|
|
545
|
-
| Method | Path
|
|
546
|
-
| ------ |
|
|
547
|
-
| `GET` | `/api/mcp/servers`
|
|
548
|
-
| `GET` | `/api/mcp/servers/:
|
|
549
|
-
| `
|
|
550
|
-
| `GET` | `/api/mcp/:serverId/
|
|
548
|
+
| Method | Path | Description |
|
|
549
|
+
| ------ | ------------------------------------------ | ------------------------ |
|
|
550
|
+
| `GET` | `/api/mcp/v0/servers` | List MCP servers |
|
|
551
|
+
| `GET` | `/api/mcp/v0/servers/:id` | Get server details |
|
|
552
|
+
| `GET` | `/api/mcp/:serverId/tools` | List server tools |
|
|
553
|
+
| `GET` | `/api/mcp/:serverId/tools/:toolId` | Get tool details |
|
|
554
|
+
| `POST` | `/api/mcp/:serverId/tools/:toolId/execute` | Execute a tool |
|
|
555
|
+
| `GET` | `/api/mcp/:serverId/resources` | List server resources |
|
|
556
|
+
| `POST` | `/api/mcp/:serverId/resources/read` | Read a resource |
|
|
557
|
+
| `ALL` | `/api/mcp/:serverId/mcp` | MCP HTTP transport |
|
|
558
|
+
| `ALL` | `/api/mcp/:serverId/sse` | Legacy MCP SSE transport |
|
|
559
|
+
| `POST` | `/api/mcp/:serverId/messages` | Legacy MCP SSE messages |
|
|
560
|
+
|
|
561
|
+
All MCP routes declare `requiresAuth: true`. Authentication is enforced only when `server.auth` is configured. Paths use the default `/api` prefix. The legacy SSE routes return `404` for MCP v2 servers.
|
|
551
562
|
|
|
552
563
|
## Responses API
|
|
553
564
|
|
|
@@ -12,18 +12,21 @@ Retention covers **growth tables** only: tables that accumulate rows unbounded a
|
|
|
12
12
|
|
|
13
13
|
Storage adapters use the shared core retention contract for `prune()`, or a database-native mechanism when that better matches the backend.
|
|
14
14
|
|
|
15
|
-
| Adapter
|
|
16
|
-
|
|
|
17
|
-
| libSQL
|
|
18
|
-
| PostgreSQL
|
|
19
|
-
| MongoDB
|
|
20
|
-
| DuckDB
|
|
21
|
-
| MySQL
|
|
22
|
-
| Microsoft SQL Server
|
|
23
|
-
| Oracle Database
|
|
24
|
-
| Amazon Aurora DSQL
|
|
25
|
-
| Google Cloud Spanner
|
|
26
|
-
|
|
|
15
|
+
| Adapter | Mechanism | Retention support |
|
|
16
|
+
| --------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| libSQL | `prune()` | All supported growth domains |
|
|
18
|
+
| PostgreSQL | `prune()` | All supported growth domains. vNext observability drops expired partitions or chunks |
|
|
19
|
+
| MongoDB | `prune()` or native TTL | All supported growth domains. Native TTL indexes are also available |
|
|
20
|
+
| DuckDB | `prune()` | Observability spans, metrics, logs, scores, and feedback |
|
|
21
|
+
| MySQL | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
22
|
+
| Microsoft SQL Server | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
23
|
+
| Oracle Database | `prune()` | Observability spans and logs, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
24
|
+
| Amazon Aurora DSQL | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
25
|
+
| Google Cloud Spanner | `prune()` | Observability spans, plus metrics when metrics storage is enabled. Durable agent run fencing (`runOwnership`, `runFences`) |
|
|
26
|
+
| DynamoDB | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`) |
|
|
27
|
+
| Convex | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`). Redeploy your Convex functions after upgrading |
|
|
28
|
+
| Cloudflare D1 and Durable Objects | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`) |
|
|
29
|
+
| ClickHouse | Native TTL | Observability spans, metrics, logs, scores, and feedback. When all five signals have finite retention, deletion-request records expire after the longest signal retention plus 30 days |
|
|
27
30
|
|
|
28
31
|
## Storage-specific maintenance
|
|
29
32
|
|
|
@@ -330,6 +330,10 @@ Signals the start of a processing step.
|
|
|
330
330
|
|
|
331
331
|
**payload.messageId** (`string`): Optional message identifier
|
|
332
332
|
|
|
333
|
+
**payload.modelId** (`string`): ID of the model this step calls. After a fallback, the fallback model.
|
|
334
|
+
|
|
335
|
+
**payload.provider** (`string`): Provider of the model this step calls
|
|
336
|
+
|
|
333
337
|
**payload.request** (`object`): Request information including body and other data
|
|
334
338
|
|
|
335
339
|
**payload.warnings** (`LanguageModelV2CallWarning[]`): Any warnings from the language model call
|
|
@@ -61,6 +61,8 @@ The first `execute` parameter is the validated value from `inputSchema`. Destruc
|
|
|
61
61
|
|
|
62
62
|
**requireApproval** (`boolean`): When true, the tool requires explicit approval before execution. The agent will emit a tool-call-approval chunk and pause until approved or declined.
|
|
63
63
|
|
|
64
|
+
**beforeApproval** (`(input, context) => void | { proceed: false; output: unknown } | Promise<...>`): Runs before the approval gate for calls that require approval, receiving the input validated against inputSchema (defaults applied) and a context with toolCallId, toolName, requestContext, and workspace. Return { proceed: false, output } to reject the call: the agent does not pause for approval, execute is not called, and output is returned to the model as the tool result. Return nothing to continue to the approval gate. Not run when the input fails inputSchema validation (execute reports the validation error after approval) or when resuming after an approval decision. If the hook throws, the error is logged and the call proceeds to the approval gate, so keep validating inside execute as well.
|
|
65
|
+
|
|
64
66
|
**mcp** (`MCPToolProperties`): MCP-specific properties for tools exposed via Model Context Protocol. Includes annotations (tool behavior hints like title, readOnlyHint, destructiveHint, idempotentHint, openWorldHint) and \_meta (arbitrary metadata passed through to MCP clients).
|
|
65
67
|
|
|
66
68
|
**requestContextSchema** (`StandardJSONSchemaV1`): A Standard JSON Schema for validating request context values. When provided, the context is validated before execute() runs, returning an error object if validation fails.
|
|
@@ -456,7 +456,7 @@ getToolInfo(toolId: string): ToolInfo | undefined
|
|
|
456
456
|
|
|
457
457
|
### `executeTool()`
|
|
458
458
|
|
|
459
|
-
Runs a tool without a protocol client, which is how the Mastra REST route `POST /api/mcp/:serverId/tools/:toolId/execute` and Studio invoke tools.
|
|
459
|
+
Runs a tool without a protocol client, which is how the Mastra REST route `POST /api/mcp/:serverId/tools/:toolId/execute` and Studio invoke tools. See [authentication for registered MCP routes](https://mastra.ai/docs/guides/mcp-authentication-authorization) and the [MCP routes reference](https://mastra.ai/reference/server/routes).
|
|
460
460
|
|
|
461
461
|
```typescript
|
|
462
462
|
async executeTool(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.8-alpha.
|
|
3
|
+
"version": "1.3.8-alpha.11",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.1.2",
|
|
28
28
|
"zod": "^4.6.4",
|
|
29
|
-
"@mastra/core": "1.78.0-alpha.
|
|
30
|
-
"@mastra/mcp": "^2.4.
|
|
29
|
+
"@mastra/core": "1.78.0-alpha.8",
|
|
30
|
+
"@mastra/mcp": "^2.4.1-alpha.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.0.0",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"tsx": "^4.23.1",
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
45
|
"vitest": "4.1.11",
|
|
46
|
-
"@internal/types-builder": "0.0.118",
|
|
47
46
|
"@internal/lint": "0.0.143",
|
|
48
|
-
"@mastra/core": "1.78.0-alpha.
|
|
47
|
+
"@mastra/core": "1.78.0-alpha.8",
|
|
48
|
+
"@internal/types-builder": "0.0.118"
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://mastra.ai",
|
|
51
51
|
"repository": {
|