@mastra/mcp-docs-server 1.0.0-beta.2 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +9 -9
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +55 -55
  3. package/.docs/organized/changelogs/%40mastra%2Fauth.md +6 -0
  4. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +11 -11
  5. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +21 -21
  6. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +11 -11
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +11 -11
  8. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
  9. package/.docs/organized/changelogs/%40mastra%2Fcore.md +207 -207
  10. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +10 -10
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +20 -20
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +11 -11
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +11 -11
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +34 -34
  15. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +14 -14
  16. package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
  17. package/.docs/organized/changelogs/%40mastra%2Flance.md +14 -14
  18. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +11 -11
  19. package/.docs/organized/changelogs/%40mastra%2Floggers.md +10 -10
  20. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +24 -24
  21. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +12 -12
  22. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
  23. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +11 -11
  24. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +11 -11
  25. package/.docs/organized/changelogs/%40mastra%2Fpg.md +11 -11
  26. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +11 -11
  27. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +44 -44
  28. package/.docs/organized/changelogs/%40mastra%2Frag.md +11 -11
  29. package/.docs/organized/changelogs/%40mastra%2Freact.md +15 -15
  30. package/.docs/organized/changelogs/%40mastra%2Fserver.md +19 -19
  31. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +14 -14
  32. package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +21 -21
  33. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +10 -10
  34. package/.docs/organized/changelogs/create-mastra.md +21 -21
  35. package/.docs/organized/changelogs/mastra.md +47 -47
  36. package/.docs/organized/code-examples/ai-elements.md +1 -1
  37. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
  38. package/.docs/organized/code-examples/ai-sdk-v5.md +1 -1
  39. package/.docs/organized/code-examples/assistant-ui.md +1 -1
  40. package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
  41. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
  42. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
  43. package/.docs/organized/code-examples/client-side-tools.md +1 -1
  44. package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
  45. package/.docs/organized/code-examples/fireworks-r1.md +1 -1
  46. package/.docs/organized/code-examples/heads-up-game.md +1 -1
  47. package/.docs/organized/code-examples/mcp-configuration.md +0 -3
  48. package/.docs/organized/code-examples/memory-per-resource-example.md +1 -1
  49. package/.docs/organized/code-examples/openapi-spec-writer.md +1 -1
  50. package/.docs/organized/code-examples/quick-start.md +1 -1
  51. package/.docs/organized/code-examples/stock-price-tool.md +1 -21
  52. package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
  53. package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
  54. package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
  55. package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
  56. package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
  57. package/.docs/raw/agents/adding-voice.mdx +50 -1
  58. package/.docs/raw/agents/agent-memory.mdx +1 -1
  59. package/.docs/raw/agents/guardrails.mdx +1 -1
  60. package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +90 -0
  61. package/.docs/raw/agents/networks.mdx +1 -1
  62. package/.docs/raw/agents/overview.mdx +8 -13
  63. package/.docs/raw/agents/using-tools.mdx +10 -9
  64. package/.docs/raw/auth/auth0.mdx +1 -1
  65. package/.docs/raw/auth/clerk.mdx +1 -1
  66. package/.docs/raw/auth/firebase.mdx +1 -1
  67. package/.docs/raw/auth/index.mdx +1 -1
  68. package/.docs/raw/auth/jwt.mdx +1 -1
  69. package/.docs/raw/auth/supabase.mdx +1 -1
  70. package/.docs/raw/auth/workos.mdx +1 -1
  71. package/.docs/raw/community/contributing-templates.mdx +1 -1
  72. package/.docs/raw/community/discord.mdx +2 -2
  73. package/.docs/raw/community/licensing.mdx +1 -1
  74. package/.docs/raw/deployment/{server-deployment.mdx → building-mastra.mdx} +4 -4
  75. package/.docs/raw/deployment/cloud-providers/amazon-ec2.mdx +2 -2
  76. package/.docs/raw/deployment/cloud-providers/aws-lambda.mdx +3 -3
  77. package/.docs/raw/deployment/cloud-providers/azure-app-services.mdx +2 -2
  78. package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/cloudflare-deployer.mdx +1 -1
  79. package/.docs/raw/deployment/cloud-providers/digital-ocean.mdx +2 -2
  80. package/.docs/raw/deployment/cloud-providers/index.mdx +8 -4
  81. package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/netlify-deployer.mdx +1 -1
  82. package/.docs/raw/deployment/{serverless-platforms → cloud-providers}/vercel-deployer.mdx +1 -1
  83. package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/dashboard.mdx +3 -3
  84. package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/observability.mdx +2 -2
  85. package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/overview.mdx +3 -3
  86. package/.docs/raw/{mastra-cloud → deployment/mastra-cloud}/setting-up.mdx +4 -4
  87. package/.docs/raw/deployment/monorepo.mdx +3 -3
  88. package/.docs/raw/deployment/overview.mdx +5 -5
  89. package/.docs/raw/deployment/web-framework.mdx +1 -1
  90. package/.docs/raw/evals/{off-the-shelf-scorers.mdx → built-in-scorers.mdx} +17 -15
  91. package/.docs/raw/evals/custom-scorers.mdx +1 -1
  92. package/.docs/raw/evals/overview.mdx +3 -3
  93. package/.docs/raw/evals/running-in-ci.mdx +2 -2
  94. package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +11 -128
  95. package/.docs/raw/frameworks/agentic-uis/assistant-ui.mdx +71 -19
  96. package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +8 -29
  97. package/.docs/raw/frameworks/agentic-uis/copilotkit.mdx +91 -267
  98. package/.docs/raw/frameworks/agentic-uis/openrouter.mdx +3 -3
  99. package/.docs/raw/frameworks/servers/express.mdx +1 -1
  100. package/.docs/raw/frameworks/web-frameworks/astro.mdx +1 -1
  101. package/.docs/raw/frameworks/web-frameworks/next-js.mdx +1 -1
  102. package/.docs/raw/frameworks/web-frameworks/sveltekit.mdx +1 -1
  103. package/.docs/raw/frameworks/web-frameworks/vite-react.mdx +1 -1
  104. package/.docs/raw/getting-started/mcp-docs-server.mdx +6 -6
  105. package/.docs/raw/getting-started/project-structure.mdx +1 -1
  106. package/.docs/raw/getting-started/quickstart.mdx +27 -0
  107. package/.docs/raw/getting-started/studio.mdx +3 -3
  108. package/.docs/raw/getting-started/templates.mdx +1 -1
  109. package/.docs/raw/guides/guide/ai-recruiter.mdx +1 -1
  110. package/.docs/raw/guides/guide/chef-michel.mdx +1 -1
  111. package/.docs/raw/{getting-started/installation.mdx → guides/guide/manual-install.mdx} +6 -80
  112. package/.docs/raw/guides/guide/notes-mcp-server.mdx +2 -2
  113. package/.docs/raw/guides/guide/research-assistant.mdx +2 -2
  114. package/.docs/raw/guides/guide/stock-agent.mdx +1 -1
  115. package/.docs/raw/guides/guide/web-search.mdx +1 -1
  116. package/.docs/raw/guides/migrations/ai-sdk-v4-to-v5.mdx +119 -0
  117. package/.docs/raw/guides/migrations/upgrade-to-v1/mastra.mdx +1 -1
  118. package/.docs/raw/guides/migrations/upgrade-to-v1/overview.mdx +9 -1
  119. package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +60 -0
  120. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +12 -0
  121. package/.docs/raw/guides/quickstarts/nextjs.mdx +18 -17
  122. package/.docs/raw/guides/quickstarts/standalone-server.mdx +86 -0
  123. package/.docs/raw/index.mdx +3 -3
  124. package/.docs/raw/logging.mdx +7 -7
  125. package/.docs/raw/mcp/overview.mdx +360 -0
  126. package/.docs/raw/mcp/publishing-mcp-server.mdx +139 -0
  127. package/.docs/raw/memory/conversation-history.mdx +1 -1
  128. package/.docs/raw/memory/memory-processors.mdx +1 -1
  129. package/.docs/raw/memory/overview.mdx +1 -1
  130. package/.docs/raw/memory/semantic-recall.mdx +1 -1
  131. package/.docs/raw/memory/storage/memory-with-libsql.mdx +1 -4
  132. package/.docs/raw/memory/storage/memory-with-mongodb.mdx +1 -1
  133. package/.docs/raw/memory/storage/memory-with-pg.mdx +1 -4
  134. package/.docs/raw/memory/storage/memory-with-upstash.mdx +1 -4
  135. package/.docs/raw/memory/threads-and-resources.mdx +1 -1
  136. package/.docs/raw/memory/working-memory.mdx +1 -1
  137. package/.docs/raw/observability/overview.mdx +2 -2
  138. package/.docs/raw/observability/tracing/exporters/arize.mdx +1 -1
  139. package/.docs/raw/observability/tracing/exporters/braintrust.mdx +1 -1
  140. package/.docs/raw/observability/tracing/exporters/cloud.mdx +2 -2
  141. package/.docs/raw/observability/tracing/exporters/default.mdx +1 -1
  142. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +1 -1
  143. package/.docs/raw/observability/tracing/exporters/langsmith.mdx +1 -1
  144. package/.docs/raw/observability/tracing/exporters/otel.mdx +1 -1
  145. package/.docs/raw/observability/tracing/overview.mdx +2 -2
  146. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +2 -2
  147. package/.docs/raw/rag/overview.mdx +1 -1
  148. package/.docs/raw/rag/retrieval.mdx +1 -1
  149. package/.docs/raw/rag/vector-databases.mdx +1 -1
  150. package/.docs/raw/reference/agents/agent.mdx +1 -2
  151. package/.docs/raw/reference/agents/generate.mdx +12 -93
  152. package/.docs/raw/reference/agents/generateLegacy.mdx +1 -1
  153. package/.docs/raw/reference/agents/getDefaultGenerateOptions.mdx +1 -1
  154. package/.docs/raw/reference/agents/getDefaultOptions.mdx +1 -1
  155. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +1 -1
  156. package/.docs/raw/reference/agents/getDescription.mdx +1 -1
  157. package/.docs/raw/reference/agents/getInstructions.mdx +1 -1
  158. package/.docs/raw/reference/agents/getLLM.mdx +1 -1
  159. package/.docs/raw/reference/agents/getMemory.mdx +1 -1
  160. package/.docs/raw/reference/agents/getModel.mdx +1 -1
  161. package/.docs/raw/reference/agents/getTools.mdx +69 -0
  162. package/.docs/raw/reference/agents/getVoice.mdx +1 -1
  163. package/.docs/raw/reference/agents/listAgents.mdx +1 -1
  164. package/.docs/raw/reference/agents/listScorers.mdx +1 -1
  165. package/.docs/raw/reference/agents/listTools.mdx +2 -2
  166. package/.docs/raw/reference/agents/listWorkflows.mdx +1 -1
  167. package/.docs/raw/reference/agents/network.mdx +4 -86
  168. package/.docs/raw/reference/auth/auth0.mdx +1 -1
  169. package/.docs/raw/reference/auth/clerk.mdx +1 -1
  170. package/.docs/raw/reference/auth/firebase.mdx +1 -1
  171. package/.docs/raw/reference/auth/jwt.mdx +1 -1
  172. package/.docs/raw/reference/auth/supabase.mdx +1 -1
  173. package/.docs/raw/reference/auth/workos.mdx +1 -1
  174. package/.docs/raw/reference/cli/create-mastra.mdx +1 -1
  175. package/.docs/raw/reference/cli/mastra.mdx +4 -4
  176. package/.docs/raw/reference/client-js/agents.mdx +1 -1
  177. package/.docs/raw/reference/client-js/error-handling.mdx +1 -1
  178. package/.docs/raw/reference/client-js/logs.mdx +1 -1
  179. package/.docs/raw/reference/client-js/mastra-client.mdx +2 -2
  180. package/.docs/raw/reference/client-js/memory.mdx +1 -1
  181. package/.docs/raw/reference/client-js/observability.mdx +1 -1
  182. package/.docs/raw/reference/client-js/telemetry.mdx +1 -1
  183. package/.docs/raw/reference/client-js/tools.mdx +1 -1
  184. package/.docs/raw/reference/client-js/vectors.mdx +1 -1
  185. package/.docs/raw/reference/client-js/workflows.mdx +1 -1
  186. package/.docs/raw/reference/core/addGateway.mdx +59 -0
  187. package/.docs/raw/reference/core/getAgent.mdx +1 -1
  188. package/.docs/raw/reference/core/getAgentById.mdx +1 -1
  189. package/.docs/raw/reference/core/getDeployer.mdx +1 -1
  190. package/.docs/raw/reference/core/getGateway.mdx +59 -0
  191. package/.docs/raw/reference/core/getGatewayById.mdx +62 -0
  192. package/.docs/raw/reference/core/getLogger.mdx +1 -1
  193. package/.docs/raw/reference/core/getMCPServer.mdx +2 -2
  194. package/.docs/raw/reference/core/getMCPServerById.mdx +2 -2
  195. package/.docs/raw/reference/core/getScorer.mdx +1 -1
  196. package/.docs/raw/reference/core/getScorerById.mdx +1 -1
  197. package/.docs/raw/reference/core/getServer.mdx +2 -2
  198. package/.docs/raw/reference/core/getStorage.mdx +1 -1
  199. package/.docs/raw/reference/core/getTelemetry.mdx +1 -1
  200. package/.docs/raw/reference/core/getVector.mdx +1 -1
  201. package/.docs/raw/reference/core/getWorkflow.mdx +1 -1
  202. package/.docs/raw/reference/core/listAgents.mdx +1 -1
  203. package/.docs/raw/reference/core/listGateways.mdx +53 -0
  204. package/.docs/raw/reference/core/listLogs.mdx +1 -1
  205. package/.docs/raw/reference/core/listLogsByRunId.mdx +1 -1
  206. package/.docs/raw/reference/core/listMCPServers.mdx +2 -2
  207. package/.docs/raw/reference/core/listScorers.mdx +1 -1
  208. package/.docs/raw/reference/core/listVectors.mdx +1 -1
  209. package/.docs/raw/reference/core/listWorkflows.mdx +1 -1
  210. package/.docs/raw/reference/core/mastra-class.mdx +9 -1
  211. package/.docs/raw/reference/core/mastra-model-gateway.mdx +241 -0
  212. package/.docs/raw/reference/core/setLogger.mdx +1 -1
  213. package/.docs/raw/reference/core/setStorage.mdx +1 -1
  214. package/.docs/raw/reference/core/setTelemetry.mdx +1 -1
  215. package/.docs/raw/reference/deployer/cloudflare.mdx +1 -1
  216. package/.docs/raw/reference/deployer/deployer.mdx +1 -1
  217. package/.docs/raw/reference/deployer/netlify.mdx +1 -1
  218. package/.docs/raw/reference/deployer/vercel.mdx +1 -1
  219. package/.docs/raw/reference/evals/answer-relevancy.mdx +1 -1
  220. package/.docs/raw/reference/evals/answer-similarity.mdx +1 -1
  221. package/.docs/raw/reference/evals/bias.mdx +1 -1
  222. package/.docs/raw/reference/evals/completeness.mdx +1 -1
  223. package/.docs/raw/reference/evals/content-similarity.mdx +1 -1
  224. package/.docs/raw/reference/evals/context-precision.mdx +1 -1
  225. package/.docs/raw/reference/evals/context-relevance.mdx +1 -1
  226. package/.docs/raw/reference/evals/create-scorer.mdx +1 -1
  227. package/.docs/raw/reference/evals/faithfulness.mdx +1 -1
  228. package/.docs/raw/reference/evals/hallucination.mdx +1 -1
  229. package/.docs/raw/reference/evals/keyword-coverage.mdx +1 -1
  230. package/.docs/raw/reference/evals/mastra-scorer.mdx +1 -1
  231. package/.docs/raw/reference/evals/noise-sensitivity.mdx +1 -1
  232. package/.docs/raw/reference/evals/prompt-alignment.mdx +1 -1
  233. package/.docs/raw/reference/evals/run-evals.mdx +1 -1
  234. package/.docs/raw/reference/evals/textual-difference.mdx +1 -1
  235. package/.docs/raw/reference/evals/tone-consistency.mdx +1 -1
  236. package/.docs/raw/reference/evals/tool-call-accuracy.mdx +1 -1
  237. package/.docs/raw/reference/evals/toxicity.mdx +1 -1
  238. package/.docs/raw/reference/logging/pino-logger.mdx +2 -2
  239. package/.docs/raw/reference/memory/createThread.mdx +1 -1
  240. package/.docs/raw/reference/memory/deleteMessages.mdx +1 -1
  241. package/.docs/raw/reference/memory/getThreadById.mdx +1 -1
  242. package/.docs/raw/reference/memory/listThreadsByResourceId.mdx +1 -1
  243. package/.docs/raw/reference/memory/memory-class.mdx +1 -1
  244. package/.docs/raw/reference/memory/query.mdx +1 -1
  245. package/.docs/raw/reference/memory/recall.mdx +1 -1
  246. package/.docs/raw/reference/observability/tracing/configuration.mdx +2 -2
  247. package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +1 -1
  248. package/.docs/raw/reference/observability/tracing/exporters/braintrust.mdx +1 -1
  249. package/.docs/raw/reference/observability/tracing/exporters/cloud-exporter.mdx +1 -1
  250. package/.docs/raw/reference/observability/tracing/exporters/console-exporter.mdx +1 -1
  251. package/.docs/raw/reference/observability/tracing/exporters/default-exporter.mdx +1 -1
  252. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +1 -1
  253. package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +1 -1
  254. package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +1 -1
  255. package/.docs/raw/reference/observability/tracing/instances.mdx +2 -2
  256. package/.docs/raw/reference/observability/tracing/interfaces.mdx +2 -2
  257. package/.docs/raw/reference/observability/tracing/processors/sensitive-data-filter.mdx +1 -1
  258. package/.docs/raw/reference/observability/tracing/spans.mdx +2 -2
  259. package/.docs/raw/reference/processors/batch-parts-processor.mdx +1 -1
  260. package/.docs/raw/reference/processors/language-detector.mdx +1 -1
  261. package/.docs/raw/reference/processors/moderation-processor.mdx +1 -1
  262. package/.docs/raw/reference/processors/pii-detector.mdx +1 -1
  263. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +1 -1
  264. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +1 -1
  265. package/.docs/raw/reference/processors/token-limiter-processor.mdx +1 -1
  266. package/.docs/raw/reference/processors/unicode-normalizer.mdx +1 -1
  267. package/.docs/raw/reference/rag/chunk.mdx +1 -1
  268. package/.docs/raw/reference/rag/database-config.mdx +1 -1
  269. package/.docs/raw/reference/rag/document.mdx +1 -1
  270. package/.docs/raw/reference/rag/embeddings.mdx +1 -1
  271. package/.docs/raw/reference/rag/extract-params.mdx +1 -1
  272. package/.docs/raw/reference/rag/graph-rag.mdx +1 -1
  273. package/.docs/raw/reference/rag/metadata-filters.mdx +1 -1
  274. package/.docs/raw/reference/rag/rerank.mdx +1 -1
  275. package/.docs/raw/reference/rag/rerankWithScorer.mdx +1 -1
  276. package/.docs/raw/reference/storage/cloudflare-d1.mdx +1 -1
  277. package/.docs/raw/reference/storage/cloudflare.mdx +1 -1
  278. package/.docs/raw/reference/storage/dynamodb.mdx +1 -1
  279. package/.docs/raw/reference/storage/lance.mdx +1 -1
  280. package/.docs/raw/reference/storage/libsql.mdx +1 -1
  281. package/.docs/raw/reference/storage/mongodb.mdx +1 -1
  282. package/.docs/raw/reference/storage/mssql.mdx +1 -1
  283. package/.docs/raw/reference/storage/postgresql.mdx +1 -1
  284. package/.docs/raw/reference/storage/upstash.mdx +1 -1
  285. package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
  286. package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +1 -1
  287. package/.docs/raw/reference/streaming/agents/stream.mdx +4 -93
  288. package/.docs/raw/reference/streaming/agents/streamLegacy.mdx +1 -1
  289. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +1 -1
  290. package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +1 -1
  291. package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +1 -1
  292. package/.docs/raw/reference/streaming/workflows/stream.mdx +1 -1
  293. package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +1 -1
  294. package/.docs/raw/reference/templates/overview.mdx +1 -1
  295. package/.docs/raw/reference/tools/client.mdx +1 -1
  296. package/.docs/raw/reference/tools/create-tool.mdx +3 -4
  297. package/.docs/raw/reference/tools/document-chunker-tool.mdx +1 -1
  298. package/.docs/raw/reference/tools/graph-rag-tool.mdx +2 -2
  299. package/.docs/raw/reference/tools/mcp-client.mdx +1 -1
  300. package/.docs/raw/reference/tools/mcp-server.mdx +6 -6
  301. package/.docs/raw/reference/tools/vector-query-tool.mdx +2 -2
  302. package/.docs/raw/reference/vectors/astra.mdx +1 -1
  303. package/.docs/raw/reference/vectors/chroma.mdx +1 -1
  304. package/.docs/raw/reference/vectors/couchbase.mdx +1 -1
  305. package/.docs/raw/reference/vectors/lance.mdx +1 -1
  306. package/.docs/raw/reference/vectors/libsql.mdx +1 -1
  307. package/.docs/raw/reference/vectors/mongodb.mdx +1 -1
  308. package/.docs/raw/reference/vectors/opensearch.mdx +1 -1
  309. package/.docs/raw/reference/vectors/pg.mdx +1 -1
  310. package/.docs/raw/reference/vectors/pinecone.mdx +22 -2
  311. package/.docs/raw/reference/vectors/qdrant.mdx +1 -1
  312. package/.docs/raw/reference/vectors/s3vectors.mdx +1 -1
  313. package/.docs/raw/reference/vectors/turbopuffer.mdx +1 -1
  314. package/.docs/raw/reference/vectors/upstash.mdx +1 -1
  315. package/.docs/raw/reference/vectors/vectorize.mdx +1 -1
  316. package/.docs/raw/reference/voice/azure.mdx +96 -81
  317. package/.docs/raw/reference/voice/cloudflare.mdx +1 -1
  318. package/.docs/raw/reference/voice/composite-voice.mdx +72 -29
  319. package/.docs/raw/reference/voice/deepgram.mdx +1 -1
  320. package/.docs/raw/reference/voice/elevenlabs.mdx +1 -1
  321. package/.docs/raw/reference/voice/google-gemini-live.mdx +1 -1
  322. package/.docs/raw/reference/voice/google.mdx +1 -1
  323. package/.docs/raw/reference/voice/mastra-voice.mdx +1 -1
  324. package/.docs/raw/reference/voice/murf.mdx +1 -1
  325. package/.docs/raw/reference/voice/openai-realtime.mdx +1 -1
  326. package/.docs/raw/reference/voice/openai.mdx +1 -1
  327. package/.docs/raw/reference/voice/playai.mdx +1 -1
  328. package/.docs/raw/reference/voice/sarvam.mdx +1 -1
  329. package/.docs/raw/reference/voice/speechify.mdx +1 -1
  330. package/.docs/raw/reference/voice/voice.addInstructions.mdx +1 -1
  331. package/.docs/raw/reference/voice/voice.addTools.mdx +1 -1
  332. package/.docs/raw/reference/voice/voice.answer.mdx +1 -1
  333. package/.docs/raw/reference/voice/voice.close.mdx +1 -1
  334. package/.docs/raw/reference/voice/voice.connect.mdx +1 -1
  335. package/.docs/raw/reference/voice/voice.events.mdx +1 -1
  336. package/.docs/raw/reference/voice/voice.getSpeakers.mdx +1 -1
  337. package/.docs/raw/reference/voice/voice.listen.mdx +87 -53
  338. package/.docs/raw/reference/voice/voice.off.mdx +1 -1
  339. package/.docs/raw/reference/voice/voice.on.mdx +1 -1
  340. package/.docs/raw/reference/voice/voice.send.mdx +1 -1
  341. package/.docs/raw/reference/voice/voice.speak.mdx +76 -41
  342. package/.docs/raw/reference/voice/voice.updateConfig.mdx +1 -1
  343. package/.docs/raw/reference/workflows/run-methods/cancel.mdx +1 -1
  344. package/.docs/raw/reference/workflows/run-methods/resume.mdx +1 -1
  345. package/.docs/raw/reference/workflows/run-methods/start.mdx +1 -1
  346. package/.docs/raw/reference/workflows/run.mdx +1 -1
  347. package/.docs/raw/reference/workflows/step.mdx +1 -1
  348. package/.docs/raw/reference/workflows/workflow-methods/branch.mdx +1 -1
  349. package/.docs/raw/reference/workflows/workflow-methods/commit.mdx +1 -1
  350. package/.docs/raw/reference/workflows/workflow-methods/create-run.mdx +1 -1
  351. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +1 -1
  352. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +1 -1
  353. package/.docs/raw/reference/workflows/workflow-methods/foreach.mdx +1 -1
  354. package/.docs/raw/reference/workflows/workflow-methods/map.mdx +1 -1
  355. package/.docs/raw/reference/workflows/workflow-methods/parallel.mdx +1 -1
  356. package/.docs/raw/reference/workflows/workflow-methods/sendEvent.mdx +1 -1
  357. package/.docs/raw/reference/workflows/workflow-methods/sleep.mdx +1 -1
  358. package/.docs/raw/reference/workflows/workflow-methods/sleepUntil.mdx +1 -1
  359. package/.docs/raw/reference/workflows/workflow-methods/then.mdx +1 -1
  360. package/.docs/raw/reference/workflows/workflow-methods/waitForEvent.mdx +1 -1
  361. package/.docs/raw/reference/workflows/workflow.mdx +2 -2
  362. package/.docs/raw/server-db/custom-api-routes.mdx +1 -1
  363. package/.docs/raw/server-db/mastra-client.mdx +2 -2
  364. package/.docs/raw/server-db/{production-server.mdx → mastra-server.mdx} +2 -2
  365. package/.docs/raw/server-db/middleware.mdx +31 -31
  366. package/.docs/raw/server-db/request-context.mdx +3 -3
  367. package/.docs/raw/server-db/storage.mdx +1 -1
  368. package/.docs/raw/streaming/events.mdx +1 -1
  369. package/.docs/raw/streaming/overview.mdx +1 -1
  370. package/.docs/raw/streaming/tool-streaming.mdx +1 -1
  371. package/.docs/raw/streaming/workflow-streaming.mdx +1 -1
  372. package/.docs/raw/tools-mcp/advanced-usage.mdx +1 -1
  373. package/.docs/raw/tools-mcp/mcp-overview.mdx +1 -1
  374. package/.docs/raw/tools-mcp/overview.mdx +1 -1
  375. package/.docs/raw/voice/overview.mdx +68 -1
  376. package/.docs/raw/voice/speech-to-speech.mdx +1 -1
  377. package/.docs/raw/voice/speech-to-text.mdx +1 -1
  378. package/.docs/raw/voice/text-to-speech.mdx +1 -1
  379. package/.docs/raw/workflows/agents-and-tools.mdx +2 -4
  380. package/.docs/raw/workflows/control-flow.mdx +6 -1
  381. package/.docs/raw/workflows/error-handling.mdx +4 -4
  382. package/.docs/raw/workflows/human-in-the-loop.mdx +160 -213
  383. package/.docs/raw/workflows/inngest-workflow.mdx +1 -1
  384. package/.docs/raw/workflows/input-data-mapping.mdx +1 -1
  385. package/.docs/raw/workflows/overview.mdx +11 -3
  386. package/.docs/raw/workflows/snapshots.mdx +4 -3
  387. package/.docs/raw/workflows/suspend-and-resume.mdx +72 -224
  388. package/CHANGELOG.md +23 -0
  389. package/dist/stdio.js +11 -9
  390. package/package.json +10 -14
  391. package/.docs/raw/deployment/serverless-platforms/index.mdx +0 -58
