@mastra/mcp-docs-server 1.1.1-alpha.0 → 1.1.1-alpha.2

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 (96) hide show
  1. package/.docs/docs/agents/agent-memory.md +45 -1
  2. package/.docs/docs/agents/network-approval.md +1 -1
  3. package/.docs/docs/agents/networks.md +3 -3
  4. package/.docs/docs/agents/overview.md +8 -0
  5. package/.docs/docs/agents/using-tools.md +82 -72
  6. package/.docs/docs/{getting-started → build-with-ai}/mcp-docs-server.md +1 -2
  7. package/.docs/docs/build-with-ai/skills.md +35 -0
  8. package/.docs/docs/community/contributing-templates.md +1 -182
  9. package/.docs/docs/community/discord.md +3 -1
  10. package/.docs/docs/deployment/cloud-providers.md +2 -2
  11. package/.docs/docs/deployment/overview.md +2 -2
  12. package/.docs/docs/getting-started/build-with-ai.md +68 -0
  13. package/.docs/docs/getting-started/start.md +1 -0
  14. package/.docs/docs/index.md +7 -13
  15. package/.docs/docs/memory/observational-memory.md +11 -8
  16. package/.docs/docs/observability/overview.md +1 -1
  17. package/.docs/docs/observability/tracing/exporters/langsmith.md +70 -0
  18. package/.docs/docs/observability/tracing/overview.md +1 -1
  19. package/.docs/docs/server/auth/better-auth.md +203 -0
  20. package/.docs/docs/server/auth.md +3 -2
  21. package/.docs/docs/server/middleware.md +0 -2
  22. package/.docs/docs/server/request-context.md +17 -0
  23. package/.docs/docs/streaming/overview.md +1 -1
  24. package/.docs/docs/workflows/agents-and-tools.md +2 -2
  25. package/.docs/docs/workflows/overview.md +1 -1
  26. package/.docs/docs/workspace/filesystem.md +2 -0
  27. package/.docs/docs/workspace/overview.md +3 -1
  28. package/.docs/docs/workspace/sandbox.md +2 -0
  29. package/.docs/docs/workspace/search.md +2 -0
  30. package/.docs/docs/workspace/skills.md +3 -1
  31. package/.docs/guides/build-your-ui/ai-sdk-ui.md +2 -2
  32. package/.docs/guides/deployment/netlify.md +77 -0
  33. package/.docs/guides/deployment/vercel.md +101 -0
  34. package/.docs/guides/getting-started/electron.md +504 -0
  35. package/.docs/guides/getting-started/next-js.md +1 -1
  36. package/.docs/guides/getting-started/quickstart.md +8 -3
  37. package/.docs/guides/getting-started/vite-react.md +40 -0
  38. package/.docs/guides/guide/github-actions-pr-description.md +1 -1
  39. package/.docs/models/gateways/netlify.md +2 -1
  40. package/.docs/models/gateways/openrouter.md +4 -1
  41. package/.docs/models/gateways/vercel.md +7 -2
  42. package/.docs/models/index.md +1 -1
  43. package/.docs/models/providers/anthropic.md +11 -2
  44. package/.docs/models/providers/chutes.md +2 -1
  45. package/.docs/models/providers/cloudflare-ai-gateway.md +2 -1
  46. package/.docs/models/providers/cortecs.md +6 -1
  47. package/.docs/models/providers/deepinfra.md +8 -2
  48. package/.docs/models/providers/firmware.md +24 -26
  49. package/.docs/models/providers/google.md +3 -1
  50. package/.docs/models/providers/groq.md +0 -2
  51. package/.docs/models/providers/jiekou.md +129 -0
  52. package/.docs/models/providers/moonshotai-cn.md +1 -1
  53. package/.docs/models/providers/moonshotai.md +1 -1
  54. package/.docs/models/providers/nebius.md +53 -22
  55. package/.docs/models/providers/novita-ai.md +3 -1
  56. package/.docs/models/providers/ollama-cloud.md +2 -1
  57. package/.docs/models/providers/openai.md +14 -13
  58. package/.docs/models/providers/opencode.md +11 -12
  59. package/.docs/models/providers/poe.md +2 -1
  60. package/.docs/models/providers/zenmux.md +2 -1
  61. package/.docs/models/providers.md +1 -0
  62. package/.docs/reference/agents/getTools.md +1 -6
  63. package/.docs/reference/agents/listAgents.md +1 -1
  64. package/.docs/reference/agents/network.md +0 -2
  65. package/.docs/reference/auth/better-auth.md +71 -0
  66. package/.docs/reference/cli/mastra.md +29 -4
  67. package/.docs/reference/client-js/agents.md +1 -1
  68. package/.docs/reference/configuration.md +1 -1
  69. package/.docs/reference/core/getStoredAgentById.md +2 -2
  70. package/.docs/reference/core/listStoredAgents.md +1 -1
  71. package/.docs/reference/deployer/netlify.md +69 -1
  72. package/.docs/reference/deployer/vercel.md +55 -3
  73. package/.docs/reference/deployer.md +2 -2
  74. package/.docs/reference/index.md +7 -2
  75. package/.docs/reference/memory/clone-utilities.md +2 -45
  76. package/.docs/reference/memory/cloneThread.md +1 -9
  77. package/.docs/reference/memory/observational-memory.md +2 -0
  78. package/.docs/reference/observability/tracing/exporters/langsmith.md +31 -1
  79. package/.docs/reference/tools/mcp-client.md +0 -2
  80. package/.docs/reference/workflows/step.md +2 -0
  81. package/.docs/reference/workflows/workflow-methods/map.md +2 -2
  82. package/.docs/reference/workspace/filesystem.md +2 -0
  83. package/.docs/reference/workspace/local-filesystem.md +2 -0
  84. package/.docs/reference/workspace/local-sandbox.md +2 -0
  85. package/.docs/reference/workspace/sandbox.md +2 -0
  86. package/.docs/reference/workspace/workspace-class.md +2 -0
  87. package/CHANGELOG.md +15 -0
  88. package/package.json +7 -7
  89. package/.docs/docs/tools-mcp/advanced-usage.md +0 -143
  90. package/.docs/docs/tools-mcp/mcp-overview.md +0 -383
  91. package/.docs/docs/tools-mcp/overview.md +0 -78
  92. package/.docs/docs/workflows/input-data-mapping.md +0 -102
  93. package/.docs/guides/deployment/netlify-deployer.md +0 -129
  94. package/.docs/guides/deployment/vercel-deployer.md +0 -191
  95. package/.docs/guides/deployment.md +0 -25
  96. package/.docs/reference/tools/client.md +0 -228
