@mastra/mcp-docs-server 1.2.13 → 1.2.14-alpha.3
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/a2a.md +1 -1
- package/.docs/docs/agents/acp.md +1 -1
- package/.docs/docs/agents/agent-approval.md +1 -1
- package/.docs/docs/agents/networks.md +2 -2
- package/.docs/docs/agents/overview.md +2 -2
- package/.docs/docs/agents/using-tools.md +2 -2
- package/.docs/docs/capabilities/channels/overview.md +1 -1
- package/.docs/docs/{agents/supervisor-agents.md → capabilities/subagents.md} +58 -58
- package/.docs/docs/deployment/sandbox.md +95 -1
- package/.docs/docs/getting-started/develop.md +2 -0
- package/.docs/docs/harness/agent-controller.md +370 -0
- package/.docs/docs/long-running-agents/background-tasks.md +1 -1
- package/.docs/docs/long-running-agents/goals.md +3 -3
- package/.docs/docs/mcp/overview.md +222 -281
- package/.docs/docs/memory/overview.md +2 -2
- package/.docs/docs/observability/integrations/exporters/confident-ai.md +140 -0
- package/.docs/docs/observability/integrations/overview.md +1 -1
- package/.docs/docs/observability/overview.md +122 -8
- package/.docs/docs/observability/tracing/overview.md +2 -2
- package/.docs/docs/server/mastra-client.md +1 -1
- package/.docs/docs/server/server-adapters.md +2 -0
- package/.docs/docs/storage/overview.md +2 -2
- package/.docs/guides/build-your-ui/copilotkit/channels.md +49 -39
- package/.docs/guides/concepts/multi-agent-systems.md +7 -7
- package/.docs/guides/guide/coding-agent.md +2 -2
- package/.docs/guides/guide/research-coordinator.md +1 -1
- package/.docs/guides/migrations/network-to-supervisor.md +1 -1
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/cortecs.md +2 -1
- package/.docs/models/providers/digitalocean.md +9 -9
- package/.docs/models/providers/kilo.md +1 -1
- package/.docs/models/providers/llmgateway.md +1 -1
- package/.docs/models/providers/opencode.md +2 -1
- package/.docs/reference/acp/acp-agent.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +195 -506
- package/.docs/reference/agent-controller/session.md +274 -111
- package/.docs/reference/agents/network.md +1 -1
- package/.docs/reference/ai-sdk/handle-network-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +1 -1
- package/.docs/reference/cli/create-mastra.md +1 -1
- package/.docs/reference/editor/versioning.md +1 -1
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/observability.md +2 -2
- package/.docs/reference/file-based-agents/storage.md +1 -1
- package/.docs/reference/file-based-agents/subagents.md +1 -1
- package/.docs/reference/file-based-agents/tools.md +1 -1
- package/.docs/reference/observability/tracing/configuration.md +1 -1
- package/.docs/reference/observability/tracing/exporters/confident-ai.md +138 -0
- package/.docs/reference/observability/tracing/interfaces.md +29 -0
- package/.docs/reference/signals/signal-provider.md +2 -0
- package/.docs/reference/tools/mcp-server.md +1 -1
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/workspace/railway-sandbox.md +5 -5
- package/CHANGELOG.md +14 -0
- package/package.json +3 -3
- package/.docs/docs/agent-controller/channels.md +0 -111
- package/.docs/docs/agent-controller/modes.md +0 -147
- package/.docs/docs/agent-controller/overview.md +0 -136
- package/.docs/docs/agent-controller/session.md +0 -161
- package/.docs/docs/agent-controller/subagents.md +0 -110
- package/.docs/docs/agent-controller/threads-and-state.md +0 -148
- package/.docs/docs/agent-controller/tool-approvals.md +0 -147
- package/.docs/docs/mcp/mcp-apps.md +0 -306
- package/.docs/docs/observability/config.md +0 -140
- package/.docs/docs/observability/storage.md +0 -81
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
The `.network()` method enables multi-agent collaboration and routing. This method accepts messages and optional execution options.
|
|
6
6
|
|
|
7
|
-
> **Deprecated:** The `.network()` primitive has been deprecated and will be removed in a future major release. Use [supervisor agents](https://mastra.ai/docs/
|
|
7
|
+
> **Deprecated:** The `.network()` primitive has been deprecated and will be removed in a future major release. Use [supervisor agents](https://mastra.ai/docs/capabilities/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# handleNetworkStream()
|
|
4
4
|
|
|
5
|
-
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/
|
|
5
|
+
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/capabilities/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
|
|
6
6
|
|
|
7
7
|
Framework-agnostic handler for streaming network execution in AI SDK-compatible format. Use this function directly when you need to handle network streaming outside Hono or Mastra's own [apiRoutes](https://mastra.ai/docs/server/custom-api-routes) feature.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# networkRoute()
|
|
4
4
|
|
|
5
|
-
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/
|
|
5
|
+
> **Deprecated:** Agent networks are deprecated and will be removed in a future release. Use [supervisor agents](https://mastra.ai/docs/capabilities/subagents) with `agent.stream()` or `agent.generate()` instead. See the [migration guide](https://mastra.ai/guides/migrations/network-to-supervisor) to upgrade.
|
|
6
6
|
|
|
7
7
|
Creates a network route handler for streaming network execution using the AI SDK format. This function registers an HTTP `POST` endpoint that accepts messages, executes an agent network, and streams the response back to the client in AI SDK-compatible format. Agent networks allow a routing agent to delegate tasks to other agents. You have to use it inside a [custom API route](https://mastra.ai/docs/server/custom-api-routes).
|
|
8
8
|
|
|
@@ -195,7 +195,7 @@ Invalid input is rejected before templates are fetched or files are created.
|
|
|
195
195
|
|
|
196
196
|
**-l, --llm \<provider>** (`string`): Managed agent-harness provider: openai, anthropic, google, or xai.
|
|
197
197
|
|
|
198
|
-
**-k, --llm-api-key \<key>** (`string`): Write the selected provider API key to the generated .env file.
|
|
198
|
+
**-k, --llm-api-key \<key>** (`string`): Write the selected provider API key to the generated .env file when automatic provider setup succeeds.
|
|
199
199
|
|
|
200
200
|
**--no-skills** (`boolean`): Skip automatic Mastra skills installation.
|
|
201
201
|
|
|
@@ -54,7 +54,7 @@ See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agen
|
|
|
54
54
|
|
|
55
55
|
## Sub-agent versioning
|
|
56
56
|
|
|
57
|
-
Version overrides propagate through [supervisor-agent delegation](https://mastra.ai/docs/
|
|
57
|
+
Version overrides propagate through [supervisor-agent delegation](https://mastra.ai/docs/capabilities/subagents) in request context. Define selectors at three levels:
|
|
58
58
|
|
|
59
59
|
1. `Mastra` instance `versions`: Defaults for every invocation
|
|
60
60
|
2. Server request-body `versions`: Per-request values added to request context
|
|
@@ -111,5 +111,5 @@ The `reason` summarizes the result and lists each criterion with its verdict, so
|
|
|
111
111
|
## Related
|
|
112
112
|
|
|
113
113
|
- [isTaskComplete on stream()](https://mastra.ai/reference/streaming/agents/stream)
|
|
114
|
-
- [Supervisor agents](https://mastra.ai/docs/
|
|
114
|
+
- [Supervisor agents](https://mastra.ai/docs/capabilities/subagents)
|
|
115
115
|
- [createScorer](https://mastra.ai/reference/evals/create-scorer)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Mastra configures [observability](https://mastra.ai/docs/observability/overview) from an `observability.ts` file directly under `src/mastra/`. The file default-exports an `Observability` instance that sets up tracing, logging, metrics, and feedback for the project.
|
|
6
6
|
|
|
7
|
-
Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see [
|
|
7
|
+
Use this page for the file-based convention. For the signal model, exporters, storage, and multi-config setup, see the [observability overview](https://mastra.ai/docs/observability/overview) and [observability configuration](https://mastra.ai/docs/observability/overview).
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
@@ -25,7 +25,7 @@ export default new Observability({
|
|
|
25
25
|
|
|
26
26
|
## Observability and storage
|
|
27
27
|
|
|
28
|
-
`observability.ts` configures which signals are collected and where they're exported. [`storage.ts`](https://mastra.ai/reference/file-based-agents/storage) configures the project store that can persist observability records. For storage support by signal, see [
|
|
28
|
+
`observability.ts` configures which signals are collected and where they're exported. [`storage.ts`](https://mastra.ai/reference/file-based-agents/storage) configures the project store that can persist observability records. For storage support by signal, see [observability signal support](https://mastra.ai/docs/observability/overview).
|
|
29
29
|
|
|
30
30
|
## Precedence with code
|
|
31
31
|
|
|
@@ -23,7 +23,7 @@ Mastra registers the store before file-based agents and workflows, so storage-de
|
|
|
23
23
|
|
|
24
24
|
## Production backends
|
|
25
25
|
|
|
26
|
-
`storage.ts` can export any Mastra storage adapter, such as LibSQL, PostgreSQL, or MongoDB. For setup patterns, provider support, and schema details, see [storage overview](https://mastra.ai/docs/storage/overview), [observability
|
|
26
|
+
`storage.ts` can export any Mastra storage adapter, such as LibSQL, PostgreSQL, or MongoDB. For setup patterns, provider support, and schema details, see [storage overview](https://mastra.ai/docs/storage/overview), [observability signal support](https://mastra.ai/docs/observability/overview), and the [storage reference](https://mastra.ai/reference/storage/overview).
|
|
27
27
|
|
|
28
28
|
## Precedence with code
|
|
29
29
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
A file-based agent can declare **subagents**, specialist child agents it delegates to. The parent model sees each subagent as a delegation tool named after the subagent directory and calls that tool to hand off a task. The subagent's result returns to the parent conversation.
|
|
6
6
|
|
|
7
|
-
Use this page for the file-based convention. For broader delegation patterns, hooks, memory isolation, tool approval propagation, and scoring, see [Supervisor agents](https://mastra.ai/docs/
|
|
7
|
+
Use this page for the file-based convention. For broader delegation patterns, hooks, memory isolation, tool approval propagation, and scoring, see [Supervisor agents](https://mastra.ai/docs/capabilities/subagents).
|
|
8
8
|
|
|
9
9
|
## Quickstart
|
|
10
10
|
|
|
@@ -51,7 +51,7 @@ The file-based convention only controls where the tool lives and how it's regist
|
|
|
51
51
|
- Use `toModelOutput` when the model should see a different shape than the raw value returned from `execute`.
|
|
52
52
|
- Use `requireApproval` when a tool needs human confirmation before execution.
|
|
53
53
|
|
|
54
|
-
See the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool) for all options and [tool approval](https://mastra.ai/docs/agent-controller
|
|
54
|
+
See the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool) for all options and [tool approval](https://mastra.ai/docs/harness/agent-controller) for the approval flow.
|
|
55
55
|
|
|
56
56
|
## Runtime boundary
|
|
57
57
|
|
|
@@ -196,7 +196,7 @@ Shuts down all observability instances and clears the registry.
|
|
|
196
196
|
|
|
197
197
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Concepts and usage guide
|
|
198
198
|
- [Sampling Strategies](https://mastra.ai/docs/observability/tracing/overview): Sampling configuration details
|
|
199
|
-
- [Multi-Config Setup](https://mastra.ai/docs/observability/
|
|
199
|
+
- [Multi-Config Setup](https://mastra.ai/docs/observability/overview): Using multiple configurations
|
|
200
200
|
|
|
201
201
|
### Reference
|
|
202
202
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# DeepEvalExporter
|
|
4
|
+
|
|
5
|
+
Sends Tracing data to [Confident AI](https://www.confident-ai.com/) for evaluation and observability. Exported by `@mastra/deepeval`, which builds on the DeepEval SDK.
|
|
6
|
+
|
|
7
|
+
See [Confident AI exporter](https://mastra.ai/docs/observability/integrations/exporters/confident-ai) for setup and usage.
|
|
8
|
+
|
|
9
|
+
## Constructor
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
new DeepEvalExporter(config?: DeepEvalExporterConfig)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## `DeepEvalExporterConfig`
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
interface DeepEvalExporterConfig extends BaseExporterConfig {
|
|
19
|
+
apiKey?: string
|
|
20
|
+
environment?: string
|
|
21
|
+
name?: string
|
|
22
|
+
tags?: string[]
|
|
23
|
+
metadata?: Record<string, any>
|
|
24
|
+
threadId?: string
|
|
25
|
+
userId?: string
|
|
26
|
+
testCaseId?: string
|
|
27
|
+
turnId?: string
|
|
28
|
+
metricCollection?: string
|
|
29
|
+
traceMetricCollection?: string
|
|
30
|
+
llmMetricCollection?: string
|
|
31
|
+
agentMetricCollection?: string
|
|
32
|
+
toolMetricCollectionMap?: Record<string, string>
|
|
33
|
+
prompt?: Prompt
|
|
34
|
+
debug?: boolean
|
|
35
|
+
traceCaptureSink?: (trace: Trace) => void
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Extends `BaseExporterConfig`, which includes:
|
|
40
|
+
|
|
41
|
+
- `logger?: IMastraLogger` - Logger instance
|
|
42
|
+
- `logLevel?: LogLevel | 'debug' | 'info' | 'warn' | 'error'` - Log level (default: INFO)
|
|
43
|
+
|
|
44
|
+
**apiKey** (`string`): Confident AI API key. Falls back to the CONFIDENT\_API\_KEY env var. The exporter disables itself when no key is found.
|
|
45
|
+
|
|
46
|
+
**environment** (`string`): Trace environment. Falls back to CONFIDENT\_TRACE\_ENVIRONMENT, then 'development'.
|
|
47
|
+
|
|
48
|
+
**name** (`string`): Trace name applied to every trace. Defaults to the Mastra serviceName.
|
|
49
|
+
|
|
50
|
+
**tags** (`string[]`): Tags applied to every trace.
|
|
51
|
+
|
|
52
|
+
**metadata** (`Record<string, any>`): Metadata applied to every trace.
|
|
53
|
+
|
|
54
|
+
**threadId** (`string`): Thread ID applied to every trace. A threadId in the root span metadata overrides it per request.
|
|
55
|
+
|
|
56
|
+
**userId** (`string`): User ID applied to every trace. A userId in the root span metadata overrides it per request.
|
|
57
|
+
|
|
58
|
+
**testCaseId** (`string`): Test case ID applied to every trace. A testCaseId in the root span metadata overrides it per request.
|
|
59
|
+
|
|
60
|
+
**turnId** (`string`): Turn ID applied to every trace. A turnId in the root span metadata overrides it per request.
|
|
61
|
+
|
|
62
|
+
**metricCollection** (`string`): Trace-level metric collection.
|
|
63
|
+
|
|
64
|
+
**traceMetricCollection** (`string`): Trace-level metric collection. Takes precedence over metricCollection.
|
|
65
|
+
|
|
66
|
+
**llmMetricCollection** (`string`): Metric collection applied to LLM spans.
|
|
67
|
+
|
|
68
|
+
**agentMetricCollection** (`string`): Metric collection applied to agent spans.
|
|
69
|
+
|
|
70
|
+
**toolMetricCollectionMap** (`Record<string, string>`): Metric collection applied per tool name.
|
|
71
|
+
|
|
72
|
+
**prompt** (`Prompt`): Confident AI managed prompt linkage attached to LLM spans.
|
|
73
|
+
|
|
74
|
+
**debug** (`boolean`): Logs exporter configuration and export errors to the console.
|
|
75
|
+
|
|
76
|
+
**traceCaptureSink** (`(trace: Trace) => void`): Receives completed traces locally instead of posting them to Confident AI. Use for offline evaluation.
|
|
77
|
+
|
|
78
|
+
**logLevel** (`'debug' | 'info' | 'warn' | 'error'`): Logger level (default: 'info')
|
|
79
|
+
|
|
80
|
+
## Methods
|
|
81
|
+
|
|
82
|
+
### `exportTracingEvent`
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
async exportTracingEvent(event: TracingEvent): Promise<void>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Exports a tracing event to Confident AI. Builds the trace tree from the Mastra span stream and posts the trace when the root span ends.
|
|
89
|
+
|
|
90
|
+
### `flush`
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
async flush(): Promise<void>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Waits for any in-flight trace posts to settle without shutting down the exporter.
|
|
97
|
+
|
|
98
|
+
### `shutdown`
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
async shutdown(): Promise<void>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Finalizes any open traces and flushes pending posts.
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
### Zero-Config (using environment variables)
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
import { DeepEvalExporter } from '@mastra/deepeval'
|
|
112
|
+
|
|
113
|
+
// Reads from CONFIDENT_API_KEY, CONFIDENT_TRACE_ENVIRONMENT
|
|
114
|
+
const exporter = new DeepEvalExporter()
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Explicit Configuration
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { DeepEvalExporter } from '@mastra/deepeval'
|
|
121
|
+
|
|
122
|
+
const exporter = new DeepEvalExporter({
|
|
123
|
+
apiKey: process.env.CONFIDENT_API_KEY,
|
|
124
|
+
environment: 'production',
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Span type mapping
|
|
129
|
+
|
|
130
|
+
| Mastra span type | Confident AI span type |
|
|
131
|
+
| ---------------------------------------------------------------------- | ---------------------- |
|
|
132
|
+
| `AGENT_RUN`, `WORKFLOW_RUN` | `AGENT` |
|
|
133
|
+
| `MODEL_GENERATION` | `LLM` |
|
|
134
|
+
| `TOOL_CALL`, `MCP_TOOL_CALL`, `PROVIDER_TOOL_CALL`, `CLIENT_TOOL_CALL` | `TOOL` |
|
|
135
|
+
| `RAG_EMBEDDING`, `RAG_VECTOR_OPERATION` | `RETRIEVER` |
|
|
136
|
+
| All other exported span types | `CUSTOM` |
|
|
137
|
+
|
|
138
|
+
Event spans (for example `MODEL_CHUNK`) are dropped.
|
|
@@ -396,6 +396,14 @@ interface ModelGenerationAttributes {
|
|
|
396
396
|
/** Model provider (e.g., 'openai', 'anthropic') */
|
|
397
397
|
provider?: string
|
|
398
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Definitions of the tools made available to the model for this generation
|
|
401
|
+
* (name, description, and JSON-schema parameters), captured once per
|
|
402
|
+
* generation. Per-step tool names live on MODEL_INFERENCE spans as
|
|
403
|
+
* `availableTools`.
|
|
404
|
+
*/
|
|
405
|
+
tools?: ModelToolDefinition[]
|
|
406
|
+
|
|
399
407
|
/** Type of result/output this model call produced */
|
|
400
408
|
resultType?: 'tool_selection' | 'response_generation' | 'reasoning' | 'planning'
|
|
401
409
|
|
|
@@ -429,6 +437,27 @@ interface ModelGenerationAttributes {
|
|
|
429
437
|
}
|
|
430
438
|
```
|
|
431
439
|
|
|
440
|
+
### `ModelToolDefinition`
|
|
441
|
+
|
|
442
|
+
Serialized definition of one tool made available to the model, attached to `MODEL_GENERATION` spans so observability exporters can surface tool schemas.
|
|
443
|
+
|
|
444
|
+
```typescript
|
|
445
|
+
interface ModelToolDefinition {
|
|
446
|
+
/** Tool type: 'function' for standard tools, or the provider tool type (e.g. 'provider-defined') */
|
|
447
|
+
type: string
|
|
448
|
+
|
|
449
|
+
name: string
|
|
450
|
+
|
|
451
|
+
description?: string
|
|
452
|
+
|
|
453
|
+
/** JSON schema of the tool's input parameters (function tools) */
|
|
454
|
+
parameters?: Record<string, unknown>
|
|
455
|
+
|
|
456
|
+
/** Provider tool id (e.g. 'anthropic.web_search_20250305') for provider-defined tools */
|
|
457
|
+
id?: string
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
432
461
|
### `ModelStepAttributes`
|
|
433
462
|
|
|
434
463
|
Model Step attributes - for a single model execution within a generation.
|
|
@@ -291,6 +291,8 @@ provider.stopPolling()
|
|
|
291
291
|
|
|
292
292
|
Handle an incoming webhook request. Override to parse the payload and match it to subscriptions. Then emit notification signals. See [`WebhookSignalProvider`](https://mastra.ai/reference/signals/webhook-signal-provider) for a ready-to-use implementation.
|
|
293
293
|
|
|
294
|
+
Call this method from an application-defined HTTP endpoint after verifying the webhook request.
|
|
295
|
+
|
|
294
296
|
```typescript
|
|
295
297
|
async handleWebhook(request) {
|
|
296
298
|
const payload = request.body as { repo: string, event: string }
|
|
@@ -1660,7 +1660,7 @@ const server = new MCPServer({
|
|
|
1660
1660
|
})
|
|
1661
1661
|
```
|
|
1662
1662
|
|
|
1663
|
-
Link a tool to its app resource by setting `_meta.ui.resourceUri` on the tool to the matching `ui://` URI. The server auto-normalizes this metadata when registering tools. Visit [MCP Apps](https://mastra.ai/docs/mcp/
|
|
1663
|
+
Link a tool to its app resource by setting `_meta.ui.resourceUri` on the tool to the matching `ui://` URI. The server auto-normalizes this metadata when registering tools. Visit [MCP Apps](https://mastra.ai/docs/mcp/overview) for the full app bridge API and usage patterns.
|
|
1664
1664
|
|
|
1665
1665
|
## Related information
|
|
1666
1666
|
|
|
@@ -90,4 +90,4 @@ Pass an object to `agent.resumeStream()`:
|
|
|
90
90
|
- **Rejected with feedback:** The tool returns the feedback and asks the model to revise the plan and submit again.
|
|
91
91
|
- **Rejected without feedback:** The tool tells the model to wait for the user's next message before revising.
|
|
92
92
|
|
|
93
|
-
When used inside an [AgentController](https://mastra.ai/docs/agent-controller
|
|
93
|
+
When used inside an [AgentController](https://mastra.ai/docs/harness/agent-controller), plan approval switches from the current mode to the mode configured by `transitionsTo`. When no `transitionsTo` is configured, the controller switches to its resolved default mode. See [Modes](https://mastra.ai/docs/harness/agent-controller) for details.
|
|
@@ -143,14 +143,14 @@ const sandbox = new RailwaySandbox({
|
|
|
143
143
|
|
|
144
144
|
Use one stable checkpoint name for each independent filesystem. Don't share a checkpoint name across unrelated sessions or projects.
|
|
145
145
|
|
|
146
|
-
###
|
|
146
|
+
### Cloned sandbox checkpoints
|
|
147
147
|
|
|
148
|
-
Use `
|
|
148
|
+
Use `clone({ checkpointName })` when a configured `RailwaySandbox` acts as the template for a sandbox fleet:
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
151
|
const template = new RailwaySandbox({ idleTimeoutMinutes: 30 })
|
|
152
152
|
|
|
153
|
-
const sessionSandbox = template.
|
|
153
|
+
const sessionSandbox = template.clone({
|
|
154
154
|
id: 'session-42',
|
|
155
155
|
checkpointName: 'project-session-42',
|
|
156
156
|
})
|
|
@@ -158,7 +158,7 @@ const sessionSandbox = template.derive({
|
|
|
158
158
|
await sessionSandbox.start()
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
A
|
|
161
|
+
A cloned sandbox uses the checkpoint passed to `clone()`. If no override is passed, it inherits the template sandbox's `checkpointName`.
|
|
162
162
|
|
|
163
163
|
### Streaming output
|
|
164
164
|
|
|
@@ -226,7 +226,7 @@ const result = await sandbox.executeCommand('cat', ['/tmp/state.txt'])
|
|
|
226
226
|
|
|
227
227
|
**fork** (`(options?) => Promise<RailwaySandbox>`): Clone this running sandbox into a new, independent RailwaySandbox. The returned sandbox is already started and reattached to the forked Railway sandbox. Accepts optional id, idleTimeoutMinutes, networkIsolation, and env overrides. Throws SandboxNotReadyError if this sandbox has not been started.
|
|
228
228
|
|
|
229
|
-
**
|
|
229
|
+
**clone** (`(options?) => RailwaySandbox`): Construct an unstarted sibling sandbox that inherits credentials and defaults. Accepts optional id, sandboxId, env, idleTimeoutMinutes, and checkpointName overrides. The cloned sandbox uses options.checkpointName when set, otherwise it inherits the template checkpointName.
|
|
230
230
|
|
|
231
231
|
## Background processes
|
|
232
232
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.2.14-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`89200ba`](https://github.com/mastra-ai/mastra/commit/89200bafa05444bb7949b363ce7b743e29867561), [`c950138`](https://github.com/mastra-ai/mastra/commit/c950138e72e4f317a40187e3800588731ab790ce), [`063c8b2`](https://github.com/mastra-ai/mastra/commit/063c8b2eb14e4e5ca021779bc33e8c3c031c8604), [`f4e964c`](https://github.com/mastra-ai/mastra/commit/f4e964cad57057301d6bed5c55bcdd730175b941), [`1f7bbd7`](https://github.com/mastra-ai/mastra/commit/1f7bbd7785a8d230aad02454ecabeb4a0b2cc96f), [`e47ff36`](https://github.com/mastra-ai/mastra/commit/e47ff36945720f4ee4caa09f6e83514d7d188608), [`fb9a6ac`](https://github.com/mastra-ai/mastra/commit/fb9a6ac11c9560518742ece60b49d6b062845fd3), [`aa2cec8`](https://github.com/mastra-ai/mastra/commit/aa2cec8501f634d51c2f3ebfb3dd3aa7af8d2ca2), [`2adf8eb`](https://github.com/mastra-ai/mastra/commit/2adf8eb4a70ed2b6cff2dd39281496ea0e025fac), [`8264611`](https://github.com/mastra-ai/mastra/commit/8264611510e421b818bc7395dc2ae4d9c2d518b2), [`44fc98b`](https://github.com/mastra-ai/mastra/commit/44fc98b9d1242aa87a3ab44bdce9e9f12c44d8c9), [`0f2ef41`](https://github.com/mastra-ai/mastra/commit/0f2ef4118da022e4f30dac4e9856cc3a8c97671c)]:
|
|
8
|
+
- @mastra/core@1.57.0-alpha.1
|
|
9
|
+
|
|
10
|
+
## 1.2.14-alpha.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`c8002da`](https://github.com/mastra-ai/mastra/commit/c8002da7775c468e2965b6ff5f82045450fa8cb9)]:
|
|
15
|
+
- @mastra/core@1.56.1-alpha.0
|
|
16
|
+
|
|
3
17
|
## 1.2.13
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.14-alpha.3",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"jsdom": "^26.1.0",
|
|
29
29
|
"local-pkg": "^1.1.2",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@mastra/core": "1.
|
|
31
|
+
"@mastra/core": "1.57.0-alpha.1",
|
|
32
32
|
"@mastra/mcp": "^1.15.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"vitest": "4.1.10",
|
|
48
48
|
"@internal/types-builder": "0.0.95",
|
|
49
49
|
"@internal/lint": "0.0.120",
|
|
50
|
-
"@mastra/core": "1.
|
|
50
|
+
"@mastra/core": "1.57.0-alpha.1"
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://mastra.ai",
|
|
53
53
|
"repository": {
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
-
|
|
3
|
-
# Channels
|
|
4
|
-
|
|
5
|
-
Channels connect an AgentController to messaging platforms like Slack, Discord, and Telegram, so a controller-backed session runs inside a chat thread. Inbound platform messages route into a controller [`Session`](https://mastra.ai/docs/agent-controller/session), and the agent's output renders back to the platform with native streaming. The response can also include tool approval cards and typing status.
|
|
6
|
-
|
|
7
|
-
AgentController channels use the same channel layer as [agent channels](https://mastra.ai/docs/capabilities/channels/overview). The adapters and configuration shape are shared. Both channel types also use the same rendering pipeline.
|
|
8
|
-
|
|
9
|
-
Message routing differs by channel type. Agent channels route messages straight into the agent loop. With AgentController channels, messages enter a durable session that tracks the active mode, model, permission grants, and state across the whole conversation.
|
|
10
|
-
|
|
11
|
-
## Configure a controller
|
|
12
|
-
|
|
13
|
-
Pass a `channels` configuration to the AgentController constructor. It accepts the same shape as the [`Agent` channels option](https://mastra.ai/docs/capabilities/channels/overview):
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import { Agent } from '@mastra/core/agent'
|
|
17
|
-
import { AgentController } from '@mastra/core/agent-controller'
|
|
18
|
-
import { createSlackAdapter } from '@chat-adapter/slack'
|
|
19
|
-
import { LibSQLStore } from '@mastra/libsql'
|
|
20
|
-
|
|
21
|
-
const agent = new Agent({
|
|
22
|
-
id: 'assistant',
|
|
23
|
-
name: 'assistant',
|
|
24
|
-
instructions: 'Help the user plan and complete tasks.',
|
|
25
|
-
model: 'anthropic/claude-sonnet-4-6',
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
export const agentController = new AgentController({
|
|
29
|
-
id: 'my-agent-controller',
|
|
30
|
-
agent,
|
|
31
|
-
storage: new LibSQLStore({ url: 'file:./data.db' }),
|
|
32
|
-
modes: [
|
|
33
|
-
{
|
|
34
|
-
id: 'plan',
|
|
35
|
-
name: 'Plan',
|
|
36
|
-
metadata: { default: true },
|
|
37
|
-
instructions: 'Reason about changes before making them.',
|
|
38
|
-
},
|
|
39
|
-
{ id: 'build', name: 'Build', instructions: 'Implement the approved plan.' },
|
|
40
|
-
],
|
|
41
|
-
channels: {
|
|
42
|
-
adapters: {
|
|
43
|
-
slack: createSlackAdapter(),
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Register the controller on the Mastra instance. Mastra registers the webhook routes and initializes the channel layer:
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
import { Mastra } from '@mastra/core'
|
|
53
|
-
import { LibSQLStore } from '@mastra/libsql'
|
|
54
|
-
import { agentController } from './agent-controller'
|
|
55
|
-
|
|
56
|
-
export const mastra = new Mastra({
|
|
57
|
-
agentControllers: { agentController },
|
|
58
|
-
storage: new LibSQLStore({
|
|
59
|
-
url: process.env.DATABASE_URL,
|
|
60
|
-
}),
|
|
61
|
-
})
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Webhook routes
|
|
65
|
-
|
|
66
|
-
Controller channel webhooks follow the same pattern as agent channels, under an `agent-controllers` path:
|
|
67
|
-
|
|
68
|
-
```text
|
|
69
|
-
/api/agent-controllers/<CONTROLLER_ID>/channels/<PLATFORM>/webhook
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
For example, a Slack adapter on a controller with the `my-agent-controller` ID uses:
|
|
73
|
-
|
|
74
|
-
```text
|
|
75
|
-
/api/agent-controllers/my-agent-controller/channels/slack/webhook
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Point the platform's webhook, event, or interactions URL to this path. See [Webhook routes](https://mastra.ai/docs/capabilities/channels/overview) for local tunneling and platform setup.
|
|
79
|
-
|
|
80
|
-
## One session per chat thread
|
|
81
|
-
|
|
82
|
-
Each chat thread maps to one durable controller session. The first message in a Slack or Discord thread creates a Mastra thread and a controller session keyed to it. Every later message in that chat thread reuses both. The session carries the active mode, model, permission grants, and state for the life of the conversation, as with a session driven from a terminal or web UI.
|
|
83
|
-
|
|
84
|
-
By default the session key derives from the platform and the external thread ID (`channel:slack:<THREAD_ID>`). Pass `resolveResourceId` in the channels configuration to control the mapping yourself.
|
|
85
|
-
|
|
86
|
-
Avoid mapping multiple active chat threads to one session. A session works on one Mastra thread at a time, and a message arriving from a different chat thread rebinds the session to that thread, which cancels any run still in flight on the previous one.
|
|
87
|
-
|
|
88
|
-
## Tool approvals
|
|
89
|
-
|
|
90
|
-
Tools that require approval render as interactive cards with Approve and Deny buttons, the same as [agent channel tool approvals](https://mastra.ai/docs/capabilities/channels/overview). The controller run pauses at the session's approval gate until a user acts on the card, then resumes and streams the continuation back to the thread.
|
|
91
|
-
|
|
92
|
-
These behaviors follow from routing approvals through the session:
|
|
93
|
-
|
|
94
|
-
- A new message in the thread while an approval is pending declines that approval, the same as sending a new message in a terminal session. The new message supersedes the pending ask.
|
|
95
|
-
- On adapters that can't render approval buttons (`toolDisplay: 'text'`), tools run without approval prompts so runs can't stall on a card nobody can act on.
|
|
96
|
-
|
|
97
|
-
See [Tool approvals and permissions](https://mastra.ai/docs/agent-controller/tool-approvals) for policies, categories, and session grants.
|
|
98
|
-
|
|
99
|
-
## Limits
|
|
100
|
-
|
|
101
|
-
- Adapters can be constructed manually with the same configuration. The managed connect flow (`mastra.channels.slack.connect(...)`) also supports controller-owned installations: call it with an options object (`connect({ id, name })`) to connect a controller that has no registered agent. Adapters without controller support must still be constructed manually.
|
|
102
|
-
- Controller sessions are in-memory objects, so channels-backed controllers need a long-lived server. Serverless deployment isn't supported for controller channels. Agent channels support it as described in [Serverless deployment](https://mastra.ai/docs/capabilities/channels/overview).
|
|
103
|
-
- Pending tool approvals don't survive a server restart. An approval card acted on after a restart is ignored as stale.
|
|
104
|
-
- Mode switching from chat (for example, a `/mode` slash command) isn't available yet.
|
|
105
|
-
|
|
106
|
-
## Related
|
|
107
|
-
|
|
108
|
-
- [Channels overview](https://mastra.ai/docs/capabilities/channels/overview)
|
|
109
|
-
- [Session](https://mastra.ai/docs/agent-controller/session)
|
|
110
|
-
- [Tool approvals and permissions](https://mastra.ai/docs/agent-controller/tool-approvals)
|
|
111
|
-
- [Channels reference](https://mastra.ai/reference/agents/channels)
|