@mastra/mcp-docs-server 1.2.7-alpha.4 → 1.2.7-alpha.8

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 (78) hide show
  1. package/.docs/docs/agent-builder/overview.md +4 -3
  2. package/.docs/docs/agent-controller/overview.md +2 -1
  3. package/.docs/docs/agents/a2a.md +2 -1
  4. package/.docs/docs/agents/guardrails.md +2 -1
  5. package/.docs/docs/agents/overview.md +2 -2
  6. package/.docs/docs/agents/skills.md +1 -1
  7. package/.docs/docs/agents/supervisor-agents.md +2 -1
  8. package/.docs/docs/browser/overview.md +2 -1
  9. package/.docs/docs/capabilities/channels/discord.md +98 -0
  10. package/.docs/docs/capabilities/channels/other-adapters.md +68 -0
  11. package/.docs/docs/capabilities/channels/overview.md +257 -0
  12. package/.docs/docs/capabilities/channels/slack.md +225 -0
  13. package/.docs/docs/capabilities/channels/teams.md +100 -0
  14. package/.docs/docs/capabilities/channels/telegram.md +98 -0
  15. package/.docs/docs/capabilities/channels/whatsapp.md +99 -0
  16. package/.docs/docs/evals/datasets/overview.md +2 -1
  17. package/.docs/docs/evals/datasets/running-experiments.md +2 -0
  18. package/.docs/docs/evals/overview.md +4 -1
  19. package/.docs/docs/getting-started/file-based-agents.md +114 -0
  20. package/.docs/docs/long-running-agents/signals.md +4 -1
  21. package/.docs/docs/mastra-platform/observability.md +5 -1
  22. package/.docs/docs/memory/observational-memory.md +2 -1
  23. package/.docs/docs/memory/overview.md +2 -0
  24. package/.docs/docs/memory/semantic-recall.md +1 -1
  25. package/.docs/docs/memory/working-memory.md +3 -3
  26. package/.docs/docs/studio/overview.md +1 -1
  27. package/.docs/docs/workflows/control-flow.md +0 -2
  28. package/.docs/docs/workflows/overview.md +2 -3
  29. package/.docs/docs/workspace/overview.md +2 -1
  30. package/.docs/docs/workspace/sandbox.md +2 -0
  31. package/.docs/guides/getting-started/quickstart.md +3 -1
  32. package/.docs/guides/guide/chef-michel.md +0 -2
  33. package/.docs/guides/guide/slack-assistant.md +2 -2
  34. package/.docs/guides/guide/stock-agent.md +0 -2
  35. package/.docs/models/environment-variables.md +2 -0
  36. package/.docs/models/gateways/netlify.md +4 -1
  37. package/.docs/models/gateways/openrouter.md +7 -6
  38. package/.docs/models/gateways/vercel.md +5 -1
  39. package/.docs/models/index.md +1 -1
  40. package/.docs/models/providers/crossmodel.md +109 -0
  41. package/.docs/models/providers/llmgateway.md +185 -181
  42. package/.docs/models/providers/meta.md +101 -0
  43. package/.docs/models/providers/nano-gpt.md +2 -2
  44. package/.docs/models/providers/neon.md +40 -29
  45. package/.docs/models/providers/openai.md +5 -1
  46. package/.docs/models/providers/poolside.md +6 -5
  47. package/.docs/models/providers/routing-run.md +20 -34
  48. package/.docs/models/providers/the-grid-ai.md +3 -3
  49. package/.docs/models/providers.md +2 -0
  50. package/.docs/reference/agents/channels.md +2 -2
  51. package/.docs/reference/channels/channel-provider.md +1 -1
  52. package/.docs/reference/channels/slack-provider.md +2 -2
  53. package/.docs/reference/cli/mastra.md +1 -0
  54. package/.docs/reference/file-based-agents/config.md +97 -0
  55. package/.docs/reference/file-based-agents/instructions.md +54 -0
  56. package/.docs/reference/file-based-agents/memory.md +58 -0
  57. package/.docs/reference/file-based-agents/observability.md +32 -0
  58. package/.docs/reference/file-based-agents/processors.md +56 -0
  59. package/.docs/reference/file-based-agents/server.md +37 -0
  60. package/.docs/reference/file-based-agents/skills.md +56 -0
  61. package/.docs/reference/file-based-agents/storage.md +30 -0
  62. package/.docs/reference/file-based-agents/studio.md +56 -0
  63. package/.docs/reference/file-based-agents/subagents.md +123 -0
  64. package/.docs/reference/file-based-agents/tools.md +63 -0
  65. package/.docs/reference/file-based-agents/workflows.md +52 -0
  66. package/.docs/reference/file-based-agents/workspace.md +74 -0
  67. package/.docs/reference/index.md +13 -0
  68. package/.docs/reference/memory/memory-class.md +1 -1
  69. package/.docs/reference/memory/serialized-memory-config.md +1 -1
  70. package/.docs/reference/project-structure.md +1 -1
  71. package/.docs/reference/pubsub/lease-provider.md +1 -1
  72. package/.docs/reference/storage/clickhouse.md +32 -0
  73. package/.docs/reference/storage/composite.md +27 -1
  74. package/.docs/reference/storage/retention.md +11 -0
  75. package/CHANGELOG.md +14 -0
  76. package/package.json +4 -4
  77. package/.docs/docs/agents/channels.md +0 -225
  78. package/.docs/docs/agents/file-based-agents.md +0 -297
