@mastra/mcp-docs-server 1.2.13-alpha.0 → 1.2.13-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.
Files changed (131) hide show
  1. package/.docs/docs/agents/agent-approval.md +72 -0
  2. package/.docs/docs/agents/overview.md +1 -1
  3. package/.docs/docs/agents/supervisor-agents.md +2 -2
  4. package/.docs/docs/agents/using-tools.md +61 -33
  5. package/.docs/docs/{evals/datasets → datasets}/overview.md +3 -3
  6. package/.docs/docs/{evals/datasets → datasets}/running-experiments.md +57 -9
  7. package/.docs/docs/deployment/workers.md +14 -14
  8. package/.docs/docs/editor/overview.md +201 -206
  9. package/.docs/docs/evals/evals-with-memory.md +1 -1
  10. package/.docs/docs/getting-started/develop.md +196 -0
  11. package/.docs/docs/index.md +78 -1
  12. package/.docs/docs/long-running-agents/durable-agents.md +2 -2
  13. package/.docs/docs/mastra-platform/overview.md +1 -1
  14. package/.docs/docs/mastra-platform/workspaces.md +152 -0
  15. package/.docs/docs/memory/observational-memory.md +53 -13
  16. package/.docs/docs/memory/overview.md +14 -0
  17. package/.docs/docs/server/auth/workers.md +7 -5
  18. package/.docs/docs/server/mastra-client.md +60 -0
  19. package/.docs/docs/server/pubsub.md +2 -2
  20. package/.docs/docs/studio/observability.md +4 -0
  21. package/.docs/docs/studio/overview.md +2 -2
  22. package/.docs/docs/workflows/overview.md +1 -1
  23. package/.docs/docs/workflows/scheduled-workflows.md +1 -0
  24. package/.docs/docs/workspace/search.md +1 -1
  25. package/.docs/guides/deployment/kubernetes.md +2 -0
  26. package/.docs/guides/deployment/mastra-workers.md +350 -6
  27. package/.docs/guides/deployment/vercel.md +2 -0
  28. package/.docs/guides/getting-started/quickstart.md +3 -3
  29. package/.docs/{docs → guides}/rag/chunking-and-embedding.md +1 -1
  30. package/.docs/{docs → guides}/rag/graph-rag.md +1 -1
  31. package/.docs/{docs → guides}/rag/overview.md +2 -2
  32. package/.docs/{docs → guides}/rag/retrieval.md +1 -1
  33. package/.docs/{docs → guides}/voice/overview.md +4 -4
  34. package/.docs/{docs → guides}/voice/realtime-voice.md +2 -2
  35. package/.docs/{docs → guides}/voice/speech-to-speech.md +1 -1
  36. package/.docs/{docs → guides}/voice/speech-to-text.md +1 -1
  37. package/.docs/{docs → guides}/voice/text-to-speech.md +2 -2
  38. package/.docs/models/embeddings.md +63 -65
  39. package/.docs/models/environment-variables.md +2 -1
  40. package/.docs/models/gateways/openrouter.md +3 -6
  41. package/.docs/models/gateways/vercel.md +4 -1
  42. package/.docs/models/index.md +1 -1
  43. package/.docs/models/providers/cortecs.md +2 -1
  44. package/.docs/models/providers/crof.md +2 -1
  45. package/.docs/models/providers/crossmodel.md +4 -3
  46. package/.docs/models/providers/empiriolabs.md +2 -1
  47. package/.docs/models/providers/greenpt.md +98 -0
  48. package/.docs/models/providers/huggingface.md +3 -1
  49. package/.docs/models/providers/hyper.md +10 -7
  50. package/.docs/models/providers/llmgateway.md +5 -4
  51. package/.docs/models/providers/minimax.md +1 -1
  52. package/.docs/models/providers/neuralwatt.md +3 -1
  53. package/.docs/models/providers/openai.md +2 -2
  54. package/.docs/models/providers/opencode-go.md +2 -1
  55. package/.docs/models/providers/opencode.md +1 -1
  56. package/.docs/models/providers/perplexity-agent.md +3 -1
  57. package/.docs/models/providers/scaleway.md +1 -3
  58. package/.docs/models/providers/the-grid-ai.md +3 -3
  59. package/.docs/models/providers/zai-coding-plan.md +11 -13
  60. package/.docs/models/providers/zhipuai-coding-plan.md +12 -12
  61. package/.docs/models/providers.md +1 -0
  62. package/.docs/reference/agents/agent.md +1 -1
  63. package/.docs/reference/agents/durable-agent.md +12 -1
  64. package/.docs/reference/agents/generate.md +1 -1
  65. package/.docs/reference/agents/getVoice.md +1 -1
  66. package/.docs/{docs/getting-started → reference}/build-with-ai.md +5 -110
  67. package/.docs/reference/cli/create-mastra.md +2 -0
  68. package/.docs/reference/cli/mastra.md +36 -16
  69. package/.docs/reference/client-js/agents.md +1 -1
  70. package/.docs/reference/configuration.md +2 -2
  71. package/.docs/reference/core/getEditor.md +1 -1
  72. package/.docs/reference/core/getVector.md +2 -2
  73. package/.docs/reference/core/listVectors.md +2 -2
  74. package/.docs/reference/core/mastra-class.md +2 -2
  75. package/.docs/reference/datasets/startExperiment.md +8 -0
  76. package/.docs/reference/datasets/startExperimentAsync.md +4 -0
  77. package/.docs/reference/editor/browser-provider.md +2 -2
  78. package/.docs/reference/editor/filesystem-provider.md +1 -1
  79. package/.docs/reference/editor/mastra-editor.md +31 -18
  80. package/.docs/reference/editor/prompt-blocks.md +137 -0
  81. package/.docs/reference/editor/sandbox-provider.md +1 -1
  82. package/.docs/reference/editor/storage-browser-ref.md +3 -3
  83. package/.docs/reference/editor/storage-workspace-ref.md +3 -3
  84. package/.docs/reference/editor/tool-provider.md +44 -10
  85. package/.docs/reference/editor/tools.md +100 -0
  86. package/.docs/reference/editor/versioning.md +130 -0
  87. package/.docs/reference/evals/mastra-scorer.md +68 -8
  88. package/.docs/reference/evals/summarization.md +203 -0
  89. package/.docs/reference/file-based-agents/config.md +39 -1
  90. package/.docs/reference/index.md +4 -4
  91. package/.docs/reference/memory/observational-memory.md +76 -24
  92. package/.docs/reference/memory/serialized-memory-config.md +3 -3
  93. package/.docs/reference/observability/tracing/interfaces.md +6 -1
  94. package/.docs/reference/processors/processor-interface.md +14 -2
  95. package/.docs/reference/processors/regex-filter-processor.md +81 -9
  96. package/.docs/reference/processors/token-limiter-processor.md +15 -1
  97. package/.docs/reference/project-structure.md +1 -1
  98. package/.docs/reference/rag/database-config.md +1 -1
  99. package/.docs/reference/storage/composite.md +2 -0
  100. package/.docs/reference/streaming/agents/stream.md +1 -1
  101. package/.docs/reference/tools/isolated-vm-transport.md +1 -1
  102. package/.docs/reference/vectors/mongodb.md +13 -13
  103. package/.docs/reference/voice/livekit.md +3 -3
  104. package/.docs/reference/workers/overview.md +10 -8
  105. package/.docs/reference/workspace/platform-filesystem.md +8 -5
  106. package/.docs/reference/workspace/platform-sandbox.md +83 -7
  107. package/CHANGELOG.md +51 -0
  108. package/README.md +1 -1
  109. package/package.json +5 -5
  110. package/.docs/docs/agent-builder/access-control.md +0 -99
  111. package/.docs/docs/agent-builder/browser.md +0 -63
  112. package/.docs/docs/agent-builder/channels.md +0 -78
  113. package/.docs/docs/agent-builder/configuration.md +0 -132
  114. package/.docs/docs/agent-builder/deploying.md +0 -124
  115. package/.docs/docs/agent-builder/integrations.md +0 -115
  116. package/.docs/docs/agent-builder/memory.md +0 -69
  117. package/.docs/docs/agent-builder/model-policy.md +0 -50
  118. package/.docs/docs/agent-builder/overview.md +0 -114
  119. package/.docs/docs/agent-builder/skill-registries.md +0 -31
  120. package/.docs/docs/agent-builder/workspace.md +0 -62
  121. package/.docs/docs/editor/prompts.md +0 -140
  122. package/.docs/docs/editor/tools.md +0 -148
  123. package/.docs/docs/getting-started/file-based-agents.md +0 -121
  124. package/.docs/docs/mastra-platform/workspace.md +0 -111
  125. package/.docs/docs/what-is-mastra.md +0 -161
  126. package/.docs/reference/client-js/agent-builder.md +0 -163
  127. package/.docs/reference/editor/agent-builder/agent-builder-options.md +0 -76
  128. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +0 -79
  129. package/.docs/reference/editor/agent-builder/builder-models.md +0 -66
  130. /package/.docs/{docs → guides}/getting-started/manual-install.md +0 -0
  131. /package/.docs/{docs → guides}/rag/vector-databases.md +0 -0
