@mastra/mcp-docs-server 0.13.32 → 0.13.34-alpha.0

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 (30) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +2 -0
  2. package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +2 -0
  3. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +9 -9
  4. package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
  5. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +11 -11
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +22 -22
  7. package/.docs/organized/changelogs/%40mastra%2Fcore.md +11 -11
  8. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +25 -25
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +25 -25
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +25 -25
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +25 -25
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +29 -29
  13. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +22 -22
  14. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +36 -36
  15. package/.docs/organized/changelogs/%40mastra%2Freact.md +21 -0
  16. package/.docs/organized/changelogs/%40mastra%2Fserver.md +26 -26
  17. package/.docs/organized/changelogs/create-mastra.md +7 -7
  18. package/.docs/organized/changelogs/mastra.md +29 -29
  19. package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +1 -1
  20. package/.docs/raw/getting-started/project-structure.mdx +48 -45
  21. package/.docs/raw/getting-started/studio.mdx +158 -0
  22. package/.docs/raw/reference/workflows/step.mdx +1 -1
  23. package/.docs/raw/tools-mcp/overview.mdx +2 -2
  24. package/.docs/raw/workflows/agents-and-tools.mdx +131 -0
  25. package/.docs/raw/workflows/overview.mdx +15 -13
  26. package/CHANGELOG.md +21 -0
  27. package/package.json +4 -4
  28. package/.docs/organized/code-examples/agent.md +0 -1387
  29. package/.docs/raw/server-db/local-dev-playground.mdx +0 -233
  30. package/.docs/raw/workflows/using-with-agents-and-tools.mdx +0 -350