@@ -2,7 +2,7 @@
2
2
 
3
3
  Agents use memory to maintain context across interactions. LLMs are stateless and don't retain information between calls, so agents need memory to track message history and recall relevant information.
4
4
 
5
- Mastra agents can be configured to store message history, with optional [working memory](https://mastra.ai/docs/memory/working-memory) to maintain recent context or [semantic recall](https://mastra.ai/docs/memory/semantic-recall) to retrieve past messages based on meaning.
5
+ Mastra agents can be configured to store message history, with optional [working memory](https://mastra.ai/docs/memory/working-memory) to maintain recent context, [semantic recall](https://mastra.ai/docs/memory/semantic-recall) to retrieve past messages based on meaning, or [observational memory](https://mastra.ai/docs/memory/observational-memory) for automatic long-term memory that compresses conversations as they grow.
6
6
 
7
7
  ## When to use memory
8
8
 
@@ -134,6 +134,49 @@ const response = await memoryAgent.generate("What's my favorite color?", {
134
134
 
135
135
  To learn more about memory see the [Memory](https://mastra.ai/docs/memory/overview) documentation.
136
136
 
137
+ ## Observational Memory
138
+
139
+ For long-running conversations, raw message history grows until it fills the context window, degrading agent performance. [Observational Memory](https://mastra.ai/docs/memory/observational-memory) solves this by running background agents that compress old messages into dense observations, keeping the context window small while preserving long-term memory.
140
+
141
+ ```typescript
142
+ import { Agent } from "@mastra/core/agent";
143
+ import { Memory } from "@mastra/memory";
144
+
145
+ export const memoryAgent = new Agent({
146
+ id: 'memory-agent',
147
+ name: 'Memory Agent',
148
+ memory: new Memory({
149
+ options: {
150
+ observationalMemory: true,
151
+ },
152
+ }),
153
+ });
154
+ ```
155
+
156
+ Setting `observationalMemory: true` uses `google/gemini-2.5-flash` as the default model for the Observer and Reflector. To use a different model or customize thresholds, pass a config object:
157
+
158
+ ```typescript
159
+ import { Agent } from "@mastra/core/agent";
160
+ import { Memory } from "@mastra/memory";
161
+
162
+ export const memoryAgent = new Agent({
163
+ id: 'memory-agent',
164
+ name: 'Memory Agent',
165
+ memory: new Memory({
166
+ options: {
167
+ observationalMemory: {
168
+ model: "deepseek/deepseek-reasoner",
169
+ observation: {
170
+ messageTokens: 20_000,
171
+ },
172
+ },
173
+ },
174
+ }),
175
+ });
176
+ ```
177
+
178
+ > **Info:** See [Observational Memory](https://mastra.ai/docs/memory/observational-memory) for details on how observations and reflections work, and [the reference](https://mastra.ai/reference/memory/observational-memory) for all configuration options.
179
+
137
180
  ## Using `RequestContext`
138
181
 
139
182
  Use [RequestContext](https://mastra.ai/docs/server/request-context) to access request-specific values. This lets you conditionally select different memory or storage configurations based on the context of the request.
@@ -162,6 +205,7 @@ export const memoryAgent = new Agent({
162
205
 
163
206
  ## Related
164
207
 
208
+ - [Observational Memory](https://mastra.ai/docs/memory/observational-memory)
165
209
  - [Working Memory](https://mastra.ai/docs/memory/working-memory)
166
210
  - [Semantic Recall](https://mastra.ai/docs/memory/semantic-recall)
167
211
  - [Storage](https://mastra.ai/docs/memory/storage)
@@ -1,6 +1,6 @@
1
1
  # Network Approval
2
2
 
3
- Agent networks can require the same [human-in-the-loop](https://mastra.ai/docs/workflows/human-in-the-loop) oversight used in individual agents and workflows. When a tool, sub-agent, or workflow within a network requires approval or suspends execution, the network pauses and emits events that allow your application to collect user input before resuming.
3
+ Agent networks can require the same [human-in-the-loop](https://mastra.ai/docs/workflows/human-in-the-loop) oversight used in individual agents and workflows. When a tool, subagent, or workflow within a network requires approval or suspends execution, the network pauses and emits events that allow your application to collect user input before resuming.
4
4
 
5
5
  ## Storage
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Agent Networks
2
2
 
3
- Agent networks in Mastra coordinate multiple agents, workflows, and tools to handle tasks that aren't clearly defined upfront but can be inferred from the user's message or context. A top-level **routing agent** (a Mastra agent with other agents, workflows, and tools configured) uses an LLM to interpret the request and decide which primitives (sub-agents, workflows, or tools) to call, in what order, and with what data.
3
+ Agent networks in Mastra coordinate multiple agents, workflows, and tools to handle tasks that aren't clearly defined upfront but can be inferred from the user's message or context. A top-level **routing agent** (a Mastra agent with other agents, workflows, and tools configured) uses an LLM to interpret the request and decide which primitives (subagents, workflows, or tools) to call, in what order, and with what data.
4
4
 
5
5
  ## When to use networks
6
6
 
@@ -16,7 +16,7 @@ Mastra agent networks operate using these principles:
16
16
 
17
17
  ## Creating an agent network
18
18
 
19
- An agent network is built around a top-level routing agent that delegates tasks to agents, workflows, and tools defined in its configuration. Memory is configured on the routing agent using the `memory` option, and `instructions` define the agent's routing behavior.
19
+ An agent network is built around a top-level routing agent that delegates tasks to subagents, workflows, and tools defined in its configuration. Memory is configured on the routing agent using the `memory` option, and `instructions` define the agent's routing behavior.
20
20
 
21
21
  ```typescript
22
22
  import { Agent } from "@mastra/core/agent";
@@ -64,7 +64,7 @@ When configuring a Mastra agent network, each primitive (agent, workflow, or too
64
64
 
65
65
  #### Agent descriptions
66
66
 
67
- Each agent in a network should include a clear `description` that explains what the agent does.
67
+ Each subagent in a network should include a clear `description` that explains what the agent does.
68
68
 
69
69
  ```typescript
70
70
  export const researchAgent = new Agent({
@@ -119,6 +119,14 @@ export const mastra = new Mastra({
119
119
  });
120
120
  ```
121
121
 
122
+ ### Registering subagents
123
+
124
+ You can register subagents within an agent. They'll be executed as tools from the parent agent. Read the [using agents as tools](https://mastra.ai/docs/agents/using-tools) documentation to learn more.
125
+
126
+ ### Registering subworkflows
127
+
128
+ You can register subworkflows within an agent. They'll be executed as tools from the parent agent. Read the [using workflows as tools](https://mastra.ai/docs/agents/using-tools) documentation to learn more.
129
+
122
130
  ## Referencing an agent
123
131
 
124
132
  You can call agents from workflow steps, tools, the Mastra Client, or the command line. Get a reference by calling `.getAgent()` on your `mastra` or `mastraClient` instance, depending on your setup:
@@ -57,84 +57,49 @@ export const weatherAgent = new Agent({
57
57
  });
58
58
  ```
59
59
 
60
- ## Controlling `toolName` in stream responses
60
+ ## Using multiple tools
61
61
 
62
- The `toolName` in stream responses is determined by the **object key** you use, not the `id` property of the tool, agent, or workflow.
62
+ When multiple tools are available, the agent may choose to use one, several, or none, depending on what's needed to answer the query.
63
63
 
64
64
  ```typescript
65
- // Tool defined with id: "weather-tool"
66
- export const weatherTool = createTool({
67
- id: "weather-tool",
68
- // ...
69
- });
70
-
71
- // Using the variable name as the key
72
- tools: { weatherTool }
73
- // Stream returns: toolName: "weatherTool"
74
-
75
- // Using the tool's id as the key
76
- tools: { [weatherTool.id]: weatherTool }
77
- // Stream returns: toolName: "weather-tool"
65
+ import { weatherTool } from "../tools/weather-tool";
66
+ import { activitiesTool } from "../tools/activities-tool";
78
67
 
79
- // Using a custom key
80
- tools: { "my-custom-name": weatherTool }
81
- // Stream returns: toolName: "my-custom-name"
68
+ export const weatherAgent = new Agent({
69
+ id: "weather-agent",
70
+ name: "Weather Agent",
71
+ tools: { weatherTool, activitiesTool },
72
+ });
82
73
  ```
83
74
 
84
- This lets you specify how tools are identified in the stream. If you want the `toolName` to match the tool's `id`, use the tool's `id` as the object key.
85
-
86
- ### Sub-agents and workflows as tools
87
-
88
- Sub-agents and workflows follow the same pattern. They are converted to tools with a prefix followed by your object key:
75
+ ## Using agents as tools
89
76
 
90
- | Property | Prefix | Example key | `toolName` |
91
- | ----------- | ----------- | ----------- | ------------------- |
92
- | `agents` | `agent-` | `weather` | `agent-weather` |
93
- | `workflows` | `workflow-` | `research` | `workflow-research` |
77
+ Agents can be added to other agents through the `agents` configuration. When you add a subagent, Mastra automatically converts it to a tool that the parent agent can call. The generated tool is named `agent-<agentName>`.
94
78
 
95
79
  ```typescript
96
- const orchestrator = new Agent({
97
- // ...
80
+ import { Agent } from "@mastra/core/agent";
81
+
82
+ export const parentAgent = new Agent({
83
+ id: "parent-agent",
84
+ name: "Parent Agent",
85
+ description: "Take care in writing a good description here",
86
+ instructions: `Instructions`,
87
+ model: "openai/gpt-5.1",
98
88
  agents: {
99
- weather: weatherAgent, // toolName: "agent-weather"
100
- },
101
- workflows: {
102
- research: researchWorkflow, // toolName: "workflow-research"
89
+ subAgent,
103
90
  },
104
91
  });
105
- ```
106
-
107
- Note that for sub-agents, you'll see two different identifiers in stream responses:
108
92
 
109
- - `toolName: "agent-weather"` in tool call events — the generated tool wrapper name
110
- - `id: "weather-agent"` in `data-tool-agent` chunks — the sub-agent's actual `id` property
111
-
112
- ## Calling an agent
113
-
114
- The agent uses the tool's `inputSchema` to infer what data the tool expects. In this case, it extracts `London` as the `location` from the message and passes it to the tool's inputData parameter.
115
-
116
- ```typescript
117
- import { mastra } from "./mastra";
118
-
119
- const agent = mastra.getAgent("weatherAgent");
120
-
121
- const result = await agent.generate("What's the weather in London?");
93
+ const subAgent = new Agent({
94
+ id: "sub-agent",
95
+ name: "Sub Agent",
96
+ description: "Take care in writing a good description here",
97
+ instructions: `Instructions`,
98
+ model: "openai/gpt-5.1",
99
+ })
122
100
  ```
123
101
 
124
- ## Using multiple tools
125
-
126
- When multiple tools are available, the agent may choose to use one, several, or none, depending on what's needed to answer the query.
127
-
128
- ```typescript
129
- import { weatherTool } from "../tools/weather-tool";
130
- import { activitiesTool } from "../tools/activities-tool";
131
-
132
- export const weatherAgent = new Agent({
133
- id: "weather-agent",
134
- name: "Weather Agent",
135
- tools: { weatherTool, activitiesTool },
136
- });
137
- ```
102
+ The subagent should include a `description` to help the parent agent understand when to use it. See the [`toolName` docs](#subagents-and-workflows-as-tools) to learn more about the tool naming scheme.
138
103
 
139
104
  ## Using workflows as tools
140
105
 
@@ -169,16 +134,8 @@ import { z } from "zod";
169
134
  export const researchWorkflow = createWorkflow({
170
135
  id: "research-workflow",
171
136
  description: "Gathers information on a topic and compiles a summary report.",
172
- inputSchema: z.object({
173
- topic: z.string(),
174
- }),
175
- outputSchema: z.object({
176
- summary: z.string(),
177
- sources: z.array(z.string()),
178
- }),
137
+ // Rest of the workflow...
179
138
  })
180
- .then(gatherSourcesStep)
181
- .then(compileReportStep)
182
139
  .commit();
183
140
  ```
184
141
 
@@ -191,6 +148,59 @@ When the agent calls the workflow tool, it receives a response containing the wo
191
148
  }
192
149
  ```
193
150
 
151
+ See the [`toolName` docs](#subagents-and-workflows-as-tools) to learn more about the tool naming scheme.
152
+
153
+ ## Controlling `toolName` in stream responses
154
+
155
+ The `toolName` in stream responses is determined by the **object key** you use, not the `id` property of the tool, agent, or workflow.
156
+
157
+ ```typescript
158
+ // Tool defined with id: "weather-tool"
159
+ export const weatherTool = createTool({
160
+ id: "weather-tool",
161
+ // ...
162
+ });
163
+
164
+ // Using the variable name as the key
165
+ tools: { weatherTool }
166
+ // Stream returns: toolName: "weatherTool"
167
+
168
+ // Using the tool's id as the key
169
+ tools: { [weatherTool.id]: weatherTool }
170
+ // Stream returns: toolName: "weather-tool"
171
+
172
+ // Using a custom key
173
+ tools: { "my-custom-name": weatherTool }
174
+ // Stream returns: toolName: "my-custom-name"
175
+ ```
176
+
177
+ This lets you specify how tools are identified in the stream. If you want the `toolName` to match the tool's `id`, use the tool's `id` as the object key.
178
+
179
+ ### Subagents and workflows as tools
180
+
181
+ Subagents and workflows follow the same pattern. They are converted to tools with a prefix followed by your object key:
182
+
183
+ | Property | Prefix | Example key | `toolName` |
184
+ | ----------- | ----------- | ----------- | ------------------- |
185
+ | `agents` | `agent-` | `weather` | `agent-weather` |
186
+ | `workflows` | `workflow-` | `research` | `workflow-research` |
187
+
188
+ ```typescript
189
+ const orchestrator = new Agent({
190
+ agents: {
191
+ weather: weatherAgent, // toolName: "agent-weather"
192
+ },
193
+ workflows: {
194
+ research: researchWorkflow, // toolName: "workflow-research"
195
+ },
196
+ });
197
+ ```
198
+
199
+ Note that for subagents, you'll see two different identifiers in stream responses:
200
+
201
+ - `toolName: "agent-weather"` in tool call events — the generated tool wrapper name
202
+ - `id: "weather-agent"` in `data-tool-agent` chunks — the subagent's actual `id` property
203
+
194
204
  ## Tools with structured output
195
205
 
196
206
  When using tools with [structured output](https://mastra.ai/docs/agents/structured-output), some models don't support combining both features in the same API call. If your tools aren't being called when structured output is enabled, or you receive errors about incompatible options, see [Combining tools and structured output](https://mastra.ai/docs/agents/structured-output) for model compatibility information and workarounds.
@@ -1,6 +1,6 @@
1
1
  # Mastra Docs Server
2
2
 
3
- The `@mastra/mcp-docs-server` package provides direct access to Mastra’s full knowledge base, including documentation, code examples, blog posts, and changelogs, via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). It works with Cursor, Windsurf, Cline, Claude Code, VS Code, Codex or any tool that supports MCP.
3
+ The `@mastra/mcp-docs-server` package provides direct access to Mastra’s full documentation via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). It works with Cursor, Windsurf, Cline, Claude Code, VS Code, Codex or any tool that supports MCP.
4
4
 
5
5
  These tools are designed to help agents retrieve precise, task-specific information — whether you're adding a feature to an agent, scaffolding a new project, or exploring how something works.
6
6
 
@@ -219,7 +219,6 @@ Once configured, you can ask your AI tool questions about Mastra or instruct it
219
219
  **Ask about integrations:**
220
220
 
221
221
  - "Does Mastra work with the AI SDK? How can I use it in my `[React/Svelte/etc]` project?"
222
- - "What's the latest Mastra news around MCP?"
223
222
  - "Does Mastra support `[provider]` speech and voice APIs? Show me an example in my code of how I can use it."
224
223
 
225
224
  **Debug or update existing code:**
@@ -0,0 +1,35 @@
1
+ # Mastra Skills
2
+
3
+ Mastra Skills are folders of instructions, scripts, and resources that agents can discover and use to gain Mastra knowledge. They contain setup instructions, best practices, and methods to fetch up-to-date information from Mastra's documentation.
4
+
5
+ ## Installation
6
+
7
+ To install all available Mastra skills, run the following command:
8
+
9
+ **npm**:
10
+
11
+ ```bash
12
+ npx skills add mastra-ai/skills
13
+ ```
14
+
15
+ **pnpm**:
16
+
17
+ ```bash
18
+ pnpm dlx skills add mastra-ai/skills
19
+ ```
20
+
21
+ **Yarn**:
22
+
23
+ ```bash
24
+ yarn dlx skills add mastra-ai/skills
25
+ ```
26
+
27
+ **Bun**:
28
+
29
+ ```bash
30
+ bun x skills add mastra-ai/skills
31
+ ```
32
+
33
+ Mastra skills work with any coding agent that supports the [Skills standard](https://agentskills.io/), including Claude Code, Cursor, Codex, OpenCode, and others.
34
+
35
+ They are also available on [GitHub](https://github.com/mastra-ai/skills).
@@ -1,184 +1,3 @@
1
1
  # Contributing Templates
2
2
 
3
- The Mastra community plays a vital role in creating templates that showcase innovative application patterns. This guide explains how to contribute your own templates to the Mastra ecosystem.
4
-
5
- ## Template Contribution Process
6
-
7
- ### 1. Review Requirements
8
-
9
- Before creating a template, ensure you understand:
10
-
11
- - [Templates Reference](https://mastra.ai/reference/templates/overview) - Technical requirements and conventions
12
- - [Project Structure](https://mastra.ai/docs/getting-started/project-structure) - Standard Mastra project organization
13
- - Community guidelines and quality standards
14
-
15
- ### 2. Develop Your Template
16
-
17
- Create your template following the established patterns:
18
-
19
- - Focus on a specific use case or pattern
20
- - Include comprehensive documentation
21
- - Test thoroughly with fresh installations
22
- - Follow all technical requirements
23
- - Ensure the github repo is a template repo. [How to create a template repo](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository)
24
-
25
- ### 3. Submit for Review
26
-
27
- Once your template is ready, submit it through our contribution form. Templates undergo an approval process to ensure quality and consistency.
28
-
29
- ## Submission Guidelines
30
-
31
- ### Template Criteria
32
-
33
- We accept templates that:
34
-
35
- - **Demonstrate unique value** - Show innovative use cases or patterns not covered by existing templates
36
- - **Follow conventions** - Adhere to all technical requirements and structural guidelines
37
- - **Include quality documentation** - Provide clear setup instructions and usage examples
38
- - **Work reliably** - Function correctly with minimal setup after installation
39
-
40
- ### Quality Standards
41
-
42
- Templates must meet these quality benchmarks:
43
-
44
- - **Code quality** - Clean, well-commented, and maintainable code
45
- - **Error handling** - Proper error handling for external APIs and user inputs
46
- - **Type safety** - Full TypeScript typing with Zod validation where appropriate
47
- - **Documentation** - Comprehensive README with setup and usage instructions
48
- - **Testing** - Verified to work with fresh installations
49
-
50
- ## Submission Process
51
-
52
- ### 1. Prepare Your Template
53
-
54
- Ensure your template meets all requirements outlined in the [Templates Reference](https://mastra.ai/reference/templates/overview):
55
-
56
- - Proper project structure in `src/mastra/` directory
57
- - Standard TypeScript configuration
58
- - Comprehensive `.env.example` file
59
- - Detailed README with setup instructions
60
-
61
- ### 2. Submit Your Template
62
-
63
- Submit your template using our contribution form:
64
-
65
- **[Submit Template Contribution](https://forms.gle/g1CGuwFxqbrb3Rz57)**
66
-
67
- ### Required Information
68
-
69
- When submitting your template, provide:
70
-
71
- - **Template Name** - Clear, descriptive name indicating the use case
72
- - **Template Author Name** - Your name or organization name
73
- - **Template Author Email** - Contact email for communication about your submission
74
- - **GitHub URL** - Link to your template repository
75
- - **Description** - Detailed explanation of what the template does and its value
76
- - **Optional Image** - Screenshot or diagram showing the template in action
77
- - **Optional Demo Video** - Link to a video demonstrating the template's functionality
78
-
79
- ## Review Process
80
-
81
- ### Review Criteria
82
-
83
- Templates are evaluated on:
84
-
85
- - **Technical compliance** - Adherence to template rules and conventions
86
- - **Code quality** - Clean, maintainable, and well-documented code
87
- - **Uniqueness** - Novel use cases or innovative implementation patterns
88
- - **Educational value** - Ability to teach Mastra concepts effectively
89
- - **Community benefit** - Potential value to the broader Mastra community
90
-
91
- ### Feedback and Iteration
92
-
93
- If your template needs improvements:
94
-
95
- - You'll receive specific feedback on required changes
96
- - Make the requested modifications and resubmit
97
- - The review process continues until the template meets standards
98
-
99
- ## Community Guidelines
100
-
101
- ### Template Ideas
102
-
103
- Consider creating templates for:
104
-
105
- - **Industry-specific use cases** - Healthcare, finance, education, etc.
106
- - **Integration patterns** - Specific API or service integrations
107
- - **Advanced techniques** - Complex workflows, multi-agent systems, or novel patterns
108
- - **Learning resources** - Step-by-step tutorials for specific concepts
109
-
110
- ### Development Best Practices
111
-
112
- - **Start simple** - Begin with a minimal working example and add complexity gradually
113
- - **Document thoroughly** - Include detailed comments and comprehensive README
114
- - **Test extensively** - Verify your template works across different environments
115
- - **Seek feedback** - Share with the community for early feedback before submission
116
-
117
- ### Community Engagement
118
-
119
- - **Join Discord** - Participate in the [Mastra Discord community](https://discord.gg/BTYqqHKUrf)
120
- - **Share progress** - Update the community on your template development
121
- - **Help others** - Assist other contributors with their templates
122
- - **Stay updated** - Keep track of new Mastra features and conventions
123
-
124
- ## Template Maintenance
125
-
126
- ### Ongoing Responsibilities
127
-
128
- As a template contributor, you may be asked to:
129
-
130
- - **Update dependencies** - Keep templates current with latest Mastra versions
131
- - **Fix issues** - Address bugs or compatibility problems
132
- - **Improve documentation** - Enhance instructions based on user feedback
133
- - **Add features** - Extend templates with new capabilities
134
-
135
- ### Community Support
136
-
137
- The Mastra team and community provide:
138
-
139
- - **Technical guidance** - Help with complex implementation challenges
140
- - **Review feedback** - Detailed feedback to improve template quality
141
- - **Promotion** - Showcase approved templates to the community
142
- - **Maintenance assistance** - Support for keeping templates up-to-date
143
-
144
- ## Validation Checklist
145
-
146
- Before submitting a template, verify:
147
-
148
- - [ ] All code organized in `src/mastra/` directory
149
- - [ ] Uses standard Mastra TypeScript configuration
150
- - [ ] Includes comprehensive `.env.example`
151
- - [ ] Has detailed README with setup instructions
152
- - [ ] No monorepo or web framework boilerplate
153
- - [ ] Successfully runs after fresh install and environment setup
154
- - [ ] Follows all code quality standards
155
- - [ ] Demonstrates clear, valuable use case
156
-
157
- ## Community Showcase
158
-
159
- ### Template Gallery
160
-
161
- Approved templates will be featured in:
162
-
163
- - **mastra.ai/templates** - Community template gallery (coming soon)
164
- - **Documentation** - Referenced in relevant documentation sections
165
- - **Community highlights** - Featured in newsletters and community updates
166
-
167
- ### Recognition
168
-
169
- Template contributors receive:
170
-
171
- - **Attribution** - Your name and contact information with the template
172
- - **Community recognition** - Acknowledgment in community channels
173
-
174
- ## Getting Started
175
-
176
- Ready to contribute a template?
177
-
178
- 1. **Explore existing templates** - Review current templates for inspiration and patterns
179
- 2. **Plan your template** - Define the use case and value proposition
180
- 3. **Follow the requirements** - Ensure compliance with all technical requirements
181
- 4. **Build and test** - Create a working, well-documented template
182
- 5. **Submit for review** - Use the contribution form to submit your template
183
-
184
- > **Info:** Your contributions help grow the Mastra ecosystem and provide valuable resources for the entire community. We look forward to seeing your innovative templates!
3
+ The Mastra community plays a vital role in creating templates that showcase innovative application patterns. We're currently reworking our template contribution process to ensure high-quality, valuable templates for the community. For the time being, we're not accepting new template contributions. Please keep an eye on this page for updates on when contributions will reopen and the new submission process.
@@ -1,6 +1,8 @@
1
1
  # Discord Community
2
2
 
3
- The Discord server has over 1000 members and serves as the main discussion forum for Mastra. The Mastra team monitors Discord during North American and European business hours, with community members active across other time zones.[Join the Discord server](https://discord.gg/BTYqqHKUrf).
3
+ The Discord server has over 1000 members and serves as the main discussion forum for Mastra. The Mastra team monitors Discord during North American and European business hours, with community members active across other time zones.
4
+
5
+ [Join the Discord server](https://discord.gg/BTYqqHKUrf)
4
6
 
5
7
  ## Discord MCP Bot
6
8
 
@@ -11,5 +11,5 @@ The following guides show how to deploy Mastra to specific cloud providers:
11
11
  - [Azure App Services](https://mastra.ai/guides/deployment/azure-app-services)
12
12
  - [Cloudflare](https://mastra.ai/guides/deployment/cloudflare-deployer)
13
13
  - [Digital Ocean](https://mastra.ai/guides/deployment/digital-ocean)
14
- - [Netlify](https://mastra.ai/guides/deployment/netlify-deployer)
15
- - [Vercel](https://mastra.ai/guides/deployment/vercel-deployer)
14
+ - [Netlify](https://mastra.ai/guides/deployment/netlify)
15
+ - [Vercel](https://mastra.ai/guides/deployment/vercel)
@@ -36,8 +36,8 @@ Use this option for auto-scaling, minimal infrastructure management, or when you
36
36
  - [Azure App Services](https://mastra.ai/guides/deployment/azure-app-services)
37
37
  - [Cloudflare](https://mastra.ai/guides/deployment/cloudflare-deployer)
38
38
  - [Digital Ocean](https://mastra.ai/guides/deployment/digital-ocean)
39
- - [Netlify](https://mastra.ai/guides/deployment/netlify-deployer)
40
- - [Vercel](https://mastra.ai/guides/deployment/vercel-deployer)
39
+ - [Netlify](https://mastra.ai/guides/deployment/netlify)
40
+ - [Vercel](https://mastra.ai/guides/deployment/vercel)
41
41
 
42
42
  ### Web Framework
43
43
 
@@ -0,0 +1,68 @@
1
+ # Build with AI
2
+
3
+ AI agents may not have up-to-date knowledge about Mastra's APIs, patterns, and best practices. These resources give your AI tools direct access to current Mastra documentation, enabling them to generate accurate code and help you build faster.
4
+
5
+ ## Mastra Skills
6
+
7
+ Agent Skills are folders of instructions, scripts, and resources that agents can discover and use to do things more accurately and efficiently. [Mastra Skills](https://mastra.ai/docs/build-with-ai/skills) contain setup instructions, best practices, and instructions on how to fetch up-to-date information from Mastra's documentation.
8
+
9
+ **npm**:
10
+
11
+ ```bash
12
+ npx skills add mastra-ai/skills
13
+ ```
14
+
15
+ **pnpm**:
16
+
17
+ ```bash
18
+ pnpm dlx skills add mastra-ai/skills
19
+ ```
20
+
21
+ **Yarn**:
22
+
23
+ ```bash
24
+ yarn dlx skills add mastra-ai/skills
25
+ ```
26
+
27
+ **Bun**:
28
+
29
+ ```bash
30
+ bun x skills add mastra-ai/skills
31
+ ```
32
+
33
+ Read the dedicated [Mastra Skills](https://mastra.ai/docs/build-with-ai/skills) guide to learn more about installation options and available skills.
34
+
35
+ > **Tip:** If you're just interested in giving your agent access to Mastra's documentation, we recommend using **Skills**. While the MCP Docs Server also provides this information, Skills will perform better. Use the MCP Docs Server when you need its tools, e.g. the migration tool.
36
+
37
+ ## MCP Docs Server
38
+
39
+ In addition to documentation access, the [MCP Docs Server](https://mastra.ai/docs/build-with-ai/mcp-docs-server) also provides tools to help you migrate to newer versions of Mastra or follow the [Mastra 101 course](https://mastra.ai/course).
40
+
41
+ Learn how to use the [MCP Docs Server](https://mastra.ai/docs/build-with-ai/mcp-docs-server).
42
+
43
+ ## Embedded package docs
44
+
45
+ Mastra packages ship with embedded documentation in `dist/docs`. When you install a Mastra package, your AI agent can read these files directly from `node_modules` to understand the package's APIs and patterns.
46
+
47
+ Each `dist/docs` includes:
48
+
49
+ - `SKILL.md`: A skill file following the skills standard
50
+ - `references/`: A folder with documentation files relevant to the package
51
+ - `assets/SOURCE_MAP.json`: A source map file linking public exports to their location in `node_modules`
52
+
53
+ ## Context files
54
+
55
+ Mastra provides a root [`llms.txt`](https://mastra.ai/llms.txt) file that contains an overview of all available documentation pages.
56
+
57
+ Each documentation page also has its own `llms.txt` file. These files are streamlined markdown files. At the end of each docs page you'll find a link to the corresponding `llms.txt` file.
58
+
59
+ Add `/llms.txt` to any Mastra docs URL to access it. You can also request it by adding a `.md` extension to the end of the URL.
60
+
61
+ Examples for the [introduction page](https://mastra.ai/docs):
62
+
63
+ - [`/docs/llms.txt`](https://mastra.ai/docs/llms.txt)
64
+ - [`/docs.md`](https://mastra.ai/docs.md)
65
+
66
+ ## Mastra's documentation
67
+
68
+ In addition to the [context files](#context-files) each documentation page also features a "Copy markdown" button at the top of the page. It'll copy the streamlined markdown version to your clipboard. Beside it, you'll find a dropdown menu to open the page on GitHub, in ChatGPT, Claude, and others.
@@ -19,6 +19,7 @@ Add Mastra to an existing project, or scaffold a new Mastra-powered app if you
19
19
  - [Nuxt](https://mastra.ai/guides/getting-started/nuxt)
20
20
  - [Express](https://mastra.ai/guides/getting-started/express)
21
21
  - [Hono](https://mastra.ai/guides/getting-started/hono)
22
+ - [Electron](https://mastra.ai/guides/getting-started/electron)
22
23
 
23
24
  Mastra works great with agentic UI frameworks like [AI SDK UI](https://mastra.ai/guides/build-your-ui/ai-sdk-ui), [CopilotKit](https://mastra.ai/guides/build-your-ui/copilotkit), and [Assistant UI](https://mastra.ai/guides/build-your-ui/assistant-ui). Use them with any of the frontend frameworks above to stream agent responses, render tools, and build chat interfaces.
24
25