@mastra/mcp-docs-server 1.1.5 → 1.1.6-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +8 -0
- package/package.json +5 -5
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Deployment
|
|
2
|
+
|
|
3
|
+
Deploy your Mastra application to production and expose your agents, tools, and workflows as REST API endpoints.
|
|
4
|
+
|
|
5
|
+
> **Info:** Mastra Cloud is currently in beta, but many teams are already using it to deploy their agents. It's the easiest way to run Mastra agents in a managed environment.
|
|
6
|
+
|
|
7
|
+
## Enable deployments
|
|
8
|
+
|
|
9
|
+
After [setting up your project](https://mastra.ai/docs/mastra-cloud/setup), click **Deployment** in the sidebar and select **Enable Deployments**.
|
|
10
|
+
|
|
11
|
+
Once enabled, your project automatically builds and deploys. Future pushes to your main branch trigger automatic redeployments.
|
|
12
|
+
|
|
13
|
+
## Dashboard
|
|
14
|
+
|
|
15
|
+
The **Overview** page shows your project's domain URL, status, latest deployment, and connected agents and workflows.
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
Click the **Deployments** menu item to view build logs. Open **Settings** to configure environment variables, branch, storage, and endpoint URLs.
|
|
20
|
+
|
|
21
|
+
> **Note:** Changes to settings require a new deployment to take effect
|
|
22
|
+
|
|
23
|
+
## Storage configuration
|
|
24
|
+
|
|
25
|
+
Mastra Cloud offers two storage options:
|
|
26
|
+
|
|
27
|
+
1. **Mastra Cloud Store**: Managed storage provided by Mastra Cloud
|
|
28
|
+
2. **Bring your own database**: Connect to your own external database
|
|
29
|
+
|
|
30
|
+
### Using Mastra Cloud Store
|
|
31
|
+
|
|
32
|
+
When using the managed Mastra Cloud Store (enabled in your project settings), storage must be configured on the `Mastra` instance, not on individual agent `Memory` instances.
|
|
33
|
+
|
|
34
|
+
Configure storage on your Mastra instance:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { Mastra } from '@mastra/core'
|
|
38
|
+
import { LibSQLStore } from '@mastra/libsql'
|
|
39
|
+
|
|
40
|
+
export const mastra = new Mastra({
|
|
41
|
+
storage: new LibSQLStore({
|
|
42
|
+
id: 'mastra-store',
|
|
43
|
+
url: 'file:./mastra.db',
|
|
44
|
+
}),
|
|
45
|
+
agents: { myAgent },
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Agents can use Memory without specifying storage as they inherit from the Mastra instance:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { Agent } from '@mastra/core/agent'
|
|
53
|
+
import { Memory } from '@mastra/memory'
|
|
54
|
+
|
|
55
|
+
export const myAgent = new Agent({
|
|
56
|
+
id: 'my-agent',
|
|
57
|
+
memory: new Memory({
|
|
58
|
+
// No storage here - uses instance-level storage from Mastra Cloud Store
|
|
59
|
+
options: {
|
|
60
|
+
lastMessages: 20,
|
|
61
|
+
},
|
|
62
|
+
}),
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Bring your own database
|
|
67
|
+
|
|
68
|
+
If you don't use Mastra Cloud Store, you can use any [storage provider](https://mastra.ai/docs/memory/storage) with any configuration. Set your database connection strings as environment variables in your project's **Settings** page.
|
|
69
|
+
|
|
70
|
+
## Using your deployment
|
|
71
|
+
|
|
72
|
+
After deployment, interact with your agents using the [Mastra Client](https://mastra.ai/docs/server/mastra-client) or call the REST API endpoints directly.
|
|
73
|
+
|
|
74
|
+
## Next steps
|
|
75
|
+
|
|
76
|
+
- [Studio](https://mastra.ai/docs/mastra-cloud/studio) - Test your agents in the cloud
|
|
77
|
+
- [Observability](https://mastra.ai/docs/mastra-cloud/observability) - Monitor traces and logs
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Observability
|
|
2
|
+
|
|
3
|
+
Cloud provides observability for production applications, giving you insight into how your agents and workflows behave. Observability works whether your application is deployed to Mastra Cloud, running locally, or hosted on your own infrastructure. Any Mastra project can send traces and logs to the platform regardless of where it's running.
|
|
4
|
+
|
|
5
|
+
For details on configuring observability, see the [Cloud Exporter](https://mastra.ai/docs/observability/tracing/exporters/cloud) docs.
|
|
6
|
+
|
|
7
|
+
## Traces
|
|
8
|
+
|
|
9
|
+
Traces are available for both agents and workflows by enabling [observability](https://mastra.ai/docs/observability/tracing/overview) using one of the [supported providers](https://mastra.ai/docs/observability/tracing/overview).
|
|
10
|
+
|
|
11
|
+
### Agents
|
|
12
|
+
|
|
13
|
+
With observability enabled, you can view detailed outputs from your agents in the **Traces** section in [Studio](https://mastra.ai/docs/mastra-cloud/studio).
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
Agent traces break a run into clear steps: model calls, tool calls, and intermediate chunks. Each includes timing, inputs, outputs, and errors. Drill into any span to inspect prompts, token usage, and results.
|
|
18
|
+
|
|
19
|
+
### Workflows
|
|
20
|
+
|
|
21
|
+
With observability enabled, you can view detailed outputs from your workflows in the **Traces** section in [Studio](https://mastra.ai/docs/mastra-cloud/studio).
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
Workflow traces capture each step in the run, including transitions, branching, timing, and any tool calls. Inspect inputs, outputs, and errors for every step to debug long-running or multi-step processes.
|
|
26
|
+
|
|
27
|
+
## Logs
|
|
28
|
+
|
|
29
|
+
The **Logs** page in the [project dashboard](https://mastra.ai/docs/mastra-cloud/deployment) displays detailed information for debugging and monitoring your application's behavior.
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
Each log entry includes its severity level and a detailed message showing agent, workflow, or storage activity.
|
|
34
|
+
|
|
35
|
+
## Next steps
|
|
36
|
+
|
|
37
|
+
- [Logging](https://mastra.ai/docs/observability/logging)
|
|
38
|
+
- [Tracing](https://mastra.ai/docs/observability/tracing/overview)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Mastra Cloud
|
|
2
|
+
|
|
3
|
+
[Mastra Cloud](https://cloud.mastra.ai) is a platform for deploying, managing, and monitoring Mastra applications. [Import your project](https://mastra.ai/docs/mastra-cloud/setup) to get started.
|
|
4
|
+
|
|
5
|
+
## Studio
|
|
6
|
+
|
|
7
|
+
Run [Studio](https://mastra.ai/docs/mastra-cloud/studio) in the cloud and share access with your team via a link. Team members can test agents and workflows, tweak system prompts, and give feedback without running the project locally.
|
|
8
|
+
|
|
9
|
+
## Deploy
|
|
10
|
+
|
|
11
|
+
Enable [deployments](https://mastra.ai/docs/mastra-cloud/deployment) and Mastra Cloud hosts your server for you. Connect your GitHub repository for automatic deployments whenever you push to your configured branch. Mastra Cloud exposes your agents, tools, and workflows as REST API endpoints.
|
|
12
|
+
|
|
13
|
+
Once deployed, the project dashboard gives you visibility into:
|
|
14
|
+
|
|
15
|
+
- Deployment status and history
|
|
16
|
+
- Build logs and configuration
|
|
17
|
+
- Environment variables and settings
|
|
18
|
+
|
|
19
|
+
## Observability
|
|
20
|
+
|
|
21
|
+
[Observability](https://mastra.ai/docs/mastra-cloud/observability) provides insight into how your agents and workflows behave in production. View detailed traces of agent runs, workflow executions, and logs to debug issues and understand performance.
|
|
22
|
+
|
|
23
|
+
> **Info:** You don’t need to deploy to Mastra Cloud to use Observability. You can send traces to Mastra from any environment
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Setup
|
|
2
|
+
|
|
3
|
+
Import your Mastra project to [Mastra Cloud](https://cloud.mastra.ai) to use [Studio](https://mastra.ai/docs/mastra-cloud/studio) and optionally [deploy](https://mastra.ai/docs/mastra-cloud/deployment) your agent.
|
|
4
|
+
|
|
5
|
+
## Before you begin
|
|
6
|
+
|
|
7
|
+
- [Sign in](https://cloud.mastra.ai) to Cloud
|
|
8
|
+
- Push your [Mastra project](https://mastra.ai/docs/getting-started/start) to GitHub
|
|
9
|
+
|
|
10
|
+
## Options
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
When you create a new project, you can choose from three options:
|
|
15
|
+
|
|
16
|
+
1. **Create from GitHub** - Import a Mastra project from GitHub
|
|
17
|
+
2. **Create from your server** - Connect a self-hosted Mastra instance to [Studio](https://mastra.ai/docs/mastra-cloud/studio)
|
|
18
|
+
3. **Create from template** - Start from a [pre-built template](https://mastra.ai/templates)
|
|
19
|
+
|
|
20
|
+
To create a project from GitHub, follow these steps:
|
|
21
|
+
|
|
22
|
+
## Create from GitHub
|
|
23
|
+
|
|
24
|
+
1. Connect to GitHub when prompted
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
2. Search for your repository and click **Import**
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
3. Configure your project settings. Mastra Cloud auto-detects most settings, but you'll still need to enter the environment variables for your configured [model provider](https://mastra.ai/models):
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
4. Click **Create Project**
|
|
37
|
+
|
|
38
|
+
## Next steps
|
|
39
|
+
|
|
40
|
+
Once your project is imported, [Studio](https://mastra.ai/docs/mastra-cloud/studio) automatically creates a sandbox where you can interact with your agents and share access with your team.
|
|
41
|
+
|
|
42
|
+
When you're ready for production, enable [Deployment](https://mastra.ai/docs/mastra-cloud/deployment) settings and hit deploy!
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Studio
|
|
2
|
+
|
|
3
|
+
[YouTube video player](https://www.youtube-nocookie.com/embed/ojGu6Bi4wYk)
|
|
4
|
+
|
|
5
|
+
Mastra Cloud provides a hosted version of [Studio](https://mastra.ai/docs/getting-started/studio) that gives your team a shared environment for interacting with and testing your agents. Team members can chat with agents, review traces, give feedback, and tweak system prompts - without needing to run the project locally.
|
|
6
|
+
|
|
7
|
+
[Set up your project](https://mastra.ai/docs/mastra-cloud/setup) to access Studio in the cloud.
|
|
8
|
+
|
|
9
|
+
See the [Studio documentation](https://mastra.ai/docs/getting-started/studio) for details on features like the Agents playground, Workflows runner, Tools testing, and MCP Servers.
|
|
10
|
+
|
|
11
|
+
> **Note:** You don't need to deploy your agent to use Studio. Studio runs in a sandbox environment separate from your production deployment
|
|
12
|
+
|
|
13
|
+
## Sharing access
|
|
14
|
+
|
|
15
|
+
To invite team members, go to [Mastra Cloud](https://cloud.mastra.ai), click **Team Settings**, then **Members** to add them. Once invited, they can sign in and access your project's Studio.
|
|
16
|
+
|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
> **Warning:** Team members can view environment variables and delete projects. Only invite people you trust.
|
|
20
|
+
|
|
21
|
+
## Next steps
|
|
22
|
+
|
|
23
|
+
- [Deployment](https://mastra.ai/docs/mastra-cloud/deployment) - Manage deployments and settings
|
|
24
|
+
- [Observability](https://mastra.ai/docs/mastra-cloud/observability) - Monitor traces and logs
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
Mastra Code is configured through project-level files, global settings, and environment variables. Configuration files live in `.mastracode/` directories at the project and user levels.
|
|
4
|
+
|
|
5
|
+
## Authentication
|
|
6
|
+
|
|
7
|
+
Mastra Code supports two authentication methods: **API keys** (environment variables) and **OAuth** (provider subscriptions). You can use either or both.
|
|
8
|
+
|
|
9
|
+
### API keys
|
|
10
|
+
|
|
11
|
+
The simplest way to get started is to set API key environment variables for the providers you want to use. Mastra Code auto-detects these on startup:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
15
|
+
export OPENAI_API_KEY=sk-...
|
|
16
|
+
export GOOGLE_GENERATIVE_AI_API_KEY=...
|
|
17
|
+
export DEEPSEEK_API_KEY=...
|
|
18
|
+
export CEREBRAS_API_KEY=...
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Mastra Code uses Mastra's [model router](https://mastra.ai/models), which routes requests to the correct provider based on the model ID and available API keys. No OAuth login is required when using API keys.
|
|
22
|
+
|
|
23
|
+
### OAuth login (optional)
|
|
24
|
+
|
|
25
|
+
If you have an Anthropic Claude Max or OpenAI ChatGPT Plus subscription, you can authenticate via OAuth to use your subscription instead of API keys. Run `/login` in the TUI to start the flow.
|
|
26
|
+
|
|
27
|
+
| Provider | OAuth flow | What you get |
|
|
28
|
+
| ------------- | ----------------------- | --------------------------------------------- |
|
|
29
|
+
| **Anthropic** | Claude Max subscription | Access to Claude models via your subscription |
|
|
30
|
+
| **OpenAI** | ChatGPT Plus / Codex | Access to OpenAI models via your subscription |
|
|
31
|
+
|
|
32
|
+
OAuth credentials are stored in `auth.json` alongside the database in the [app data directory](#database-location). During onboarding, you can skip the OAuth step if you already have API keys configured.
|
|
33
|
+
|
|
34
|
+
### Anthropic OAuth warning
|
|
35
|
+
|
|
36
|
+
Authenticating with a Claude Max subscription through OAuth is a grey area. Anthropic has reportedly banned users for using Claude max credentials outside of Claude Code, so it may violate Anthropic Terms of Service.
|
|
37
|
+
|
|
38
|
+
## MCP servers
|
|
39
|
+
|
|
40
|
+
Mastra Code can connect to external [MCP](https://mastra.ai/docs/mcp/overview) servers and make their tools available to the agent. Configure servers in JSON files:
|
|
41
|
+
|
|
42
|
+
| Priority | Path | Scope |
|
|
43
|
+
| -------- | ----------------------------- | -------------------------------- |
|
|
44
|
+
| Highest | `.mastracode/mcp.json` | Project |
|
|
45
|
+
| | `~/.mastracode/mcp.json` | Global |
|
|
46
|
+
| Lowest | `.claude/settings.local.json` | Project (Claude Code compatible) |
|
|
47
|
+
|
|
48
|
+
Project config overrides global config by server name. Claude Code settings are the lowest priority fallback.
|
|
49
|
+
|
|
50
|
+
### MCP config format
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"my-server": {
|
|
56
|
+
"command": "npx",
|
|
57
|
+
"args": ["-y", "@my-org/mcp-server"],
|
|
58
|
+
"env": {
|
|
59
|
+
"API_KEY": "your-key"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Each server entry requires a `command` field. The `args` and `env` fields are optional.
|
|
67
|
+
|
|
68
|
+
On startup, Mastra Code connects to all configured servers and reports the status:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
MCP: 2 server(s) connected, 15 tool(s)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Tools from MCP servers are namespaced as `serverName_toolName` and appear in the agent's tool list alongside built-in tools.
|
|
75
|
+
|
|
76
|
+
## Hooks
|
|
77
|
+
|
|
78
|
+
Hooks are user-configured shell commands that run at specific lifecycle events. Use hooks for custom validation, logging, notifications, or integration with external systems.
|
|
79
|
+
|
|
80
|
+
### Hook config format
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"PreToolUse": [
|
|
85
|
+
{
|
|
86
|
+
"type": "command",
|
|
87
|
+
"command": "node scripts/validate-tool.js",
|
|
88
|
+
"matcher": {
|
|
89
|
+
"tool_name": "execute_command"
|
|
90
|
+
},
|
|
91
|
+
"timeout": 5000,
|
|
92
|
+
"description": "Validate shell commands before execution"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"PostToolUse": [
|
|
96
|
+
{
|
|
97
|
+
"type": "command",
|
|
98
|
+
"command": "node scripts/log-tool.js",
|
|
99
|
+
"description": "Log tool usage"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Hook events
|
|
106
|
+
|
|
107
|
+
| Event | When it fires | Can block? |
|
|
108
|
+
| ------------------ | --------------------------------------------------------------- | ---------- |
|
|
109
|
+
| `PreToolUse` | Before a tool call executes | Yes |
|
|
110
|
+
| `PostToolUse` | After a tool call completes | No |
|
|
111
|
+
| `Stop` | When an agent response ends (`complete`, `aborted`, or `error`) | Yes |
|
|
112
|
+
| `UserPromptSubmit` | When the user sends a message | Yes |
|
|
113
|
+
| `SessionStart` | When a session begins | No |
|
|
114
|
+
| `SessionEnd` | When a session ends | No |
|
|
115
|
+
| `Notification` | When the TUI fires a notification | No |
|
|
116
|
+
|
|
117
|
+
`UserPromptSubmit` runs before a non-command prompt is sent to the agent. If a hook blocks, the prompt is not sent.
|
|
118
|
+
|
|
119
|
+
### Hook I/O protocol
|
|
120
|
+
|
|
121
|
+
Hook processes receive a JSON payload on stdin with context about the event:
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"session_id": "thread-abc123",
|
|
126
|
+
"cwd": "/path/to/project",
|
|
127
|
+
"hook_event_name": "PreToolUse",
|
|
128
|
+
"tool_name": "execute_command",
|
|
129
|
+
"tool_input": { "command": "npm test" }
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
For blocking events (`PreToolUse`, `Stop`, `UserPromptSubmit`), the hook can respond on stdout with a JSON object:
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"decision": "block",
|
|
138
|
+
"reason": "This command is not allowed"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Hook config locations
|
|
143
|
+
|
|
144
|
+
| Priority | Path | Scope |
|
|
145
|
+
| -------- | -------------------------- | ------------------------------- |
|
|
146
|
+
| Higher | `.mastracode/hooks.json` | Project (appended after global) |
|
|
147
|
+
| Lower | `~/.mastracode/hooks.json` | Global (runs first) |
|
|
148
|
+
|
|
149
|
+
Global hooks run before project hooks. For the same event, all hooks execute in order.
|
|
150
|
+
|
|
151
|
+
## Custom slash commands
|
|
152
|
+
|
|
153
|
+
Define reusable prompt templates as markdown files. Mastra Code scans these directories for `.md` files:
|
|
154
|
+
|
|
155
|
+
| Priority | Path | Scope |
|
|
156
|
+
| -------- | ------------------------- | -------------------------------- |
|
|
157
|
+
| Highest | `.mastracode/commands/` | Project |
|
|
158
|
+
| | `.claude/commands/` | Project (Claude Code compatible) |
|
|
159
|
+
| | `~/.mastracode/commands/` | Global |
|
|
160
|
+
| Lowest | `~/.claude/commands/` | Global (Claude Code compatible) |
|
|
161
|
+
|
|
162
|
+
Each command file can include YAML frontmatter with `name` and `description` fields:
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
---
|
|
166
|
+
name: review
|
|
167
|
+
description: Review the current diff for issues
|
|
168
|
+
---
|
|
169
|
+
Review my current git diff. Look for bugs, security issues,
|
|
170
|
+
and violations of the project's coding standards.
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The filename (or directory structure) determines the command name. For example, `git/commit.md` becomes `/git:commit`.
|
|
174
|
+
|
|
175
|
+
Commands support variables like `$ARGUMENTS` for positional args, `@filename` for file content injection, and `!command` for shell command output.
|
|
176
|
+
|
|
177
|
+
## Skills
|
|
178
|
+
|
|
179
|
+
Skills are structured instruction files that the agent loads automatically based on trigger conditions. They provide domain-specific guidance without manually pasting instructions.
|
|
180
|
+
|
|
181
|
+
Mastra Code scans these directories for skills:
|
|
182
|
+
|
|
183
|
+
| Priority | Path | Scope |
|
|
184
|
+
| -------- | ----------------------- | -------------------------------- |
|
|
185
|
+
| Highest | `.mastracode/skills/` | Project |
|
|
186
|
+
| | `.claude/skills/` | Project (Claude Code compatible) |
|
|
187
|
+
| | `~/.mastracode/skills/` | Global |
|
|
188
|
+
| Lowest | `~/.claude/skills/` | Global (Claude Code compatible) |
|
|
189
|
+
|
|
190
|
+
Each skill is a directory containing a `SKILL.md` file with instructions and trigger descriptions. Skills installed via symlinks (e.g., from `npx skills add`) are automatically resolved.
|
|
191
|
+
|
|
192
|
+
## Agent instructions
|
|
193
|
+
|
|
194
|
+
Mastra Code loads project-specific instructions from `AGENTS.md` or `CLAUDE.md` files and injects them into the agent's system prompt. This is how you can customize the agent's behavior for your project.
|
|
195
|
+
|
|
196
|
+
### Lookup order
|
|
197
|
+
|
|
198
|
+
For project instructions (first match wins):
|
|
199
|
+
|
|
200
|
+
1. `AGENTS.md` or `CLAUDE.md` in the project root
|
|
201
|
+
2. `.claude/AGENTS.md` or `.claude/CLAUDE.md`
|
|
202
|
+
3. `.mastracode/AGENTS.md` or `.mastracode/CLAUDE.md`
|
|
203
|
+
|
|
204
|
+
For global instructions (first match wins):
|
|
205
|
+
|
|
206
|
+
1. `~/.claude/AGENTS.md` or `~/.claude/CLAUDE.md`
|
|
207
|
+
2. `~/.mastracode/AGENTS.md` or `~/.mastracode/CLAUDE.md`
|
|
208
|
+
3. `~/.config/claude/AGENTS.md` or `~/.config/claude/CLAUDE.md`
|
|
209
|
+
4. `~/.config/mastracode/AGENTS.md` or `~/.config/mastracode/CLAUDE.md`
|
|
210
|
+
|
|
211
|
+
`AGENTS.md` takes priority over `CLAUDE.md` when both exist at the same location.
|
|
212
|
+
|
|
213
|
+
## Storage
|
|
214
|
+
|
|
215
|
+
Mastra Code stores threads, messages, state, and observational memory in a database. It uses LibSQL by default with a local file — no setup needed.
|
|
216
|
+
|
|
217
|
+
To switch to a remote LibSQL (Turso) or PostgreSQL backend, run `/settings` and select a storage backend. You'll be prompted for a connection URL.
|
|
218
|
+
|
|
219
|
+
If a PostgreSQL connection fails on startup, Mastra Code falls back to LibSQL and shows a warning so you can fix the connection via `/settings`.
|
|
220
|
+
|
|
221
|
+
## Observational memory
|
|
222
|
+
|
|
223
|
+
[Observational memory](https://mastra.ai/docs/memory/observational-memory) (OM) uses background agents to maintain a dense log of observations and reflections about the conversation, providing long-term context that persists across sessions.
|
|
224
|
+
|
|
225
|
+
### OM scope
|
|
226
|
+
|
|
227
|
+
Control whether observations are scoped to individual threads or shared across all threads for a project:
|
|
228
|
+
|
|
229
|
+
| Scope | Behavior |
|
|
230
|
+
| ------------------ | --------------------------------------------------------------- |
|
|
231
|
+
| `thread` (default) | Observations are private to each conversation thread |
|
|
232
|
+
| `resource` | Observations are shared across all threads for the same project |
|
|
233
|
+
|
|
234
|
+
Configure the scope through:
|
|
235
|
+
|
|
236
|
+
1. `MASTRA_OM_SCOPE` environment variable (`"thread"` or `"resource"`)
|
|
237
|
+
2. `.mastracode/database.json` → `omScope` field
|
|
238
|
+
3. `~/.mastracode/database.json` → `omScope` field
|
|
239
|
+
|
|
240
|
+
### OM model settings
|
|
241
|
+
|
|
242
|
+
The observer and reflector models default to `google/gemini-2.5-flash`. Override them per-thread through the `/settings` panel or in the harness state.
|
|
243
|
+
|
|
244
|
+
### OM thresholds
|
|
245
|
+
|
|
246
|
+
| Threshold | Default | Description |
|
|
247
|
+
| --------------------- | ------------- | --------------------------------------------- |
|
|
248
|
+
| Observation threshold | 30,000 tokens | Token count that triggers an observation pass |
|
|
249
|
+
| Reflection threshold | 40,000 tokens | Token count that triggers a reflection pass |
|
|
250
|
+
|
|
251
|
+
## Color theme
|
|
252
|
+
|
|
253
|
+
Mastra Code detects your terminal's color scheme and applies a matching dark or light theme. You can override the detected theme with the `/theme` slash command or the `MASTRA_THEME` environment variable.
|
|
254
|
+
|
|
255
|
+
### Detection order
|
|
256
|
+
|
|
257
|
+
1. `MASTRA_THEME` environment variable — explicit `dark` or `light`
|
|
258
|
+
2. Persisted setting from `/theme` command (stored in `settings.json`)
|
|
259
|
+
3. OSC 11 query — asks your terminal for its actual background color
|
|
260
|
+
4. `COLORFGBG` environment variable (set by some terminals like iTerm2 and Konsole)
|
|
261
|
+
5. Falls back to dark theme
|
|
262
|
+
|
|
263
|
+
### Switching themes
|
|
264
|
+
|
|
265
|
+
Use the `/theme` command to change the theme at runtime:
|
|
266
|
+
|
|
267
|
+
```text
|
|
268
|
+
/theme light
|
|
269
|
+
/theme dark
|
|
270
|
+
/theme auto
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Running `/theme` with no arguments shows the current theme. The choice is persisted across sessions.
|
|
274
|
+
|
|
275
|
+
## Environment variables
|
|
276
|
+
|
|
277
|
+
| Variable | Description |
|
|
278
|
+
| ---------------------- | -------------------------------------------------------------- |
|
|
279
|
+
| `MASTRA_DB_URL` | LibSQL database URL (e.g., `libsql://...` or `file:./data.db`) |
|
|
280
|
+
| `MASTRA_DB_AUTH_TOKEN` | Auth token for remote LibSQL database |
|
|
281
|
+
| `MASTRA_DB_PATH` | Override the local database file path |
|
|
282
|
+
| `MASTRA_USER_ID` | Override the auto-detected user identity |
|
|
283
|
+
| `MASTRA_RESOURCE_ID` | Override the auto-detected project resource ID |
|
|
284
|
+
| `MASTRA_OM_SCOPE` | Observational memory scope (`thread` or `resource`) |
|
|
285
|
+
| `DEFAULT_OM_MODEL_ID` | Default model for OM observer and reflector |
|
|
286
|
+
| `MASTRA_THEME` | Color theme override (`dark` or `light`) |
|
|
287
|
+
| `TAVILY_API_KEY` | Enable Tavily-powered web search and extract tools |
|
|
288
|
+
|
|
289
|
+
## Resource ID override
|
|
290
|
+
|
|
291
|
+
Resource IDs determine how threads are grouped. By default, Mastra Code generates one from the Git remote URL or filesystem path. Override it to share threads across repositories or isolate threads within a monorepo:
|
|
292
|
+
|
|
293
|
+
```json
|
|
294
|
+
{
|
|
295
|
+
"resourceId": "my-custom-project-id"
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
You can also set `MASTRA_RESOURCE_ID` as an environment variable. Two users who set the same resource ID share threads and observations for that resource.
|