@@ -0,0 +1,86 @@
1
+ ---
2
+ title: "Standalone Server Quickstart"
3
+ description: Get started with Mastra using the create mastra CLI to build a standalone server with agents, workflows, and tools.
4
+ ---
5
+
6
+ import Tabs from "@theme/Tabs";
7
+ import TabItem from "@theme/TabItem";
8
+ import Steps from "@site/src/components/Steps";
9
+ import StepItem from "@site/src/components/StepItem";
10
+ import { VideoPlayer } from "@site/src/components/video-player";
11
+
12
+ # Standalone Server Quickstart
13
+
14
+ The `create mastra` CLI command is the quickest way to spin up a standalone Mastra server. It walks you through setup and creates example agents, workflows, and tools for you to run locally or adapt
15
+
16
+ If you need more control over the setup, see the [manual installation guide](/guides/v1/guide/manual-install). You can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init) for existing projects.
17
+
18
+ ## Before you begin
19
+
20
+ * You'll need an API key from a supported [model provider](/models/v1). If you don't have a preference, use [OpenAI](/models/v1/providers/openai).
21
+
22
+ ## Initialize Mastra
23
+
24
+ You can run `create mastra` anywhere on your machine.
25
+
26
+ When prompted, choose a provider (e.g. OpenAI) and enter your key:
27
+
28
+ <Tabs>
29
+ <TabItem value="npm" label="npm">
30
+
31
+ ```bash copy
32
+ npm create mastra@beta
33
+ ```
34
+
35
+ </TabItem>
36
+ <TabItem value="pnpm" label="pnpm">
37
+
38
+ ```bash copy
39
+ pnpm create mastra@beta
40
+ ```
41
+
42
+ </TabItem>
43
+ <TabItem value="yarn" label="yarn">
44
+
45
+ ```bash copy
46
+ yarn create mastra@beta
47
+ ```
48
+
49
+ </TabItem>
50
+ <TabItem value="bun" label="bun">
51
+
52
+ ```bash copy
53
+ bun create mastra@beta
54
+ ```
55
+
56
+ </TabItem>
57
+ </Tabs>
58
+
59
+ This creates a new directory for your project with a `src/mastra` folder containing an example weather agent and the following files:
60
+
61
+ - `index.ts` - Mastra config, including memory
62
+ - `tools/weather-tool.ts` - a tool to fetch weather for a given location
63
+ - `agents/weather-agent.ts` - a weather agent with a prompt that uses the tool
64
+
65
+ :::tip
66
+
67
+ You can use [flags](/reference/v1/cli/create-mastra#cli-flags) with `create mastra` like `--no-example` to skip the example weather agent or `--template` to start from a specific [template](/docs/v1/getting-started/templates)
68
+
69
+ :::
70
+
71
+ ## Test your agent
72
+
73
+ Once setup is complete, follow the instructions in your terminal to start the Mastra dev server, then open Studio at [localhost:4111](http://localhost:4111).
74
+
75
+ Try asking about the weather. If your API key is set up correctly, you'll get a response:
76
+
77
+ <VideoPlayer src="https://res.cloudinary.com/mastra-assets/video/upload/v1751406022/local-dev-agents-playground_100_m3begx.mp4" />
78
+
79
+ [Studio](/docs/v1/getting-started/studio) lets you rapidly build and prototype agents without needing to build a UI. Once you're ready, you can integrate your Mastra agent into your app using the guides below.
80
+
81
+ ## Next steps
82
+
83
+ - Integrate Mastra with your frontend framework: [Next.js](/docs/v1/frameworks/web-frameworks/next-js), [React](/docs/v1/frameworks/web-frameworks/vite-react), or [Astro](/docs/v1/frameworks/web-frameworks/astro)
84
+ - Read more about [Mastra's features](/docs/v1#why-mastra)
85
+ - Build an agent from scratch following one of our [guides](/guides/v1)
86
+ - Watch conceptual guides on our [YouTube channel](https://www.youtube.com/@mastra-ai) and [subscribe](https://www.youtube.com/@mastra-ai?sub_confirmation=1)
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "About Mastra | Mastra Docs"
2
+ title: "About Mastra"
3
3
  sidebar_position: 2
4
4
  sidebar_label: "Introduction"
5
5
  description: "Mastra is an all-in-one framework for building AI-powered applications and agents with a modern TypeScript stack."
@@ -51,8 +51,8 @@ Explore real-world examples in our [community showcase](/showcase).
51
51
 
52
52
  ## Get started
53
53
 
54
- Follow the [Installation guide](/docs/v1/getting-started/installation) for step-by-step setup with the CLI or a manual install.
54
+ Choose a [quickstart](/docs/v1/getting-started/quickstart) to get started, or see the [manual installation guide](/guides/v1/guide/manual-install) if you need more control over your setup.
55
55
 
56
- If you're new to AI agents, check out our [templates](/docs/v1/getting-started/templates), [course](https://mastra.ai/book), and [YouTube videos](https://youtube.com/@mastra-ai) to start building with Mastra today.
56
+ If you're new to AI agents, check out our [templates](/docs/v1/getting-started/templates), [course](https://mastra.ai/course), and [YouTube videos](https://youtube.com/@mastra-ai). You can also join our [Discord](https://discord.gg/BTYqqHKUrf) community to get help and share your projects.
57
57
 
58
58
  We can't wait to see what you build ✌️
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Logging | Observability | Mastra Docs"
2
+ title: "Logging | Observability"
3
3
  description: Learn how to use logging in Mastra to monitor execution, capture application behavior, and improve the accuracy of AI applications.
4
4
  ---
5
5
 
@@ -7,14 +7,14 @@ description: Learn how to use logging in Mastra to monitor execution, capture ap
7
7
 
8
8
  Mastra's logging system captures function execution, input data, and output responses in a structured format.
9
9
 
10
- When deploying to Mastra Cloud, logs are shown on the [Logs](/docs/v1/mastra-cloud/observability) page. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
10
+ When deploying to Mastra Cloud, logs are shown on the [Logs](/docs/v1/deployment/mastra-cloud/observability) page. In self-hosted or custom environments, logs can be directed to files or external services depending on the configured transports.
11
11
 
12
- ## PinoLogger
12
+ ## Configuring logs with PinoLogger
13
13
 
14
- When [initializing a new Mastra project](/docs/v1/getting-started/installation) using the CLI, `PinoLogger` is included by default.
14
+ When [initializing a new Mastra project](/guides/v1/quickstarts/standalone-server) using the CLI, `PinoLogger` is included by default.
15
15
 
16
16
  ```typescript title="src/mastra/index.ts" showLineNumbers copy
17
- import { Mastra } from "@mastra/core";
17
+ import { Mastra } from "@mastra/core/mastra";
18
18
  import { PinoLogger } from "@mastra/loggers";
19
19
 
20
20
  export const mastra = new Mastra({
@@ -28,7 +28,7 @@ export const mastra = new Mastra({
28
28
 
29
29
  > See the [PinoLogger](/reference/v1/logging/pino-logger) API reference for all available configuration options.
30
30
 
31
- ## Logging from workflows and tools
31
+ ## Customizing logs
32
32
 
33
33
  Mastra provides access to a logger instance via the `mastra.getLogger()` method, available inside both workflow steps and tools. The logger supports standard severity levels: `debug`, `info`, `warn`, and `error`.
34
34
 
@@ -79,7 +79,7 @@ export const testTool = createTool({
79
79
  });
80
80
  ```
81
81
 
82
- ## Logging with additional data
82
+ ### Logging with additional data
83
83
 
84
84
  Logger methods accept an optional second argument for additional data. This can be any value, such as an object, string, or number.
85
85
 
@@ -0,0 +1,360 @@
1
+ ---
2
+ title: "MCP Overview | MCP"
3
+ description: Learn about the Model Context Protocol (MCP), how to use third-party tools via MCPClient, connect to registries, and share your own tools using MCPServer.
4
+ ---
5
+
6
+ import Tabs from "@theme/Tabs";
7
+ import TabItem from "@theme/TabItem";
8
+
9
+ # MCP Overview
10
+
11
+ Mastra supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction), an open standard for connecting AI agents to external tools and resources. It serves as a universal plugin system, enabling agents to call tools regardless of language or hosting environment.
12
+
13
+ Mastra can also be used to author MCP servers, exposing agents, tools, and other structured resources via the MCP interface. These can then be accessed by any system or agent that supports the protocol.
14
+
15
+ Mastra currently supports two MCP classes:
16
+
17
+ 1. **`MCPClient`**: Connects to one or many MCP servers to access their tools, resources, prompts, and handle elicitation requests.
18
+ 2. **`MCPServer`**: Exposes Mastra tools, agents, workflows, prompts, and resources to MCP-compatible clients.
19
+
20
+ ## Getting started
21
+
22
+ To use MCP, install the required dependency:
23
+
24
+ ```bash
25
+ npm install @mastra/mcp@beta
26
+ ```
27
+
28
+ ## Configuring `MCPClient`
29
+
30
+ The `MCPClient` connects Mastra primitives to external MCP servers, which can be local packages (invoked using `npx`) or remote HTTP(S) endpoints. Each server must be configured with either a `command` or a `url`, depending on how it's hosted.
31
+
32
+ ```typescript title="src/mastra/mcp/test-mcp-client.ts" showLineNumbers copy
33
+ import { MCPClient } from "@mastra/mcp";
34
+
35
+ export const testMcpClient = new MCPClient({
36
+ id: "test-mcp-client",
37
+ servers: {
38
+ wikipedia: {
39
+ command: "npx",
40
+ args: ["-y", "wikipedia-mcp"],
41
+ },
42
+ weather: {
43
+ url: new URL(
44
+ `https://server.smithery.ai/@smithery-ai/national-weather-service/mcp?api_key=${process.env.SMITHERY_API_KEY}`,
45
+ ),
46
+ },
47
+ },
48
+ });
49
+ ```
50
+
51
+ > See [MCPClient](/reference/v1/tools/mcp-client) for a full list of configuration options.
52
+
53
+ ## Using `MCPClient` with an agent
54
+
55
+ To use tools from an MCP server in an agent, import your `MCPClient` and call `.getTools()` in the `tools` parameter. This loads from the defined MCP servers, making them available to the agent.
56
+
57
+ ```typescript {4,16} title="src/mastra/agents/test-agent.ts" showLineNumbers copy
58
+ import { openai } from "@ai-sdk/openai";
59
+ import { Agent } from "@mastra/core/agent";
60
+
61
+ import { testMcpClient } from "../mcp/test-mcp-client";
62
+
63
+ export const testAgent = new Agent({
64
+ name: "Test Agent",
65
+ description: "You are a helpful AI assistant",
66
+ instructions: `
67
+ You are a helpful assistant that has access to the following MCP Servers.
68
+ - Wikipedia MCP Server
69
+ - US National Weather Service
70
+
71
+ Answer questions using the information you find using the MCP Servers.`,
72
+ model: openai("gpt-4o-mini"),
73
+ tools: await testMcpClient.getTools(),
74
+ });
75
+ ```
76
+
77
+ > See the [Agent Class](/reference/v1/agents/agent) for a full list of configuration options.
78
+
79
+ ## Configuring `MCPServer`
80
+
81
+ To expose agents, tools, and workflows from your Mastra application to external systems over HTTP(S) use the `MCPServer` class. This makes them accessible to any system or agent that supports the protocol.
82
+
83
+ ```typescript title="src/mastra/mcp/test-mcp-server.ts" showLineNumbers copy
84
+ import { MCPServer } from "@mastra/mcp";
85
+
86
+ import { testAgent } from "../agents/test-agent";
87
+ import { testWorkflow } from "../workflows/test-workflow";
88
+ import { testTool } from "../tools/test-tool";
89
+
90
+ export const testMcpServer = new MCPServer({
91
+ id: "test-mcp-server",
92
+ name: "Test Server",
93
+ version: "1.0.0",
94
+ agents: { testAgent },
95
+ tools: { testTool },
96
+ workflows: { testWorkflow },
97
+ });
98
+ ```
99
+
100
+ > See [MCPServer](/reference/v1/tools/mcp-server) for a full list of configuration options.
101
+
102
+ ## Registering an `MCPServer`
103
+
104
+ To make an MCP server available to other systems or agents that support the protocol, register it in the main `Mastra` instance using `mcpServers`.
105
+
106
+ ```typescript title="src/mastra/index.ts" showLineNumbers copy
107
+ import { Mastra } from "@mastra/core/mastra";
108
+
109
+ import { testMcpServer } from "./mcp/test-mcp-server";
110
+
111
+ export const mastra = new Mastra({
112
+ // ...
113
+ mcpServers: { testMcpServer },
114
+ });
115
+ ```
116
+
117
+ ## Static and dynamic tools
118
+
119
+ `MCPClient` offers two approaches to retrieving tools from connected servers, suitable for different application architectures:
120
+
121
+ | Feature | Static Configuration (`await mcp.getTools()`) | Dynamic Configuration (`await mcp.getToolsets()`) |
122
+ | :---------------- | :-------------------------------------------- | :--------------------------------------------------- |
123
+ | **Use Case** | Single-user, static config (e.g., CLI tool) | Multi-user, dynamic config (e.g., SaaS app) |
124
+ | **Configuration** | Fixed at agent initialization | Per-request, dynamic |
125
+ | **Credentials** | Shared across all uses | Can vary per user/request |
126
+ | **Agent Setup** | Tools added in `Agent` constructor | Tools passed in `.generate()` or `.stream()` options |
127
+
128
+ ### Static tools
129
+
130
+ Use the `.getTools()` method to fetch tools from all configured MCP servers. This is suitable when configuration (such as API keys) is static and consistent across users or requests. Call it once and pass the result to the `tools` property when defining your agent.
131
+
132
+ > See [getTools()](/reference/v1/tools/mcp-client#gettools) for more information.
133
+
134
+ ```typescript {8} title="src/mastra/agents/test-agent.ts" showLineNumbers copy
135
+ import { openai } from "@ai-sdk/openai";
136
+ import { Agent } from "@mastra/core/agent";
137
+
138
+ import { testMcpClient } from "../mcp/test-mcp-client";
139
+
140
+ export const testAgent = new Agent({
141
+ // ...
142
+ tools: await testMcpClient.getTools(),
143
+ });
144
+ ```
145
+
146
+ ### Dynamic tools
147
+
148
+ Use the `.getToolsets()` method when tool configuration may vary by request or user, such as in a multi-tenant system where each user provides their own API key. This method returns toolsets that can be passed to the `toolsets` option in the agent's `.generate()` or `.stream()` calls.
149
+
150
+ ```typescript {5-16,21} showLineNumbers copy
151
+ import { MCPClient } from "@mastra/mcp";
152
+ import { mastra } from "./mastra";
153
+
154
+ async function handleRequest(userPrompt: string, userApiKey: string) {
155
+ const userMcp = new MCPClient({
156
+ servers: {
157
+ weather: {
158
+ url: new URL("http://localhost:8080/mcp"),
159
+ requestInit: {
160
+ headers: {
161
+ Authorization: `Bearer ${userApiKey}`,
162
+ },
163
+ },
164
+ },
165
+ },
166
+ });
167
+
168
+ const agent = mastra.getAgent("testAgent");
169
+
170
+ const response = await agent.generate(userPrompt, {
171
+ toolsets: await userMcp.getToolsets(),
172
+ });
173
+
174
+ await userMcp.disconnect();
175
+
176
+ return Response.json({
177
+ data: response.text,
178
+ });
179
+ }
180
+ ```
181
+
182
+ > See [getToolsets()](/reference/v1/tools/mcp-client#gettoolsets) for more information.
183
+
184
+ ## Connecting to an MCP registry
185
+
186
+ MCP servers can be discovered through registries. Here's how to connect to some popular ones using `MCPClient`:
187
+
188
+ <Tabs>
189
+ <TabItem value="klavis" label="Klavis AI">
190
+ [Klavis AI](https://klavis.ai) provides hosted, enterprise-authenticated, high-quality MCP servers.
191
+
192
+ ```typescript
193
+ import { MCPClient } from "@mastra/mcp";
194
+
195
+ const mcp = new MCPClient({
196
+ servers: {
197
+ salesforce: {
198
+ url: new URL("https://salesforce-mcp-server.klavis.ai/mcp/?instance_id={private-instance-id}"),
199
+ },
200
+ hubspot: {
201
+ url: new URL("https://hubspot-mcp-server.klavis.ai/mcp/?instance_id={private-instance-id}"),
202
+ },
203
+ },
204
+ });
205
+ ```
206
+
207
+ Klavis AI offers enterprise-grade authentication and security for production deployments.
208
+
209
+ For more details on how to integrate Mastra with Klavis, check out their [documentation](https://docs.klavis.ai/documentation/ai-platform-integration/mastra).
210
+
211
+ </TabItem>
212
+ <TabItem value="mcp-run" label="mcp.run">
213
+ [mcp.run](https://www.mcp.run/) provides pre-authenticated, managed MCP servers. Tools are grouped into Profiles, each with a unique, signed URL.
214
+
215
+ ```typescript
216
+ import { MCPClient } from "@mastra/mcp";
217
+
218
+ const mcp = new MCPClient({
219
+ servers: {
220
+ marketing: { // Example profile name
221
+ url: new URL(process.env.MCP_RUN_SSE_URL!), // Get URL from mcp.run profile
222
+ },
223
+ },
224
+ });
225
+ ```
226
+
227
+ > **Important:** Treat the mcp.run SSE URL like a password. Store it securely, for example, in an environment variable.
228
+ > ```bash title=".env"
229
+ > MCP_RUN_SSE_URL=https://www.mcp.run/api/mcp/sse?nonce=...
230
+ > ```
231
+
232
+ </TabItem>
233
+ <TabItem value="composio" label="Composio.dev">
234
+ [Composio.dev](https://composio.dev) offers a registry of [SSE-based MCP servers](https://mcp.composio.dev). You can use the SSE URL generated for tools like Cursor directly.
235
+
236
+ ```typescript
237
+ import { MCPClient } from "@mastra/mcp";
238
+
239
+ const mcp = new MCPClient({
240
+ servers: {
241
+ googleSheets: {
242
+ url: new URL("https://mcp.composio.dev/googlesheets/[private-url-path]"),
243
+ },
244
+ gmail: {
245
+ url: new URL("https://mcp.composio.dev/gmail/[private-url-path]"),
246
+ },
247
+ },
248
+ });
249
+ ```
250
+
251
+ Authentication with services like Google Sheets often happens interactively through the agent conversation.
252
+
253
+ *Note: Composio URLs are typically tied to a single user account, making them best suited for personal automation rather than multi-tenant applications.*
254
+
255
+ </TabItem>
256
+ <TabItem value="smithery" label="Smithery.ai">
257
+ [Smithery.ai](https://smithery.ai) provides a registry accessible via their CLI.
258
+
259
+ ```typescript
260
+ // Unix/Mac
261
+ import { MCPClient } from "@mastra/mcp";
262
+
263
+ const mcp = new MCPClient({
264
+ servers: {
265
+ sequentialThinking: {
266
+ command: "npx",
267
+ args: [
268
+ "-y",
269
+ "@smithery/cli@latest",
270
+ "run",
271
+ "@smithery-ai/server-sequential-thinking",
272
+ "--config",
273
+ "{}",
274
+ ],
275
+ },
276
+ },
277
+ });
278
+ ```
279
+
280
+ ```typescript
281
+ // Windows
282
+ import { MCPClient } from "@mastra/mcp";
283
+
284
+ const mcp = new MCPClient({
285
+ servers: {
286
+ sequentialThinking: {
287
+ command: "npx",
288
+ args: [
289
+ "-y",
290
+ "@smithery/cli@latest",
291
+ "run",
292
+ "@smithery-ai/server-sequential-thinking",
293
+ "--config",
294
+ "{}",
295
+ ],
296
+ },
297
+ },
298
+ });
299
+ ```
300
+
301
+ </TabItem>
302
+ <TabItem value="ampersand" label="Ampersand">
303
+
304
+ [Ampersand](https://withampersand.com?utm_source=mastra-docs) offers an [MCP Server](https://docs.withampersand.com/mcp) that allows you to connect your agent to 150+ integrations with SaaS products like Salesforce, Hubspot, and Zendesk.
305
+
306
+ ```typescript
307
+ // MCPClient with Ampersand MCP Server using SSE
308
+ export const mcp = new MCPClient({
309
+ servers: {
310
+ "@amp-labs/mcp-server": {
311
+ url: `https://mcp.withampersand.com/v1/sse?${new URLSearchParams({
312
+ apiKey: process.env.AMPERSAND_API_KEY,
313
+ project: process.env.AMPERSAND_PROJECT_ID,
314
+ integrationName: process.env.AMPERSAND_INTEGRATION_NAME,
315
+ groupRef: process.env.AMPERSAND_GROUP_REF,
316
+ })}`,
317
+ },
318
+ },
319
+ });
320
+ ```
321
+
322
+ ```typescript
323
+ // If you prefer to run the MCP server locally:
324
+ import { MCPClient } from "@mastra/mcp";
325
+
326
+ // MCPClient with Ampersand MCP Server using stdio transport
327
+ export const mcp = new MCPClient({
328
+ servers: {
329
+ "@amp-labs/mcp-server": {
330
+ command: "npx",
331
+ args: [
332
+ "-y",
333
+ "@amp-labs/mcp-server@latest",
334
+ "--transport",
335
+ "stdio",
336
+ "--project",
337
+ process.env.AMPERSAND_PROJECT_ID,
338
+ "--integrationName",
339
+ process.env.AMPERSAND_INTEGRATION_NAME,
340
+ "--groupRef",
341
+ process.env.AMPERSAND_GROUP_REF, // optional
342
+ ],
343
+ env: {
344
+ AMPERSAND_API_KEY: process.env.AMPERSAND_API_KEY,
345
+ },
346
+ },
347
+ },
348
+ });
349
+ ```
350
+
351
+ As an alternative to MCP, Ampersand's AI SDK also has an adapter for Mastra, so you can [directly import Ampersand tools](https://docs.withampersand.com/ai-sdk#use-with-mastra) for your agent to access.
352
+
353
+ </TabItem>
354
+ </Tabs>
355
+
356
+ ## Related
357
+
358
+ - [Using Tools](/docs/v1/agents/using-tools)
359
+ - [MCPClient](/reference/v1/tools/mcp-client)
360
+ - [MCPServer](/reference/v1/tools/mcp-server)
@@ -0,0 +1,139 @@
1
+ ---
2
+ title: "Publishing an MCP Server | MCP"
3
+ description: Guide to setting up and building a Mastra MCP server using the stdio transport, and publishing it to NPM.
4
+ ---
5
+
6
+ import Steps from "@site/src/components/Steps";
7
+ import StepItem from "@site/src/components/StepItem";
8
+
9
+ # Publishing an MCP Server
10
+
11
+ This example guides you through setting up a basic Mastra MCPServer using the stdio transport, building it, and preparing it for publishing to NPM.
12
+
13
+ ## Install dependencies
14
+
15
+ Install the necessary packages:
16
+
17
+ ```bash
18
+ pnpm add @mastra/mcp @mastra/core tsup
19
+ ```
20
+
21
+ ## Setting up an MCP Server
22
+
23
+ <Steps>
24
+
25
+ <StepItem>
26
+
27
+ Create a file for your stdio server, for example, `/src/mastra/stdio.ts`.
28
+
29
+ </StepItem>
30
+
31
+ <StepItem>
32
+
33
+ Add the following code to the file. Remember to import your actual Mastra tools and name the server appropriately.
34
+
35
+ ```typescript title="src/mastra/stdio.ts" copy
36
+ #!/usr/bin/env node
37
+ import { MCPServer } from "@mastra/mcp";
38
+ import { weatherTool } from "./tools";
39
+
40
+ const server = new MCPServer({
41
+ name: "my-mcp-server",
42
+ version: "1.0.0",
43
+ tools: { weatherTool },
44
+ });
45
+
46
+ server.startStdio().catch((error) => {
47
+ console.error("Error running MCP server:", error);
48
+ process.exit(1);
49
+ });
50
+ ```
51
+
52
+ </StepItem>
53
+
54
+ <StepItem>
55
+
56
+ Update your `package.json` to include the `bin` entry pointing to your built server file and a script to build the server with both ESM and CJS outputs.
57
+
58
+ ```json title="package.json" copy
59
+ {
60
+ "bin": "dist/stdio.mjs",
61
+ "scripts": {
62
+ "build:mcp": "tsup src/mastra/stdio.ts --format esm,cjs --no-splitting --dts && echo '#!/usr/bin/env node' | cat - dist/stdio.mjs > temp && mv temp dist/stdio.mjs && chmod +x dist/stdio.mjs"
63
+ }
64
+ }
65
+ ```
66
+
67
+ The build command generates both ESM (`.mjs`) and CJS (`.cjs`) outputs for maximum compatibility. The shebang (`#!/usr/bin/env node`) is prepended to the ESM artifact to make it directly executable, and the `bin` entry points to this file.
68
+
69
+ </StepItem>
70
+
71
+ <StepItem>
72
+
73
+ Run the build command:
74
+
75
+ ```bash
76
+ pnpm run build:mcp
77
+ ```
78
+
79
+ This will compile your server code into both ESM and CJS formats and make the ESM output file executable. On Unix-like systems, the `chmod +x` step makes the file directly executable. Windows users may need to use WSL or handle execution through Node.js directly.
80
+
81
+ </StepItem>
82
+
83
+ </Steps>
84
+
85
+ ## Publishing to NPM
86
+
87
+ To make your MCP server available for others (or yourself) to use via `npx` or as a dependency, you can publish it to NPM.
88
+
89
+ <Steps>
90
+
91
+ <StepItem>
92
+
93
+ Ensure you have an NPM account and are logged in (`npm login`).
94
+
95
+ </StepItem>
96
+
97
+ <StepItem>
98
+
99
+ Make sure your package name in `package.json` is unique and available.
100
+
101
+ </StepItem>
102
+
103
+ <StepItem>
104
+
105
+ Run the publish command from your project root after building:
106
+
107
+ ```bash
108
+ npm publish --access public
109
+ ```
110
+
111
+ For more details on publishing packages, refer to the [NPM documentation](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages).
112
+
113
+ </StepItem>
114
+
115
+ </Steps>
116
+
117
+ ## Using a published MCP Server
118
+
119
+ Once published, your MCP server can be used by an `MCPClient` by specifying the command to run your package. You can also use any other MCP client like Claude desktop, Cursor, or Windsurf.
120
+
121
+ ```typescript
122
+ import { MCPClient } from "@mastra/mcp";
123
+
124
+ const mcp = new MCPClient({
125
+ servers: {
126
+ // Give this MCP server instance a name
127
+ yourServerName: {
128
+ command: "npx",
129
+ args: ["-y", "@your-org-name/your-package-name@latest"], // Replace with your package name
130
+ },
131
+ },
132
+ });
133
+
134
+ // You can then get tools or toolsets from this configuration to use in your agent
135
+ const tools = await mcp.getTools();
136
+ const toolsets = await mcp.getToolsets();
137
+ ```
138
+
139
+ Note: If you published without an organization scope, the `args` might just be `["-y", "your-package-name@latest"]`.
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Conversation History | Memory | Mastra Docs"
2
+ title: "Conversation History | Memory"
3
3
  description: "Learn how to configure conversation history in Mastra to store recent messages from the current conversation."
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Memory Processors | Memory | Mastra Docs"
2
+ title: "Memory Processors | Memory"
3
3
  description: "Learn how to use memory processors in Mastra to filter, trim, and transform messages before they're sent to the language model to manage context window limits."
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Memory overview | Memory | Mastra Docs"
2
+ title: "Memory overview | Memory"
3
3
  description: "Learn how Mastra's memory system works with working memory, conversation history, and semantic recall."
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Semantic Recall | Memory | Mastra Docs"
2
+ title: "Semantic Recall | Memory"
3
3
  description: "Learn how to use semantic recall in Mastra to retrieve relevant messages from past conversations using vector search and embeddings."
4
4
  ---
5
5