@@ -1,5 +1,40 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 6.6.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2b031e2`](https://github.com/mastra-ai/mastra/commit/2b031e25ca10cd3e4d63e6a27f909cba26d91405)]:
8
+ - @mastra/core@0.22.2-alpha.0
9
+ - @mastra/client-js@0.16.4-alpha.0
10
+ - @mastra/react@0.0.10-alpha.0
11
+
12
+ ## 6.6.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Fix subagent link not working in agents overview pane ([#9099](https://github.com/mastra-ai/mastra/pull/9099))
17
+
18
+ - Fix wrong MCP link in playground ([#9103](https://github.com/mastra-ai/mastra/pull/9103))
19
+
20
+ - Updated dependencies []:
21
+ - @mastra/core@0.22.1
22
+ - @mastra/client-js@0.16.3
23
+ - @mastra/react@0.0.9
24
+
25
+ ## 6.6.1-alpha.0
26
+
27
+ ### Patch Changes
28
+
29
+ - Fix subagent link not working in agents overview pane ([#9099](https://github.com/mastra-ai/mastra/pull/9099))
30
+
31
+ - Fix wrong MCP link in playground ([#9103](https://github.com/mastra-ai/mastra/pull/9103))
32
+
33
+ - Updated dependencies []:
34
+ - @mastra/core@0.22.1-alpha.0
35
+ - @mastra/client-js@0.16.3-alpha.0
36
+ - @mastra/react@0.0.9-alpha.0
37
+
3
38
  ## 6.6.0
4
39
 
5
40
  ### Minor Changes
@@ -264,39 +299,4 @@
264
299
 
265
300
  - Convert WorkflowWatchResult to WorkflowResult in workflow graph ([#8541](https://github.com/mastra-ai/mastra/pull/8541))
266
301
 
267
- - remove icons in entity lists ([#8520](https://github.com/mastra-ai/mastra/pull/8520))
268
-
269
- - extract mcp servers into playground + use a table instead of custom stuff ([#8521](https://github.com/mastra-ai/mastra/pull/8521))
270
-
271
- - add client search to all entities ([#8523](https://github.com/mastra-ai/mastra/pull/8523))
272
-
273
- - Fixed an issue where model router was adding /chat/completions to API urls when it shouldn't. ([#8589](https://github.com/mastra-ai/mastra/pull/8589))
274
- fixed an issue with provider ID rendering in playground UI
275
-
276
- - UX for the agents page ([#8517](https://github.com/mastra-ai/mastra/pull/8517))
277
-
278
- - add icons into playground titles + a link to the entity doc ([#8518](https://github.com/mastra-ai/mastra/pull/8518))
279
-
280
- - Updated dependencies [[`c621613`](https://github.com/mastra-ai/mastra/commit/c621613069173c69eb2c3ef19a5308894c6549f0), [`12b1189`](https://github.com/mastra-ai/mastra/commit/12b118942445e4de0dd916c593e33ec78dc3bc73), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`076b092`](https://github.com/mastra-ai/mastra/commit/076b0924902ff0f49d5712d2df24c4cca683713f), [`2aee9e7`](https://github.com/mastra-ai/mastra/commit/2aee9e7d188b8b256a4ddc203ccefb366b4867fa), [`c582906`](https://github.com/mastra-ai/mastra/commit/c5829065a346260f96c4beb8af131b94804ae3ad), [`fa2eb96`](https://github.com/mastra-ai/mastra/commit/fa2eb96af16c7d433891a73932764960d3235c1d), [`ee9108f`](https://github.com/mastra-ai/mastra/commit/ee9108fa29bb8368fc23df158c9f0645b2d7b65c), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`a739d0c`](https://github.com/mastra-ai/mastra/commit/a739d0c8b37cd89569e04a6ca0827083c6167e19), [`603e927`](https://github.com/mastra-ai/mastra/commit/603e9279db8bf8a46caf83881c6b7389ccffff7e), [`cd45982`](https://github.com/mastra-ai/mastra/commit/cd4598291cda128a88738734ae6cbef076ebdebd), [`874f74d`](https://github.com/mastra-ai/mastra/commit/874f74da4b1acf6517f18132d035612c3ecc394a), [`b728a45`](https://github.com/mastra-ai/mastra/commit/b728a45ab3dba59da0f5ee36b81fe246659f305d), [`0baf2ba`](https://github.com/mastra-ai/mastra/commit/0baf2bab8420277072ef1f95df5ea7b0a2f61fe7), [`10e633a`](https://github.com/mastra-ai/mastra/commit/10e633a07d333466d9734c97acfc3dbf757ad2d0), [`a6d69c5`](https://github.com/mastra-ai/mastra/commit/a6d69c5fb50c0875b46275811fece5862f03c6a0), [`84199af`](https://github.com/mastra-ai/mastra/commit/84199af8673f6f9cb59286ffb5477a41932775de), [`7f431af`](https://github.com/mastra-ai/mastra/commit/7f431afd586b7d3265075e73106eb73167edbb86), [`26e968d`](https://github.com/mastra-ai/mastra/commit/26e968db2171ded9e4d47aa1b4f19e1e771158d0), [`cbd3fb6`](https://github.com/mastra-ai/mastra/commit/cbd3fb65adb03a7c0df193cb998aed5ac56675ee)]:
281
- - @mastra/core@0.20.1
282
- - @mastra/client-js@0.15.1
283
- - @mastra/react@0.0.4
284
-
285
- ## 6.4.0-alpha.4
286
-
287
- ### Minor Changes
288
-
289
- - Update peer dependencies to match core package version bump (0.20.1) ([#8589](https://github.com/mastra-ai/mastra/pull/8589))
290
-
291
- ### Patch Changes
292
-
293
- - Fixed an issue where model router was adding /chat/completions to API urls when it shouldn't. ([#8589](https://github.com/mastra-ai/mastra/pull/8589))
294
- fixed an issue with provider ID rendering in playground UI
295
- - Updated dependencies [[`b728a45`](https://github.com/mastra-ai/mastra/commit/b728a45ab3dba59da0f5ee36b81fe246659f305d)]:
296
- - @mastra/core@0.20.1-alpha.4
297
- - @mastra/client-js@0.15.1-alpha.4
298
- - @mastra/react@0.0.4-alpha.4
299
-
300
- ## 6.3.1-alpha.3
301
-
302
- ... 3768 more lines hidden. See full changelog in package directory.
302
+ ... 3803 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,26 @@
1
1
  # @mastra/react-hooks
2
2
 
3
+ ## 0.0.10-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @mastra/client-js@0.16.4-alpha.0
9
+
10
+ ## 0.0.9
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies []:
15
+ - @mastra/client-js@0.16.3
16
+
17
+ ## 0.0.9-alpha.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies []:
22
+ - @mastra/client-js@0.16.3-alpha.0
23
+
3
24
  ## 0.0.8
4
25
 
5
26
  ### Patch Changes
@@ -1,5 +1,30 @@
1
1
  # @mastra/server
2
2
 
3
+ ## 0.22.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2b031e2`](https://github.com/mastra-ai/mastra/commit/2b031e25ca10cd3e4d63e6a27f909cba26d91405)]:
8
+ - @mastra/core@0.22.2-alpha.0
9
+
10
+ ## 0.22.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Get agent registered on a parent agent via API ([#9106](https://github.com/mastra-ai/mastra/pull/9106))
15
+
16
+ - Updated dependencies []:
17
+ - @mastra/core@0.22.1
18
+
19
+ ## 0.22.1-alpha.0
20
+
21
+ ### Patch Changes
22
+
23
+ - Get agent registered on a parent agent via API ([#9106](https://github.com/mastra-ai/mastra/pull/9106))
24
+
25
+ - Updated dependencies []:
26
+ - @mastra/core@0.22.1-alpha.0
27
+
3
28
  ## 0.22.0
4
29
 
5
30
  ### Minor Changes
@@ -273,30 +298,5 @@
273
298
  - Updated dependencies [[`4a70ccc`](https://github.com/mastra-ai/mastra/commit/4a70ccc5cfa12ae9c2b36545a5814cd98e5a0ead), [`0992b8b`](https://github.com/mastra-ai/mastra/commit/0992b8bf0f4f1ba7ad9940883ec4bb8d867d3105), [`283bea0`](https://github.com/mastra-ai/mastra/commit/283bea07adbaf04a27fa3ad2df611095e0825195)]:
274
299
  - @mastra/core@0.19.1
275
300
 
276
- ## 0.19.1-alpha.1
277
-
278
- ### Patch Changes
279
-
280
- - Updated dependencies [[`4a70ccc`](https://github.com/mastra-ai/mastra/commit/4a70ccc5cfa12ae9c2b36545a5814cd98e5a0ead)]:
281
- - @mastra/core@0.19.1-alpha.1
282
-
283
- ## 0.19.1-alpha.0
284
-
285
- ### Patch Changes
286
-
287
- - Added Mastra model router to Playground UI ([#8332](https://github.com/mastra-ai/mastra/pull/8332))
288
-
289
- - Updated dependencies [[`0992b8b`](https://github.com/mastra-ai/mastra/commit/0992b8bf0f4f1ba7ad9940883ec4bb8d867d3105), [`283bea0`](https://github.com/mastra-ai/mastra/commit/283bea07adbaf04a27fa3ad2df611095e0825195)]:
290
- - @mastra/core@0.19.1-alpha.0
291
-
292
- ## 0.19.0
293
-
294
- ### Patch Changes
295
-
296
- - Support passing tracing options for start/resume workflows for server APIs and client sdk ([#8277](https://github.com/mastra-ai/mastra/pull/8277))
297
-
298
- - add a way to hide the deploy mastra cloud button ([#8137](https://github.com/mastra-ai/mastra/pull/8137))
299
-
300
- - Update peer deps ([#8154](https://github.com/mastra-ai/mastra/pull/8154))
301
301
 
302
- ... 3821 more lines hidden. See full changelog in package directory.
302
+ ... 3846 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,11 @@
1
1
  # create-mastra
2
2
 
3
+ ## 0.17.3-alpha.0
4
+
5
+ ## 0.17.2
6
+
7
+ ## 0.17.2-alpha.0
8
+
3
9
  ## 0.17.1
4
10
 
5
11
  ### Patch Changes
@@ -292,11 +298,5 @@
292
298
 
293
299
  ## 0.13.3-alpha.0
294
300
 
295
- ### Patch Changes
296
-
297
- - Add types in the streamVNext codepath, fixes for various issues across multiple packages surfaced from type issues, align return types. ([#8010](https://github.com/mastra-ai/mastra/pull/8010))
298
-
299
- - Add model fallbacks to playground ([#7427](https://github.com/mastra-ai/mastra/pull/7427))
300
-
301
301
 
302
- ... 1768 more lines hidden. See full changelog in package directory.
302
+ ... 1774 more lines hidden. See full changelog in package directory.
@@ -1,5 +1,33 @@
1
1
  # mastra
2
2
 
3
+ ## 0.17.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2b031e2`](https://github.com/mastra-ai/mastra/commit/2b031e25ca10cd3e4d63e6a27f909cba26d91405)]:
8
+ - @mastra/core@0.22.2-alpha.0
9
+ - @mastra/deployer@0.22.2-alpha.0
10
+
11
+ ## 0.17.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Fix a bug where `mastra init` didn't work correctly when core dependencies were missing in the project ([#9070](https://github.com/mastra-ai/mastra/pull/9070))
16
+
17
+ - Updated dependencies [[`69ff5d5`](https://github.com/mastra-ai/mastra/commit/69ff5d58e4bc4054ce76bbb25a8fa5d3177c49ea)]:
18
+ - @mastra/deployer@0.22.1
19
+ - @mastra/core@0.22.1
20
+
21
+ ## 0.17.2-alpha.0
22
+
23
+ ### Patch Changes
24
+
25
+ - Fix a bug where `mastra init` didn't work correctly when core dependencies were missing in the project ([#9070](https://github.com/mastra-ai/mastra/pull/9070))
26
+
27
+ - Updated dependencies [[`69ff5d5`](https://github.com/mastra-ai/mastra/commit/69ff5d58e4bc4054ce76bbb25a8fa5d3177c49ea)]:
28
+ - @mastra/deployer@0.22.1-alpha.0
29
+ - @mastra/core@0.22.1-alpha.0
30
+
3
31
  ## 0.17.1
4
32
 
5
33
  ### Patch Changes
@@ -270,33 +298,5 @@
270
298
 
271
299
  - Mutable shared workflow run state ([#8545](https://github.com/mastra-ai/mastra/pull/8545))
272
300
 
273
- - avoid refetching memory threads and messages on window focus ([#8519](https://github.com/mastra-ai/mastra/pull/8519))
274
-
275
- - add tripwire reason in playground ([#8568](https://github.com/mastra-ai/mastra/pull/8568))
276
-
277
- - Save waiting step status in snapshot ([#8576](https://github.com/mastra-ai/mastra/pull/8576))
278
-
279
- - Convert WorkflowWatchResult to WorkflowResult in workflow graph ([#8541](https://github.com/mastra-ai/mastra/pull/8541))
280
-
281
- - add new deploy to cloud button ([#8549](https://github.com/mastra-ai/mastra/pull/8549))
282
-
283
- - remove icons in entity lists ([#8520](https://github.com/mastra-ai/mastra/pull/8520))
284
-
285
- - add client search to all entities ([#8523](https://github.com/mastra-ai/mastra/pull/8523))
286
-
287
- - UX for the agents page ([#8517](https://github.com/mastra-ai/mastra/pull/8517))
288
-
289
- - add icons into playground titles + a link to the entity doc ([#8518](https://github.com/mastra-ai/mastra/pull/8518))
290
-
291
- - Updated dependencies [[`c621613`](https://github.com/mastra-ai/mastra/commit/c621613069173c69eb2c3ef19a5308894c6549f0), [`ee17cec`](https://github.com/mastra-ai/mastra/commit/ee17cec065f4454740c9cc8f8a841027a5990f57), [`12b1189`](https://github.com/mastra-ai/mastra/commit/12b118942445e4de0dd916c593e33ec78dc3bc73), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`076b092`](https://github.com/mastra-ai/mastra/commit/076b0924902ff0f49d5712d2df24c4cca683713f), [`2aee9e7`](https://github.com/mastra-ai/mastra/commit/2aee9e7d188b8b256a4ddc203ccefb366b4867fa), [`c582906`](https://github.com/mastra-ai/mastra/commit/c5829065a346260f96c4beb8af131b94804ae3ad), [`fa2eb96`](https://github.com/mastra-ai/mastra/commit/fa2eb96af16c7d433891a73932764960d3235c1d), [`4783b30`](https://github.com/mastra-ai/mastra/commit/4783b3063efea887825514b783ba27f67912c26d), [`a739d0c`](https://github.com/mastra-ai/mastra/commit/a739d0c8b37cd89569e04a6ca0827083c6167e19), [`a9c4cb7`](https://github.com/mastra-ai/mastra/commit/a9c4cb7d6a35de23ca51066f166a66e0e4cca418), [`603e927`](https://github.com/mastra-ai/mastra/commit/603e9279db8bf8a46caf83881c6b7389ccffff7e), [`cd45982`](https://github.com/mastra-ai/mastra/commit/cd4598291cda128a88738734ae6cbef076ebdebd), [`874f74d`](https://github.com/mastra-ai/mastra/commit/874f74da4b1acf6517f18132d035612c3ecc394a), [`0baf2ba`](https://github.com/mastra-ai/mastra/commit/0baf2bab8420277072ef1f95df5ea7b0a2f61fe7), [`26e968d`](https://github.com/mastra-ai/mastra/commit/26e968db2171ded9e4d47aa1b4f19e1e771158d0), [`cbd3fb6`](https://github.com/mastra-ai/mastra/commit/cbd3fb65adb03a7c0df193cb998aed5ac56675ee)]:
292
- - @mastra/core@0.20.1-alpha.1
293
- - @mastra/deployer@0.20.1-alpha.1
294
- - @mastra/mcp@0.13.4-alpha.0
295
-
296
- ## 0.14.2-alpha.0
297
-
298
- ### Patch Changes
299
-
300
- - streamLegacy/generateLegacy clarification in playground ([#8468](https://github.com/mastra-ai/mastra/pull/8468))
301
301
 
302
- ... 6260 more lines hidden. See full changelog in package directory.
302
+ ... 6288 more lines hidden. See full changelog in package directory.
@@ -160,7 +160,7 @@ Enable Function URL for external access:
160
160
  3. Set **Auth type** to **NONE** (for public access)
161
161
  4. Configure **CORS** settings:
162
162
  - **Allow-Origin**: `*` (restrict to your domain in production)
163
- - **Allow-Headers**: `content-type`
163
+ - **Allow-Headers**: `content-type` (`x-amzn-request-context` is also required when used with services like Cloudfront/API Gateway)
164
164
  - **Allow-Methods**: `*` (audit and restrict in production)
165
165
  5. Click **Save**
166
166
 
@@ -3,70 +3,73 @@ title: "Local Project Structure | Getting Started | Mastra Docs"
3
3
  description: Guide on organizing folders and files in Mastra, including best practices and recommended structures.
4
4
  ---
5
5
 
6
- import { FileTree } from "nextra/components";
6
+ import { FileTree, Callout } from "nextra/components";
7
7
 
8
8
  # Project Structure
9
9
 
10
- This page provides a guide for organizing folders and files in Mastra. Mastra is a modular framework, and you can use any of the modules separately or together.
10
+ Your new Mastra project, created with the `create mastra` command, comes with a predefined set of files and folders to help you get started.
11
11
 
12
- You could write everything in a single file, or separate each agent, tool, and workflow into their own files.
12
+ Mastra is a framework, but it's **unopinionated** about how you organize or colocate your files. The CLI provides a sensible default structure that works well for most projects, but you're free to adapt it to your workflow or team conventions. You could even build your entire project in a single file if you wanted! Whatever structure you choose, keep it consistent to ensure your code stays maintainable and easy to navigate.
13
13
 
14
- We don't enforce a specific folder structure, but we do recommend some best practices, and the CLI will scaffold a project with a sensible structure.
14
+ ## Default project structure
15
15
 
16
- ## Example Project Structure
17
-
18
- A default project created with the CLI looks like this:
16
+ A project created with the `create mastra` command looks like this:
19
17
 
20
18
  <FileTree>
21
19
  <FileTree.Folder name="src" defaultOpen>
22
20
  <FileTree.Folder name="mastra" defaultOpen>
23
21
  <FileTree.Folder name="agents" defaultOpen>
24
- <FileTree.File name="agent-name.ts" />
22
+ <FileTree.File name="weather-agent.ts" />
25
23
  </FileTree.Folder>
26
24
  <FileTree.Folder name="tools" defaultOpen>
27
- <FileTree.File name="tool-name.ts" />
25
+ <FileTree.File name="weather-tool.ts" />
28
26
  </FileTree.Folder>
29
27
  <FileTree.Folder name="workflows" defaultOpen>
30
- <FileTree.File name="workflow-name.ts" />
28
+ <FileTree.File name="weather-workflow.ts" />
29
+ </FileTree.Folder>
30
+ <FileTree.Folder name="scorers" defaultOpen>
31
+ <FileTree.File name="weather-scorer.ts" />
31
32
  </FileTree.Folder>
32
33
  <FileTree.File name="index.ts" />
33
34
  </FileTree.Folder>
34
35
  </FileTree.Folder>
35
- <FileTree.File name=".env" />
36
+ <FileTree.File name=".env.example" />
36
37
  <FileTree.File name="package.json" />
37
38
  <FileTree.File name="tsconfig.json" />
38
39
  </FileTree>
39
- {/*
40
- ```
41
- root/
42
- ├── src/
43
- │ └── mastra/
44
- │ ├── agents/
45
- │ │ └── index.ts
46
- │ ├── tools/
47
- │ │ └── index.ts
48
- │ ├── workflows/
49
- │ │ └── index.ts
50
- │ ├── index.ts
51
- ├── .env
52
- ├── package.json
53
- ├── tssconfig.json
54
- ``` */}
55
-
56
- ### Top-level Folders
57
-
58
- | Folder | Description |
59
- | ---------------------- | ------------------------------------ |
60
- | `src/mastra` | Core application folder |
61
- | `src/mastra/agents` | Agent configurations and definitions |
62
- | `src/mastra/tools` | Custom tool definitions |
63
- | `src/mastra/workflows` | Workflow definitions |
64
-
65
- ### Top-level Files
66
-
67
- | File | Description |
68
- | --------------------- | --------------------------------------------------- |
69
- | `src/mastra/index.ts` | Main configuration file for Mastra |
70
- | `.env` | Environment variables |
71
- | `package.json` | Node.js project metadata, scripts, and dependencies |
72
- | `tsconfig.json` | TypeScript compiler configuration |
40
+
41
+ <Callout type="info">
42
+ Tip - Use the predefined files as templates. Duplicate and adapt them to quickly create your own agents, tools, workflows, etc.
43
+ </Callout>
44
+
45
+ ### Folders
46
+
47
+ Folders organize your agent's resources, like agents, tools, and workflows.
48
+
49
+ | Folder | Description |
50
+ | ---------------------- | ------------ |
51
+ | `src/mastra` | Entry point for all Mastra-related code and configuration.|
52
+ | `src/mastra/agents` | Define and configure your agents - their behavior, goals, and tools. |
53
+ | `src/mastra/workflows` | Define multi-step workflows that orchestrate agents and tools together. |
54
+ | `src/mastra/tools` | Create reusable tools that your agents can call |
55
+ | `src/mastra/mcp` | (Optional) Implement custom MCP servers to share your tools with external agents |
56
+ | `src/mastra/scorers` | (Optional) Define scorers for evaluating agent performance over time |
57
+ | `src/mastra/public` | (Optional) Contents are copied into the `.build/output` directory during the build process, making them available for serving at runtime |
58
+
59
+ ### Top-level files
60
+
61
+ Top-level files define how your Mastra project is configured, built, and connected to its environment.
62
+
63
+ | File | Description |
64
+ | --------------------- | ------------ |
65
+ | `src/mastra/index.ts` | Central entry point where you configure and initialize Mastra. |
66
+ | `.env.example` | Template for environment variables — copy and rename to `.env` to add your secret [model provider](/models) keys. |
67
+ | `package.json` | Defines project metadata, dependencies, and available npm scripts. |
68
+ | `tsconfig.json` | Configures TypeScript options such as path aliases, compiler settings, and build output. |
69
+
70
+ ## Next steps
71
+
72
+ - Read more about [Mastra's features](/docs#why-mastra).
73
+ - Integrate Mastra with your frontend framework: [Next.js](/docs/frameworks/web-frameworks/next-js), [React](/docs/frameworks/web-frameworks/vite-react), or [Astro](/docs/frameworks/web-frameworks/astro).
74
+ - Build an agent from scratch following one of our [guides](/guides).
75
+ - Watch conceptual guides on our [YouTube channel](https://www.youtube.com/@mastra-ai) and [subscribe](https://www.youtube.com/@mastra-ai?sub_confirmation=1)!
@@ -0,0 +1,158 @@
1
+ ---
2
+ title: "Playground"
3
+ description: Guide on installing Mastra and setting up the necessary prerequisites for running it with various LLM providers.
4
+ ---
5
+
6
+ import YouTube from "@/components/youtube";
7
+ import { Tabs, Tab } from "@/components/tabs";
8
+ import { VideoPlayer } from "@/components/video-player"
9
+ import { Callout } from "nextra/components";
10
+
11
+ # Playground
12
+
13
+ Playground helps you build agents quickly. It provides an interactive UI for testing your agents and workflows, along with a REST API that exposes your Mastra application as a local service. This lets you start building without having to integrate Mastra into your project right away.
14
+
15
+ As your project evolves, Playground enables you to iterate quickly. Features like Observability and Scorers give you visibility into performance at every stage of development.
16
+
17
+ To get started, run Playground locally using the instructions below, or [deploy to Mastra Cloud](/docs/mastra-cloud/setting-up) to access the Playground remotely and collaborate with your team.
18
+
19
+ <YouTube id="spGlcTEjuXY" startTime={126}/>
20
+
21
+ ## Launch Playground
22
+
23
+ If you created your application with `create mastra`, start the local development server using the `dev` script. You can also run it directly with `mastra dev`.
24
+
25
+ <Tabs items={["npm", "pnpm", "yarn", "bun", "mastra"]}>
26
+ <Tab>
27
+ ```bash copy
28
+ npm run dev
29
+ ```
30
+ </Tab>
31
+ <Tab>
32
+ ```bash copy
33
+ pnpm run dev
34
+ ```
35
+ </Tab>
36
+ <Tab>
37
+ ```bash copy
38
+ yarn run dev
39
+ ```
40
+ </Tab>
41
+ <Tab>
42
+ ```bash copy
43
+ bun run dev
44
+ ```
45
+ </Tab>
46
+ <Tab>
47
+ ```bash copy
48
+ mastra dev
49
+ ```
50
+ </Tab>
51
+ </Tabs>
52
+
53
+ Once the server's running, you can:
54
+
55
+ - Open the Playground UI at http://localhost:4111/ to test your agent interactively.
56
+ - Visit http://localhost:4111/swagger-ui to discover and interact with the underlying REST API.
57
+
58
+ ## Playground UI
59
+
60
+ The Playground UI provides an interactive development environment for you to test your agents, workflows, and tools, observe exactly what happens under the hood with each interaction, and tweak things as you go.
61
+
62
+ ### Agents
63
+
64
+
65
+ Chat with your agent directly, dynamically switch [models](/models), and tweak settings like temperature and top-p to understand how they affect the output.
66
+
67
+ <VideoPlayer
68
+ src="https://res.cloudinary.com/mastra-assets/video/upload/v1751406022/local-dev-agents-playground_100_m3begx.mp4"
69
+ />
70
+
71
+ When you interact with your agent, you can follow each step of its reasoning, view tool call outputs, and [observe](#observability) traces and logs to see how responses are generated. You can also attach [scorers](#scorers) to measure and compare response quality over time.
72
+
73
+ ### Workflows
74
+
75
+ Visualize your workflow as a graph and run it step by step with a custom input. During execution, the interface updates in real time to show the active step and the path taken.
76
+
77
+ <VideoPlayer
78
+ src="https://res.cloudinary.com/mastra-assets/video/upload/v1751406027/local-dev-workflows-playground_100_rbc466.mp4"
79
+ />
80
+
81
+ When running a workflow, you can also view detailed traces showing tool calls, raw JSON outputs, and any errors that might have occured along the way.
82
+
83
+ ### Tools
84
+
85
+ Run tools in isolation to observe their behavior. Test them before assigning them to your agent, or isolate them to debug issues should something go wrong.
86
+
87
+ <VideoPlayer
88
+ src="https://res.cloudinary.com/mastra-assets/video/upload/v1751406316/local-dev-agents-tools_100_fe1jdt.mp4"
89
+ />
90
+ ### MCP
91
+ List the MCP servers attached to your Mastra instance and explore their available tools.
92
+
93
+ ![MCP Servers Playground](/image/local-dev/local-dev-mcp-server-playground.jpg)
94
+
95
+ ### Observability
96
+
97
+
98
+ When you run an agent or workflow, the Observability tab displays traces that highlight the key AI operations such as model calls, tool executions, and workflow steps. Follow these traces to see how data moves, where time is spent, and what's happening under the hood.
99
+
100
+ ![](https://mastra.ai/_next/image?url=%2Ftracingafter.png&w=1920&q=75)
101
+
102
+ AI Tracing filters out low-level framework details so your traces stay focused and readable.
103
+
104
+
105
+ ### Scorers
106
+
107
+ The Scorers tab displays the results of your agent's scorers as they run. When messages pass through your agent, the defined scorers evaluate each output asynchronously and render their results here. This allows you to understand how your scorers respond to different interactions, compare performance across test cases, and identify areas for improvement.
108
+
109
+ ## REST API
110
+
111
+ The local development server exposes a complete set of REST API routes, allowing you to programmatically interact with your agents, workflows, and tools during development. This is particularly helpful if you plan to deploy the Mastra server, since the local development server uses the exact same API routes as the [production server](/docs/server-db/production-server), allowing you to develop and test against it with full parity.
112
+
113
+ You can explore all available endpoints in the OpenAPI specification at http://localhost:4111/openapi.json, which details every endpoint and its request and response schemas.
114
+
115
+ To explore the API interactively, visit the Swagger UI at http://localhost:4111/swagger-ui. Here, you can discover endpoints and test them directly from your browser.
116
+
117
+ <Callout type="info">
118
+ The OpenAPI and Swagger endpoints are disabled in production by default. To enable them, set `server.build.openAPIDocs` and `server.build.swaggerUI` to `true` respectively.
119
+ </Callout>
120
+
121
+ ## Configuration
122
+
123
+ ### Port
124
+
125
+ By default, the development server runs at http://localhost:4111. You can change the `host` and `port` in the Mastra server configuration:
126
+
127
+ ```typescript
128
+ import { Mastra } from "@mastra/core/mastra";
129
+
130
+ export const mastra = new Mastra({
131
+ server: {
132
+ port: 8080,
133
+ host: "0.0.0.0",
134
+ },
135
+ });
136
+ ```
137
+
138
+ ### Local HTTPS
139
+
140
+ Mastra supports local HTTPS development through the [`--https`](/reference/cli/mastra#--https) flag, which automatically creates and manages certificates for your project. When you run `mastra dev --https`, a private key and certificate are generated for localhost (or your configured host). For custom certificate management, you can provide your own key and certificate files through the server configuration:
141
+
142
+ ```typescript
143
+ import { Mastra } from "@mastra/core/mastra";
144
+ import fs from 'node:fs';
145
+
146
+ export const mastra = new Mastra({
147
+ server: {
148
+ https: {
149
+ key: fs.readFileSync('path/to/key.pem'),
150
+ cert: fs.readFileSync('path/to/cert.pem')
151
+ }
152
+ },
153
+ });
154
+ ```
155
+ ## Next steps
156
+
157
+ - Learn more about Mastra's suggested [project structure](/docs/getting-started/project-structure).
158
+ - Integrate Mastra with your frontend framework of choice - [Next.js](/docs/frameworks/web-frameworks/next-js), [React](/docs/frameworks/web-frameworks/vite-react), or [Astro](/docs/frameworks/web-frameworks/astro).
@@ -152,4 +152,4 @@ const step1 = createStep({
152
152
  ## Related
153
153
 
154
154
  - [Control flow](../../docs/workflows/control-flow.mdx)
155
- - [Using agents and tools](../../docs/workflows/using-with-agents-and-tools.mdx)
155
+ - [Using agents and tools](../../docs/workflows/agents-and-tools.mdx)
@@ -1,11 +1,11 @@
1
1
  ---
2
- title: "Tools Overview | Tools & MCP | Mastra Docs"
2
+ title: "Using Tools | Tools & MCP | Mastra Docs"
3
3
  description: Understand what tools are in Mastra, how to add them to agents, and best practices for designing effective tools.
4
4
  ---
5
5
 
6
6
  import { Steps } from "nextra/components";
7
7
 
8
- # Tools Overview
8
+ # Using Tools
9
9
 
10
10
  Tools are functions that agents can execute to perform specific tasks or access external information. They extend an agent's capabilities beyond simple text generation, allowing interaction with APIs, databases, or other systems.
11
11