@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,214 @@
|
|
|
1
|
+
# Using Tools
|
|
2
|
+
|
|
3
|
+
Agents use tools to call APIs, query databases, or run custom functions from your codebase. Tools give agents capabilities beyond language generation by providing structured access to data and performing clearly defined operations. You can also load tools from remote [MCP servers](https://mastra.ai/docs/mcp/overview) to expand an agent's capabilities.
|
|
4
|
+
|
|
5
|
+
## When to use tools
|
|
6
|
+
|
|
7
|
+
Use tools when an agent needs additional context or information from remote resources, or when it needs to run code that performs a specific operation. This includes tasks a model can't reliably handle on its own, such as fetching live data or returning consistent, well defined outputs.
|
|
8
|
+
|
|
9
|
+
## Creating a tool
|
|
10
|
+
|
|
11
|
+
When creating tools, keep descriptions simple and focused on what the tool does, emphasizing its primary use case. Descriptive schema names can also help guide the agent on how to use the tool.
|
|
12
|
+
|
|
13
|
+
This example shows how to create a tool that fetches weather data from an API. When the agent calls the tool, it provides the required input as defined by the tool's `inputSchema`. The tool accesses this data through its `inputData` parameter, which in this example includes the `location` used in the weather API query.
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { createTool } from '@mastra/core/tools'
|
|
17
|
+
import { z } from 'zod'
|
|
18
|
+
|
|
19
|
+
export const weatherTool = createTool({
|
|
20
|
+
id: 'weather-tool',
|
|
21
|
+
description: 'Fetches weather for a location',
|
|
22
|
+
inputSchema: z.object({
|
|
23
|
+
location: z.string(),
|
|
24
|
+
}),
|
|
25
|
+
outputSchema: z.object({
|
|
26
|
+
weather: z.string(),
|
|
27
|
+
}),
|
|
28
|
+
execute: async inputData => {
|
|
29
|
+
const { location } = inputData
|
|
30
|
+
|
|
31
|
+
const response = await fetch(`https://wttr.in/${location}?format=3`)
|
|
32
|
+
const weather = await response.text()
|
|
33
|
+
|
|
34
|
+
return { weather }
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Adding tools to an agent
|
|
40
|
+
|
|
41
|
+
To make a tool available to an agent, add it to `tools`. Mentioning available tools and their general purpose in the agent's system prompt helps the agent decide when to call a tool and when not to.
|
|
42
|
+
|
|
43
|
+
An agent can use multiple tools to handle more complex tasks by delegating specific parts to individual tools. The agent decides which tools to use based on the user's message, the agent's instructions, and the tool descriptions and schemas.
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { Agent } from '@mastra/core/agent'
|
|
47
|
+
import { weatherTool } from '../tools/weather-tool'
|
|
48
|
+
|
|
49
|
+
export const weatherAgent = new Agent({
|
|
50
|
+
id: 'weather-agent',
|
|
51
|
+
name: 'Weather Agent',
|
|
52
|
+
instructions: `
|
|
53
|
+
You are a helpful weather assistant.
|
|
54
|
+
Use the weatherTool to fetch current weather data.`,
|
|
55
|
+
model: 'openai/gpt-5.1',
|
|
56
|
+
tools: { weatherTool },
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Using multiple tools
|
|
61
|
+
|
|
62
|
+
When multiple tools are available, the agent may choose to use one, several, or none, depending on what's needed to answer the query.
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { weatherTool } from '../tools/weather-tool'
|
|
66
|
+
import { activitiesTool } from '../tools/activities-tool'
|
|
67
|
+
|
|
68
|
+
export const weatherAgent = new Agent({
|
|
69
|
+
id: 'weather-agent',
|
|
70
|
+
name: 'Weather Agent',
|
|
71
|
+
tools: { weatherTool, activitiesTool },
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Using agents as tools
|
|
76
|
+
|
|
77
|
+
Agents can be added to other agents through the `agents` configuration. When you add subagents, the parent agent becomes a supervisor. A supervisor can delegate tasks to subagents using the [supervisor pattern](https://mastra.ai/docs/agents/supervisor-agents), with support for delegation hooks, message filtering, iteration monitoring, and task completion scoring. Mastra automatically converts each subagent to a tool that the parent agent can call, named `agent-<agentName>`.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { Agent } from '@mastra/core/agent'
|
|
81
|
+
|
|
82
|
+
export const parentAgent = new Agent({
|
|
83
|
+
id: 'parent-agent',
|
|
84
|
+
name: 'Parent Agent',
|
|
85
|
+
description: 'Take care in writing a good description here',
|
|
86
|
+
instructions: `Instructions`,
|
|
87
|
+
model: 'openai/gpt-5.1',
|
|
88
|
+
agents: {
|
|
89
|
+
subAgent,
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const subAgent = new Agent({
|
|
94
|
+
id: 'sub-agent',
|
|
95
|
+
name: 'Sub Agent',
|
|
96
|
+
description: 'Take care in writing a good description here',
|
|
97
|
+
instructions: `Instructions`,
|
|
98
|
+
model: 'openai/gpt-5.1',
|
|
99
|
+
})
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The subagent should include a `description` to help the parent agent understand when to use it. See the [`toolName` docs](#subagents-and-workflows-as-tools) to learn more about the tool naming scheme.
|
|
103
|
+
|
|
104
|
+
## Using workflows as tools
|
|
105
|
+
|
|
106
|
+
Workflows can be added to agents through the `workflows` configuration. When you add a workflow, Mastra automatically converts it to a tool that the agent can call. The generated tool is named `workflow-<workflowName>` and uses the workflow's `inputSchema` and `outputSchema`.
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { Agent } from '@mastra/core/agent'
|
|
110
|
+
import { researchWorkflow } from '../workflows/research-workflow'
|
|
111
|
+
|
|
112
|
+
export const researchAgent = new Agent({
|
|
113
|
+
id: 'research-agent',
|
|
114
|
+
name: 'Research Agent',
|
|
115
|
+
instructions: `
|
|
116
|
+
You are a research assistant.
|
|
117
|
+
Use the research workflow to gather and compile information on topics.`,
|
|
118
|
+
model: 'openai/gpt-5.1',
|
|
119
|
+
tools: {
|
|
120
|
+
weatherTool,
|
|
121
|
+
},
|
|
122
|
+
workflows: {
|
|
123
|
+
researchWorkflow,
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The workflow should include a `description` to help the agent understand when to use it:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { createWorkflow } from '@mastra/core/workflows'
|
|
132
|
+
import { z } from 'zod'
|
|
133
|
+
|
|
134
|
+
export const researchWorkflow = createWorkflow({
|
|
135
|
+
id: 'research-workflow',
|
|
136
|
+
description: 'Gathers information on a topic and compiles a summary report.',
|
|
137
|
+
// Rest of the workflow...
|
|
138
|
+
}).commit()
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
When the agent calls the workflow tool, it receives a response containing the workflow result and a `runId` that can be used to track the execution:
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
{
|
|
145
|
+
result: { summary: "...", sources: ["..."] },
|
|
146
|
+
runId: "abc-123"
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
See the [`toolName` docs](#subagents-and-workflows-as-tools) to learn more about the tool naming scheme.
|
|
151
|
+
|
|
152
|
+
## Controlling `toolName` in stream responses
|
|
153
|
+
|
|
154
|
+
The `toolName` in stream responses is determined by the **object key** you use, not the `id` property of the tool, agent, or workflow.
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// Tool defined with id: "weather-tool"
|
|
158
|
+
export const weatherTool = createTool({
|
|
159
|
+
id: "weather-tool",
|
|
160
|
+
// ...
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Using the variable name as the key
|
|
164
|
+
tools: { weatherTool }
|
|
165
|
+
// Stream returns: toolName: "weatherTool"
|
|
166
|
+
|
|
167
|
+
// Using the tool's id as the key
|
|
168
|
+
tools: { [weatherTool.id]: weatherTool }
|
|
169
|
+
// Stream returns: toolName: "weather-tool"
|
|
170
|
+
|
|
171
|
+
// Using a custom key
|
|
172
|
+
tools: { "my-custom-name": weatherTool }
|
|
173
|
+
// Stream returns: toolName: "my-custom-name"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
This lets you specify how tools are identified in the stream. If you want the `toolName` to match the tool's `id`, use the tool's `id` as the object key.
|
|
177
|
+
|
|
178
|
+
### Subagents and workflows as tools
|
|
179
|
+
|
|
180
|
+
Subagents and workflows follow the same pattern. They are converted to tools with a prefix followed by your object key:
|
|
181
|
+
|
|
182
|
+
| Property | Prefix | Example key | `toolName` |
|
|
183
|
+
| ----------- | ----------- | ----------- | ------------------- |
|
|
184
|
+
| `agents` | `agent-` | `weather` | `agent-weather` |
|
|
185
|
+
| `workflows` | `workflow-` | `research` | `workflow-research` |
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const orchestrator = new Agent({
|
|
189
|
+
agents: {
|
|
190
|
+
weather: weatherAgent, // toolName: "agent-weather"
|
|
191
|
+
},
|
|
192
|
+
workflows: {
|
|
193
|
+
research: researchWorkflow, // toolName: "workflow-research"
|
|
194
|
+
},
|
|
195
|
+
})
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Note that for subagents, you'll see two different identifiers in stream responses:
|
|
199
|
+
|
|
200
|
+
- `toolName: "agent-weather"` in tool call events — the generated tool wrapper name
|
|
201
|
+
- `id: "weather-agent"` in `data-tool-agent` chunks — the subagent's actual `id` property
|
|
202
|
+
|
|
203
|
+
## Tools with structured output
|
|
204
|
+
|
|
205
|
+
When using tools with [structured output](https://mastra.ai/docs/agents/structured-output), some models don't support combining both features in the same API call. If your tools aren't being called when structured output is enabled, or you receive errors about incompatible options, see [Combining tools and structured output](https://mastra.ai/docs/agents/structured-output) for model compatibility information and workarounds.
|
|
206
|
+
|
|
207
|
+
## Related
|
|
208
|
+
|
|
209
|
+
- [MCP Overview](https://mastra.ai/docs/mcp/overview)
|
|
210
|
+
- [Dynamic Tool Search](https://mastra.ai/reference/processors/tool-search-processor) - Load tools on demand for agents with large tool libraries
|
|
211
|
+
- [Structured Output](https://mastra.ai/docs/agents/structured-output)
|
|
212
|
+
- [Agent Memory](https://mastra.ai/docs/agents/agent-memory)
|
|
213
|
+
- [Supervisor Agents](https://mastra.ai/docs/agents/supervisor-agents)
|
|
214
|
+
- [Request Context](https://mastra.ai/docs/server/request-context)
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Mastra Docs Server
|
|
2
|
+
|
|
3
|
+
The `@mastra/mcp-docs-server` package provides direct access to Mastra’s full documentation via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). It works with Cursor, Windsurf, Cline, Claude Code, VS Code, Codex or any tool that supports MCP.
|
|
4
|
+
|
|
5
|
+
These tools are designed to help agents retrieve precise, task-specific information — whether you're adding a feature to an agent, scaffolding a new project, or exploring how something works.
|
|
6
|
+
|
|
7
|
+
In this guide you'll learn how to add Mastra's MCP server to your AI tooling.
|
|
8
|
+
|
|
9
|
+
[YouTube video player](https://www.youtube-nocookie.com/embed/vciV57lF0og)
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### create-mastra
|
|
14
|
+
|
|
15
|
+
During the interactive [create-mastra](https://mastra.ai/reference/cli/create-mastra) wizard, choose one of your tools in the MCP step.
|
|
16
|
+
|
|
17
|
+
### Manual setup
|
|
18
|
+
|
|
19
|
+
If there are no specific instructions for your tool below, you may be able to add the MCP server with this common JSON configuration anyways.
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"mastra": {
|
|
25
|
+
"type": "stdio",
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": ["-y", "@mastra/mcp-docs-server@latest"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Claude Code CLI
|
|
34
|
+
|
|
35
|
+
Install using the terminal command:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
claude mcp add --scope project mastra -- npx -y @mastra/mcp-docs-server@latest
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This creates a project-scoped `.mcp.json` file if one doesn't already exist. You can use the same command when using Claude Code as a [Visual Studio Code extension](https://code.claude.com/docs/en/vs-code#connect-to-external-tools-with-mcp).
|
|
42
|
+
|
|
43
|
+
[More info on using MCP servers with Claude Code](https://docs.claude.com/en/docs/claude-code/mcp)
|
|
44
|
+
|
|
45
|
+
### OpenAI Codex CLI
|
|
46
|
+
|
|
47
|
+
1. Register it from the terminal:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
codex mcp add mastra-docs -- npx -y @mastra/mcp-docs-server@latest
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. Run `codex mcp list` to confirm the server shows as `enabled`.
|
|
54
|
+
|
|
55
|
+
[More info on using MCP servers with OpenAI Codex](https://developers.openai.com/codex/mcp)
|
|
56
|
+
|
|
57
|
+
### Cursor
|
|
58
|
+
|
|
59
|
+
Install by clicking the button below:
|
|
60
|
+
|
|
61
|
+
[](cursor://anysphere.cursor-deeplink/mcp/install?name=mastra\&config=eyJjb21tYW5kIjoibnB4IC15IEBtYXN0cmEvbWNwLWRvY3Mtc2VydmVyIn0%3D)
|
|
62
|
+
|
|
63
|
+
If you followed the automatic installation, you'll see a popup when you open cursor in the bottom left corner to prompt you to enable the Mastra Docs MCP Server.
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
[More info on using MCP servers with Cursor](https://cursor.com/de/docs/context/mcp)
|
|
68
|
+
|
|
69
|
+
### Antigravity
|
|
70
|
+
|
|
71
|
+
Google Antigravity is an agent-first development platform that supports MCP servers for accessing external documentation, APIs, and project context.
|
|
72
|
+
|
|
73
|
+
1. Open your Antigravity MCP configuration file:
|
|
74
|
+
|
|
75
|
+
- Click on **Agent session** and select the **“…” dropdown** at the top of the editor’s side panel, then select **MCP Servers** to access the **MCP Store**.
|
|
76
|
+
- You can access it through the MCP Store interface in Antigravity
|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
2. To add a custom MCP server, select **Manage MCP Servers** at the top of the MCP Store and click **View raw config** in the main tab.
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
3. Add the Mastra MCP server configuration:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"mastra-docs": {
|
|
90
|
+
"command": "npx",
|
|
91
|
+
"args": ["-y", "@mastra/mcp-docs-server"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
4. Save the configuration and restart Antigravity
|
|
98
|
+
|
|
99
|
+

|
|
100
|
+
|
|
101
|
+
Once configured, the Mastra MCP server exposes the following to Antigravity agents:
|
|
102
|
+
|
|
103
|
+
- Indexed documentation and API schemas for Mastra, enabling programmatic retrieval of relevant context during code generation
|
|
104
|
+
- Access to example code snippets and usage patterns stored in Mastra Docs
|
|
105
|
+
- Structured data for error handling and debugging references in the editor
|
|
106
|
+
- Metadata about current Mastra project patterns for code suggestion and completion
|
|
107
|
+
|
|
108
|
+
The MCP server will appear in Antigravity's MCP Store, where you can manage its connection status and authentication if needed.
|
|
109
|
+
|
|
110
|
+
[More info on using MCP servers with Antigravity](https://antigravity.google)
|
|
111
|
+
|
|
112
|
+
### Visual Studio Code
|
|
113
|
+
|
|
114
|
+
1. Create a `.vscode/mcp.json` file in your workspace
|
|
115
|
+
|
|
116
|
+
2. Insert the following configuration:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"servers": {
|
|
121
|
+
"mastra": {
|
|
122
|
+
"type": "stdio",
|
|
123
|
+
"command": "npx",
|
|
124
|
+
"args": ["-y", "@mastra/mcp-docs-server@latest"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Once you installed the MCP server, you can use it like so:
|
|
131
|
+
|
|
132
|
+
1. Open VSCode settings.
|
|
133
|
+
|
|
134
|
+
2. Navigate to MCP settings.
|
|
135
|
+
|
|
136
|
+
3. Click "enable" on the Chat > MCP option.
|
|
137
|
+
|
|
138
|
+

|
|
139
|
+
|
|
140
|
+
MCP only works in Agent mode in VSCode. Once you are in agent mode, open the `mcp.json` file and click the "start" button. Note that the "start" button will only appear if the `.vscode` folder containing `mcp.json` is in your workspace root, or the highest level of the in-editor file explorer.
|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+
After starting the MCP server, click the tools button in the Copilot pane to see available tools.
|
|
145
|
+
|
|
146
|
+

|
|
147
|
+
|
|
148
|
+
[More info on using MCP servers with Visual Studio Code](https://code.visualstudio.com/docs/copilot/customization/mcp-servers)
|
|
149
|
+
|
|
150
|
+
### Windsurf
|
|
151
|
+
|
|
152
|
+
1. Open `~/.codeium/windsurf/mcp_config.json` in your editor
|
|
153
|
+
|
|
154
|
+
2. Insert the following configuration:
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"mcpServers": {
|
|
159
|
+
"mastra": {
|
|
160
|
+
"command": "npx",
|
|
161
|
+
"args": ["-y", "@mastra/mcp-docs-server@latest"]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
3. Save the configuration and restart Windsurf
|
|
168
|
+
|
|
169
|
+
[More info on using MCP servers with Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp#mcp-config-json)
|
|
170
|
+
|
|
171
|
+
### OpenCode
|
|
172
|
+
|
|
173
|
+
You can define MCP servers in your [OpenCode configuration](https://opencode.ai/docs/config/) under `mcp`. Create an `opencode.jsonc` file in your project root with the following content:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"$schema": "https://opencode.ai/config.json",
|
|
178
|
+
"mcp": {
|
|
179
|
+
"mastra": {
|
|
180
|
+
"type": "local",
|
|
181
|
+
"command": ["npx", "-y", "@mastra/mcp-docs-server@latest"],
|
|
182
|
+
"enabled": true
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
[More info on using MCP servers with OpenCode](https://opencode.ai/docs/mcp-servers)
|
|
189
|
+
|
|
190
|
+
### Zed
|
|
191
|
+
|
|
192
|
+
1. Open `~/.config/zed/settings.json` in your editor
|
|
193
|
+
2. Insert the following configuration:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"context_servers": {
|
|
198
|
+
"Mastra": {
|
|
199
|
+
"command": "npx",
|
|
200
|
+
"args": ["-y", "@mastra/mcp-docs-server@latest"]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Usage
|
|
207
|
+
|
|
208
|
+
Once configured, you can ask your AI tool questions about Mastra or instruct it to take actions. For these steps, it'll take the up-to-date information from Mastra's MCP server.
|
|
209
|
+
|
|
210
|
+
**Add features:**
|
|
211
|
+
|
|
212
|
+
- "Add evals to my agent and write tests"
|
|
213
|
+
- "Write me a workflow that does the following `[task]`"
|
|
214
|
+
- "Make a new tool that allows my agent to access `[3rd party API]`"
|
|
215
|
+
|
|
216
|
+
**Ask about integrations:**
|
|
217
|
+
|
|
218
|
+
- "Does Mastra work with the AI SDK? How can I use it in my `[React/Svelte/etc]` project?"
|
|
219
|
+
- "Does Mastra support `[provider]` speech and voice APIs? Show me an example in my code of how I can use it."
|
|
220
|
+
|
|
221
|
+
**Debug or update existing code:**
|
|
222
|
+
|
|
223
|
+
- "I'm running into a bug with agent memory, have there been any related changes or bug fixes recently?"
|
|
224
|
+
- "How does working memory behave in Mastra and how can I use it to do `[task]`? It doesn't seem to work the way I expect."
|
|
225
|
+
- "I saw there are new workflow features, explain them to me and then update `[workflow]` to use them."
|
|
226
|
+
|
|
227
|
+
### Troubleshooting
|
|
228
|
+
|
|
229
|
+
1. **Server Not Starting**
|
|
230
|
+
|
|
231
|
+
- Ensure [npx](https://docs.npmjs.com/cli/v11/commands/npx) is installed and working.
|
|
232
|
+
- Check for conflicting MCP servers.
|
|
233
|
+
- Verify your configuration file syntax.
|
|
234
|
+
|
|
235
|
+
2. **Tool Calls Failing**
|
|
236
|
+
|
|
237
|
+
- Restart the MCP server and/or your IDE.
|
|
238
|
+
- Update to the latest version of your IDE.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Mastra Skills
|
|
2
|
+
|
|
3
|
+
Mastra Skills are folders of instructions, scripts, and resources that agents can discover and use to gain Mastra knowledge. They contain setup instructions, best practices, and methods to fetch up-to-date information from Mastra's documentation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To install all available Mastra skills, run the following command:
|
|
8
|
+
|
|
9
|
+
**npm**:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx skills add mastra-ai/skills
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**pnpm**:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm dlx skills add mastra-ai/skills
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Yarn**:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn dlx skills add mastra-ai/skills
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Bun**:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun x skills add mastra-ai/skills
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Mastra skills work with any coding agent that supports the [Skills standard](https://agentskills.io/), including Claude Code, Cursor, Codex, OpenCode, and others.
|
|
34
|
+
|
|
35
|
+
They are also available on [GitHub](https://github.com/mastra-ai/skills).
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Contributing Templates
|
|
2
|
+
|
|
3
|
+
The Mastra community plays a vital role in creating templates that showcase innovative application patterns. We're currently reworking our template contribution process to ensure high-quality, valuable templates for the community. For the time being, we're not accepting new template contributions. Please keep an eye on this page for updates on when contributions will reopen and the new submission process.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Discord Community
|
|
2
|
+
|
|
3
|
+
The Discord server has over 1000 members and serves as the main discussion forum for Mastra. The Mastra team monitors Discord during North American and European business hours, with community members active across other time zones.
|
|
4
|
+
|
|
5
|
+
[Join the Discord server](https://discord.gg/BTYqqHKUrf)
|
|
6
|
+
|
|
7
|
+
## Discord MCP Bot
|
|
8
|
+
|
|
9
|
+
In addition to community members, we have an (experimental!) Discord bot that can also help answer questions. It uses [Model Context Protocol (MCP)](https://mastra.ai/docs/mcp/overview). You can ask it a question with `/ask` (either in public channels or DMs) and clear history (in DMs only) with `/cleardm`.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
## Apache License 2.0
|
|
4
|
+
|
|
5
|
+
Mastra is licensed under the Apache License 2.0, a permissive open-source license that provides users with broad rights to use, modify, and distribute the software.
|
|
6
|
+
|
|
7
|
+
### What is Apache License 2.0?
|
|
8
|
+
|
|
9
|
+
The Apache License 2.0 is a permissive open-source license that grants users extensive rights to use, modify, and distribute the software. It allows:
|
|
10
|
+
|
|
11
|
+
- Free use for any purpose, including commercial use
|
|
12
|
+
- Viewing, modifying, and redistributing the source code
|
|
13
|
+
- Creating and distributing derivative works
|
|
14
|
+
- Commercial use without restrictions
|
|
15
|
+
- Patent protection from contributors
|
|
16
|
+
|
|
17
|
+
The Apache License 2.0 is one of the most permissive and business-friendly open-source licenses available.
|
|
18
|
+
|
|
19
|
+
### Why We Chose Apache License 2.0
|
|
20
|
+
|
|
21
|
+
We selected the Apache License 2.0 for several important reasons:
|
|
22
|
+
|
|
23
|
+
1. **True Open Source**: It's a recognized open-source license that aligns with open-source principles and community expectations.
|
|
24
|
+
|
|
25
|
+
2. **Business Friendly**: It allows for unrestricted commercial use and distribution, making it ideal for businesses of all sizes.
|
|
26
|
+
|
|
27
|
+
3. **Patent Protection**: It includes explicit patent protection for users, providing additional legal security.
|
|
28
|
+
|
|
29
|
+
4. **Community Focus**: It encourages community contributions and collaboration without restrictions.
|
|
30
|
+
|
|
31
|
+
5. **Widely Adopted**: It's one of the most popular and well-understood open-source licenses in the industry.
|
|
32
|
+
|
|
33
|
+
### Building Your Business with Mastra
|
|
34
|
+
|
|
35
|
+
The Apache License 2.0 provides maximum flexibility for building businesses with Mastra:
|
|
36
|
+
|
|
37
|
+
#### Allowed Business Models
|
|
38
|
+
|
|
39
|
+
- **Building Applications**: Create and sell applications built with Mastra
|
|
40
|
+
- **Offering Consulting Services**: Provide expertise, implementation, and customization services
|
|
41
|
+
- **Developing Custom Solutions**: Build bespoke AI solutions for clients using Mastra
|
|
42
|
+
- **Creating Add-ons and Extensions**: Develop and sell complementary tools that extend Mastra's functionality
|
|
43
|
+
- **Training and Education**: Offer courses and educational materials about using Mastra effectively
|
|
44
|
+
- **Hosted Services**: Offer Mastra as a hosted or managed service
|
|
45
|
+
- **SaaS Platforms**: Build SaaS platforms powered by Mastra
|
|
46
|
+
|
|
47
|
+
#### Examples of Compliant Usage
|
|
48
|
+
|
|
49
|
+
- A company builds an AI-powered customer service application using Mastra and sells it to clients
|
|
50
|
+
- A consulting firm offers implementation and customization services for Mastra
|
|
51
|
+
- A developer creates specialized agents and tools with Mastra and licenses them to other businesses
|
|
52
|
+
- A startup builds a vertical-specific solution (e.g., healthcare AI assistant) powered by Mastra
|
|
53
|
+
- A company offers Mastra as a hosted service to their customers
|
|
54
|
+
- A SaaS platform integrates Mastra as their AI backend
|
|
55
|
+
|
|
56
|
+
#### Compliance Requirements
|
|
57
|
+
|
|
58
|
+
The Apache License 2.0 has minimal requirements:
|
|
59
|
+
|
|
60
|
+
- **Attribution**: Maintain copyright notices and license information (including NOTICE file)
|
|
61
|
+
- **State Changes**: If you modify the software, state that you have made changes
|
|
62
|
+
- **Include License**: Include a copy of the Apache License 2.0 when distributing
|
|
63
|
+
|
|
64
|
+
### Questions About Licensing?
|
|
65
|
+
|
|
66
|
+
If you have specific questions about how the Apache License 2.0 applies to your use case, please [contact us](https://discord.gg/BTYqqHKUrf) on Discord for clarification. We're committed to supporting all legitimate use cases while maintaining the open-source nature of the project.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Deploy to Cloud Providers
|
|
2
|
+
|
|
3
|
+
Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the deployment process.
|
|
4
|
+
|
|
5
|
+
## Supported Cloud Providers
|
|
6
|
+
|
|
7
|
+
The following guides show how to deploy Mastra to specific cloud providers:
|
|
8
|
+
|
|
9
|
+
- [Amazon EC2](https://mastra.ai/guides/deployment/amazon-ec2)
|
|
10
|
+
- [AWS Lambda](https://mastra.ai/guides/deployment/aws-lambda)
|
|
11
|
+
- [Azure App Services](https://mastra.ai/guides/deployment/azure-app-services)
|
|
12
|
+
- [Cloudflare](https://mastra.ai/guides/deployment/cloudflare)
|
|
13
|
+
- [Digital Ocean](https://mastra.ai/guides/deployment/digital-ocean)
|
|
14
|
+
- [Netlify](https://mastra.ai/guides/deployment/netlify)
|
|
15
|
+
- [Vercel](https://mastra.ai/guides/deployment/vercel)
|