@@ -1,121 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # File-based agents
4
-
5
- **Added in:** `@mastra/core@1.50.0`
6
-
7
- > **Beta:** This feature is in beta. Breaking changes may occur without a major version bump until the API is stable.
8
-
9
- File-based agents are an experimental, convention-based way to define [Mastra agents](https://mastra.ai/docs/agents/overview) and the primitives they use in files under `src/mastra/`, instead of registering them manually on your [`Mastra`](https://mastra.ai/reference/core/mastra-class) instance.
10
-
11
- This approach reduces glue code and makes the file system itself a direct representation of your [project structure](https://mastra.ai/reference/project-structure), so both you and your coding agent can understand it at a glance.
12
-
13
- You can build your entire project with file-based agents or combine this approach with agents and other primitives defined directly in code for incremental adoption.
14
-
15
- File-based agents have some limitations while in beta. They don't support every Mastra feature yet. Runtime configuration and wiring are usually better defined directly in code, along with any related primitives.
16
-
17
- > **Note:** All Mastra documentation currently shows agents and primitives defined directly in code. File-based agents use the same underlying concepts and APIs, so the guidance elsewhere in the docs still applies. As file-based agents mature, more examples may use this structure where appropriate.
18
-
19
- ## Basic layout
20
-
21
- A small file-based agent looks like this:
22
-
23
- ```text
24
- src/mastra/
25
- agents/
26
- weather/
27
- config.ts
28
- instructions.md
29
- tools/
30
- get-weather.ts
31
- skills/
32
- forecast-review.md
33
- ```
34
-
35
- The main files in an agent directory are:
36
-
37
- - [`config.ts`](https://mastra.ai/reference/file-based-agents/config): Model selection and runtime options
38
- - [`instructions.md`](https://mastra.ai/reference/file-based-agents/instructions): The prompt that applies to every response
39
- - [`tools/`](https://mastra.ai/reference/file-based-agents/tools): Typed functions the model can call
40
- - [`skills/`](https://mastra.ai/reference/file-based-agents/skills): Reusable instructions
41
-
42
- You need to define `config.ts` and `instructions.md` at a minimum. Add optional files as needed. Learn more in the [add capabilities](#add-capabilities) section.
43
-
44
- ## Quickstart
45
-
46
- Create a folder at `src/mastra/agents/weather`. Inside, add a `config.ts` and an `instructions.md` file with these contents:
47
-
48
- ```typescript
49
- import { agentConfig } from '@mastra/core/agent'
50
-
51
- export default agentConfig({
52
- model: 'openai/gpt-5.6-sol',
53
- })
54
- ```
55
-
56
- ```markdown
57
- You are a helpful weather assistant. Answer questions about current conditions and forecasts.
58
- ```
59
-
60
- Start Mastra's development server with `mastra dev`. Inside Studio, you can now call the `weather` agent and ask it about the weather.
61
-
62
- ## Add capabilities
63
-
64
- Map each primitive or feature to its file convention:
65
-
66
- | Primitive or feature | File convention |
67
- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
68
- | [Agent config](https://mastra.ai/reference/file-based-agents/config) | `src/mastra/agents/<agent-id>/config.ts` |
69
- | [Agent instructions](https://mastra.ai/reference/file-based-agents/instructions) | `src/mastra/agents/<agent-id>/instructions.md` |
70
- | [Tools](https://mastra.ai/reference/file-based-agents/tools) | `src/mastra/agents/<agent-id>/tools/` |
71
- | [Skills](https://mastra.ai/reference/file-based-agents/skills) | `src/mastra/agents/<agent-id>/skills/` |
72
- | [Memory](https://mastra.ai/reference/file-based-agents/memory) | `src/mastra/agents/<agent-id>/memory.ts` |
73
- | [Workspace](https://mastra.ai/reference/file-based-agents/workspace) | `src/mastra/agents/<agent-id>/workspace.ts` and `src/mastra/agents/<agent-id>/workspace/` |
74
- | [Processors](https://mastra.ai/reference/file-based-agents/processors) | `src/mastra/agents/<agent-id>/processors/` |
75
- | [Scorers](https://mastra.ai/reference/file-based-agents/scorers) | `src/mastra/agents/<agent-id>/scorers/` |
76
- | [Subagents](https://mastra.ai/reference/file-based-agents/subagents) | `src/mastra/agents/<agent-id>/subagents/` |
77
- | [Workflows](https://mastra.ai/reference/file-based-agents/workflows) | `src/mastra/workflows/` |
78
- | [Storage](https://mastra.ai/reference/file-based-agents/storage) | `src/mastra/storage.ts` |
79
- | [Observability](https://mastra.ai/reference/file-based-agents/observability) | `src/mastra/observability.ts` |
80
- | [Logger](https://mastra.ai/reference/file-based-agents/logger) | `src/mastra/logger.ts` |
81
- | [Server config](https://mastra.ai/reference/file-based-agents/server) | `src/mastra/server.ts` |
82
- | [Studio config](https://mastra.ai/reference/file-based-agents/studio) | `src/mastra/studio.ts` |
83
- | [Schedules](https://mastra.ai/docs/long-running-agents/schedules) | Not yet file-based, create at runtime with `mastra.schedules.create()` |
84
-
85
- ## Discovery lifecycle
86
-
87
- File-based primitives are discovered by the Mastra bundler under `mastra dev` and `mastra build`. During discovery, Mastra reads supported files under `src/mastra/`, imports TypeScript and JavaScript modules, reads markdown instructions and skills, copies workspace seed files, and registers the assembled primitives with your Mastra app.
88
-
89
- After discovery, a file-based agent runs as a normal [`Agent`](https://mastra.ai/reference/agents/agent). Calling it from the Agent API, Studio, workflows, or your application code uses the same runtime as a code-defined agent.
90
-
91
- Discovery is source-based and conservative.
92
-
93
- It skips symlinks, test files, and directories that aren't agent directories. Workflows and singleton project files are file-routed only when they have a default export.
94
-
95
- Start your app through the Mastra CLI so discovery runs:
96
-
97
- **npm**:
98
-
99
- ```bash
100
- npx mastra dev
101
- ```
102
-
103
- **pnpm**:
104
-
105
- ```bash
106
- pnpm dlx mastra dev
107
- ```
108
-
109
- **Yarn**:
110
-
111
- ```bash
112
- yarn dlx mastra dev
113
- ```
114
-
115
- **Bun**:
116
-
117
- ```bash
118
- bun x mastra dev
119
- ```
120
-
121
- If you import your `mastra` instance directly, `agents/<name>/` directories and the other conventions aren't discovered. When you consume Mastra as a library, register those primitives in code instead.
@@ -1,111 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Workspace
4
-
5
- A workspace gives an environment two things your agents can use at runtime:
6
-
7
- - A **bucket** for filesystem storage, exposed to your code as [`PlatformFilesystem`](https://mastra.ai/reference/workspace/platform-filesystem).
8
- - A **sandbox** for executing commands, exposed as [`PlatformSandbox`](https://mastra.ai/reference/workspace/platform-sandbox).
9
-
10
- Workspaces are provisioned per [environment](https://mastra.ai/docs/mastra-platform/environments), so `production` and `staging` each get their own bucket and sandbox. The platform manages provisioning, credentials, and lifecycle. Your deploy code only needs to construct the providers.
11
-
12
- ## When workspaces are provisioned
13
-
14
- New projects have workspaces enabled by default. When you create an environment, the platform provisions a bucket for it automatically. The sandbox base image is warmed in the background so the first `PlatformSandbox` call starts quickly.
15
-
16
- Existing projects that haven't opted in show an **Enable workspaces** action in the Workspaces tab. Enabling provisions a bucket for every environment on the project.
17
-
18
- If provisioning fails for an environment, for example while Railway is under load, the Workspaces tab shows the failure and offers a retry. The environment itself is still created. Only the workspace is unavailable until you retry.
19
-
20
- ## Use the workspace from your code
21
-
22
- Install the provider package:
23
-
24
- **npm**:
25
-
26
- ```bash
27
- npm install @mastra/platform-workspace
28
- ```
29
-
30
- **pnpm**:
31
-
32
- ```bash
33
- pnpm add @mastra/platform-workspace
34
- ```
35
-
36
- **Yarn**:
37
-
38
- ```bash
39
- yarn add @mastra/platform-workspace
40
- ```
41
-
42
- **Bun**:
43
-
44
- ```bash
45
- bun add @mastra/platform-workspace
46
- ```
47
-
48
- Compose the providers into a workspace and register it with Mastra:
49
-
50
- ```typescript
51
- import { Workspace } from '@mastra/core/workspace'
52
- import { PlatformFilesystem, PlatformSandbox } from '@mastra/platform-workspace'
53
-
54
- export const workspace = new Workspace({
55
- filesystem: new PlatformFilesystem(),
56
- sandbox: new PlatformSandbox(),
57
- })
58
- ```
59
-
60
- ```typescript
61
- import { Mastra } from '@mastra/core'
62
- import { workspace } from './workspace'
63
-
64
- export const mastra = new Mastra({
65
- workspace,
66
- })
67
- ```
68
-
69
- `PlatformFilesystem` and `PlatformSandbox` read their credentials from environment variables the platform injects at deploy time, so you don't pass any options on the platform.
70
-
71
- ## Injected environment variables
72
-
73
- Every deploy that runs on a platform environment with a workspace receives these variables:
74
-
75
- | Variable | Contents |
76
- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
- | `MASTRA_PLATFORM_SECRET_KEY` | Secret key scoped to the deploy. Used by the workspace providers to authenticate. `MASTRA_PLATFORM_ACCESS_TOKEN` is also injected as a deprecated alias. |
78
- | `MASTRA_PROJECT_ID` | Project the deploy belongs to. |
79
- | `MASTRA_ENVIRONMENT_ID` | Environment the deploy belongs to. Selects which sandbox pool the platform uses. |
80
- | `MASTRA_PLATFORM_BUCKET_NAME` | Bucket name attached to the environment. Selects which bucket `PlatformFilesystem` reads and writes. |
81
-
82
- These names are reserved. If your project sets any of them explicitly, the platform-managed values take precedence.
83
-
84
- ## Local development
85
-
86
- Reuse the same providers locally by putting the four variables in your `.env` file. Get the values from your project's Workspaces tab:
87
-
88
- ```bash
89
- MASTRA_PLATFORM_SECRET_KEY=your-secret-key
90
- MASTRA_PROJECT_ID=your-project-id
91
- MASTRA_ENVIRONMENT_ID=your-environment-id
92
- MASTRA_PLATFORM_BUCKET_NAME=your-bucket-name
93
- ```
94
-
95
- `PlatformFilesystem` and `PlatformSandbox` behave the same locally as on the platform, they connect to the same bucket and sandbox pool for that environment. Use a `staging` or `preview` environment's variables for local runs if you want to keep production data isolated.
96
-
97
- For a purely offline loop that never touches the platform, swap the providers for [`LocalFilesystem`](https://mastra.ai/reference/workspace/local-filesystem) and [`LocalSandbox`](https://mastra.ai/reference/workspace/local-sandbox) in a local build.
98
-
99
- ## Inspect the workspace
100
-
101
- The Workspaces tab in your platform project shows, per environment:
102
-
103
- - Bucket status and its contents, with upload, download, and delete actions.
104
- - Recent sandbox sessions with their command, exit code, and duration.
105
- - Provisioning failures with a **Retry** action.
106
-
107
- ## See also
108
-
109
- - [`PlatformFilesystem`](https://mastra.ai/reference/workspace/platform-filesystem): reference for the filesystem provider.
110
- - [`PlatformSandbox`](https://mastra.ai/reference/workspace/platform-sandbox): reference for the sandbox provider.
111
- - [Environments](https://mastra.ai/docs/mastra-platform/environments): how environments scope workspaces, variables, and databases.
@@ -1,161 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # What is Mastra?
4
-
5
- Mastra is an open-source TypeScript framework for building AI applications and autonomous AI systems. Use it for anything from an AI feature inside an existing product to long-running agents that run entire processes on their own, such as a software factory that plans, builds, reviews, and ships code.
6
-
7
- Mastra gives you everything you need to build an agent harness out of the box. It's built on established patterns, so you make fewer integration decisions and spend more time on your product. And, as you'd expect from an AI framework, it includes a [skill and CLI](https://mastra.ai/docs/getting-started/build-with-ai) that help your coding agent write accurate, up-to-date Mastra code.
8
-
9
- Run Mastra standalone or inside your existing web server, and call your agents from your own code, over HTTP using the [Mastra client](https://mastra.ai/docs/server/mastra-client), or from channels (for example, Slack).
10
-
11
- > **📹 Video:** [A quick tour of the Mastra platform](https://www.youtube.com/watch?v=NosES9aJxCc) shows how the pieces fit together.
12
-
13
- ## Framework
14
-
15
- Mastra is batteries-included, but not all-or-nothing. A single agent can start small:
16
-
17
- ```typescript
18
- import { Agent } from '@mastra/core/agent'
19
- import { searchDocs } from '../tools/search-docs'
20
-
21
- export const supportAgent = new Agent({
22
- id: 'support-agent',
23
- name: 'Support Agent',
24
- instructions: 'Answer customer support questions clearly.',
25
- model: 'openai/gpt-5.6-sol',
26
- tools: { searchDocs },
27
- })
28
- ```
29
-
30
- Then add the capabilities your agent needs:
31
-
32
- - **Act in real environments**: Use [workspaces](https://mastra.ai/docs/workspace/overview) so agents can read and write files, run commands, and work inside a sandbox.
33
- - **Bring the right context**: Use tools, [memory](https://mastra.ai/docs/memory/observational-memory), [skills](https://mastra.ai/docs/agents/skills), and domain knowledge so agents remember what matters and stay within the context window.
34
- - **Coordinate complex work**: Run typed [workflows](https://mastra.ai/docs/workflows/overview), [tasks](https://mastra.ai/docs/agents/using-tools), and [subagents](https://mastra.ai/docs/agents/supervisor-agents) when work needs multiple steps or parallel execution.
35
- - **Control the agent loop**: [Suspend](https://mastra.ai/docs/agents/agent-approval) for human approval, steer an in-flight loop with [signals](https://mastra.ai/docs/long-running-agents/signals), or queue input for the next turn.
36
- - **Meet users where they work**: Connect agents to Slack, Discord, GitHub, and other [channels](https://mastra.ai/docs/capabilities/channels/overview).
37
- - **Manage risk and cost**: Configure authentication, multi-tenant isolation, and [guardrails](https://mastra.ai/docs/agents/guardrails), including [`CostGuardProcessor`](https://mastra.ai/reference/processors/cost-guard-processor).
38
-
39
- See the left-hand sidebar for the full menu of features.
40
-
41
- ## Studio
42
-
43
- ![Agents page in Mastra Studio. A sidebar lists primitives like agents, workflows, and tools, a middle panel lists recent chats, and a chat panel shows the agent responding to a prompt with collapsible tool calls and a task list tracking progress. Below the chat is a message box with a model picker.](/assets/images/studio-agent-chat-e516834f26abd332aa54cbffa7553028.png)
44
-
45
- [Studio](https://mastra.ai/docs/studio/overview) is usually the first place you go after creating a Mastra app. It gives you a live environment for testing agents, inspecting runs, and iterating quickly.
46
-
47
- Studio isn't just for engineers. Deploy it and share it with your team, so collaborators can try an agent before it ships. With the [Editor](https://mastra.ai/docs/editor/overview) and [Agent Builder](https://mastra.ai/docs/agent-builder/overview), non-technical teammates can create and iterate on agents themselves, with every change versioned in code.
48
-
49
- ## Observability and evals
50
-
51
- ![Traces page in Mastra Studio. A table lists recent agent runs with timestamps and inputs. A details panel shows the selected trace as an expandable tree of model, tool, and workspace spans with per-span timings, plus actions to evaluate the trace or save it as a dataset item.](/assets/images/studio-traces-e061dbd62a9c7f2ac2d61ad172125be6.png)
52
-
53
- Mastra has built-in logs, traces, and metrics, so you can understand every run in development and production. See [Observability](https://mastra.ai/docs/observability/overview).
54
-
55
- Evals close the loop. Score outputs with rule-based or LLM-as-judge [scorers](https://mastra.ai/docs/evals/overview), live in production or offline in CI. Create datasets from real traces, run experiments, and compare versions. Because you own the code and the observability layer, you get a closed loop from trace to prompt edit to measurable improvement.
56
-
57
- ## Long-running agents
58
-
59
- Some agents finish in a single request. Others run for hours or days, like a sales agent that watches for signups or an SRE agent that handles incidents. Mastra supports [long-running agents](https://mastra.ai/docs/long-running-agents/durable-agents) with these capabilities:
60
-
61
- - **Survive restarts and disconnects**: [Durable agents](https://mastra.ai/docs/long-running-agents/durable-agents) persist run state so work resumes and clients reconnect.
62
- - **Wake and steer agents mid-run**: Send [messages and signals](https://mastra.ai/docs/long-running-agents/signals) to wake an agent, add context, or queue input.
63
- - **Keep working toward a goal**: [Goals](https://mastra.ai/docs/long-running-agents/goals) persist an objective until it's met or the run budget is spent.
64
- - **Run work outside the request**: Use [schedules](https://mastra.ai/docs/long-running-agents/schedules) and [background tasks](https://mastra.ai/docs/long-running-agents/background-tasks) for recurring jobs, slow tools, and work that shouldn't block the agent loop.
65
-
66
- For long-running interactive applications, [AgentController](https://mastra.ai/docs/agent-controller/overview) manages threads, modes, tool approvals, and model switching. It powers [Mastra Code](https://code.mastra.ai/) and lets you build a Claude Code-style experience for your own domain.
67
-
68
- ## Deployment
69
-
70
- Mastra is open source and infrastructure-neutral. The framework fits your stack instead of requiring your stack to fit one vendor. Choose from an ecosystem of model providers, databases, sandboxes, and observability platforms, and change providers without rewriting your application around proprietary infrastructure.
71
-
72
- When you're ready to deploy:
73
-
74
- - **[Mastra Server](https://mastra.ai/docs/mastra-platform/server)**: The quickest path to production. Mastra builds and hosts your application as an API server with a stable endpoint, environment variables, custom domains, and deploy history.
75
- - **Your infrastructure**: Use Mastra's [deployers for major platforms](https://mastra.ai/docs/deployment/overview), deploy a standard server to your preferred virtual machine, container, or platform as a service, or run Mastra inside an existing TypeScript application with a [server adapter](https://mastra.ai/docs/server/server-adapters).
76
-
77
- ## Use cases
78
-
79
- Here are some of the ways you can use Mastra:
80
-
81
- <details>
82
- **Embed agents in your product**
83
-
84
- Add AI capabilities to your platform so your users can build or interact with agents.
85
-
86
- Used by [Replit](https://mastra.ai/blog/replitagent3), [Fireworks](https://mastra.ai/blog/fireworks-xml-prompting), [Medusa](https://mastra.ai/blog/medusa-ecommerce)
87
-
88
- </details>
89
-
90
- <details>
91
- **Customer-facing assistants**
92
-
93
- Build agents that handle inquiries, schedule appointments, send reminders, and answer questions via chat, WhatsApp, or voice.
94
-
95
- Used by [Vetnio](https://mastra.ai/blog/vetnio), [Lua](https://mastra.ai/blog/lua-scaling)
96
-
97
- Templates: [Docs Chatbot](https://mastra.ai/templates/docs-chatbot), [Slack Agent](https://mastra.ai/templates/slack-agent)
98
-
99
- </details>
100
-
101
- <details>
102
- **Internal copilots**
103
-
104
- Help employees work faster with AI that understands your domain—HR queries, clinical documentation, sales prep, or document generation.
105
-
106
- Used by [Factorial](https://mastra.ai/blog/factorial-case-study), [Counsel Health](https://mastra.ai/blog/counsel-health), [Cedar](https://mastra.ai/blog/cedar-case-study), [SoftBank](https://mastra.ai/blog/softbank-productivity-mastra-2025-08-20)
107
-
108
- Templates: [Chat with PDF](https://mastra.ai/templates/chat-with-pdf), [Google Sheet Analysis](https://mastra.ai/templates/google-sheets-analysis)
109
-
110
- </details>
111
-
112
- <details>
113
- **Data analysis agents**
114
-
115
- Let users query databases and dashboards in natural language. Connect to your data sources and return answers, charts, or reports.
116
-
117
- Used by [Index](https://mastra.ai/blog/index-case-study), [PLAID Japan](https://mastra.ai/blog/plaid-jpn-gcp-agents)
118
-
119
- Templates: [Chat with Database](https://mastra.ai/templates/text-to-sql), [CSV to Questions](https://mastra.ai/templates/csv-to-questions)
120
-
121
- </details>
122
-
123
- <details>
124
- **Content automation**
125
-
126
- Generate, transform, and manage structured content at scale—whether for a CMS, knowledge base, or documentation system.
127
-
128
- Used by [Sanity](https://mastra.ai/blog/sanity)
129
-
130
- Templates: [Chat with YouTube](https://mastra.ai/templates/chat-with-youtube), [Flash Cards from PDF](https://mastra.ai/templates/flash-cards-from-pdf)
131
-
132
- </details>
133
-
134
- <details>
135
- **DevOps & engineering automation**
136
-
137
- Automate deployments, debug production issues, manage infrastructure, and handle on-call workflows.
138
-
139
- Used by [StarSling](https://mastra.ai/blog/starsling)
140
-
141
- Templates: [GitHub PR Code Review](https://mastra.ai/templates/github-pr-code-review-agent), [Browser Agent](https://mastra.ai/templates/browsing-agent)
142
-
143
- </details>
144
-
145
- <details>
146
- **Sales & GTM workflows**
147
-
148
- Turn customer conversations into structured tasks, generate investment memos, or automate outreach sequences.
149
-
150
- Used by [Kestral](https://mastra.ai/blog/kestral), [Orange Collective](https://mastra.ai/blog/orange-collective-vc-operating-system), [WorkOS](https://mastra.ai/blog/workos-teaching-mastra)
151
-
152
- Templates: [Customer Feedback Summarization](https://mastra.ai/templates/customer-feedback-summarization)
153
-
154
- </details>
155
-
156
- Browse [templates](https://mastra.ai/templates) for working examples.
157
-
158
- ## Next steps
159
-
160
- - [Get started](https://mastra.ai/docs)
161
- - [Agents overview](https://mastra.ai/docs/agents/overview)
@@ -1,163 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # Agent Builder API
4
-
5
- The Agent Builder API provides methods to interact with [Agent Builder](https://mastra.ai/docs/agent-builder/overview) actions on the server. Each action is a workflow exposed under `/agent-builder/:actionId/*`. The Builder must be enabled on the server via `MastraEditor.builder.enabled`, with a valid `MASTRA_EE_LICENSE` in production.
6
-
7
- ## Getting all actions
8
-
9
- Retrieve a record of available Agent Builder actions:
10
-
11
- ```typescript
12
- const actions = await mastraClient.getAgentBuilderActions()
13
- ```
14
-
15
- Returns a `Record<string, WorkflowInfo>` keyed by action ID.
16
-
17
- ## Working with a specific action
18
-
19
- Get an instance of a specific action by its ID:
20
-
21
- ```typescript
22
- const action = mastraClient.getAgentBuilderAction('create-agent')
23
- ```
24
-
25
- ## Action methods
26
-
27
- ### `details()`
28
-
29
- Retrieve metadata about an Agent Builder action:
30
-
31
- ```typescript
32
- const info = await action.details()
33
- ```
34
-
35
- ### `createRun()`
36
-
37
- Create a new run for this action and receive a `runId`. Use the returned id with `startActionRun()`, `stream()`, `resume()`, or `observeStream()`.
38
-
39
- ```typescript
40
- const { runId } = await action.createRun()
41
- ```
42
-
43
- You can also pass an explicit `runId`:
44
-
45
- ```typescript
46
- const { runId } = await action.createRun({ runId: 'my-run-id' })
47
- ```
48
-
49
- ### `startAsync()`
50
-
51
- Start the action and wait for completion. Returns the final `AgentBuilderActionResult` with `success`, `applied`, `branchName`, `message`, `validationResults`, `error`, `errors`, and `stepResults`.
52
-
53
- ```typescript
54
- const result = await action.startAsync({
55
- inputData: { agentName: 'support-bot' },
56
- })
57
- ```
58
-
59
- Pass an existing `runId` as the second argument to start a previously created run:
60
-
61
- ```typescript
62
- const { runId } = await action.createRun()
63
- const result = await action.startAsync({ inputData }, runId)
64
- ```
65
-
66
- ### `startActionRun()`
67
-
68
- Start an existing run without waiting for completion. Returns `{ message }`.
69
-
70
- ```typescript
71
- const { runId } = await action.createRun()
72
- await action.startActionRun({ inputData }, runId)
73
- ```
74
-
75
- ### `stream()`
76
-
77
- Start an existing run and stream progress events as a `ReadableStream<{ type, payload }>`.
78
-
79
- ```typescript
80
- const { runId } = await action.createRun()
81
- const stream = await action.stream({ inputData }, runId)
82
-
83
- for await (const event of stream) {
84
- console.log(event.type, event.payload)
85
- }
86
- ```
87
-
88
- ### `resume()`
89
-
90
- Resume a suspended step on a run. Returns `{ message }`.
91
-
92
- ```typescript
93
- await action.resume({ step: 'review', resumeData: { approved: true } }, runId)
94
- ```
95
-
96
- ### `resumeAsync()`
97
-
98
- Resume a suspended step and wait for completion. Returns an `AgentBuilderActionResult`.
99
-
100
- ```typescript
101
- const result = await action.resumeAsync({ step: 'review', resumeData: { approved: true } }, runId)
102
- ```
103
-
104
- ### `resumeStream()`
105
-
106
- Resume a suspended step and stream subsequent events.
107
-
108
- ```typescript
109
- const stream = await action.resumeStream({
110
- runId,
111
- step: 'review',
112
- resumeData: { approved: true },
113
- })
114
- ```
115
-
116
- ### `observeStream()`
117
-
118
- Attach to an existing run, replaying cached events from the beginning, then continuing with live events. Use this to recover after a page refresh or hot reload.
119
-
120
- ```typescript
121
- const stream = await action.observeStream({ runId })
122
- ```
123
-
124
- ### `observeStreamLegacy()`
125
-
126
- Same as `observeStream()` but uses the legacy streaming endpoint. Prefer `observeStream()` for new code.
127
-
128
- ```typescript
129
- const stream = await action.observeStreamLegacy({ runId })
130
- ```
131
-
132
- ### `runs()`
133
-
134
- List runs for this action with optional filters.
135
-
136
- ```typescript
137
- const runs = await action.runs({ page: 0, perPage: 20 })
138
- ```
139
-
140
- Accepts `fromDate`, `toDate`, `page`, `perPage`, `resourceId`, and legacy `limit`/`offset`.
141
-
142
- ### `runById()`
143
-
144
- Fetch a specific run by ID. Use `fields` to limit the returned payload and `withNestedWorkflows` to skip nested workflow data.
145
-
146
- ```typescript
147
- const run = await action.runById(runId, {
148
- fields: ['result', 'steps'],
149
- withNestedWorkflows: false,
150
- })
151
- ```
152
-
153
- ### `cancelRun()`
154
-
155
- Cancel an in-flight run.
156
-
157
- ```typescript
158
- await action.cancelRun(runId)
159
- ```
160
-
161
- ## Access control
162
-
163
- The `/agent-builder/*` routes are gated by the `agent-builder` permission resource. Calling clients need at minimum `agent-builder:read` and `agent-builder:execute`, plus any picker resources the action touches (`stored-agents`, `stored-skills`, `tools`, `workflows`, `memory`). See [Access control](https://mastra.ai/docs/agent-builder/access-control) for the full grant list.
@@ -1,76 +0,0 @@
1
- > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
-
3
- # AgentBuilderOptions
4
-
5
- `AgentBuilderOptions` configures the Agent Builder. Pass it as `MastraEditor.builder` to enable the Builder UI, toggle visible surfaces, pin admin defaults, and opt into skill registries.
6
-
7
- See the [Configuration](https://mastra.ai/docs/agent-builder/configuration) page for concepts and worked examples.
8
-
9
- ## Usage example
10
-
11
- ```typescript
12
- import { MastraEditor } from '@mastra/editor'
13
-
14
- new MastraEditor({
15
- builder: {
16
- enabled: true,
17
- features: {
18
- agent: { browser: false },
19
- },
20
- configuration: {
21
- agent: {
22
- memory: { observationalMemory: true },
23
- models: {
24
- allowed: [
25
- { provider: 'openai', modelId: 'gpt-5.4-mini' },
26
- { provider: 'openai', modelId: 'gpt-5.4' },
27
- { provider: 'anthropic', modelId: 'claude-opus-4-7' },
28
- ],
29
- },
30
- },
31
- },
32
- registries: {
33
- skillsSh: { enabled: true },
34
- },
35
- },
36
- })
37
- ```
38
-
39
- ## Properties
40
-
41
- **enabled** (`boolean`): Master switch. When false, the Builder UI is disabled and MastraEditor.resolveBuilder() returns undefined. (Default: `true`)
42
-
43
- **features** (`{ agent?: AgentFeatures }`): UI toggles. Each key on features.agent defaults to true when omitted.
44
-
45
- **features.agent.tools** (`boolean`): Show the tools tab in the agent editor.
46
-
47
- **features.agent.agents** (`boolean`): Show the sub-agents picker in the agent editor.
48
-
49
- **features.agent.workflows** (`boolean`): Show the workflows picker in the agent editor.
50
-
51
- **features.agent.skills** (`boolean`): Show the skills tab and library for the agent.
52
-
53
- **features.agent.memory** (`boolean`): Show the memory configuration in the agent editor.
54
-
55
- **features.agent.model** (`boolean`): Show the model picker in the agent editor. When false, the admin-pinned default model applies.
56
-
57
- **features.agent.browser** (`boolean`): Show the browser tab. Resolves to true only when a valid browser provider is registered on MastraEditor.browsers; otherwise it is downgraded to false and a warning is logged.
58
-
59
- **features.agent.avatarUpload** (`boolean`): Allow end users to upload an avatar for stored agents.
60
-
61
- **features.agent.favorites** (`boolean`): Show favorite agents and skills with per-user state and aggregate counts.
62
-
63
- **configuration** (`{ agent?: BuilderAgentDefaults }`): Admin-pinned defaults applied to every Builder-created agent. End users cannot override these values. See the BuilderAgentDefaults reference for the full schema.
64
-
65
- **registries** (`{ skillsSh?: { enabled: boolean } }`): Opt-in third-party skill registries. When no registry is enabled, the Builder hides registry browse UI.
66
-
67
- **registries.skillsSh** (`{ enabled: boolean }`): Enable the skills.sh registry. When enabled, the Builder shows registry browse UI for skills.sh skills.
68
-
69
- **registries.skillsSh.enabled** (`boolean`): Set to true to opt in. Defaults to false.
70
-
71
- ## Related
72
-
73
- - [Configuration](https://mastra.ai/docs/agent-builder/configuration): Concept and worked examples.
74
- - [BuilderAgentDefaults](https://mastra.ai/reference/editor/agent-builder/builder-agent-defaults): Full schema for `configuration.agent`.
75
- - [builder.configuration.agent.models](https://mastra.ai/reference/editor/agent-builder/builder-models): Model allowlist and default model.
76
- - [MastraEditor class](https://mastra.ai/reference/editor/mastra-editor): The parent surface that hosts `builder`.