@mastra/mcp-docs-server 1.1.5 → 1.1.6
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/docs/agents/adding-voice.md +349 -0
- package/.docs/docs/agents/agent-approval.md +558 -0
- package/.docs/docs/agents/agent-memory.md +209 -0
- package/.docs/docs/agents/guardrails.md +374 -0
- package/.docs/docs/agents/network-approval.md +275 -0
- package/.docs/docs/agents/networks.md +299 -0
- package/.docs/docs/agents/overview.md +304 -0
- package/.docs/docs/agents/processors.md +622 -0
- package/.docs/docs/agents/structured-output.md +273 -0
- package/.docs/docs/agents/supervisor-agents.md +304 -0
- package/.docs/docs/agents/using-tools.md +214 -0
- package/.docs/docs/build-with-ai/mcp-docs-server.md +238 -0
- package/.docs/docs/build-with-ai/skills.md +35 -0
- package/.docs/docs/community/contributing-templates.md +3 -0
- package/.docs/docs/community/discord.md +9 -0
- package/.docs/docs/community/licensing.md +66 -0
- package/.docs/docs/deployment/cloud-providers.md +15 -0
- package/.docs/docs/deployment/mastra-server.md +122 -0
- package/.docs/docs/deployment/monorepo.md +142 -0
- package/.docs/docs/deployment/overview.md +62 -0
- package/.docs/docs/deployment/studio.md +239 -0
- package/.docs/docs/deployment/web-framework.md +52 -0
- package/.docs/docs/deployment/workflow-runners.md +9 -0
- package/.docs/docs/evals/built-in-scorers.md +47 -0
- package/.docs/docs/evals/custom-scorers.md +519 -0
- package/.docs/docs/evals/overview.md +141 -0
- package/.docs/docs/evals/running-in-ci.md +124 -0
- package/.docs/docs/getting-started/build-with-ai.md +68 -0
- package/.docs/docs/getting-started/manual-install.md +226 -0
- package/.docs/docs/getting-started/project-structure.md +60 -0
- package/.docs/docs/getting-started/start.md +28 -0
- package/.docs/docs/getting-started/studio.md +101 -0
- package/.docs/docs/index.md +43 -0
- package/.docs/docs/mastra-cloud/deployment.md +77 -0
- package/.docs/docs/mastra-cloud/observability.md +38 -0
- package/.docs/docs/mastra-cloud/overview.md +23 -0
- package/.docs/docs/mastra-cloud/setup.md +42 -0
- package/.docs/docs/mastra-cloud/studio.md +24 -0
- package/.docs/docs/mastra-code/configuration.md +299 -0
- package/.docs/docs/mastra-code/customization.md +228 -0
- package/.docs/docs/mastra-code/modes.md +104 -0
- package/.docs/docs/mastra-code/overview.md +135 -0
- package/.docs/docs/mastra-code/tools.md +229 -0
- package/.docs/docs/mcp/overview.md +373 -0
- package/.docs/docs/mcp/publishing-mcp-server.md +95 -0
- package/.docs/docs/memory/memory-processors.md +314 -0
- package/.docs/docs/memory/message-history.md +260 -0
- package/.docs/docs/memory/observational-memory.md +248 -0
- package/.docs/docs/memory/overview.md +45 -0
- package/.docs/docs/memory/semantic-recall.md +272 -0
- package/.docs/docs/memory/storage.md +261 -0
- package/.docs/docs/memory/working-memory.md +400 -0
- package/.docs/docs/observability/datasets/overview.md +198 -0
- package/.docs/docs/observability/datasets/running-experiments.md +274 -0
- package/.docs/docs/observability/logging.md +99 -0
- package/.docs/docs/observability/overview.md +70 -0
- package/.docs/docs/observability/tracing/bridges/otel.md +209 -0
- package/.docs/docs/observability/tracing/exporters/arize.md +272 -0
- package/.docs/docs/observability/tracing/exporters/braintrust.md +111 -0
- package/.docs/docs/observability/tracing/exporters/cloud.md +127 -0
- package/.docs/docs/observability/tracing/exporters/datadog.md +187 -0
- package/.docs/docs/observability/tracing/exporters/default.md +209 -0
- package/.docs/docs/observability/tracing/exporters/laminar.md +100 -0
- package/.docs/docs/observability/tracing/exporters/langfuse.md +213 -0
- package/.docs/docs/observability/tracing/exporters/langsmith.md +198 -0
- package/.docs/docs/observability/tracing/exporters/otel.md +476 -0
- package/.docs/docs/observability/tracing/exporters/posthog.md +148 -0
- package/.docs/docs/observability/tracing/exporters/sentry.md +208 -0
- package/.docs/docs/observability/tracing/overview.md +1112 -0
- package/.docs/docs/observability/tracing/processors/sensitive-data-filter.md +300 -0
- package/.docs/docs/rag/chunking-and-embedding.md +183 -0
- package/.docs/docs/rag/graph-rag.md +215 -0
- package/.docs/docs/rag/overview.md +72 -0
- package/.docs/docs/rag/retrieval.md +515 -0
- package/.docs/docs/rag/vector-databases.md +645 -0
- package/.docs/docs/server/auth/auth0.md +220 -0
- package/.docs/docs/server/auth/better-auth.md +203 -0
- package/.docs/docs/server/auth/clerk.md +132 -0
- package/.docs/docs/server/auth/composite-auth.md +234 -0
- package/.docs/docs/server/auth/custom-auth-provider.md +513 -0
- package/.docs/docs/server/auth/firebase.md +272 -0
- package/.docs/docs/server/auth/jwt.md +110 -0
- package/.docs/docs/server/auth/simple-auth.md +180 -0
- package/.docs/docs/server/auth/supabase.md +117 -0
- package/.docs/docs/server/auth/workos.md +186 -0
- package/.docs/docs/server/auth.md +38 -0
- package/.docs/docs/server/custom-adapters.md +378 -0
- package/.docs/docs/server/custom-api-routes.md +267 -0
- package/.docs/docs/server/mastra-client.md +243 -0
- package/.docs/docs/server/mastra-server.md +71 -0
- package/.docs/docs/server/middleware.md +225 -0
- package/.docs/docs/server/request-context.md +471 -0
- package/.docs/docs/server/server-adapters.md +547 -0
- package/.docs/docs/streaming/events.md +237 -0
- package/.docs/docs/streaming/overview.md +175 -0
- package/.docs/docs/streaming/tool-streaming.md +175 -0
- package/.docs/docs/streaming/workflow-streaming.md +109 -0
- package/.docs/docs/voice/overview.md +959 -0
- package/.docs/docs/voice/speech-to-speech.md +102 -0
- package/.docs/docs/voice/speech-to-text.md +79 -0
- package/.docs/docs/voice/text-to-speech.md +83 -0
- package/.docs/docs/workflows/agents-and-tools.md +166 -0
- package/.docs/docs/workflows/control-flow.md +822 -0
- package/.docs/docs/workflows/error-handling.md +360 -0
- package/.docs/docs/workflows/human-in-the-loop.md +215 -0
- package/.docs/docs/workflows/overview.md +370 -0
- package/.docs/docs/workflows/snapshots.md +238 -0
- package/.docs/docs/workflows/suspend-and-resume.md +205 -0
- package/.docs/docs/workflows/time-travel.md +309 -0
- package/.docs/docs/workflows/workflow-state.md +181 -0
- package/.docs/docs/workspace/filesystem.md +164 -0
- package/.docs/docs/workspace/overview.md +239 -0
- package/.docs/docs/workspace/sandbox.md +63 -0
- package/.docs/docs/workspace/search.md +243 -0
- package/.docs/docs/workspace/skills.md +169 -0
- package/.docs/guides/agent-frameworks/ai-sdk.md +140 -0
- package/.docs/guides/build-your-ui/ai-sdk-ui.md +1499 -0
- package/.docs/guides/build-your-ui/assistant-ui.md +156 -0
- package/.docs/guides/build-your-ui/copilotkit.md +289 -0
- package/.docs/guides/deployment/amazon-ec2.md +130 -0
- package/.docs/guides/deployment/aws-lambda.md +248 -0
- package/.docs/guides/deployment/azure-app-services.md +114 -0
- package/.docs/guides/deployment/cloudflare.md +99 -0
- package/.docs/guides/deployment/digital-ocean.md +168 -0
- package/.docs/guides/deployment/inngest.md +682 -0
- package/.docs/guides/deployment/netlify.md +77 -0
- package/.docs/guides/deployment/vercel.md +101 -0
- package/.docs/guides/getting-started/astro.md +398 -0
- package/.docs/guides/getting-started/electron.md +504 -0
- package/.docs/guides/getting-started/express.md +251 -0
- package/.docs/guides/getting-started/hono.md +190 -0
- package/.docs/guides/getting-started/next-js.md +347 -0
- package/.docs/guides/getting-started/nuxt.md +497 -0
- package/.docs/guides/getting-started/quickstart.md +67 -0
- package/.docs/guides/getting-started/sveltekit.md +296 -0
- package/.docs/guides/getting-started/vite-react.md +425 -0
- package/.docs/guides/guide/ai-recruiter.md +226 -0
- package/.docs/guides/guide/chef-michel.md +211 -0
- package/.docs/guides/guide/code-review-bot.md +226 -0
- package/.docs/guides/guide/dev-assistant.md +307 -0
- package/.docs/guides/guide/docs-manager.md +238 -0
- package/.docs/guides/guide/github-actions-pr-description.md +236 -0
- package/.docs/guides/guide/notes-mcp-server.md +416 -0
- package/.docs/guides/guide/research-assistant.md +348 -0
- package/.docs/guides/guide/research-coordinator.md +416 -0
- package/.docs/guides/guide/stock-agent.md +132 -0
- package/.docs/guides/guide/web-search.md +320 -0
- package/.docs/guides/guide/whatsapp-chat-bot.md +405 -0
- package/.docs/guides/index.md +3 -0
- package/.docs/guides/migrations/agentnetwork.md +97 -0
- package/.docs/guides/migrations/ai-sdk-v4-to-v5.md +112 -0
- package/.docs/guides/migrations/network-to-supervisor.md +261 -0
- package/.docs/guides/migrations/upgrade-to-v1/agent.md +404 -0
- package/.docs/guides/migrations/upgrade-to-v1/cli.md +57 -0
- package/.docs/guides/migrations/upgrade-to-v1/client.md +337 -0
- package/.docs/guides/migrations/upgrade-to-v1/deployment.md +37 -0
- package/.docs/guides/migrations/upgrade-to-v1/evals.md +239 -0
- package/.docs/guides/migrations/upgrade-to-v1/mastra.md +143 -0
- package/.docs/guides/migrations/upgrade-to-v1/mcp.md +97 -0
- package/.docs/guides/migrations/upgrade-to-v1/memory.md +285 -0
- package/.docs/guides/migrations/upgrade-to-v1/overview.md +119 -0
- package/.docs/guides/migrations/upgrade-to-v1/processors.md +68 -0
- package/.docs/guides/migrations/upgrade-to-v1/rag.md +42 -0
- package/.docs/guides/migrations/upgrade-to-v1/storage.md +553 -0
- package/.docs/guides/migrations/upgrade-to-v1/tools.md +180 -0
- package/.docs/guides/migrations/upgrade-to-v1/tracing.md +412 -0
- package/.docs/guides/migrations/upgrade-to-v1/vectors.md +87 -0
- package/.docs/guides/migrations/upgrade-to-v1/voice.md +30 -0
- package/.docs/guides/migrations/upgrade-to-v1/workflows.md +341 -0
- package/.docs/guides/migrations/vnext-to-standard-apis.md +362 -0
- package/.docs/models/embeddings.md +161 -0
- package/.docs/models/gateways/azure-openai.md +128 -0
- package/.docs/models/gateways/custom-gateways.md +545 -0
- package/.docs/models/gateways/netlify.md +88 -0
- package/.docs/models/gateways/openrouter.md +219 -0
- package/.docs/models/gateways/vercel.md +225 -0
- package/.docs/models/gateways.md +14 -0
- package/.docs/models/index.md +286 -0
- package/.docs/models/providers/302ai.md +134 -0
- package/.docs/models/providers/abacus.md +125 -0
- package/.docs/models/providers/agentrouter.md +90 -0
- package/.docs/models/providers/aihubmix.md +107 -0
- package/.docs/models/providers/alibaba-cn.md +135 -0
- package/.docs/models/providers/alibaba.md +111 -0
- package/.docs/models/providers/amazon-bedrock.md +33 -0
- package/.docs/models/providers/anthropic.md +153 -0
- package/.docs/models/providers/azure.md +33 -0
- package/.docs/models/providers/bailing.md +72 -0
- package/.docs/models/providers/baseten.md +77 -0
- package/.docs/models/providers/berget.md +78 -0
- package/.docs/models/providers/cerebras.md +101 -0
- package/.docs/models/providers/chutes.md +136 -0
- package/.docs/models/providers/cloudflare-ai-gateway.md +33 -0
- package/.docs/models/providers/cloudflare-workers-ai.md +109 -0
- package/.docs/models/providers/cohere.md +33 -0
- package/.docs/models/providers/cortecs.md +91 -0
- package/.docs/models/providers/deepinfra.md +112 -0
- package/.docs/models/providers/deepseek.md +88 -0
- package/.docs/models/providers/fastrouter.md +84 -0
- package/.docs/models/providers/fireworks-ai.md +89 -0
- package/.docs/models/providers/firmware.md +85 -0
- package/.docs/models/providers/friendli.md +78 -0
- package/.docs/models/providers/github-models.md +125 -0
- package/.docs/models/providers/google-vertex.md +33 -0
- package/.docs/models/providers/google.md +159 -0
- package/.docs/models/providers/groq.md +107 -0
- package/.docs/models/providers/helicone.md +161 -0
- package/.docs/models/providers/huggingface.md +90 -0
- package/.docs/models/providers/iflowcn.md +84 -0
- package/.docs/models/providers/inception.md +72 -0
- package/.docs/models/providers/inference.md +79 -0
- package/.docs/models/providers/io-intelligence.md +87 -0
- package/.docs/models/providers/io-net.md +87 -0
- package/.docs/models/providers/jiekou.md +131 -0
- package/.docs/models/providers/kilo.md +333 -0
- package/.docs/models/providers/kimi-for-coding.md +100 -0
- package/.docs/models/providers/kuae-cloud-coding-plan.md +71 -0
- package/.docs/models/providers/llama.md +77 -0
- package/.docs/models/providers/lmstudio.md +73 -0
- package/.docs/models/providers/lucidquery.md +72 -0
- package/.docs/models/providers/minimax-cn-coding-plan.md +102 -0
- package/.docs/models/providers/minimax-cn.md +102 -0
- package/.docs/models/providers/minimax-coding-plan.md +102 -0
- package/.docs/models/providers/minimax.md +104 -0
- package/.docs/models/providers/mistral.md +124 -0
- package/.docs/models/providers/moark.md +72 -0
- package/.docs/models/providers/modelscope.md +77 -0
- package/.docs/models/providers/moonshotai-cn.md +76 -0
- package/.docs/models/providers/moonshotai.md +76 -0
- package/.docs/models/providers/morph.md +73 -0
- package/.docs/models/providers/nano-gpt.md +103 -0
- package/.docs/models/providers/nebius.md +116 -0
- package/.docs/models/providers/nova.md +72 -0
- package/.docs/models/providers/novita-ai.md +154 -0
- package/.docs/models/providers/nvidia.md +141 -0
- package/.docs/models/providers/ollama-cloud.md +103 -0
- package/.docs/models/providers/ollama.md +33 -0
- package/.docs/models/providers/openai.md +193 -0
- package/.docs/models/providers/opencode.md +100 -0
- package/.docs/models/providers/ovhcloud.md +83 -0
- package/.docs/models/providers/perplexity.md +100 -0
- package/.docs/models/providers/poe.md +183 -0
- package/.docs/models/providers/privatemode-ai.md +75 -0
- package/.docs/models/providers/requesty.md +90 -0
- package/.docs/models/providers/scaleway.md +84 -0
- package/.docs/models/providers/siliconflow-cn.md +138 -0
- package/.docs/models/providers/siliconflow.md +140 -0
- package/.docs/models/providers/stackit.md +78 -0
- package/.docs/models/providers/stepfun.md +73 -0
- package/.docs/models/providers/submodel.md +79 -0
- package/.docs/models/providers/synthetic.md +96 -0
- package/.docs/models/providers/togetherai.md +115 -0
- package/.docs/models/providers/upstage.md +73 -0
- package/.docs/models/providers/venice.md +95 -0
- package/.docs/models/providers/vivgrid.md +106 -0
- package/.docs/models/providers/vultr.md +75 -0
- package/.docs/models/providers/wandb.md +80 -0
- package/.docs/models/providers/xai.md +141 -0
- package/.docs/models/providers/xiaomi.md +71 -0
- package/.docs/models/providers/zai-coding-plan.md +80 -0
- package/.docs/models/providers/zai.md +79 -0
- package/.docs/models/providers/zenmux.md +161 -0
- package/.docs/models/providers/zhipuai-coding-plan.md +79 -0
- package/.docs/models/providers/zhipuai.md +79 -0
- package/.docs/models/providers.md +81 -0
- package/.docs/reference/agents/agent.md +141 -0
- package/.docs/reference/agents/generate.md +186 -0
- package/.docs/reference/agents/generateLegacy.md +173 -0
- package/.docs/reference/agents/getDefaultGenerateOptions.md +36 -0
- package/.docs/reference/agents/getDefaultOptions.md +34 -0
- package/.docs/reference/agents/getDefaultStreamOptions.md +36 -0
- package/.docs/reference/agents/getDescription.md +21 -0
- package/.docs/reference/agents/getInstructions.md +34 -0
- package/.docs/reference/agents/getLLM.md +37 -0
- package/.docs/reference/agents/getMemory.md +34 -0
- package/.docs/reference/agents/getModel.md +34 -0
- package/.docs/reference/agents/getTools.md +29 -0
- package/.docs/reference/agents/getVoice.md +34 -0
- package/.docs/reference/agents/listAgents.md +35 -0
- package/.docs/reference/agents/listScorers.md +34 -0
- package/.docs/reference/agents/listTools.md +34 -0
- package/.docs/reference/agents/listWorkflows.md +34 -0
- package/.docs/reference/agents/network.md +133 -0
- package/.docs/reference/ai-sdk/chat-route.md +82 -0
- package/.docs/reference/ai-sdk/handle-chat-stream.md +53 -0
- package/.docs/reference/ai-sdk/handle-network-stream.md +37 -0
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +55 -0
- package/.docs/reference/ai-sdk/network-route.md +74 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +231 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-v4-messages.md +79 -0
- package/.docs/reference/ai-sdk/to-ai-sdk-v5-messages.md +76 -0
- package/.docs/reference/ai-sdk/with-mastra.md +59 -0
- package/.docs/reference/ai-sdk/workflow-route.md +79 -0
- package/.docs/reference/auth/auth0.md +73 -0
- package/.docs/reference/auth/better-auth.md +71 -0
- package/.docs/reference/auth/clerk.md +36 -0
- package/.docs/reference/auth/firebase.md +80 -0
- package/.docs/reference/auth/jwt.md +26 -0
- package/.docs/reference/auth/supabase.md +33 -0
- package/.docs/reference/auth/workos.md +84 -0
- package/.docs/reference/cli/create-mastra.md +137 -0
- package/.docs/reference/cli/mastra.md +336 -0
- package/.docs/reference/client-js/agents.md +437 -0
- package/.docs/reference/client-js/error-handling.md +16 -0
- package/.docs/reference/client-js/logs.md +24 -0
- package/.docs/reference/client-js/mastra-client.md +63 -0
- package/.docs/reference/client-js/memory.md +221 -0
- package/.docs/reference/client-js/observability.md +72 -0
- package/.docs/reference/client-js/telemetry.md +20 -0
- package/.docs/reference/client-js/tools.md +44 -0
- package/.docs/reference/client-js/vectors.md +79 -0
- package/.docs/reference/client-js/workflows.md +199 -0
- package/.docs/reference/configuration.md +752 -0
- package/.docs/reference/core/addGateway.md +42 -0
- package/.docs/reference/core/getAgent.md +21 -0
- package/.docs/reference/core/getAgentById.md +21 -0
- package/.docs/reference/core/getDeployer.md +22 -0
- package/.docs/reference/core/getGateway.md +38 -0
- package/.docs/reference/core/getGatewayById.md +41 -0
- package/.docs/reference/core/getLogger.md +22 -0
- package/.docs/reference/core/getMCPServer.md +47 -0
- package/.docs/reference/core/getMCPServerById.md +55 -0
- package/.docs/reference/core/getMemory.md +50 -0
- package/.docs/reference/core/getScorer.md +54 -0
- package/.docs/reference/core/getScorerById.md +54 -0
- package/.docs/reference/core/getServer.md +22 -0
- package/.docs/reference/core/getStorage.md +22 -0
- package/.docs/reference/core/getStoredAgentById.md +89 -0
- package/.docs/reference/core/getTelemetry.md +22 -0
- package/.docs/reference/core/getVector.md +22 -0
- package/.docs/reference/core/getWorkflow.md +42 -0
- package/.docs/reference/core/listAgents.md +21 -0
- package/.docs/reference/core/listGateways.md +40 -0
- package/.docs/reference/core/listLogs.md +38 -0
- package/.docs/reference/core/listLogsByRunId.md +36 -0
- package/.docs/reference/core/listMCPServers.md +55 -0
- package/.docs/reference/core/listMemory.md +56 -0
- package/.docs/reference/core/listScorers.md +29 -0
- package/.docs/reference/core/listStoredAgents.md +93 -0
- package/.docs/reference/core/listVectors.md +22 -0
- package/.docs/reference/core/listWorkflows.md +21 -0
- package/.docs/reference/core/mastra-class.md +66 -0
- package/.docs/reference/core/mastra-model-gateway.md +153 -0
- package/.docs/reference/core/setLogger.md +26 -0
- package/.docs/reference/core/setStorage.md +27 -0
- package/.docs/reference/datasets/addItem.md +37 -0
- package/.docs/reference/datasets/addItems.md +35 -0
- package/.docs/reference/datasets/compareExperiments.md +52 -0
- package/.docs/reference/datasets/create.md +51 -0
- package/.docs/reference/datasets/dataset.md +82 -0
- package/.docs/reference/datasets/datasets-manager.md +94 -0
- package/.docs/reference/datasets/delete.md +25 -0
- package/.docs/reference/datasets/deleteExperiment.md +27 -0
- package/.docs/reference/datasets/deleteItem.md +27 -0
- package/.docs/reference/datasets/deleteItems.md +29 -0
- package/.docs/reference/datasets/get.md +31 -0
- package/.docs/reference/datasets/getDetails.md +47 -0
- package/.docs/reference/datasets/getExperiment.md +30 -0
- package/.docs/reference/datasets/getItem.md +33 -0
- package/.docs/reference/datasets/getItemHistory.md +31 -0
- package/.docs/reference/datasets/list.md +31 -0
- package/.docs/reference/datasets/listExperimentResults.md +39 -0
- package/.docs/reference/datasets/listExperiments.md +33 -0
- package/.docs/reference/datasets/listItems.md +46 -0
- package/.docs/reference/datasets/listVersions.md +33 -0
- package/.docs/reference/datasets/startExperiment.md +62 -0
- package/.docs/reference/datasets/startExperimentAsync.md +43 -0
- package/.docs/reference/datasets/update.md +48 -0
- package/.docs/reference/datasets/updateItem.md +38 -0
- package/.docs/reference/deployer/cloudflare.md +79 -0
- package/.docs/reference/deployer/netlify.md +80 -0
- package/.docs/reference/deployer/vercel.md +91 -0
- package/.docs/reference/deployer.md +100 -0
- package/.docs/reference/evals/answer-relevancy.md +105 -0
- package/.docs/reference/evals/answer-similarity.md +99 -0
- package/.docs/reference/evals/bias.md +120 -0
- package/.docs/reference/evals/completeness.md +136 -0
- package/.docs/reference/evals/content-similarity.md +101 -0
- package/.docs/reference/evals/context-precision.md +196 -0
- package/.docs/reference/evals/context-relevance.md +531 -0
- package/.docs/reference/evals/create-scorer.md +270 -0
- package/.docs/reference/evals/faithfulness.md +114 -0
- package/.docs/reference/evals/hallucination.md +213 -0
- package/.docs/reference/evals/keyword-coverage.md +128 -0
- package/.docs/reference/evals/mastra-scorer.md +123 -0
- package/.docs/reference/evals/noise-sensitivity.md +675 -0
- package/.docs/reference/evals/prompt-alignment.md +614 -0
- package/.docs/reference/evals/run-evals.md +179 -0
- package/.docs/reference/evals/scorer-utils.md +326 -0
- package/.docs/reference/evals/textual-difference.md +113 -0
- package/.docs/reference/evals/tone-consistency.md +119 -0
- package/.docs/reference/evals/tool-call-accuracy.md +533 -0
- package/.docs/reference/evals/toxicity.md +123 -0
- package/.docs/reference/harness/harness-class.md +708 -0
- package/.docs/reference/index.md +277 -0
- package/.docs/reference/logging/pino-logger.md +117 -0
- package/.docs/reference/mastra-code/createMastraCode.md +108 -0
- package/.docs/reference/memory/clone-utilities.md +199 -0
- package/.docs/reference/memory/cloneThread.md +130 -0
- package/.docs/reference/memory/createThread.md +68 -0
- package/.docs/reference/memory/deleteMessages.md +38 -0
- package/.docs/reference/memory/getThreadById.md +24 -0
- package/.docs/reference/memory/listThreads.md +145 -0
- package/.docs/reference/memory/memory-class.md +147 -0
- package/.docs/reference/memory/observational-memory.md +565 -0
- package/.docs/reference/memory/recall.md +91 -0
- package/.docs/reference/observability/tracing/bridges/otel.md +131 -0
- package/.docs/reference/observability/tracing/configuration.md +178 -0
- package/.docs/reference/observability/tracing/exporters/arize.md +141 -0
- package/.docs/reference/observability/tracing/exporters/braintrust.md +93 -0
- package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +163 -0
- package/.docs/reference/observability/tracing/exporters/console-exporter.md +138 -0
- package/.docs/reference/observability/tracing/exporters/datadog.md +116 -0
- package/.docs/reference/observability/tracing/exporters/default-exporter.md +174 -0
- package/.docs/reference/observability/tracing/exporters/laminar.md +78 -0
- package/.docs/reference/observability/tracing/exporters/langfuse.md +134 -0
- package/.docs/reference/observability/tracing/exporters/langsmith.md +108 -0
- package/.docs/reference/observability/tracing/exporters/otel.md +199 -0
- package/.docs/reference/observability/tracing/exporters/posthog.md +92 -0
- package/.docs/reference/observability/tracing/exporters/sentry.md +184 -0
- package/.docs/reference/observability/tracing/instances.md +107 -0
- package/.docs/reference/observability/tracing/interfaces.md +743 -0
- package/.docs/reference/observability/tracing/processors/sensitive-data-filter.md +144 -0
- package/.docs/reference/observability/tracing/spans.md +224 -0
- package/.docs/reference/processors/batch-parts-processor.md +61 -0
- package/.docs/reference/processors/language-detector.md +82 -0
- package/.docs/reference/processors/message-history-processor.md +85 -0
- package/.docs/reference/processors/moderation-processor.md +104 -0
- package/.docs/reference/processors/pii-detector.md +108 -0
- package/.docs/reference/processors/processor-interface.md +521 -0
- package/.docs/reference/processors/prompt-injection-detector.md +72 -0
- package/.docs/reference/processors/semantic-recall-processor.md +117 -0
- package/.docs/reference/processors/system-prompt-scrubber.md +80 -0
- package/.docs/reference/processors/token-limiter-processor.md +115 -0
- package/.docs/reference/processors/tool-call-filter.md +85 -0
- package/.docs/reference/processors/tool-search-processor.md +111 -0
- package/.docs/reference/processors/unicode-normalizer.md +62 -0
- package/.docs/reference/processors/working-memory-processor.md +152 -0
- package/.docs/reference/rag/chunk.md +221 -0
- package/.docs/reference/rag/database-config.md +261 -0
- package/.docs/reference/rag/document.md +114 -0
- package/.docs/reference/rag/embeddings.md +92 -0
- package/.docs/reference/rag/extract-params.md +168 -0
- package/.docs/reference/rag/graph-rag.md +111 -0
- package/.docs/reference/rag/metadata-filters.md +216 -0
- package/.docs/reference/rag/rerank.md +75 -0
- package/.docs/reference/rag/rerankWithScorer.md +80 -0
- package/.docs/reference/server/create-route.md +262 -0
- package/.docs/reference/server/express-adapter.md +176 -0
- package/.docs/reference/server/fastify-adapter.md +90 -0
- package/.docs/reference/server/hono-adapter.md +162 -0
- package/.docs/reference/server/koa-adapter.md +127 -0
- package/.docs/reference/server/mastra-server.md +298 -0
- package/.docs/reference/server/register-api-route.md +249 -0
- package/.docs/reference/server/routes.md +306 -0
- package/.docs/reference/storage/cloudflare-d1.md +218 -0
- package/.docs/reference/storage/cloudflare.md +88 -0
- package/.docs/reference/storage/composite.md +235 -0
- package/.docs/reference/storage/convex.md +161 -0
- package/.docs/reference/storage/dynamodb.md +282 -0
- package/.docs/reference/storage/lance.md +131 -0
- package/.docs/reference/storage/libsql.md +135 -0
- package/.docs/reference/storage/mongodb.md +262 -0
- package/.docs/reference/storage/mssql.md +157 -0
- package/.docs/reference/storage/overview.md +121 -0
- package/.docs/reference/storage/postgresql.md +526 -0
- package/.docs/reference/storage/upstash.md +160 -0
- package/.docs/reference/streaming/ChunkType.md +292 -0
- package/.docs/reference/streaming/agents/MastraModelOutput.md +182 -0
- package/.docs/reference/streaming/agents/stream.md +221 -0
- package/.docs/reference/streaming/agents/streamLegacy.md +142 -0
- package/.docs/reference/streaming/workflows/observeStream.md +42 -0
- package/.docs/reference/streaming/workflows/resumeStream.md +61 -0
- package/.docs/reference/streaming/workflows/stream.md +88 -0
- package/.docs/reference/streaming/workflows/timeTravelStream.md +142 -0
- package/.docs/reference/templates/overview.md +194 -0
- package/.docs/reference/tools/create-tool.md +237 -0
- package/.docs/reference/tools/document-chunker-tool.md +89 -0
- package/.docs/reference/tools/graph-rag-tool.md +182 -0
- package/.docs/reference/tools/mcp-client.md +954 -0
- package/.docs/reference/tools/mcp-server.md +1271 -0
- package/.docs/reference/tools/vector-query-tool.md +459 -0
- package/.docs/reference/vectors/astra.md +121 -0
- package/.docs/reference/vectors/chroma.md +264 -0
- package/.docs/reference/vectors/convex.md +300 -0
- package/.docs/reference/vectors/couchbase.md +226 -0
- package/.docs/reference/vectors/duckdb.md +318 -0
- package/.docs/reference/vectors/elasticsearch.md +189 -0
- package/.docs/reference/vectors/lance.md +220 -0
- package/.docs/reference/vectors/libsql.md +305 -0
- package/.docs/reference/vectors/mongodb.md +295 -0
- package/.docs/reference/vectors/opensearch.md +99 -0
- package/.docs/reference/vectors/pg.md +408 -0
- package/.docs/reference/vectors/pinecone.md +168 -0
- package/.docs/reference/vectors/qdrant.md +222 -0
- package/.docs/reference/vectors/s3vectors.md +277 -0
- package/.docs/reference/vectors/turbopuffer.md +157 -0
- package/.docs/reference/vectors/upstash.md +294 -0
- package/.docs/reference/vectors/vectorize.md +147 -0
- package/.docs/reference/voice/azure.md +148 -0
- package/.docs/reference/voice/cloudflare.md +83 -0
- package/.docs/reference/voice/composite-voice.md +121 -0
- package/.docs/reference/voice/deepgram.md +79 -0
- package/.docs/reference/voice/elevenlabs.md +98 -0
- package/.docs/reference/voice/google-gemini-live.md +378 -0
- package/.docs/reference/voice/google.md +228 -0
- package/.docs/reference/voice/mastra-voice.md +311 -0
- package/.docs/reference/voice/murf.md +122 -0
- package/.docs/reference/voice/openai-realtime.md +203 -0
- package/.docs/reference/voice/openai.md +88 -0
- package/.docs/reference/voice/playai.md +80 -0
- package/.docs/reference/voice/sarvam.md +126 -0
- package/.docs/reference/voice/speechify.md +75 -0
- package/.docs/reference/voice/voice.addInstructions.md +55 -0
- package/.docs/reference/voice/voice.addTools.md +67 -0
- package/.docs/reference/voice/voice.answer.md +54 -0
- package/.docs/reference/voice/voice.close.md +51 -0
- package/.docs/reference/voice/voice.connect.md +94 -0
- package/.docs/reference/voice/voice.events.md +37 -0
- package/.docs/reference/voice/voice.getSpeakers.md +129 -0
- package/.docs/reference/voice/voice.listen.md +164 -0
- package/.docs/reference/voice/voice.off.md +54 -0
- package/.docs/reference/voice/voice.on.md +111 -0
- package/.docs/reference/voice/voice.send.md +65 -0
- package/.docs/reference/voice/voice.speak.md +157 -0
- package/.docs/reference/voice/voice.updateConfig.md +60 -0
- package/.docs/reference/workflows/run-methods/cancel.md +86 -0
- package/.docs/reference/workflows/run-methods/restart.md +33 -0
- package/.docs/reference/workflows/run-methods/resume.md +59 -0
- package/.docs/reference/workflows/run-methods/start.md +58 -0
- package/.docs/reference/workflows/run-methods/startAsync.md +67 -0
- package/.docs/reference/workflows/run-methods/timeTravel.md +142 -0
- package/.docs/reference/workflows/run.md +59 -0
- package/.docs/reference/workflows/step.md +119 -0
- package/.docs/reference/workflows/workflow-methods/branch.md +25 -0
- package/.docs/reference/workflows/workflow-methods/commit.md +17 -0
- package/.docs/reference/workflows/workflow-methods/create-run.md +63 -0
- package/.docs/reference/workflows/workflow-methods/dountil.md +25 -0
- package/.docs/reference/workflows/workflow-methods/dowhile.md +25 -0
- package/.docs/reference/workflows/workflow-methods/foreach.md +118 -0
- package/.docs/reference/workflows/workflow-methods/map.md +93 -0
- package/.docs/reference/workflows/workflow-methods/parallel.md +21 -0
- package/.docs/reference/workflows/workflow-methods/sleep.md +35 -0
- package/.docs/reference/workflows/workflow-methods/sleepUntil.md +35 -0
- package/.docs/reference/workflows/workflow-methods/then.md +21 -0
- package/.docs/reference/workflows/workflow.md +157 -0
- package/.docs/reference/workspace/e2b-sandbox.md +289 -0
- package/.docs/reference/workspace/filesystem.md +255 -0
- package/.docs/reference/workspace/gcs-filesystem.md +174 -0
- package/.docs/reference/workspace/local-filesystem.md +343 -0
- package/.docs/reference/workspace/local-sandbox.md +301 -0
- package/.docs/reference/workspace/s3-filesystem.md +175 -0
- package/.docs/reference/workspace/sandbox.md +87 -0
- package/.docs/reference/workspace/workspace-class.md +244 -0
- package/CHANGELOG.md +16 -0
- package/package.json +6 -6
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# MastraAuthWorkos Class
|
|
2
|
+
|
|
3
|
+
The `MastraAuthWorkos` class provides authentication for Mastra using WorkOS. It verifies incoming requests using WorkOS access tokens and integrates with the Mastra server using the `auth` option.
|
|
4
|
+
|
|
5
|
+
## Usage example
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Mastra } from '@mastra/core'
|
|
9
|
+
import { MastraAuthWorkos } from '@mastra/auth-workos'
|
|
10
|
+
|
|
11
|
+
export const mastra = new Mastra({
|
|
12
|
+
server: {
|
|
13
|
+
auth: new MastraAuthWorkos({
|
|
14
|
+
apiKey: process.env.WORKOS_API_KEY,
|
|
15
|
+
clientId: process.env.WORKOS_CLIENT_ID,
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
> **Note:** You can omit the constructor parameters if you have the appropriately named environment variables (`WORKOS_API_KEY` and `WORKOS_CLIENT_ID`) set. In that case, simply use `new MastraAuthWorkos()` without any arguments.
|
|
22
|
+
|
|
23
|
+
## Constructor parameters
|
|
24
|
+
|
|
25
|
+
**apiKey?:** (`string`): Your WorkOS API key. This is used to authenticate with the WorkOS API for user verification and organization management. (Default: `process.env.WORKOS_API_KEY`)
|
|
26
|
+
|
|
27
|
+
**clientId?:** (`string`): Your WorkOS Client ID. This identifies your application when exchanging authorization codes for access tokens. (Default: `process.env.WORKOS_CLIENT_ID`)
|
|
28
|
+
|
|
29
|
+
**name?:** (`string`): Custom name for the auth provider instance. (Default: `"workos"`)
|
|
30
|
+
|
|
31
|
+
**authorizeUser?:** (`(user: WorkosUser) => Promise<boolean> | boolean`): Custom authorization function to determine if a user should be granted access. Called after token verification. By default, checks if the user has an 'admin' role in any organization membership.
|
|
32
|
+
|
|
33
|
+
## Environment Variables
|
|
34
|
+
|
|
35
|
+
The following environment variables are automatically used when constructor options are not provided:
|
|
36
|
+
|
|
37
|
+
**WORKOS\_API\_KEY?:** (`string`): Your WorkOS API key. Can be found in your WorkOS Dashboard under API Keys.
|
|
38
|
+
|
|
39
|
+
**WORKOS\_CLIENT\_ID?:** (`string`): Your WorkOS Client ID. Can be found in your WorkOS Dashboard under Applications.
|
|
40
|
+
|
|
41
|
+
## Default Authorization Behavior
|
|
42
|
+
|
|
43
|
+
By default, `MastraAuthWorkos` implements role-based authorization that checks for admin access:
|
|
44
|
+
|
|
45
|
+
1. **Token Verification**: The access token is verified with WorkOS to ensure it's valid and not expired
|
|
46
|
+
2. **User Retrieval**: User information is extracted from the verified token
|
|
47
|
+
3. **Organization Membership Check**: The system queries WorkOS for all organization memberships associated with the user's ID
|
|
48
|
+
4. **Role Extraction**: All roles from the user's organization memberships are collected
|
|
49
|
+
5. **Admin Check**: The system checks if any role has the slug 'admin'
|
|
50
|
+
6. **Authorization Decision**: Access is granted only if the user has an admin role in at least one organization
|
|
51
|
+
|
|
52
|
+
This means that by default, only users with admin privileges in at least one organization will be authorized to access your Mastra endpoints.
|
|
53
|
+
|
|
54
|
+
To implement custom authorization logic (e.g., allow all authenticated users, check for specific roles, or implement custom business logic), provide a custom `authorizeUser` function.
|
|
55
|
+
|
|
56
|
+
## WorkOS User Type
|
|
57
|
+
|
|
58
|
+
The `WorkosUser` type used in the `authorizeUser` function corresponds to the JWT token payload returned by WorkOS. WorkOS allows administrators to set up custom JWT templates, so the exact structure may vary based on your configuration. Here's an example of what the user object might look like:
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
{
|
|
62
|
+
'urn:myapp:full_name': 'John Doe',
|
|
63
|
+
'urn:myapp:email': 'john.doe@example.com',
|
|
64
|
+
'urn:myapp:organization_tier': 'bronze',
|
|
65
|
+
'urn:myapp:user_language': 'en',
|
|
66
|
+
'urn:myapp:organization_domain': 'example.com',
|
|
67
|
+
iss: 'https://api.workos.com/user_management/client_01ABC123DEF456GHI789JKL012',
|
|
68
|
+
sub: 'user_01XYZ789ABC123DEF456GHI012',
|
|
69
|
+
sid: 'session_01PQR456STU789VWX012YZA345',
|
|
70
|
+
jti: '01MNO678PQR901STU234VWX567',
|
|
71
|
+
org_id: 'org_01DEF234GHI567JKL890MNO123',
|
|
72
|
+
role: 'member',
|
|
73
|
+
roles: [ 'member' ],
|
|
74
|
+
permissions: [],
|
|
75
|
+
exp: 1758290589,
|
|
76
|
+
iat: 1758290289
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The properties with `urn:myapp:` prefixes are custom claims configured in your WorkOS JWT template. Standard JWT claims include `sub` (user ID), `iss` (issuer), `exp` (expiration), and WorkOS-specific claims like `org_id`, `role`, and `roles`.
|
|
81
|
+
|
|
82
|
+
## Related
|
|
83
|
+
|
|
84
|
+
[MastraAuthWorkos Class](https://mastra.ai/docs/server/auth/workos)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# create-mastra
|
|
2
|
+
|
|
3
|
+
The `create-mastra` command **creates** a new standalone Mastra project. Use this command to scaffold a complete Mastra setup in a dedicated directory. You can run it with additional flags to customize the setup process.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
**npm**:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx create-mastra@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**pnpm**:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm dlx create-mastra@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Yarn**:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn dlx create-mastra@latest
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Bun**:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
bun x create-mastra@latest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`create-mastra` automatically runs in _interactive_ mode, but you can also specify your project name and template with command line arguments.
|
|
32
|
+
|
|
33
|
+
**npm**:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx create-mastra@latest my-mastra-project -- --template coding-agent
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**pnpm**:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm dlx create-mastra@latest my-mastra-project -- --template coding-agent
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Yarn**:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
yarn dlx create-mastra@latest my-mastra-project -- --template coding-agent
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Bun**:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bun x create-mastra@latest my-mastra-project -- --template coding-agent
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Check out the [full list](https://mastra.ai/api/templates.json) of templates and use the `slug` as input to the `--template` CLI flag.
|
|
58
|
+
|
|
59
|
+
You can also use any GitHub repo as a template (it has to be a valid Mastra project):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx create-mastra@latest my-mastra-project -- --template mastra-ai/template-coding-agent
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
You can install Mastra skills for specific agents during project creation:
|
|
66
|
+
|
|
67
|
+
**npm**:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx create-mastra@latest my-project -- --default --skills claude-code,cursor
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**pnpm**:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pnpm dlx create-mastra@latest my-project -- --default --skills claude-code,cursor
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Yarn**:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
yarn dlx create-mastra@latest my-project -- --default --skills claude-code,cursor
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Bun**:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
bun x create-mastra@latest my-project -- --default --skills claude-code,cursor
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## CLI flags
|
|
92
|
+
|
|
93
|
+
Instead of an interactive prompt you can also define these CLI flags.
|
|
94
|
+
|
|
95
|
+
**--version?:** (`boolean`): Output the version number
|
|
96
|
+
|
|
97
|
+
**--project-name?:** (`string`): Project name that will be used in package.json and as the project directory name
|
|
98
|
+
|
|
99
|
+
**--default?:** (`boolean`): Quick start with defaults (src, OpenAI, no examples)
|
|
100
|
+
|
|
101
|
+
**--components?:** (`string`): Comma-separated list of components (agents, tools, workflows, scorers)
|
|
102
|
+
|
|
103
|
+
**--llm?:** (`string`): Default model provider (openai, anthropic, groq, google, or cerebras)
|
|
104
|
+
|
|
105
|
+
**--llm-api-key?:** (`string`): API key for the model provider
|
|
106
|
+
|
|
107
|
+
**--example?:** (`boolean`): Include example code
|
|
108
|
+
|
|
109
|
+
**--no-example?:** (`boolean`): Do not include example code
|
|
110
|
+
|
|
111
|
+
**--template?:** (`string`): Create project from a template (use template name, public GitHub URL, or leave blank to select from list)
|
|
112
|
+
|
|
113
|
+
**--timeout?:** (`number`): Configurable timeout for package installation, defaults to 60000 ms
|
|
114
|
+
|
|
115
|
+
**--dir?:** (`string`): Target directory for Mastra source code (default: src/)
|
|
116
|
+
|
|
117
|
+
**--mcp?:** (`string`): MCP Server for code editor (cursor, cursor-global, windsurf, vscode)
|
|
118
|
+
|
|
119
|
+
**--skills?:** (`string`): Comma-separated list of agents to install Mastra skills for (e.g., claude-code,cursor,windsurf)
|
|
120
|
+
|
|
121
|
+
**--help?:** (`boolean`): Display help for command
|
|
122
|
+
|
|
123
|
+
## Telemetry
|
|
124
|
+
|
|
125
|
+
By default, Mastra collects anonymous information about your project like your OS, Mastra version or Node.js version. You can read the [source code](https://github.com/mastra-ai/mastra/blob/main/packages/cli/src/analytics/index.ts) to check what's collected.
|
|
126
|
+
|
|
127
|
+
You can opt out of the CLI analytics by setting an environment variable:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
MASTRA_TELEMETRY_DISABLED=1
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
You can also set this while using other `mastra` commands:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
MASTRA_TELEMETRY_DISABLED=1 npx create-mastra@latest
|
|
137
|
+
```
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# CLI Commands
|
|
2
|
+
|
|
3
|
+
You can use the Command-Line Interface (CLI) provided by Mastra to develop, build, and start your Mastra project.
|
|
4
|
+
|
|
5
|
+
## `mastra dev`
|
|
6
|
+
|
|
7
|
+
Starts a server which exposes [Studio](https://mastra.ai/docs/getting-started/studio) and REST endpoints for your agents, tools, and workflows. You can visit <http://localhost:4111/swagger-ui> for an overview of all available endpoints once `mastra dev` is running.
|
|
8
|
+
|
|
9
|
+
You can also [configure the server](https://mastra.ai/docs/getting-started/studio).
|
|
10
|
+
|
|
11
|
+
### Flags
|
|
12
|
+
|
|
13
|
+
The command accepts [common flags](#common-flags) and the following additional flags:
|
|
14
|
+
|
|
15
|
+
#### `--https`
|
|
16
|
+
|
|
17
|
+
Enable local HTTPS support. [Learn more](https://mastra.ai/reference/configuration).
|
|
18
|
+
|
|
19
|
+
#### `--inspect`
|
|
20
|
+
|
|
21
|
+
Start the development server in inspect mode, helpful for debugging. Optionally specify a custom host and port (e.g., `--inspect=0.0.0.0:9229` for Docker). This can't be used together with `--inspect-brk`.
|
|
22
|
+
|
|
23
|
+
#### `--inspect-brk`
|
|
24
|
+
|
|
25
|
+
Start the development server in inspect mode and break at the beginning of the script. Optionally specify a custom host and port (e.g., `--inspect-brk=0.0.0.0:9229`). This can't be used together with `--inspect`.
|
|
26
|
+
|
|
27
|
+
#### `--custom-args`
|
|
28
|
+
|
|
29
|
+
Comma-separated list of custom arguments to pass to the Node.js process, e.g. `--require=newrelic` or `--experimental-transform-types`.
|
|
30
|
+
|
|
31
|
+
#### `--request-context-presets`
|
|
32
|
+
|
|
33
|
+
Path to a JSON file containing named [request context](https://mastra.ai/docs/server/request-context) presets. When provided, a dropdown appears in Studio's request context editor, letting you quickly switch between preset configurations.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
mastra dev --request-context-presets ./presets.json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The file must be a JSON object where each key is a preset name and each value is an object:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"development": { "userId": "dev-user", "env": "development" },
|
|
44
|
+
"production": { "userId": "prod-user", "env": "production" }
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Configs
|
|
49
|
+
|
|
50
|
+
You can set certain environment variables to modify the behavior of `mastra dev`.
|
|
51
|
+
|
|
52
|
+
#### Skip peer dependency check
|
|
53
|
+
|
|
54
|
+
Set `MASTRA_SKIP_PEERDEP_CHECK=1` to skip the peer dependency version mismatch check at startup:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
MASTRA_SKIP_PEERDEP_CHECK=1 mastra dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This is useful during monorepo development when peer dependencies may be bumped but packages are not yet published.
|
|
61
|
+
|
|
62
|
+
#### Disable build caching
|
|
63
|
+
|
|
64
|
+
Set `MASTRA_DEV_NO_CACHE=1` to force a full rebuild rather than using the cached assets under `.mastra/`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
MASTRA_DEV_NO_CACHE=1 mastra dev
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
This helps when you are debugging bundler plugins or suspect stale output.
|
|
71
|
+
|
|
72
|
+
#### Limit parallelism
|
|
73
|
+
|
|
74
|
+
`MASTRA_CONCURRENCY` caps how many expensive operations run in parallel (primarily build and evaluation steps). For example:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
MASTRA_CONCURRENCY=4 mastra dev
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Leave it unset to let the CLI pick a sensible default for the machine.
|
|
81
|
+
|
|
82
|
+
#### Custom provider endpoints
|
|
83
|
+
|
|
84
|
+
When using providers supported by the Vercel AI SDK you can redirect requests through proxies or internal gateways by setting a base URL. For OpenAI:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
OPENAI_API_KEY=<your-api-key> \
|
|
88
|
+
OPENAI_BASE_URL=https://openrouter.example/v1 \
|
|
89
|
+
mastra dev
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For Anthropic:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ANTHROPIC_API_KEY=<your-api-key> \
|
|
96
|
+
ANTHROPIC_BASE_URL=https://anthropic.internal \
|
|
97
|
+
mastra dev
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
These are forwarded to the Mastra model router and will work with any `"openai/..."` or `"anthropic/..."` model selections.
|
|
101
|
+
|
|
102
|
+
## `mastra build`
|
|
103
|
+
|
|
104
|
+
The `mastra build` command bundles your Mastra project into a production-ready Hono server. [Hono](https://hono.dev/) is a lightweight, type-safe web framework that makes it easy to deploy Mastra agents as HTTP endpoints with middleware support.
|
|
105
|
+
|
|
106
|
+
Under the hood Mastra's Rollup server locates your Mastra entry file and bundles it to a production-ready Hono server. During that bundling it tree-shakes your code and generates source maps for debugging.
|
|
107
|
+
|
|
108
|
+
The output in `.mastra` can be deployed to any cloud server using [`mastra start`](#mastra-start).
|
|
109
|
+
|
|
110
|
+
If you're deploying to a [serverless platform](https://mastra.ai/docs/deployment/cloud-providers) you need to install the correct deployer in order to receive the correct output in `.mastra`.
|
|
111
|
+
|
|
112
|
+
It accepts [common flags](#common-flags).
|
|
113
|
+
|
|
114
|
+
### Flags
|
|
115
|
+
|
|
116
|
+
#### `--studio`
|
|
117
|
+
|
|
118
|
+
Bundle the Studio UI with the build.
|
|
119
|
+
|
|
120
|
+
### Configs
|
|
121
|
+
|
|
122
|
+
You can set certain environment variables to modify the behavior of `mastra build`.
|
|
123
|
+
|
|
124
|
+
#### Skip peer dependency check
|
|
125
|
+
|
|
126
|
+
Set `MASTRA_SKIP_PEERDEP_CHECK=1` to skip the peer dependency version mismatch check:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
MASTRA_SKIP_PEERDEP_CHECK=1 mastra build
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### Limit parallelism
|
|
133
|
+
|
|
134
|
+
For CI or when running in resource constrained environments you can cap how many expensive tasks run at once by setting `MASTRA_CONCURRENCY`.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
MASTRA_CONCURRENCY=2 mastra build
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## `mastra start`
|
|
141
|
+
|
|
142
|
+
> **Info:** You need to run `mastra build` before using `mastra start`.
|
|
143
|
+
|
|
144
|
+
Starts a local server to serve your built Mastra application in production mode. By default, [OTEL Tracing](https://mastra.ai/docs/observability/tracing/overview) is enabled.
|
|
145
|
+
|
|
146
|
+
### Flags
|
|
147
|
+
|
|
148
|
+
The command accepts [common flags](#common-flags) and the following additional flags:
|
|
149
|
+
|
|
150
|
+
#### `--dir`
|
|
151
|
+
|
|
152
|
+
The path to your built Mastra output directory. Defaults to `.mastra/output`.
|
|
153
|
+
|
|
154
|
+
#### `--custom-args`
|
|
155
|
+
|
|
156
|
+
Comma-separated list of custom arguments to pass to the Node.js process, e.g. `--require=newrelic` or `--experimental-transform-types`.
|
|
157
|
+
|
|
158
|
+
## `mastra studio`
|
|
159
|
+
|
|
160
|
+
Starts [Mastra Studio](https://mastra.ai/docs/getting-started/studio) as a static server. After starting, you can enter your Mastra instance URL (e.g. `http://localhost:4111`) to connect Studio to your Mastra backend. Looks for `.env` and `.env.production` files in the current working directory for configuration.
|
|
161
|
+
|
|
162
|
+
### Flags
|
|
163
|
+
|
|
164
|
+
The command accepts [common flags](#common-flags) and the following additional flags:
|
|
165
|
+
|
|
166
|
+
#### `--port`
|
|
167
|
+
|
|
168
|
+
The port to run Studio on. Defaults to `3000`.
|
|
169
|
+
|
|
170
|
+
#### `--server-host`
|
|
171
|
+
|
|
172
|
+
The host of the Mastra API server to connect to. Defaults to `localhost`.
|
|
173
|
+
|
|
174
|
+
#### `--server-port`
|
|
175
|
+
|
|
176
|
+
The port of the Mastra API server to connect to. Defaults to `4111`.
|
|
177
|
+
|
|
178
|
+
#### `--server-protocol`
|
|
179
|
+
|
|
180
|
+
The protocol of the Mastra API server to connect to. Defaults to `http`.
|
|
181
|
+
|
|
182
|
+
#### `--request-context-presets`
|
|
183
|
+
|
|
184
|
+
Path to a JSON file containing named [request context](https://mastra.ai/docs/server/request-context) presets. Works the same as the [`mastra dev` flag](#--request-context-presets).
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
mastra studio --request-context-presets ./presets.json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## `mastra lint`
|
|
191
|
+
|
|
192
|
+
The `mastra lint` command validates the structure and code of your Mastra project to ensure it follows best practices and is error-free.
|
|
193
|
+
|
|
194
|
+
It accepts [common flags](#common-flags).
|
|
195
|
+
|
|
196
|
+
## `mastra scorers`
|
|
197
|
+
|
|
198
|
+
The `mastra scorers` command provides management capabilities for evaluation scorers that measure the quality, accuracy, and performance of AI-generated outputs.
|
|
199
|
+
|
|
200
|
+
Read the [Scorers overview](https://mastra.ai/docs/evals/overview) to learn more.
|
|
201
|
+
|
|
202
|
+
### `add`
|
|
203
|
+
|
|
204
|
+
Add a new scorer to your project. You can use an interactive prompt:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
mastra scorers add
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Or provide a scorer name directly:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
mastra scorers add answer-relevancy
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Use the [`list`](#list) command to get the correct ID.
|
|
217
|
+
|
|
218
|
+
### `list`
|
|
219
|
+
|
|
220
|
+
List all available scorer templates. Use the ID for the `add` command.
|
|
221
|
+
|
|
222
|
+
## `mastra init`
|
|
223
|
+
|
|
224
|
+
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 from scratch.
|
|
225
|
+
|
|
226
|
+
### Flags
|
|
227
|
+
|
|
228
|
+
The command accepts the following additional flags:
|
|
229
|
+
|
|
230
|
+
#### `--default`
|
|
231
|
+
|
|
232
|
+
Creates files inside `src` using OpenAI. It also populates the `src/mastra` folders with example code.
|
|
233
|
+
|
|
234
|
+
#### `--dir`
|
|
235
|
+
|
|
236
|
+
The directory where Mastra files should be saved to. Defaults to `src`.
|
|
237
|
+
|
|
238
|
+
#### `--components`
|
|
239
|
+
|
|
240
|
+
Comma-separated list of components to add. For each component a new folder will be created. Choose from: `"agents" | "tools" | "workflows" | "scorers"`. Defaults to `['agents', 'tools', 'workflows']`.
|
|
241
|
+
|
|
242
|
+
#### `--llm`
|
|
243
|
+
|
|
244
|
+
Default model provider. Choose from: `"openai" | "anthropic" | "groq" | "google" | "cerebras" | "mistral"`.
|
|
245
|
+
|
|
246
|
+
#### `--llm-api-key`
|
|
247
|
+
|
|
248
|
+
The API key for your chosen model provider. Will be written to an environment variables file (`.env`).
|
|
249
|
+
|
|
250
|
+
#### `--example`
|
|
251
|
+
|
|
252
|
+
If enabled, example code is written to the list of components (e.g. example agent code).
|
|
253
|
+
|
|
254
|
+
#### `--no-example`
|
|
255
|
+
|
|
256
|
+
Do not include example code. Useful when using the `--default` flag.
|
|
257
|
+
|
|
258
|
+
#### `--mcp`
|
|
259
|
+
|
|
260
|
+
Configure your code editor with Mastra's MCP server. Choose from: `"cursor" | "cursor-global" | "windsurf" | "vscode"`.
|
|
261
|
+
|
|
262
|
+
## `mastra migrate`
|
|
263
|
+
|
|
264
|
+
Runs database migrations to update your storage schema. This command is useful when upgrading Mastra versions that include storage schema changes.
|
|
265
|
+
|
|
266
|
+
The command bundles your project, connects to your configured storage backend, and executes any pending migrations. Currently supports:
|
|
267
|
+
|
|
268
|
+
- **Duplicate spans migration**: Removes duplicate `(traceId, spanId)` entries and adds a unique constraint to ensure data integrity.
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
mastra migrate
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
See the [Storage migration guide](https://mastra.ai/guides/migrations/upgrade-to-v1/storage) for details on when migrations are needed.
|
|
275
|
+
|
|
276
|
+
It accepts [common flags](#common-flags).
|
|
277
|
+
|
|
278
|
+
## Common flags
|
|
279
|
+
|
|
280
|
+
### `--dir`
|
|
281
|
+
|
|
282
|
+
**Available in:** `dev`, `build`, `lint`, `migrate`
|
|
283
|
+
|
|
284
|
+
The path to your Mastra folder. Defaults to `src/mastra`.
|
|
285
|
+
|
|
286
|
+
### `--debug`
|
|
287
|
+
|
|
288
|
+
**Available in:** `dev`, `build`, `migrate`
|
|
289
|
+
|
|
290
|
+
Enable verbose logging for Mastra's internals. Defaults to `false`.
|
|
291
|
+
|
|
292
|
+
### `--env`
|
|
293
|
+
|
|
294
|
+
**Available in:** `dev`, `start`, `studio`, `migrate`
|
|
295
|
+
|
|
296
|
+
Custom environment variables file to include. By default, includes `.env.development`, `.env.local`, and `.env`.
|
|
297
|
+
|
|
298
|
+
### `--root`
|
|
299
|
+
|
|
300
|
+
**Available in:** `dev`, `build`, `lint`, `migrate`
|
|
301
|
+
|
|
302
|
+
Path to your root folder. Defaults to `process.cwd()`.
|
|
303
|
+
|
|
304
|
+
### `--tools`
|
|
305
|
+
|
|
306
|
+
**Available in:** `dev`, `build`, `lint`
|
|
307
|
+
|
|
308
|
+
Comma-separated list of tool paths to include. Defaults to `src/mastra/tools`.
|
|
309
|
+
|
|
310
|
+
## Global flags
|
|
311
|
+
|
|
312
|
+
Use these flags to get information about the `mastra` CLI.
|
|
313
|
+
|
|
314
|
+
### `--version`
|
|
315
|
+
|
|
316
|
+
Prints the Mastra CLI version and exits.
|
|
317
|
+
|
|
318
|
+
### `--help`
|
|
319
|
+
|
|
320
|
+
Prints help message and exits.
|
|
321
|
+
|
|
322
|
+
## Telemetry
|
|
323
|
+
|
|
324
|
+
By default, Mastra collects anonymous information about your project like your OS, Mastra version or Node.js version. You can read the [source code](https://github.com/mastra-ai/mastra/blob/main/packages/cli/src/analytics/index.ts) to check what's collected.
|
|
325
|
+
|
|
326
|
+
You can opt out of the CLI analytics by setting an environment variable:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
MASTRA_TELEMETRY_DISABLED=1
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
You can also set this while using other `mastra` commands:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
MASTRA_TELEMETRY_DISABLED=1 mastra dev
|
|
336
|
+
```
|