@mastra/mcp-docs-server 0.13.27 → 0.13.28-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.
- package/.docs/organized/changelogs/%40internal%2Fplayground.md +3 -1
- package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +10 -10
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +4 -0
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +20 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +97 -97
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +44 -44
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +75 -75
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flance.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +105 -105
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Frag.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Freact.md +40 -0
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +21 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +41 -41
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +13 -13
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +11 -11
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +10 -10
- package/.docs/organized/changelogs/create-mastra.md +79 -79
- package/.docs/organized/changelogs/mastra.md +118 -118
- package/.docs/organized/code-examples/agent.md +2 -1
- package/.docs/organized/code-examples/heads-up-game.md +5 -5
- package/.docs/raw/agents/guardrails.mdx +335 -0
- package/.docs/raw/{networks-vnext/complex-task-execution.mdx → agents/networks.mdx} +29 -9
- package/.docs/raw/agents/overview.mdx +107 -63
- package/.docs/raw/agents/runtime-context.mdx +11 -16
- package/.docs/raw/agents/using-tools-and-mcp.mdx +1 -1
- package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +9 -2
- package/.docs/raw/getting-started/mcp-docs-server.mdx +84 -179
- package/.docs/raw/getting-started/model-providers.mdx +5 -3
- package/.docs/raw/reference/agents/network.mdx +1 -1
- package/.docs/raw/reference/cli/create-mastra.mdx +61 -5
- package/.docs/raw/reference/cli/mastra.mdx +252 -0
- package/.docs/raw/reference/client-js/agents.mdx +1 -10
- package/.docs/raw/reference/processors/batch-parts-processor.mdx +111 -0
- package/.docs/raw/reference/processors/language-detector.mdx +154 -0
- package/.docs/raw/reference/processors/moderation-processor.mdx +145 -0
- package/.docs/raw/reference/processors/pii-detector.mdx +153 -0
- package/.docs/raw/reference/processors/prompt-injection-detector.mdx +130 -0
- package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +145 -0
- package/.docs/raw/reference/processors/token-limiter-processor.mdx +136 -0
- package/.docs/raw/reference/processors/unicode-normalizer.mdx +114 -0
- package/.docs/raw/reference/streaming/ChunkType.mdx +2 -6
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +1 -5
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +1 -1
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +1 -1
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +17 -1
- package/.docs/raw/reference/workflows/run-methods/start.mdx +17 -1
- package/.docs/raw/reference/workflows/step.mdx +11 -0
- package/.docs/raw/reference/workflows/workflow.mdx +7 -1
- package/.docs/raw/server-db/local-dev-playground.mdx +1 -1
- package/.docs/raw/workflows/overview.mdx +22 -5
- package/CHANGELOG.md +24 -0
- package/package.json +5 -5
- package/.docs/raw/agents/input-processors.mdx +0 -284
- package/.docs/raw/agents/output-processors.mdx +0 -328
- package/.docs/raw/networks-vnext/overview.mdx +0 -85
- package/.docs/raw/networks-vnext/single-task-execution.mdx +0 -135
- package/.docs/raw/reference/cli/build.mdx +0 -115
- package/.docs/raw/reference/cli/dev.mdx +0 -249
- package/.docs/raw/reference/cli/init.mdx +0 -97
- package/.docs/raw/reference/cli/lint.mdx +0 -56
- package/.docs/raw/reference/cli/mcp-docs-server.mdx +0 -82
- package/.docs/raw/reference/cli/scorers.mdx +0 -160
- package/.docs/raw/reference/cli/start.mdx +0 -50
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "mastra dev | Development Server | Mastra CLI"
|
|
3
|
-
description: Documentation for the mastra dev command, which starts a development server for agents, tools, and workflows.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# mastra dev
|
|
7
|
-
|
|
8
|
-
The `mastra dev` command starts a development server that exposes REST endpoints for your agents, tools, and workflows.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
mastra dev [options]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Options
|
|
17
|
-
|
|
18
|
-
<PropertiesTable
|
|
19
|
-
content={[
|
|
20
|
-
{
|
|
21
|
-
name: "--dir",
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Path to your mastra folder",
|
|
24
|
-
isOptional: true,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "--root",
|
|
28
|
-
type: "string",
|
|
29
|
-
description: "Path to your root folder",
|
|
30
|
-
isOptional: true,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "--tools",
|
|
34
|
-
type: "string",
|
|
35
|
-
description: "Comma-separated list of paths to tool files to include",
|
|
36
|
-
isOptional: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: "--port",
|
|
40
|
-
type: "number",
|
|
41
|
-
description:
|
|
42
|
-
"deprecated: Port number for the development server (defaults to 4111)",
|
|
43
|
-
isOptional: true,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: "--env",
|
|
47
|
-
type: "string",
|
|
48
|
-
description: "Path to custom environment file",
|
|
49
|
-
isOptional: true,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: "--inspect",
|
|
53
|
-
type: "boolean",
|
|
54
|
-
description: "Start the dev server in inspect mode for debugging (cannot be used with --inspect-brk)",
|
|
55
|
-
isOptional: true,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "--inspect-brk",
|
|
59
|
-
type: "boolean",
|
|
60
|
-
description: "Start the dev server in inspect mode and break at the beginning of the script (cannot be used with --inspect)",
|
|
61
|
-
isOptional: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "--custom-args",
|
|
65
|
-
type: "string",
|
|
66
|
-
description: "Comma-separated list of custom arguments to pass to the dev server. IE: --experimental-transform-types",
|
|
67
|
-
isOptional: true,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: "--help",
|
|
71
|
-
type: "boolean",
|
|
72
|
-
description: "display help for command",
|
|
73
|
-
isOptional: true,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: "--https",
|
|
77
|
-
type: "boolean",
|
|
78
|
-
description: "Enable local HTTPS",
|
|
79
|
-
isOptional: true,
|
|
80
|
-
},
|
|
81
|
-
]}
|
|
82
|
-
/>
|
|
83
|
-
|
|
84
|
-
## Routes
|
|
85
|
-
|
|
86
|
-
Starting the server with `mastra dev` exposes a set of REST routes by default:
|
|
87
|
-
|
|
88
|
-
### System Routes
|
|
89
|
-
|
|
90
|
-
- **GET `/api`**: Get API status.
|
|
91
|
-
|
|
92
|
-
### Agent Routes
|
|
93
|
-
|
|
94
|
-
Agents are expected to be exported from `src/mastra/agents`.
|
|
95
|
-
|
|
96
|
-
- **GET `/api/agents`**: Lists the registered agents found in your Mastra folder.
|
|
97
|
-
- **GET `/api/agents/:agentId`**: Get agent by ID.
|
|
98
|
-
- **GET `/api/agents/:agentId/evals/ci`**: Get CI evals by agent ID.
|
|
99
|
-
- **GET `/api/agents/:agentId/evals/live`**: Get live evals by agent ID.
|
|
100
|
-
- **POST `/api/agents/:agentId/generate`**: Sends a text-based prompt to the specified agent, returning the agent's response.
|
|
101
|
-
- **POST `/api/agents/:agentId/stream`**: Stream a response from an agent.
|
|
102
|
-
- **POST `/api/agents/:agentId/instructions`**: Update an agent's instructions.
|
|
103
|
-
- **POST `/api/agents/:agentId/instructions/enhance`**: Generate an improved system prompt from instructions.
|
|
104
|
-
- **GET `/api/agents/:agentId/speakers`**: Get available speakers for an agent.
|
|
105
|
-
- **POST `/api/agents/:agentId/speak`**: Convert text to speech using the agent's voice provider.
|
|
106
|
-
- **POST `/api/agents/:agentId/listen`**: Convert speech to text using the agent's voice provider.
|
|
107
|
-
- **POST `/api/agents/:agentId/tools/:toolId/execute`**: Execute a tool through an agent.
|
|
108
|
-
|
|
109
|
-
### Tool Routes
|
|
110
|
-
|
|
111
|
-
Tools are expected to be exported from `src/mastra/tools` (or the configured tools directory).
|
|
112
|
-
|
|
113
|
-
- **GET `/api/tools`**: Get all tools.
|
|
114
|
-
- **GET `/api/tools/:toolId`**: Get tool by ID.
|
|
115
|
-
- **POST `/api/tools/:toolId/execute`**: Invokes a specific tool by name, passing input data in the request body.
|
|
116
|
-
|
|
117
|
-
### Workflow Routes
|
|
118
|
-
|
|
119
|
-
Workflows are expected to be exported from `src/mastra/workflows` (or the configured workflows directory).
|
|
120
|
-
|
|
121
|
-
- **GET `/api/workflows`**: Get all workflows.
|
|
122
|
-
- **GET `/api/workflows/:workflowId`**: Get workflow by ID.
|
|
123
|
-
- **POST `/api/workflows/:workflowName/start`**: Starts the specified workflow.
|
|
124
|
-
- **POST `/api/workflows/:workflowName/:instanceId/event`**: Sends an event or trigger signal to an existing workflow instance.
|
|
125
|
-
- **GET `/api/workflows/:workflowName/:instanceId/status`**: Returns status info for a running workflow instance.
|
|
126
|
-
- **POST `/api/workflows/:workflowId/resume`**: Resume a suspended workflow step.
|
|
127
|
-
- **POST `/api/workflows/:workflowId/resume-async`**: Resume a suspended workflow step asynchronously.
|
|
128
|
-
- **POST `/api/workflows/:workflowId/createRun`**: Create a new workflow run.
|
|
129
|
-
- **POST `/api/workflows/:workflowId/start-async`**: Execute/Start a workflow asynchronously.
|
|
130
|
-
- **GET `/api/workflows/:workflowId/watch`**: Watch workflow transitions in real-time.
|
|
131
|
-
|
|
132
|
-
### Memory Routes
|
|
133
|
-
|
|
134
|
-
- **GET `/api/memory/status`**: Get memory status.
|
|
135
|
-
- **GET `/api/memory/threads`**: Get all threads.
|
|
136
|
-
- **GET `/api/memory/threads/:threadId`**: Get thread by ID.
|
|
137
|
-
- **GET `/api/memory/threads/:threadId/messages`**: Get messages for a thread.
|
|
138
|
-
- **GET `/api/memory/threads/:threadId/messages/paginated`**: Get paginated messages for a thread.
|
|
139
|
-
- **POST `/api/memory/threads`**: Create a new thread.
|
|
140
|
-
- **PATCH `/api/memory/threads/:threadId`**: Update a thread.
|
|
141
|
-
- **DELETE `/api/memory/threads/:threadId`**: Delete a thread.
|
|
142
|
-
- **POST `/api/memory/save-messages`**: Save messages.
|
|
143
|
-
|
|
144
|
-
### Telemetry Routes
|
|
145
|
-
|
|
146
|
-
- **GET `/api/telemetry`**: Get all traces.
|
|
147
|
-
|
|
148
|
-
### Log Routes
|
|
149
|
-
|
|
150
|
-
- **GET `/api/logs`**: Get all logs.
|
|
151
|
-
- **GET `/api/logs/transports`**: List of all log transports.
|
|
152
|
-
- **GET `/api/logs/:runId`**: Get logs by run ID.
|
|
153
|
-
|
|
154
|
-
### Vector Routes
|
|
155
|
-
|
|
156
|
-
- **POST `/api/vector/:vectorName/upsert`**: Upsert vectors into an index.
|
|
157
|
-
- **POST `/api/vector/:vectorName/create-index`**: Create a new vector index.
|
|
158
|
-
- **POST `/api/vector/:vectorName/query`**: Query vectors from an index.
|
|
159
|
-
- **GET `/api/vector/:vectorName/indexes`**: List all indexes for a vector store.
|
|
160
|
-
- **GET `/api/vector/:vectorName/indexes/:indexName`**: Get details about a specific index.
|
|
161
|
-
- **DELETE `/api/vector/:vectorName/indexes/:indexName`**: Delete a specific index.
|
|
162
|
-
|
|
163
|
-
### OpenAPI Specification
|
|
164
|
-
|
|
165
|
-
- **GET `/openapi.json`**: Returns an auto-generated OpenAPI specification for your project's routes.
|
|
166
|
-
- **GET `/swagger-ui`**: Access Swagger UI for API documentation.
|
|
167
|
-
|
|
168
|
-
## Additional Notes
|
|
169
|
-
|
|
170
|
-
The port defaults to `4111`. The port, hostname, and HTTPS settings can also be configured via the Mastra server configuration. See [Launch Development Server](/docs/server-db/local-dev-playground) for configuration details.
|
|
171
|
-
|
|
172
|
-
Make sure you have your environment variables set up in your `.env.development` or `.env` file for any providers you use (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, etc.).
|
|
173
|
-
|
|
174
|
-
Make sure the `index.ts` file in your Mastra folder exports the Mastra instance for the dev server to read.
|
|
175
|
-
|
|
176
|
-
### Example request
|
|
177
|
-
|
|
178
|
-
To test an agent after running `mastra dev`:
|
|
179
|
-
|
|
180
|
-
```bash copy
|
|
181
|
-
curl -X POST http://localhost:4111/api/agents/myAgent/generate \
|
|
182
|
-
-H "Content-Type: application/json" \
|
|
183
|
-
-d '{
|
|
184
|
-
"messages": [
|
|
185
|
-
{ "role": "user", "content": "Hello, how can you assist me today?" }
|
|
186
|
-
]
|
|
187
|
-
}'
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## Advanced usage
|
|
191
|
-
|
|
192
|
-
The `mastra dev` server obeys a few extra environment variables that can
|
|
193
|
-
be handy during development:
|
|
194
|
-
|
|
195
|
-
### Disable build caching
|
|
196
|
-
|
|
197
|
-
Set `MASTRA_DEV_NO_CACHE=1` to force a full rebuild rather than using
|
|
198
|
-
the cached assets under `.mastra/`:
|
|
199
|
-
|
|
200
|
-
```bash copy
|
|
201
|
-
MASTRA_DEV_NO_CACHE=1 mastra dev
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
This helps when you are debugging bundler plugins or suspect stale
|
|
205
|
-
output.
|
|
206
|
-
|
|
207
|
-
### Limit parallelism
|
|
208
|
-
|
|
209
|
-
`MASTRA_CONCURRENCY` caps how many expensive operations run in parallel
|
|
210
|
-
(primarily build and evaluation steps). For example:
|
|
211
|
-
|
|
212
|
-
```bash copy
|
|
213
|
-
MASTRA_CONCURRENCY=4 mastra dev
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
Leave it unset to let the CLI pick a sensible default for the machine.
|
|
217
|
-
|
|
218
|
-
### Custom provider endpoints
|
|
219
|
-
|
|
220
|
-
When using providers supported by the Vercel AI SDK you can redirect
|
|
221
|
-
requests through proxies or internal gateways by setting a base URL. For
|
|
222
|
-
OpenAI:
|
|
223
|
-
|
|
224
|
-
```bash copy
|
|
225
|
-
OPENAI_API_KEY=<your-api-key> \
|
|
226
|
-
OPENAI_BASE_URL=https://openrouter.example/v1 \
|
|
227
|
-
mastra dev
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
and for Anthropic:
|
|
231
|
-
|
|
232
|
-
```bash copy
|
|
233
|
-
OPENAI_API_KEY=<your-api-key> \
|
|
234
|
-
ANTHROPIC_BASE_URL=https://anthropic.internal \
|
|
235
|
-
mastra dev
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
These are forwarded by the AI SDK and work with any `openai()` or
|
|
239
|
-
`anthropic()` calls.
|
|
240
|
-
|
|
241
|
-
### Disable telemetry
|
|
242
|
-
|
|
243
|
-
To opt out of anonymous CLI analytics set
|
|
244
|
-
`MASTRA_TELEMETRY_DISABLED=1`. This also prevents tracking within the
|
|
245
|
-
local playground.
|
|
246
|
-
|
|
247
|
-
```bash copy
|
|
248
|
-
MASTRA_TELEMETRY_DISABLED=1 mastra dev
|
|
249
|
-
```
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "mastra init | Initialize Project | Mastra CLI"
|
|
3
|
-
description: Documentation for the mastra init command, which creates a new Mastra project with interactive setup options.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# mastra init
|
|
7
|
-
|
|
8
|
-
The `mastra init` command **initializes** Mastra in an existing project. Use this command to scaffold the necessary folders and configuration without generating a new project.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
mastra init [options]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Options
|
|
17
|
-
|
|
18
|
-
<PropertiesTable
|
|
19
|
-
content={[
|
|
20
|
-
{
|
|
21
|
-
name: "--default",
|
|
22
|
-
type: "boolean",
|
|
23
|
-
description: "Quick start with defaults (src, OpenAI, no examples)",
|
|
24
|
-
isOptional: true,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "--dir",
|
|
28
|
-
type: "string",
|
|
29
|
-
description: "Directory for Mastra files (defaults to src/)",
|
|
30
|
-
isOptional: false,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "--components",
|
|
34
|
-
type: "string",
|
|
35
|
-
description:
|
|
36
|
-
"Comma-separated list of components (agents, tools, workflows)",
|
|
37
|
-
isOptional: false,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "--llm",
|
|
41
|
-
type: "string",
|
|
42
|
-
description:
|
|
43
|
-
"Default model provider (openai, anthropic, groq, google or cerebras)",
|
|
44
|
-
isOptional: false,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "--llm-api-key",
|
|
48
|
-
type: "string",
|
|
49
|
-
description: "API key for the model provider",
|
|
50
|
-
isOptional: false,
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "--example",
|
|
54
|
-
type: "boolean",
|
|
55
|
-
description: "Include example code",
|
|
56
|
-
isOptional: true,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: "--no-example",
|
|
60
|
-
type: "boolean",
|
|
61
|
-
description: "Do not include example code",
|
|
62
|
-
isOptional: true,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: "--mcp",
|
|
66
|
-
type: "string",
|
|
67
|
-
description:
|
|
68
|
-
"MCP Server for code editor (cursor, cursor-global, windsurf, vscode)",
|
|
69
|
-
isOptional: false,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "--help",
|
|
73
|
-
type: "boolean",
|
|
74
|
-
description: "Display help for command",
|
|
75
|
-
isOptional: true,
|
|
76
|
-
},
|
|
77
|
-
]}
|
|
78
|
-
/>
|
|
79
|
-
|
|
80
|
-
## Advanced usage
|
|
81
|
-
|
|
82
|
-
### Disable analytics
|
|
83
|
-
|
|
84
|
-
If you prefer not to send anonymous usage data then set the
|
|
85
|
-
`MASTRA_TELEMETRY_DISABLED=1` environment variable when running the
|
|
86
|
-
command:
|
|
87
|
-
|
|
88
|
-
```bash copy
|
|
89
|
-
MASTRA_TELEMETRY_DISABLED=1 mastra init
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Custom provider endpoints
|
|
93
|
-
|
|
94
|
-
Initialized projects respect the `OPENAI_BASE_URL` and
|
|
95
|
-
`ANTHROPIC_BASE_URL` variables if present. This lets you route provider
|
|
96
|
-
traffic through proxies or private gateways when starting the dev server
|
|
97
|
-
later on.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "mastra lint | Validate Project | Mastra CLI"
|
|
3
|
-
description: "Lint your Mastra project"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# mastra lint
|
|
7
|
-
|
|
8
|
-
The `mastra lint` command validates the structure and code of your Mastra project to ensure it follows best practices and is error-free.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
mastra lint [options]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Options
|
|
17
|
-
|
|
18
|
-
<PropertiesTable
|
|
19
|
-
content={[
|
|
20
|
-
{
|
|
21
|
-
name: "--dir",
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Path to your Mastra folder",
|
|
24
|
-
isOptional: true,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: "--root",
|
|
28
|
-
type: "string",
|
|
29
|
-
description: "Path to your root folder",
|
|
30
|
-
isOptional: true,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "--tools",
|
|
34
|
-
type: "string",
|
|
35
|
-
description: "Comma-separated list of paths to tool files to include",
|
|
36
|
-
isOptional: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: "--help",
|
|
40
|
-
type: "boolean",
|
|
41
|
-
description: "display help for command",
|
|
42
|
-
isOptional: true,
|
|
43
|
-
},
|
|
44
|
-
]}
|
|
45
|
-
/>
|
|
46
|
-
|
|
47
|
-
## Advanced usage
|
|
48
|
-
|
|
49
|
-
### Disable telemetry
|
|
50
|
-
|
|
51
|
-
To disable CLI analytics while running linting (and other commands) set
|
|
52
|
-
`MASTRA_TELEMETRY_DISABLED=1`:
|
|
53
|
-
|
|
54
|
-
```bash copy
|
|
55
|
-
MASTRA_TELEMETRY_DISABLED=1 mastra lint
|
|
56
|
-
```
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "@mastra/mcp-docs-server"
|
|
3
|
-
description: "Serve Mastra docs, examples and blog posts over MCP"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
The `@mastra/mcp-docs-server` package runs a small [Model Context
|
|
7
|
-
Protocol](https://github.com/modelcontextprotocol/mcp) server that makes
|
|
8
|
-
Mastra documentation, code examples, blog posts and changelogs
|
|
9
|
-
queryable by an LLM agent. It can be invoked manually from the command
|
|
10
|
-
line or configured inside an MCP-aware IDE such as Cursor or Windsurf.
|
|
11
|
-
|
|
12
|
-
## Running from the CLI
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npx -y @mastra/mcp-docs-server
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
The command above runs a stdio based MCP server. The process will keep
|
|
19
|
-
reading requests from `stdin` and returning responses on `stdout`. This
|
|
20
|
-
is the same command that IDE integrations use. When run manually it can
|
|
21
|
-
be pointed at the `@wong2/mcp-cli` package for exploration.
|
|
22
|
-
|
|
23
|
-
### Examples
|
|
24
|
-
|
|
25
|
-
Rebuild the docs before serving (useful if you've modified docs locally):
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
REBUILD_DOCS_ON_START=true npx -y @mastra/mcp-docs-server
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Enable verbose logging while experimenting:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
DEBUG=1 npx -y @mastra/mcp-docs-server
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Serve blog posts from a custom domain:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
BLOG_URL=https://my-blog.example npx -y @mastra/mcp-docs-server
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Environment variables
|
|
44
|
-
|
|
45
|
-
`@mastra/mcp-docs-server` honours a few environment variables that tweak
|
|
46
|
-
its behaviour:
|
|
47
|
-
|
|
48
|
-
- **`REBUILD_DOCS_ON_START`** - when set to `true` the server rebuilds
|
|
49
|
-
the `.docs` directory before binding to stdio. This can be helpful
|
|
50
|
-
after editing or adding documentation locally.
|
|
51
|
-
- **`PREPARE`** - the docs build step (`pnpm mcp-docs-server
|
|
52
|
-
prepare-docs`) looks for `PREPARE=true` to copy Markdown sources from
|
|
53
|
-
the repository into `.docs`.
|
|
54
|
-
- **`BLOG_URL`** - base URL used for fetching blog posts.
|
|
55
|
-
Defaults to `https://mastra.ai`.
|
|
56
|
-
- **`DEBUG`** or **`NODE_ENV=development`** - increase logging written
|
|
57
|
-
to `stderr`.
|
|
58
|
-
|
|
59
|
-
No other variables are required for a basic run; the server ships with a
|
|
60
|
-
pre-built docs directory.
|
|
61
|
-
|
|
62
|
-
## Rebuilding with custom docs
|
|
63
|
-
|
|
64
|
-
The package includes a precompiled copy of the documentation. If you
|
|
65
|
-
want to experiment with additional content you can rebuild the
|
|
66
|
-
`.docs` directory locally:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
pnpm mcp-docs-server prepare-docs
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The script will copy documentation from
|
|
73
|
-
`mastra/docs/src/content/en/docs` and
|
|
74
|
-
`mastra/docs/src/content/en/reference` into the package. Once rebuilt,
|
|
75
|
-
start the server with `REBUILD_DOCS_ON_START=true` so the fresh content
|
|
76
|
-
is served.
|
|
77
|
-
|
|
78
|
-
A rebuild is only necessary if you need to serve customised docs. For
|
|
79
|
-
regular use you can rely on the published package contents.
|
|
80
|
-
|
|
81
|
-
For IDE configuration details see the
|
|
82
|
-
[Getting started guide](/docs/getting-started/mcp-docs-server).
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "mastra scorers | Evaluation Management | Mastra CLI"
|
|
3
|
-
description: "Manage scorers for evaluating AI outputs with the Mastra CLI"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# mastra scorers
|
|
7
|
-
|
|
8
|
-
The `mastra scorers` command provides management capabilities for evaluation scorers that measure the quality, accuracy, and performance of AI-generated outputs.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
mastra scorers <command> [options]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Commands
|
|
17
|
-
|
|
18
|
-
### mastra scorers add
|
|
19
|
-
|
|
20
|
-
Add a new scorer template to your project.
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
mastra scorers add [scorer-name] [options]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
#### Options
|
|
27
|
-
|
|
28
|
-
<PropertiesTable
|
|
29
|
-
content={[
|
|
30
|
-
{
|
|
31
|
-
name: "--dir",
|
|
32
|
-
type: "string",
|
|
33
|
-
description: "Path to your Mastra directory (default: auto-detect)",
|
|
34
|
-
isOptional: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "--help",
|
|
38
|
-
type: "boolean",
|
|
39
|
-
description: "Display help for command",
|
|
40
|
-
isOptional: true,
|
|
41
|
-
},
|
|
42
|
-
]}
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
|
-
#### Examples
|
|
46
|
-
|
|
47
|
-
Add a specific scorer by name:
|
|
48
|
-
|
|
49
|
-
```bash copy
|
|
50
|
-
mastra scorers add answer-relevancy
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Interactive scorer selection (when no name provided):
|
|
54
|
-
|
|
55
|
-
```bash copy
|
|
56
|
-
mastra scorers add
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Add scorer to custom directory:
|
|
60
|
-
|
|
61
|
-
```bash copy
|
|
62
|
-
mastra scorers add toxicity-detection --dir ./custom/scorers
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### mastra scorers list
|
|
66
|
-
|
|
67
|
-
List all available scorer templates.
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
mastra scorers list
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
This command displays built-in scorer templates organized by category:
|
|
74
|
-
|
|
75
|
-
- **Accuracy and Reliability**: answer-relevancy, bias-detection, faithfulness, hallucination, toxicity-detection
|
|
76
|
-
- **Output Quality**: completeness, content-similarity, keyword-coverage, textual-difference, tone-consistency
|
|
77
|
-
|
|
78
|
-
## Available Scorers
|
|
79
|
-
|
|
80
|
-
When running `mastra scorers add` without specifying a scorer name, you can select from these built-in templates:
|
|
81
|
-
|
|
82
|
-
### Accuracy and Reliability
|
|
83
|
-
|
|
84
|
-
- **answer-relevancy**: Evaluates how relevant an AI response is to the input question
|
|
85
|
-
- **bias-detection**: Identifies potential biases in AI-generated content
|
|
86
|
-
- **faithfulness**: Measures how faithful the response is to provided context
|
|
87
|
-
- **hallucination**: Detects when AI generates information not grounded in the input
|
|
88
|
-
- **toxicity-detection**: Identifies harmful or inappropriate content
|
|
89
|
-
|
|
90
|
-
### Output Quality
|
|
91
|
-
|
|
92
|
-
- **completeness**: Assesses whether the response fully addresses the input
|
|
93
|
-
- **content-similarity**: Measures semantic similarity between expected and actual outputs
|
|
94
|
-
- **keyword-coverage**: Evaluates coverage of expected keywords or topics
|
|
95
|
-
- **textual-difference**: Measures textual differences between responses
|
|
96
|
-
- **tone-consistency**: Evaluates consistency of tone and style
|
|
97
|
-
|
|
98
|
-
## What It Does
|
|
99
|
-
|
|
100
|
-
1. **Dependency Management**: Automatically installs `@mastra/evals` package if needed
|
|
101
|
-
2. **Template Selection**: Provides interactive selection when no scorer specified
|
|
102
|
-
3. **File Generation**: Creates scorer files from built-in templates
|
|
103
|
-
4. **Directory Structure**: Places scorers in `src/mastra/scorers/` or custom directory
|
|
104
|
-
5. **Duplicate Detection**: Prevents overwriting existing scorer files
|
|
105
|
-
|
|
106
|
-
## Integration
|
|
107
|
-
|
|
108
|
-
After adding scorers, integrate them with your agents or workflows:
|
|
109
|
-
|
|
110
|
-
### With Agents
|
|
111
|
-
|
|
112
|
-
```typescript filename="src/mastra/agents/evaluated-agent.ts"
|
|
113
|
-
import { Agent } from "@mastra/core/agent";
|
|
114
|
-
import { openai } from "@ai-sdk/openai";
|
|
115
|
-
import { createAnswerRelevancyScorer } from "../scorers/answer-relevancy-scorer";
|
|
116
|
-
|
|
117
|
-
export const evaluatedAgent = new Agent({
|
|
118
|
-
// ... other config
|
|
119
|
-
scorers: {
|
|
120
|
-
relevancy: {
|
|
121
|
-
scorer: createAnswerRelevancyScorer({ model: openai("gpt-4o-mini") }),
|
|
122
|
-
sampling: { type: "ratio", rate: 0.5 }
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### With Workflow Steps
|
|
129
|
-
|
|
130
|
-
```typescript filename="src/mastra/workflows/content-generation.ts"
|
|
131
|
-
import { createWorkflow, createStep } from "@mastra/core/workflows";
|
|
132
|
-
import { customStepScorer } from "../scorers/custom-step-scorer";
|
|
133
|
-
|
|
134
|
-
const contentStep = createStep({
|
|
135
|
-
// ... other config
|
|
136
|
-
scorers: {
|
|
137
|
-
customStepScorer: {
|
|
138
|
-
scorer: customStepScorer(),
|
|
139
|
-
sampling: { type: "ratio", rate: 1 }
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Testing Scorers
|
|
146
|
-
|
|
147
|
-
Use the [Local Dev Playground](/docs/server-db/local-dev-playground) to test your scorers:
|
|
148
|
-
|
|
149
|
-
```bash copy
|
|
150
|
-
mastra dev
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Navigate to [http://localhost:4111/](http://localhost:4111/) and access the scorers section to run individual scorers against test inputs and view detailed results.
|
|
154
|
-
|
|
155
|
-
## Next Steps
|
|
156
|
-
|
|
157
|
-
- Learn about scorer implementation in [Creating Custom Scorers](/docs/scorers/custom-scorers)
|
|
158
|
-
- Explore built-in options in [Off-the-shelf Scorers](/docs/scorers/off-the-shelf-scorers)
|
|
159
|
-
- See [Scorers Overview](/docs/scorers/overview) for evaluation pipeline details
|
|
160
|
-
- Test scorers with the [Local Dev Playground](/docs/server-db/local-dev-playground)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'mastra start'
|
|
3
|
-
description: 'Start your built Mastra application'
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# mastra start
|
|
7
|
-
|
|
8
|
-
Start your built Mastra application. This command is used to run your built Mastra application in production mode.
|
|
9
|
-
Telemetry is enabled by default.
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
After building your project with `mastra build` run:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
mastra start [options]
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Options
|
|
19
|
-
|
|
20
|
-
| Option | Description |
|
|
21
|
-
|--------|-------------|
|
|
22
|
-
| `-d, --dir <path>` | Path to your built Mastra output directory (default: .mastra/output) |
|
|
23
|
-
| `-e, --env <env>` | Custom env file to include in the start (default: .env.production, .env) |
|
|
24
|
-
| `-nt, --no-telemetry` | Disable telemetry on start |
|
|
25
|
-
|
|
26
|
-
## Examples
|
|
27
|
-
|
|
28
|
-
Start the application with default settings:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
mastra start
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Start from a custom output directory:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
mastra start --dir ./my-output
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Start with a custom environment file:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
mastra start --env .env.staging
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Start with telemetry disabled:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
mastra start -nt
|
|
50
|
-
```
|