@@ -0,0 +1,37 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Server
4
+
5
+ Mastra configures its HTTP [server](https://mastra.ai/docs/server/mastra-server) from a `server.ts` file directly under `src/mastra/`. The server exposes agents, workflows, and other registered primitives as REST endpoints, and the file default-exports the same `ServerConfig` shape you'd pass to [`new Mastra()`](https://mastra.ai/reference/core/mastra-class).
6
+
7
+ Use this page for the file-based convention. For server features, middleware, custom routes, generated API docs, and deployment behavior, see [Server overview](https://mastra.ai/docs/server/mastra-server).
8
+
9
+ ## Quickstart
10
+
11
+ Create `src/mastra/server.ts` and default-export a `ServerConfig` object:
12
+
13
+ ```typescript
14
+ import type { ServerConfig } from '@mastra/core/server'
15
+
16
+ export default {
17
+ port: 4111,
18
+ host: '0.0.0.0',
19
+ } satisfies ServerConfig
20
+ ```
21
+
22
+ ## Common configurations
23
+
24
+ `server.ts` can configure the same server options as code registration:
25
+
26
+ | Need | Use |
27
+ | ------------------------------------- | ----------------------------------------- |
28
+ | Bind to a deployment platform address | `host` and `port` |
29
+ | Restrict browser access | `cors` |
30
+ | Add webhooks or health checks | `apiRoutes` |
31
+ | Enable generated API docs | `build.openAPIDocs` and `build.swaggerUI` |
32
+
33
+ See [Mastra server](https://mastra.ai/docs/server/mastra-server), [middleware](https://mastra.ai/docs/server/middleware), and [custom API routes](https://mastra.ai/docs/server/custom-api-routes) for examples.
34
+
35
+ ## Precedence with code
36
+
37
+ Code-registered server config wins over `server.ts`. Routes added during startup, such as channel webhooks, are preserved when file-based server config is applied.
@@ -0,0 +1,56 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Skills
4
+
5
+ A file-based agent discovers skills from its `skills/` directory and bundles them at build time. Skills are reusable procedures or reference material that the agent can load when relevant, instead of putting every detail into the always-on prompt.
6
+
7
+ Use this page for the file-based convention. For code-defined skills, see [Agent skills](https://mastra.ai/docs/agents/skills). For the `SKILL.md` package format, see [Workspace skills](https://mastra.ai/docs/workspace/skills).
8
+
9
+ ## Quickstart
10
+
11
+ The simplest skill is one markdown file under `skills/`. The filename becomes the skill name, and `description` tells the agent when to load it.
12
+
13
+ ```markdown
14
+ ---
15
+ description: Use when reporting temperatures or comparing forecast units.
16
+ ---
17
+
18
+ Always report temperatures in Celsius and Fahrenheit. Include the user's preferred unit first when known.
19
+ ```
20
+
21
+ ## Skills vs tools vs instructions
22
+
23
+ | Need | Use | Why |
24
+ | ---------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
25
+ | Always-on identity, tone, or rules | [`instructions.md`](https://mastra.ai/reference/file-based-agents/instructions) | The model should see the guidance every turn. |
26
+ | Callable action with inputs and outputs | [`tools/`](https://mastra.ai/reference/file-based-agents/tools) | The model needs to execute code, call APIs, or perform side effects. |
27
+ | Detailed reference or procedure loaded when relevant | `skills/` | The model only needs the full guidance for specific tasks. |
28
+
29
+ ## Skill formats
30
+
31
+ Mastra supports three file-based skill formats:
32
+
33
+ | Format | Use it when |
34
+ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------- |
35
+ | TypeScript/JavaScript module | You want to default-export a [`createSkill()`](https://mastra.ai/reference/agents/createSkill) result from code. |
36
+ | Packaged `SKILL.md` directory | The skill has instructions plus supporting files under `references/`. |
37
+ | Flat markdown file | The skill is one markdown file with frontmatter and instructions. |
38
+
39
+ For packaged skills, `description` is required in `SKILL.md` frontmatter. Flat markdown skills also require `description` in frontmatter. Write when to use the skill, not only what the skill contains.
40
+
41
+ ## What gets loaded
42
+
43
+ File-based Agents skills are read at build time and added to the generated bundle. The deployed agent doesn't need to read those skill files from disk at runtime.
44
+
45
+ For packaged skills, Mastra reads:
46
+
47
+ - `SKILL.md` for metadata and instructions.
48
+ - Files directly under `references/` as supporting reference content.
49
+
50
+ Reference files are keyed by filename. Symlinked files and directories under `references/` are skipped during discovery.
51
+
52
+ ## Precedence with config
53
+
54
+ Discovered skills merge with any `skills` in [`config.ts`](https://mastra.ai/reference/file-based-agents/config). On a name collision, `config.skills` wins and a warning is logged.
55
+
56
+ If `config.skills` is a function, discovered skills are ignored with a warning because function-valued skills can't be statically merged.
@@ -0,0 +1,30 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Storage
4
+
5
+ Mastra sets the project's default [storage](https://mastra.ai/docs/storage/overview) from a `storage.ts` file directly under `src/mastra/`. The file default-exports a store, which replaces the built-in in-memory store used for memory, workflows, observability, and other storage domains.
6
+
7
+ Use this page for the file-based convention. For backend choice, storage domains, retention, and provider details, see [storage overview](https://mastra.ai/docs/storage/overview).
8
+
9
+ ## Quickstart
10
+
11
+ Use [`LibSQLStore`](https://mastra.ai/reference/storage/libsql) for a local file-backed store:
12
+
13
+ ```typescript
14
+ import { LibSQLStore } from '@mastra/libsql'
15
+
16
+ export default new LibSQLStore({
17
+ id: 'mastra-storage',
18
+ url: 'file:./mastra.db',
19
+ })
20
+ ```
21
+
22
+ Mastra registers the store before file-based agents and workflows, so storage-dependent primitives bind to this store instead of the default in-memory store.
23
+
24
+ ## Production backends
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 storage](https://mastra.ai/docs/observability/storage), and the [storage reference](https://mastra.ai/reference/storage/overview).
27
+
28
+ ## Precedence with code
29
+
30
+ Code-registered storage wins over `storage.ts`. Use `storage.ts` when one project-wide store is enough; use code registration when setup depends on runtime wiring in `src/mastra/index.ts`.
@@ -0,0 +1,56 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Studio
4
+
5
+ Mastra configures [Studio](https://mastra.ai/docs/studio/overview) from a `studio.ts` file directly under `src/mastra/`. The file default-exports a `StudioConfig` object for Studio authentication and authorization: who can access Studio, and what authenticated users can do.
6
+
7
+ Use this page for the file-based convention. For auth providers, role-based access control (RBAC), and fine-grained authorization (FGA), see [Studio auth](https://mastra.ai/docs/studio/auth).
8
+
9
+ ## Quickstart
10
+
11
+ For local development, you don't need `studio.ts`. Start the dev server and open Studio:
12
+
13
+ **npm**:
14
+
15
+ ```bash
16
+ npm run dev
17
+ ```
18
+
19
+ **pnpm**:
20
+
21
+ ```bash
22
+ pnpm run dev
23
+ ```
24
+
25
+ **Yarn**:
26
+
27
+ ```bash
28
+ yarn dev
29
+ ```
30
+
31
+ **Bun**:
32
+
33
+ ```bash
34
+ bun run dev
35
+ ```
36
+
37
+ Studio opens without authentication in local development. Add `studio.ts` when you're ready to secure a shared or production deployment.
38
+
39
+ ## Add authentication
40
+
41
+ Use an auth provider to require sign-in before users can access Studio. This example uses [WorkOS](https://mastra.ai/docs/server/auth/workos):
42
+
43
+ ```typescript
44
+ import { MastraAuthWorkos } from '@mastra/auth-workos'
45
+ import type { StudioConfig } from '@mastra/core/server'
46
+
47
+ export default {
48
+ auth: new MastraAuthWorkos(),
49
+ } satisfies StudioConfig
50
+ ```
51
+
52
+ The auth provider handles who the user is. For what the user can do after sign-in, add RBAC or FGA in the same config. See [Studio auth](https://mastra.ai/docs/studio/auth) for full examples.
53
+
54
+ ## Precedence with code
55
+
56
+ Code-registered Studio config wins over `studio.ts`. Use `studio.ts` when one project-wide Studio config is enough; use code registration when auth depends on runtime wiring in `src/mastra/index.ts`.
@@ -0,0 +1,123 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Subagents
4
+
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, calls that tool to hand off a task, and receives the subagent's result back in the parent conversation.
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/agents/supervisor-agents).
8
+
9
+ ## Quickstart
10
+
11
+ Declare one directory per subagent under `subagents/`:
12
+
13
+ ```text
14
+ src/mastra/agents/
15
+ └── supervisor/
16
+ ├── config.ts
17
+ ├── instructions.md
18
+ └── subagents/
19
+ └── researcher/
20
+ ├── config.ts
21
+ ├── instructions.md
22
+ └── tools/
23
+ └── search.ts
24
+ ```
25
+
26
+ Mastra assembles `researcher` as its own agent and wires it into the supervisor's `agents` map. The parent model can delegate to it by using the generated `researcher` delegation tool.
27
+
28
+ A subagent's `config.ts` must set a non-empty `description`. The parent model reads this when deciding whether to delegate.
29
+
30
+ ```typescript
31
+ import { agentConfig } from '@mastra/core/agent'
32
+
33
+ export default agentConfig({
34
+ model: 'openai/gpt-5.5',
35
+ description: 'Researches a topic and returns cited findings.',
36
+ })
37
+ ```
38
+
39
+ ## How the model delegates
40
+
41
+ A subagent's `description` is routing text for the parent model. Write it like a [tool description](https://mastra.ai/reference/file-based-agents/tools): explain what the subagent does and when to delegate to it.
42
+
43
+ The build fails when a discovered subagent doesn't provide a non-empty description.
44
+
45
+ ## Isolation
46
+
47
+ Subagents are isolated. A subagent doesn't inherit its parent's tools, skills, workspace, memory, processors, or subagents. Each child is a self-contained agent with its own directory.
48
+
49
+ If multiple agents should share the same dependency, define it in code and assign it through each agent's config.
50
+
51
+ ## Nesting
52
+
53
+ Subagents can declare their own `subagents/` directories, nesting up to three levels below the top-level agent. A `subagents/` directory nested deeper is ignored with a warning.
54
+
55
+ ```text
56
+ src/mastra/agents/
57
+ └── supervisor/ # depth 0
58
+ └── subagents/
59
+ └── researcher/ # depth 1
60
+ └── subagents/
61
+ └── summarizer/ # depth 2
62
+ ```
63
+
64
+ ## Naming rules
65
+
66
+ - A subagent id that collides with one of the parent's tool keys is a build error.
67
+ - A duplicate subagent id under the same parent is a build error.
68
+ - If a subagent id also exists in the parent's `config.agents`, the `config.agents` entry wins and logs a warning.
69
+ - If `config.agents` is a function, discovered subagents are ignored with a warning because they can't be statically merged.
70
+
71
+ ## Example
72
+
73
+ This supervisor coordinates a research-and-writing flow. The `researcher` subagent owns search tools, while the `writer` subagent owns a workspace for drafting files.
74
+
75
+ ```text
76
+ src/mastra/agents/
77
+ └── research-supervisor/
78
+ ├── config.ts
79
+ ├── instructions.md
80
+ └── subagents/
81
+ ├── researcher/
82
+ │ ├── config.ts
83
+ │ ├── instructions.md
84
+ │ └── tools/
85
+ │ └── search_web.ts
86
+ └── writer/
87
+ ├── config.ts
88
+ ├── instructions.md
89
+ └── workspace/
90
+ └── draft-template.md
91
+ ```
92
+
93
+ ```typescript
94
+ import { agentConfig } from '@mastra/core/agent'
95
+
96
+ export default agentConfig({
97
+ model: 'openai/gpt-5.5',
98
+ })
99
+ ```
100
+
101
+ ```markdown
102
+ You coordinate research and writing.
103
+
104
+ Delegate fact gathering to `researcher`. Delegate final drafting to `writer`.
105
+ ```
106
+
107
+ ```typescript
108
+ import { agentConfig } from '@mastra/core/agent'
109
+
110
+ export default agentConfig({
111
+ model: 'openai/gpt-5-mini',
112
+ description: 'Use to gather facts, sources, and concise research notes for a topic.',
113
+ })
114
+ ```
115
+
116
+ ```typescript
117
+ import { agentConfig } from '@mastra/core/agent'
118
+
119
+ export default agentConfig({
120
+ model: 'openai/gpt-5.5',
121
+ description: 'Use to turn research notes into a structured draft.',
122
+ })
123
+ ```
@@ -0,0 +1,63 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Tools
4
+
5
+ A file-based agent discovers tools from `.ts` and `.js` files directly under its `tools/` directory. Each discovered file is imported at build time, the file must default-export a [`createTool()`](https://mastra.ai/reference/tools/create-tool) result, and the filename without its extension becomes the tool key the model can call.
6
+
7
+ Use this page for the file-based convention. For tool schemas, execution options, output shaping, and approval options, see the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool).
8
+
9
+ ## Quickstart
10
+
11
+ Place one tool per file under `tools/`. This file is exposed to the agent as `get_weather`.
12
+
13
+ ```typescript
14
+ import { createTool } from '@mastra/core/tools'
15
+ import { z } from 'zod'
16
+
17
+ export default createTool({
18
+ id: 'get_weather',
19
+ description: 'Get the current weather for a city.',
20
+ inputSchema: z.object({
21
+ city: z.string(),
22
+ }),
23
+ outputSchema: z.object({
24
+ city: z.string(),
25
+ tempC: z.number(),
26
+ }),
27
+ execute: async ({ context }) => {
28
+ return { city: context.city, tempC: 21 }
29
+ },
30
+ })
31
+ ```
32
+
33
+ ## Organizing tools
34
+
35
+ Use one file per tool. Name the file after the action the model should take:
36
+
37
+ - Use `get_weather.ts`, `search_docs.ts`, or `create_ticket.ts`.
38
+ - Avoid vague names like `helper.ts`, `api.ts`, or `utils.ts`.
39
+ - Co-locate tests next to the tool as `*.test.ts` or `*.spec.ts`; discovery ignores those files.
40
+ - Keep shared helper code outside `tools/` or in files that don't match the discovered extensions under `tools/`.
41
+
42
+ Because nested directories aren't discovered as tools, group related tools with clear filename prefixes instead of subfolders, such as `calendar_create_event.ts` and `calendar_list_events.ts`.
43
+
44
+ ## Tool options
45
+
46
+ The file-based convention only controls where the tool lives and how it's registered. The tool API still comes from `createTool()`:
47
+
48
+ - Use `description` to tell the model when to call the tool.
49
+ - Use `inputSchema` and `outputSchema` for structured inputs and outputs.
50
+ - Use `toModelOutput` when the model should see a different shape than the raw value returned from `execute`.
51
+ - Use `requireApproval` when a tool needs human confirmation before execution.
52
+
53
+ See the [`createTool()` reference](https://mastra.ai/reference/tools/create-tool) for all options and [tool approval](https://mastra.ai/docs/agent-controller/tool-approvals) for the approval flow.
54
+
55
+ ## Runtime boundary
56
+
57
+ Tool code runs in your app/server runtime when the agent calls the tool. If a tool needs filesystem or shell isolation, call [workspace](https://mastra.ai/reference/file-based-agents/workspace) or sandbox APIs explicitly.
58
+
59
+ ## Precedence with config
60
+
61
+ Discovered tools merge with any `tools` in [`config.ts`](https://mastra.ai/reference/file-based-agents/config). On a key collision, `config.tools` wins and a warning is logged.
62
+
63
+ If `config.tools` is a function, discovered tools are ignored with a warning because function-valued tools can't be statically merged.
@@ -0,0 +1,52 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Workflows
4
+
5
+ Mastra discovers project-level workflows from `.ts` and `.js` files under `src/mastra/workflows/`. This convention isn't scoped to one agent: every file with a default export becomes a registered workflow, and the filename becomes the workflow key.
6
+
7
+ Use this page for the file-based convention. For steps, schemas, control flow, streaming, state, and workflow execution, see [Workflows overview](https://mastra.ai/docs/workflows/overview).
8
+
9
+ ## Quickstart
10
+
11
+ Create a file under `src/mastra/workflows/`, build the workflow with [`createWorkflow()`](https://mastra.ai/reference/workflows/workflow), and default-export it.
12
+
13
+ ```typescript
14
+ import { createStep, createWorkflow } from '@mastra/core/workflows'
15
+ import { z } from 'zod'
16
+
17
+ const collectInputs = createStep({
18
+ id: 'collect-inputs',
19
+ inputSchema: z.object({ topic: z.string() }),
20
+ outputSchema: z.object({ topic: z.string(), audience: z.string() }),
21
+ execute: async ({ inputData }) => ({
22
+ topic: inputData.topic,
23
+ audience: 'engineering',
24
+ }),
25
+ })
26
+
27
+ const writeSummary = createStep({
28
+ id: 'write-summary',
29
+ inputSchema: z.object({ topic: z.string(), audience: z.string() }),
30
+ outputSchema: z.object({ report: z.string() }),
31
+ execute: async ({ inputData }) => ({
32
+ report: `Daily report about ${inputData.topic} for ${inputData.audience}.`,
33
+ }),
34
+ })
35
+
36
+ const dailyReport = createWorkflow({
37
+ id: 'daily-report',
38
+ inputSchema: z.object({ topic: z.string() }),
39
+ outputSchema: z.object({ report: z.string() }),
40
+ })
41
+ .then(collectInputs)
42
+ .then(writeSummary)
43
+ .commit()
44
+
45
+ export default dailyReport
46
+ ```
47
+
48
+ Mastra registers this workflow under the `daily-report` key.
49
+
50
+ ## Precedence with code
51
+
52
+ File-based workflows merge with workflows registered in [`new Mastra()`](https://mastra.ai/reference/core/mastra-class). On a key collision, the code-registered workflow wins.
@@ -0,0 +1,74 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Workspace
4
+
5
+ A [workspace](https://mastra.ai/docs/workspace/overview) gives an agent filesystem access and command execution. File-based agents get a default workspace automatically when discovered through `mastra dev` or `mastra build`, so they can read and write files and run shell commands without extra configuration.
6
+
7
+ Use this page for the file-based convention. For workspace providers, tools, search, lifecycle, and sandbox details, see [Workspaces](https://mastra.ai/docs/workspace/overview).
8
+
9
+ ## Default workspace
10
+
11
+ Without `workspace.ts`, a file-based agent gets a default [`Workspace`](https://mastra.ai/reference/workspace/workspace-class) when the build provides a per-agent workspace path. The default workspace uses:
12
+
13
+ - [`LocalFilesystem`](https://mastra.ai/reference/workspace/local-filesystem) rooted at the agent's bundled workspace directory.
14
+ - [`LocalSandbox`](https://mastra.ai/reference/workspace/local-sandbox) with the same working directory.
15
+
16
+ This gives the agent file tools and shell tools automatically. The default workspace is per agent; subagents get nested workspace directories under their parent agent's workspace path.
17
+
18
+ ## Quickstart
19
+
20
+ For the default workspace, don't add a file. Start with an agent directory like this:
21
+
22
+ ```text
23
+ src/mastra/agents/weather/
24
+ ├── config.ts
25
+ └── instructions.md
26
+ ```
27
+
28
+ Add `workspace.ts` only when you need to customize the workspace:
29
+
30
+ ```typescript
31
+ import { Workspace, LocalFilesystem, LocalSandbox } from '@mastra/core/workspace'
32
+
33
+ export default new Workspace({
34
+ name: 'weather-workspace',
35
+ filesystem: new LocalFilesystem({ basePath: './data/weather' }),
36
+ sandbox: new LocalSandbox({ workingDirectory: './data/weather' }),
37
+ })
38
+ ```
39
+
40
+ Visit the [`Workspace` reference](https://mastra.ai/reference/workspace/workspace-class) for the full config.
41
+
42
+ ## When to customize the workspace
43
+
44
+ Customize the workspace when the default local directory isn't enough. Common reasons include:
45
+
46
+ - Point file tools at a different filesystem root.
47
+ - Run shell commands in a different sandbox provider.
48
+ - Add workspace search with BM25 or vector search.
49
+ - Share one workspace across multiple agents.
50
+
51
+ For provider patterns and runtime behavior, see the [workspace overview](https://mastra.ai/docs/workspace/overview), [sandbox guide](https://mastra.ai/docs/workspace/sandbox), and [workspace search](https://mastra.ai/docs/workspace/search).
52
+
53
+ ## Runtime boundary
54
+
55
+ The workspace filesystem controls what file tools can read and write. The sandbox controls where shell commands run. Application runtime code, including code in [`tools/`](https://mastra.ai/reference/file-based-agents/tools), still runs in your app/server process unless it explicitly calls workspace or sandbox APIs.
56
+
57
+ ## Seed files
58
+
59
+ Add a `workspace/` directory to ship starting files with the agent. Mastra mirrors files under `workspace/` into the agent's default runtime workspace at build time, so the agent starts with those files on disk.
60
+
61
+ ```text
62
+ src/mastra/agents/weather/
63
+ ├── config.ts
64
+ └── workspace/
65
+ ├── README.md
66
+ └── data/
67
+ └── cities.json
68
+ ```
69
+
70
+ The files are copied into the bundled workspace path, where workspace file tools and sandbox commands can read them. Symlinked seed files are skipped during mirroring.
71
+
72
+ ## Precedence with config
73
+
74
+ `config.workspace` wins over `workspace.ts`; otherwise the default file-based workspace is used. See [`config.ts` precedence](https://mastra.ai/reference/file-based-agents/config) for the full merge table.
@@ -175,6 +175,19 @@ The Reference section provides documentation of Mastra's API, including paramete
175
175
  - [.startExperimentAsync()](https://mastra.ai/reference/datasets/startExperimentAsync)
176
176
  - [.update()](https://mastra.ai/reference/datasets/update)
177
177
  - [.updateItem()](https://mastra.ai/reference/datasets/updateItem)
178
+ - [config.ts](https://mastra.ai/reference/file-based-agents/config)
179
+ - [Instructions](https://mastra.ai/reference/file-based-agents/instructions)
180
+ - [Memory](https://mastra.ai/reference/file-based-agents/memory)
181
+ - [Observability](https://mastra.ai/reference/file-based-agents/observability)
182
+ - [Processors](https://mastra.ai/reference/file-based-agents/processors)
183
+ - [Server](https://mastra.ai/reference/file-based-agents/server)
184
+ - [Skills](https://mastra.ai/reference/file-based-agents/skills)
185
+ - [Storage](https://mastra.ai/reference/file-based-agents/storage)
186
+ - [Studio](https://mastra.ai/reference/file-based-agents/studio)
187
+ - [Subagents](https://mastra.ai/reference/file-based-agents/subagents)
188
+ - [Tools](https://mastra.ai/reference/file-based-agents/tools)
189
+ - [Workflows](https://mastra.ai/reference/file-based-agents/workflows)
190
+ - [Workspace](https://mastra.ai/reference/file-based-agents/workspace)
178
191
  - [API Reference](https://mastra.ai/reference/mastra-platform/api)
179
192
  - [Cloned Thread Utilities](https://mastra.ai/reference/memory/clone-utilities)
180
193
  - [Memory Class](https://mastra.ai/reference/memory/memory-class)
@@ -37,7 +37,7 @@ export const agent = new Agent({
37
37
 
38
38
  **options** (`MemoryConfig`): Memory configuration options.
39
39
 
40
- **options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable loading conversation history into context. Use Number.MAX\_SAFE\_INTEGER to retrieve all messages with no limit. To prevent saving new messages, use the readOnly option instead.
40
+ **options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable the message history feature entirely (messages are not loaded into context or saved). Use Number.MAX\_SAFE\_INTEGER to retrieve all messages with no limit. To load messages without saving new ones, use the readOnly option.
41
41
 
42
42
  **options.readOnly** (`boolean`): When true, prevents memory from saving new messages and provides working memory as read-only context (without the updateWorkingMemory tool). Useful for read-only operations like previews, internal routing agents, or sub agents that should reference but not modify memory.
43
43
 
@@ -38,7 +38,7 @@ new MastraEditor({
38
38
 
39
39
  **options.readOnly** (`boolean`): Treat memory as read-only — no new messages are stored.
40
40
 
41
- **options.lastMessages** (`number | false`): Number of recent messages to include in context, or false to disable.
41
+ **options.lastMessages** (`number | false`): Number of recent messages to include in context, or false to disable message history entirely (messages are not loaded or saved).
42
42
 
43
43
  **options.semanticRecall** (`boolean | SemanticRecall`): Semantic recall configuration. See the Memory class reference for the full shape.
44
44
 
@@ -44,7 +44,7 @@ Mastra recommends organizing your code into the following folders:
44
44
 
45
45
  Mastra has two special folder conventions:
46
46
 
47
- - `src/mastra/agents/<name>`: You can define an agent by file convention instead of constructing it in code. Learn more in the [file-based agents](https://mastra.ai/docs/agents/file-based-agents) guide.
47
+ - `src/mastra/agents/<name>`: You can define an agent by file convention instead of constructing it in code. Learn more in the [File-based Agents](https://mastra.ai/docs/getting-started/file-based-agents) docs.
48
48
  - `src/mastra/public`: Contents are copied into the `.build/output` directory during the build process, making them available for serving at runtime.
49
49
 
50
50
  ### Top-level files
@@ -130,4 +130,4 @@ When the configured pub/sub backend doesn't implement `LeaseProvider`, the runti
130
130
  - [PubSub](https://mastra.ai/reference/pubsub/base): The event delivery contract, separate from leasing
131
131
  - [RedisStreamsPubSub](https://mastra.ai/reference/pubsub/redis-streams): The built-in backend that implements `LeaseProvider`
132
132
  - [Signals](https://mastra.ai/docs/long-running-agents/signals): The runtime that uses leasing to coordinate thread runs across processes
133
- - [Channels](https://mastra.ai/docs/agents/channels): Uses leasing to coordinate agent runs in serverless and multi-instance deployments
133
+ - [Channels](https://mastra.ai/docs/capabilities/channels/overview): Uses leasing to coordinate agent runs in serverless and multi-instance deployments
@@ -101,6 +101,38 @@ const observabilityStore = new ObservabilityStorageClickhouse({
101
101
 
102
102
  New projects should use `ObservabilityStorageClickhouseVNext` instead.
103
103
 
104
+ ### Migrating from legacy to vNext
105
+
106
+ To migrate historical spans from the legacy `mastra_ai_spans` table to the vNext schema, run:
107
+
108
+ **npm**:
109
+
110
+ ```bash
111
+ npx mastra migrate
112
+ ```
113
+
114
+ **pnpm**:
115
+
116
+ ```bash
117
+ pnpm dlx mastra migrate
118
+ ```
119
+
120
+ **Yarn**:
121
+
122
+ ```bash
123
+ yarn dlx mastra migrate
124
+ ```
125
+
126
+ **Bun**:
127
+
128
+ ```bash
129
+ bun x mastra migrate
130
+ ```
131
+
132
+ The migration copies span data from `mastra_ai_spans` into `mastra_span_events` in day-sized batches. It handles column mapping, deduplicates legacy rows, and preserves the original table as a backup. After migration, traces appear in Studio through the vNext adapter.
133
+
134
+ > **Note:** The legacy table is not deleted. Drop it manually after verifying the migration.
135
+
104
136
  ### ClickHouse for every domain
105
137
 
106
138
  `ClickhouseStoreVNext` backs the `memory`, `workflows`, and `observability` domains with ClickHouse and uses the vNext observability adapter automatically. Use it when you want ClickHouse to back the entire application without wiring a composite store manually.
@@ -156,6 +156,32 @@ export const mastra = new Mastra({
156
156
  })
157
157
  ```
158
158
 
159
+ ### Disabling a domain
160
+
161
+ Set a domain to `false` to disable it. A disabled domain doesn't fall back to `default`, so data for that domain isn't persisted:
162
+
163
+ ```typescript
164
+ import { MastraCompositeStore } from '@mastra/core/storage'
165
+ import { PostgresStore } from '@mastra/pg'
166
+ import { Mastra } from '@mastra/core'
167
+
168
+ const pgStore = new PostgresStore({
169
+ id: 'pg',
170
+ connectionString: process.env.DATABASE_URL,
171
+ })
172
+
173
+ export const mastra = new Mastra({
174
+ storage: new MastraCompositeStore({
175
+ id: 'composite',
176
+ default: pgStore,
177
+ domains: {
178
+ // don't persist traces and spans
179
+ observability: false,
180
+ },
181
+ }),
182
+ })
183
+ ```
184
+
159
185
  ## Options
160
186
 
161
187
  **id** (`string`): Unique identifier for this storage instance.
@@ -164,7 +190,7 @@ export const mastra = new Mastra({
164
190
 
165
191
  **disableInit** (`boolean`): When true, automatic initialization is disabled. You must call init() explicitly.
166
192
 
167
- **domains** (`object`): Individual domain overrides. Each domain can come from a different storage adapter. These take precedence over both editor and default storage.
193
+ **domains** (`object`): Individual domain overrides. Each domain can come from a different storage adapter. These take precedence over both editor and default storage. Set a domain to false to disable it entirely; a disabled domain does not fall back to editor or default.
168
194
 
169
195
  **domains.memory** (`MemoryStorage`): Storage for threads, messages, and resources.
170
196