@mastra/mcp-docs-server 0.0.0-commonjs-20250414101718

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 (254) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fastra.md +302 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +302 -0
  3. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +161 -0
  4. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +302 -0
  5. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +110 -0
  6. package/.docs/organized/changelogs/%40mastra%2Fcore.md +302 -0
  7. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +302 -0
  8. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +302 -0
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +302 -0
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +302 -0
  11. package/.docs/organized/changelogs/%40mastra%2Fevals.md +302 -0
  12. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +302 -0
  13. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +302 -0
  14. package/.docs/organized/changelogs/%40mastra%2Floggers.md +302 -0
  15. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +302 -0
  16. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +26 -0
  17. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +302 -0
  18. package/.docs/organized/changelogs/%40mastra%2Fmem0.md +196 -0
  19. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +302 -0
  20. package/.docs/organized/changelogs/%40mastra%2Fpg.md +302 -0
  21. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +302 -0
  22. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +302 -0
  23. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +302 -0
  24. package/.docs/organized/changelogs/%40mastra%2Frag.md +302 -0
  25. package/.docs/organized/changelogs/%40mastra%2Fragie.md +302 -0
  26. package/.docs/organized/changelogs/%40mastra%2Fserver.md +302 -0
  27. package/.docs/organized/changelogs/%40mastra%2Fspeech-azure.md +302 -0
  28. package/.docs/organized/changelogs/%40mastra%2Fspeech-deepgram.md +302 -0
  29. package/.docs/organized/changelogs/%40mastra%2Fspeech-elevenlabs.md +302 -0
  30. package/.docs/organized/changelogs/%40mastra%2Fspeech-google.md +302 -0
  31. package/.docs/organized/changelogs/%40mastra%2Fspeech-ibm.md +302 -0
  32. package/.docs/organized/changelogs/%40mastra%2Fspeech-murf.md +302 -0
  33. package/.docs/organized/changelogs/%40mastra%2Fspeech-openai.md +302 -0
  34. package/.docs/organized/changelogs/%40mastra%2Fspeech-playai.md +302 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fspeech-replicate.md +302 -0
  36. package/.docs/organized/changelogs/%40mastra%2Fspeech-speechify.md +302 -0
  37. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +302 -0
  38. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +302 -0
  39. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +302 -0
  40. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +250 -0
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +250 -0
  42. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +302 -0
  43. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +302 -0
  44. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +302 -0
  45. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +302 -0
  46. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +302 -0
  47. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +302 -0
  48. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +302 -0
  49. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +302 -0
  50. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +302 -0
  51. package/.docs/organized/changelogs/create-mastra.md +302 -0
  52. package/.docs/organized/changelogs/mastra.md +302 -0
  53. package/.docs/organized/code-examples/agent-network.md +282 -0
  54. package/.docs/organized/code-examples/agent.md +388 -0
  55. package/.docs/organized/code-examples/ai-sdk-useChat.md +378 -0
  56. package/.docs/organized/code-examples/assistant-ui.md +37 -0
  57. package/.docs/organized/code-examples/bird-checker-with-express.md +235 -0
  58. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +360 -0
  59. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +250 -0
  60. package/.docs/organized/code-examples/client-side-tools.md +69 -0
  61. package/.docs/organized/code-examples/crypto-chatbot.md +96 -0
  62. package/.docs/organized/code-examples/fireworks-r1.md +159 -0
  63. package/.docs/organized/code-examples/mcp-registry-registry.md +63 -0
  64. package/.docs/organized/code-examples/memory-todo-agent.md +164 -0
  65. package/.docs/organized/code-examples/memory-with-context.md +167 -0
  66. package/.docs/organized/code-examples/memory-with-libsql.md +204 -0
  67. package/.docs/organized/code-examples/memory-with-mem0.md +121 -0
  68. package/.docs/organized/code-examples/memory-with-pg.md +224 -0
  69. package/.docs/organized/code-examples/memory-with-upstash.md +268 -0
  70. package/.docs/organized/code-examples/quick-start.md +129 -0
  71. package/.docs/organized/code-examples/stock-price-tool.md +124 -0
  72. package/.docs/organized/code-examples/weather-agent.md +353 -0
  73. package/.docs/organized/code-examples/workflow-ai-recruiter.md +159 -0
  74. package/.docs/organized/code-examples/workflow-with-inline-steps.md +111 -0
  75. package/.docs/organized/code-examples/workflow-with-memory.md +393 -0
  76. package/.docs/organized/code-examples/workflow-with-separate-steps.md +131 -0
  77. package/.docs/raw/agents/adding-tools.mdx +317 -0
  78. package/.docs/raw/agents/adding-voice.mdx +175 -0
  79. package/.docs/raw/agents/agent-memory.mdx +62 -0
  80. package/.docs/raw/agents/mcp-guide.mdx +215 -0
  81. package/.docs/raw/agents/overview.mdx +303 -0
  82. package/.docs/raw/community/discord.mdx +12 -0
  83. package/.docs/raw/community/licensing.mdx +63 -0
  84. package/.docs/raw/deployment/client.mdx +120 -0
  85. package/.docs/raw/deployment/deployment.mdx +127 -0
  86. package/.docs/raw/deployment/server.mdx +282 -0
  87. package/.docs/raw/evals/custom-eval.mdx +22 -0
  88. package/.docs/raw/evals/overview.mdx +95 -0
  89. package/.docs/raw/evals/running-in-ci.mdx +81 -0
  90. package/.docs/raw/evals/textual-evals.mdx +54 -0
  91. package/.docs/raw/faq/index.mdx +63 -0
  92. package/.docs/raw/frameworks/ai-sdk.mdx +296 -0
  93. package/.docs/raw/frameworks/next-js.mdx +238 -0
  94. package/.docs/raw/getting-started/installation.mdx +442 -0
  95. package/.docs/raw/getting-started/mcp-docs-server.mdx +141 -0
  96. package/.docs/raw/getting-started/project-structure.mdx +80 -0
  97. package/.docs/raw/index.mdx +22 -0
  98. package/.docs/raw/integrations/index.mdx +213 -0
  99. package/.docs/raw/local-dev/add-to-existing-project.mdx +48 -0
  100. package/.docs/raw/local-dev/creating-a-new-project.mdx +54 -0
  101. package/.docs/raw/local-dev/mastra-dev.mdx +108 -0
  102. package/.docs/raw/memory/memory-processors.mdx +131 -0
  103. package/.docs/raw/memory/overview.mdx +119 -0
  104. package/.docs/raw/memory/semantic-recall.mdx +122 -0
  105. package/.docs/raw/memory/working-memory.mdx +87 -0
  106. package/.docs/raw/observability/logging.mdx +38 -0
  107. package/.docs/raw/observability/nextjs-tracing.mdx +108 -0
  108. package/.docs/raw/observability/tracing.mdx +115 -0
  109. package/.docs/raw/rag/chunking-and-embedding.mdx +156 -0
  110. package/.docs/raw/rag/overview.mdx +85 -0
  111. package/.docs/raw/rag/retrieval.mdx +365 -0
  112. package/.docs/raw/rag/vector-databases.mdx +340 -0
  113. package/.docs/raw/reference/agents/createTool.mdx +229 -0
  114. package/.docs/raw/reference/agents/generate.mdx +334 -0
  115. package/.docs/raw/reference/agents/getAgent.mdx +54 -0
  116. package/.docs/raw/reference/agents/stream.mdx +369 -0
  117. package/.docs/raw/reference/cli/build.mdx +55 -0
  118. package/.docs/raw/reference/cli/dev.mdx +134 -0
  119. package/.docs/raw/reference/cli/init.mdx +43 -0
  120. package/.docs/raw/reference/client-js/agents.mdx +107 -0
  121. package/.docs/raw/reference/client-js/error-handling.mdx +38 -0
  122. package/.docs/raw/reference/client-js/logs.mdx +24 -0
  123. package/.docs/raw/reference/client-js/memory.mdx +97 -0
  124. package/.docs/raw/reference/client-js/telemetry.mdx +20 -0
  125. package/.docs/raw/reference/client-js/tools.mdx +44 -0
  126. package/.docs/raw/reference/client-js/vectors.mdx +79 -0
  127. package/.docs/raw/reference/client-js/workflows.mdx +136 -0
  128. package/.docs/raw/reference/core/mastra-class.mdx +232 -0
  129. package/.docs/raw/reference/deployer/cloudflare.mdx +207 -0
  130. package/.docs/raw/reference/deployer/deployer.mdx +159 -0
  131. package/.docs/raw/reference/deployer/netlify.mdx +109 -0
  132. package/.docs/raw/reference/deployer/vercel.mdx +117 -0
  133. package/.docs/raw/reference/evals/answer-relevancy.mdx +186 -0
  134. package/.docs/raw/reference/evals/bias.mdx +186 -0
  135. package/.docs/raw/reference/evals/completeness.mdx +174 -0
  136. package/.docs/raw/reference/evals/content-similarity.mdx +183 -0
  137. package/.docs/raw/reference/evals/context-position.mdx +190 -0
  138. package/.docs/raw/reference/evals/context-precision.mdx +189 -0
  139. package/.docs/raw/reference/evals/context-relevancy.mdx +188 -0
  140. package/.docs/raw/reference/evals/contextual-recall.mdx +191 -0
  141. package/.docs/raw/reference/evals/faithfulness.mdx +193 -0
  142. package/.docs/raw/reference/evals/hallucination.mdx +219 -0
  143. package/.docs/raw/reference/evals/keyword-coverage.mdx +176 -0
  144. package/.docs/raw/reference/evals/prompt-alignment.mdx +238 -0
  145. package/.docs/raw/reference/evals/summarization.mdx +205 -0
  146. package/.docs/raw/reference/evals/textual-difference.mdx +161 -0
  147. package/.docs/raw/reference/evals/tone-consistency.mdx +181 -0
  148. package/.docs/raw/reference/evals/toxicity.mdx +165 -0
  149. package/.docs/raw/reference/index.mdx +12 -0
  150. package/.docs/raw/reference/memory/Memory.mdx +212 -0
  151. package/.docs/raw/reference/memory/createThread.mdx +95 -0
  152. package/.docs/raw/reference/memory/getThreadById.mdx +46 -0
  153. package/.docs/raw/reference/memory/getThreadsByResourceId.mdx +48 -0
  154. package/.docs/raw/reference/memory/query.mdx +167 -0
  155. package/.docs/raw/reference/networks/agent-network.mdx +159 -0
  156. package/.docs/raw/reference/observability/create-logger.mdx +106 -0
  157. package/.docs/raw/reference/observability/logger.mdx +55 -0
  158. package/.docs/raw/reference/observability/otel-config.mdx +120 -0
  159. package/.docs/raw/reference/observability/providers/braintrust.mdx +40 -0
  160. package/.docs/raw/reference/observability/providers/dash0.mdx +40 -0
  161. package/.docs/raw/reference/observability/providers/index.mdx +16 -0
  162. package/.docs/raw/reference/observability/providers/laminar.mdx +41 -0
  163. package/.docs/raw/reference/observability/providers/langfuse.mdx +51 -0
  164. package/.docs/raw/reference/observability/providers/langsmith.mdx +48 -0
  165. package/.docs/raw/reference/observability/providers/langwatch.mdx +45 -0
  166. package/.docs/raw/reference/observability/providers/new-relic.mdx +40 -0
  167. package/.docs/raw/reference/observability/providers/signoz.mdx +40 -0
  168. package/.docs/raw/reference/observability/providers/traceloop.mdx +40 -0
  169. package/.docs/raw/reference/rag/astra.mdx +258 -0
  170. package/.docs/raw/reference/rag/chroma.mdx +281 -0
  171. package/.docs/raw/reference/rag/chunk.mdx +235 -0
  172. package/.docs/raw/reference/rag/document.mdx +127 -0
  173. package/.docs/raw/reference/rag/embeddings.mdx +160 -0
  174. package/.docs/raw/reference/rag/extract-params.mdx +226 -0
  175. package/.docs/raw/reference/rag/graph-rag.mdx +182 -0
  176. package/.docs/raw/reference/rag/libsql.mdx +357 -0
  177. package/.docs/raw/reference/rag/metadata-filters.mdx +298 -0
  178. package/.docs/raw/reference/rag/pg.mdx +477 -0
  179. package/.docs/raw/reference/rag/pinecone.mdx +281 -0
  180. package/.docs/raw/reference/rag/qdrant.mdx +236 -0
  181. package/.docs/raw/reference/rag/rerank.mdx +212 -0
  182. package/.docs/raw/reference/rag/turbopuffer.mdx +249 -0
  183. package/.docs/raw/reference/rag/upstash.mdx +247 -0
  184. package/.docs/raw/reference/rag/vectorize.mdx +298 -0
  185. package/.docs/raw/reference/storage/libsql.mdx +74 -0
  186. package/.docs/raw/reference/storage/postgresql.mdx +48 -0
  187. package/.docs/raw/reference/storage/upstash.mdx +86 -0
  188. package/.docs/raw/reference/tools/client.mdx +207 -0
  189. package/.docs/raw/reference/tools/document-chunker-tool.mdx +141 -0
  190. package/.docs/raw/reference/tools/graph-rag-tool.mdx +154 -0
  191. package/.docs/raw/reference/tools/mcp-configuration.mdx +206 -0
  192. package/.docs/raw/reference/tools/vector-query-tool.mdx +212 -0
  193. package/.docs/raw/reference/voice/composite-voice.mdx +140 -0
  194. package/.docs/raw/reference/voice/deepgram.mdx +164 -0
  195. package/.docs/raw/reference/voice/elevenlabs.mdx +216 -0
  196. package/.docs/raw/reference/voice/google.mdx +198 -0
  197. package/.docs/raw/reference/voice/mastra-voice.mdx +394 -0
  198. package/.docs/raw/reference/voice/murf.mdx +251 -0
  199. package/.docs/raw/reference/voice/openai-realtime.mdx +431 -0
  200. package/.docs/raw/reference/voice/openai.mdx +168 -0
  201. package/.docs/raw/reference/voice/playai.mdx +159 -0
  202. package/.docs/raw/reference/voice/sarvam.mdx +260 -0
  203. package/.docs/raw/reference/voice/speechify.mdx +145 -0
  204. package/.docs/raw/reference/voice/voice.answer.mdx +122 -0
  205. package/.docs/raw/reference/voice/voice.connect.mdx +124 -0
  206. package/.docs/raw/reference/voice/voice.listen.mdx +195 -0
  207. package/.docs/raw/reference/voice/voice.on.mdx +189 -0
  208. package/.docs/raw/reference/voice/voice.send.mdx +118 -0
  209. package/.docs/raw/reference/voice/voice.speak.mdx +203 -0
  210. package/.docs/raw/reference/workflows/after.mdx +88 -0
  211. package/.docs/raw/reference/workflows/afterEvent.mdx +76 -0
  212. package/.docs/raw/reference/workflows/commit.mdx +37 -0
  213. package/.docs/raw/reference/workflows/createRun.mdx +77 -0
  214. package/.docs/raw/reference/workflows/else.mdx +72 -0
  215. package/.docs/raw/reference/workflows/events.mdx +305 -0
  216. package/.docs/raw/reference/workflows/execute.mdx +110 -0
  217. package/.docs/raw/reference/workflows/if.mdx +107 -0
  218. package/.docs/raw/reference/workflows/resume.mdx +155 -0
  219. package/.docs/raw/reference/workflows/resumeWithEvent.mdx +133 -0
  220. package/.docs/raw/reference/workflows/snapshots.mdx +207 -0
  221. package/.docs/raw/reference/workflows/start.mdx +84 -0
  222. package/.docs/raw/reference/workflows/step-class.mdx +100 -0
  223. package/.docs/raw/reference/workflows/step-condition.mdx +134 -0
  224. package/.docs/raw/reference/workflows/step-function.mdx +92 -0
  225. package/.docs/raw/reference/workflows/step-options.mdx +69 -0
  226. package/.docs/raw/reference/workflows/step-retries.mdx +203 -0
  227. package/.docs/raw/reference/workflows/suspend.mdx +70 -0
  228. package/.docs/raw/reference/workflows/then.mdx +74 -0
  229. package/.docs/raw/reference/workflows/until.mdx +165 -0
  230. package/.docs/raw/reference/workflows/watch.mdx +118 -0
  231. package/.docs/raw/reference/workflows/while.mdx +168 -0
  232. package/.docs/raw/reference/workflows/workflow.mdx +233 -0
  233. package/.docs/raw/storage/overview.mdx +378 -0
  234. package/.docs/raw/voice/overview.mdx +135 -0
  235. package/.docs/raw/voice/speech-to-text.mdx +45 -0
  236. package/.docs/raw/voice/text-to-speech.mdx +52 -0
  237. package/.docs/raw/voice/voice-to-voice.mdx +310 -0
  238. package/.docs/raw/workflows/control-flow.mdx +778 -0
  239. package/.docs/raw/workflows/dynamic-workflows.mdx +236 -0
  240. package/.docs/raw/workflows/error-handling.mdx +183 -0
  241. package/.docs/raw/workflows/nested-workflows.mdx +352 -0
  242. package/.docs/raw/workflows/overview.mdx +203 -0
  243. package/.docs/raw/workflows/steps.mdx +108 -0
  244. package/.docs/raw/workflows/suspend-and-resume.mdx +404 -0
  245. package/.docs/raw/workflows/variables.mdx +313 -0
  246. package/LICENSE.md +46 -0
  247. package/README.md +129 -0
  248. package/dist/_tsup-dts-rollup.d.ts +149 -0
  249. package/dist/chunk-QWYMT5LP.js +194 -0
  250. package/dist/prepare-docs/prepare.d.ts +1 -0
  251. package/dist/prepare-docs/prepare.js +1 -0
  252. package/dist/stdio.d.ts +1 -0
  253. package/dist/stdio.js +518 -0
  254. package/package.json +60 -0
package/LICENSE.md ADDED
@@ -0,0 +1,46 @@
1
+ # Elastic License 2.0 (ELv2)
2
+
3
+ Copyright (c) 2025 Mastra AI, Inc.
4
+
5
+ **Acceptance**
6
+ By using the software, you agree to all of the terms and conditions below.
7
+
8
+ **Copyright License**
9
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
10
+
11
+ **Limitations**
12
+ You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
13
+
14
+ You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
15
+
16
+ You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
17
+
18
+ **Patents**
19
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
20
+
21
+ **Notices**
22
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
23
+
24
+ If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
25
+
26
+ **No Other Rights**
27
+ These terms do not imply any licenses other than those expressly granted in these terms.
28
+
29
+ **Termination**
30
+ If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
31
+
32
+ **No Liability**
33
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
34
+
35
+ **Definitions**
36
+ The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
37
+
38
+ _you_ refers to the individual or entity agreeing to these terms.
39
+
40
+ _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
41
+
42
+ _your licenses_ are all the licenses granted to you for the software under these terms.
43
+
44
+ _use_ means anything you do with the software requiring one of your licenses.
45
+
46
+ _trademark_ means trademarks, service marks, and similar rights.
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # @mastra/mcp-docs-server
2
+
3
+ A Model Context Protocol (MCP) server that provides AI assistants with direct access to Mastra.ai's complete knowledge base. This includes comprehensive documentation with MDX support, a collection of production-ready code examples, technical blog posts, and detailed package changelogs. The server integrates with popular AI development environments like Cursor and Windsurf, as well as Mastra agents, making it easy to build documentation-aware AI assistants that can provide accurate, up-to-date information about Mastra.ai's ecosystem.
4
+
5
+ ## Installation
6
+
7
+ ### In Cursor
8
+
9
+ Create or update `.cursor/mcp.json` in your project root:
10
+
11
+ MacOS/Linux
12
+
13
+ ```json
14
+ {
15
+ "mcpServers": {
16
+ "mastra": {
17
+ "command": "npx",
18
+ "args": ["-y", "@mastra/mcp-docs-server@latest"]
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ Windows
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "mastra": {
30
+ "command": "cmd",
31
+ "args": ["/c", "npx", "-y", "@mastra/mcp-docs-server@latest"]
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ This will make all Mastra documentation tools available in your Cursor workspace.
38
+ Note that the MCP server wont be enabled by default. You'll need to go to Cursor settings -> MCP settings and click "enable" on the Mastra MCP server.
39
+
40
+ ### In Windsurf
41
+
42
+ Create or update `~/.codeium/windsurf/mcp_config.json`:
43
+
44
+ MacOS/Linux
45
+
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "mastra": {
50
+ "command": "npx",
51
+ "args": ["-y", "@mastra/mcp-docs-server@latest"]
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ Windows
58
+
59
+ ```json
60
+ {
61
+ "mcpServers": {
62
+ "mastra": {
63
+ "command": "cmd",
64
+ "args": ["/c", "npx", "-y", "@mastra/mcp-docs-server@latest"]
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ This will make all Mastra documentation tools available in your Windsurf workspace.
71
+ Note that Windsurf MCP tool calling doesn't work very well. You will need to fully quit and re-open Windsurf after adding this.
72
+ If a tool call fails you will need to go into Windsurf MCP settings and re-start the MCP server.
73
+
74
+ ### In a Mastra Agent
75
+
76
+ ```typescript
77
+ import { MCPConfiguration } from '@mastra/mcp';
78
+ import { Agent } from '@mastra/core/agent';
79
+ import { openai } from '@ai-sdk/openai';
80
+
81
+ // Configure MCP with the docs server
82
+ const mcp = new MCPConfiguration({
83
+ servers: {
84
+ mastra: {
85
+ command: 'npx',
86
+ args: ['-y', '@mastra/mcp-docs-server@latest'],
87
+ },
88
+ },
89
+ });
90
+
91
+ // Create an agent with access to all documentation tools
92
+ const agent = new Agent({
93
+ name: 'Documentation Assistant',
94
+ instructions: 'You help users find and understand Mastra.ai documentation.',
95
+ model: openai('gpt-4'),
96
+ tools: await mcp.getTools(),
97
+ });
98
+
99
+ // Or use toolsets dynamically in generate/stream
100
+ const response = await agent.stream('Show me the quick start example', {
101
+ toolsets: await mcp.getToolsets(),
102
+ });
103
+ ```
104
+
105
+ ## Tools
106
+
107
+ ### Documentation Tool (`mastraDocs`)
108
+
109
+ - Get Mastra.ai documentation by requesting specific paths
110
+ - Explore both general guides and API reference documentation
111
+ - Automatically lists available paths when a requested path isn't found
112
+
113
+ ### Examples Tool (`mastraExamples`)
114
+
115
+ - Access code examples showing Mastra.ai implementation patterns
116
+ - List all available examples
117
+ - Get detailed source code for specific examples
118
+
119
+ ### Blog Tool (`mastraBlog`)
120
+
121
+ - Access technical blog posts and articles
122
+ - Posts are properly formatted with code block handling
123
+ - Supports various date formats in blog metadata
124
+
125
+ ### Changes Tool (`mastraChanges`)
126
+
127
+ - Access package changelogs
128
+ - List all available package changelogs
129
+ - Get detailed changelog content for specific packages
@@ -0,0 +1,149 @@
1
+ import { MCPConfiguration } from '@mastra/mcp';
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { ServerType } from '@hono/node-server/.';
4
+ import { z } from 'zod';
5
+
6
+ export declare type BlogInput = z.infer<typeof blogInputSchema>;
7
+
8
+ export declare const blogInputSchema: z.ZodObject<{
9
+ url: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ url: string;
12
+ }, {
13
+ url: string;
14
+ }>;
15
+
16
+ export declare const blogTool: {
17
+ name: string;
18
+ description: string;
19
+ execute: (args: BlogInput) => Promise<{
20
+ content: {
21
+ type: string;
22
+ text: string;
23
+ }[];
24
+ isError: boolean;
25
+ }>;
26
+ };
27
+
28
+ export declare function callTool(tool: any, args: any): Promise<string>;
29
+
30
+ export declare type ChangesInput = z.infer<typeof changesInputSchema>;
31
+
32
+ export declare const changesInputSchema: z.ZodObject<{
33
+ package: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ package?: string | undefined;
36
+ }, {
37
+ package?: string | undefined;
38
+ }>;
39
+
40
+ export declare const changesTool: {
41
+ name: string;
42
+ description: string;
43
+ execute: (args: ChangesInput) => Promise<{
44
+ content: {
45
+ type: string;
46
+ text: string;
47
+ }[];
48
+ isError: boolean;
49
+ }>;
50
+ };
51
+
52
+ export declare function copyRaw(): Promise<void>;
53
+
54
+ export declare type DocsInput = z.infer<typeof docsInputSchema>;
55
+
56
+ export declare const docsInputSchema: z.ZodObject<{
57
+ paths: z.ZodArray<z.ZodString, "many">;
58
+ }, "strip", z.ZodTypeAny, {
59
+ paths: string[];
60
+ }, {
61
+ paths: string[];
62
+ }>;
63
+
64
+ export declare const docsTool: {
65
+ name: string;
66
+ description: string;
67
+ execute: (args: DocsInput) => Promise<{
68
+ content: {
69
+ type: string;
70
+ text: string;
71
+ }[];
72
+ isError: boolean;
73
+ }>;
74
+ };
75
+
76
+ export declare type ExamplesInput = z.infer<typeof examplesInputSchema>;
77
+
78
+ export declare const examplesInputSchema: z.ZodObject<{
79
+ example: z.ZodOptional<z.ZodString>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ example?: string | undefined;
82
+ }, {
83
+ example?: string | undefined;
84
+ }>;
85
+
86
+ export declare const examplesTool: {
87
+ name: string;
88
+ description: string;
89
+ execute: (args: ExamplesInput) => Promise<{
90
+ content: {
91
+ type: string;
92
+ text: string;
93
+ }[];
94
+ isError: boolean;
95
+ }>;
96
+ };
97
+
98
+ export declare function fromPackageRoot(relative: string): string;
99
+
100
+ export declare function fromRepoRoot(relative: string): string;
101
+
102
+ export declare const log: {
103
+ (...data: any[]): void;
104
+ (message?: any, ...optionalParams: any[]): void;
105
+ };
106
+
107
+ export declare const mcp: MCPConfiguration;
108
+
109
+ export declare function prepare(): Promise<void>;
110
+
111
+ /**
112
+ * Scans example directories and creates flattened code example files
113
+ */
114
+ export declare function prepareCodeExamples(): Promise<void>;
115
+
116
+ /**
117
+ * Scans package directories and creates organized changelog files
118
+ */
119
+ export declare function preparePackageChanges(): Promise<void>;
120
+
121
+ export declare function runServer(): Promise<void>;
122
+
123
+ export declare const server: Server<{
124
+ method: string;
125
+ params?: {
126
+ [x: string]: unknown;
127
+ _meta?: {
128
+ [x: string]: unknown;
129
+ progressToken?: string | number | undefined;
130
+ } | undefined;
131
+ } | undefined;
132
+ }, {
133
+ method: string;
134
+ params?: {
135
+ [x: string]: unknown;
136
+ _meta?: {
137
+ [x: string]: unknown;
138
+ } | undefined;
139
+ } | undefined;
140
+ }, {
141
+ [x: string]: unknown;
142
+ _meta?: {
143
+ [x: string]: unknown;
144
+ } | undefined;
145
+ }>;
146
+
147
+ export declare const server_alias_1: ServerType;
148
+
149
+ export { }
@@ -0,0 +1,194 @@
1
+ import path from 'path';
2
+ import fs from 'node:fs/promises';
3
+ import path4 from 'node:path';
4
+
5
+ // src/utils.ts
6
+ function fromRepoRoot(relative) {
7
+ return path.resolve(import.meta.dirname, `../../../`, relative);
8
+ }
9
+ function fromPackageRoot(relative) {
10
+ return path.resolve(import.meta.dirname, `../`, relative);
11
+ }
12
+ var log = console.error;
13
+ var EXAMPLES_SOURCE = fromRepoRoot("examples");
14
+ var OUTPUT_DIR = fromPackageRoot(".docs/organized/code-examples");
15
+ async function prepareCodeExamples() {
16
+ try {
17
+ await fs.rm(OUTPUT_DIR, { recursive: true, force: true });
18
+ } catch {
19
+ }
20
+ await fs.mkdir(OUTPUT_DIR, { recursive: true });
21
+ const examples = await fs.readdir(EXAMPLES_SOURCE, { withFileTypes: true });
22
+ const exampleDirs = examples.filter((entry) => entry.isDirectory());
23
+ for (const dir of exampleDirs) {
24
+ const examplePath = path4.join(EXAMPLES_SOURCE, dir.name);
25
+ const outputFile = path4.join(OUTPUT_DIR, `${dir.name}.md`);
26
+ const files = [];
27
+ try {
28
+ const packageJson = await fs.readFile(path4.join(examplePath, "package.json"), "utf-8");
29
+ files.push({
30
+ path: "package.json",
31
+ content: packageJson
32
+ });
33
+ } catch {
34
+ }
35
+ try {
36
+ const srcPath = path4.join(examplePath, "src");
37
+ await scanDirectory(srcPath, srcPath, files);
38
+ } catch {
39
+ }
40
+ if (files.length > 0) {
41
+ const output = files.map((file) => `### ${file.path}
42
+ \`\`\`${getFileType(file.path)}
43
+ ${file.content}
44
+ \`\`\`
45
+ `).join("\n");
46
+ const totalLines = output.split("\n").length;
47
+ if (totalLines > 500) {
48
+ log(`Skipping ${dir.name}: ${totalLines} lines exceeds limit of 500`);
49
+ continue;
50
+ }
51
+ await fs.writeFile(outputFile, output, "utf-8");
52
+ log(`Generated ${dir.name}.md with ${totalLines} lines`);
53
+ }
54
+ }
55
+ }
56
+ async function scanDirectory(basePath, currentPath, files) {
57
+ const entries = await fs.readdir(currentPath, { withFileTypes: true });
58
+ for (const entry of entries) {
59
+ const fullPath = path4.join(currentPath, entry.name);
60
+ const relativePath = path4.relative(basePath, fullPath);
61
+ if (entry.isDirectory()) {
62
+ await scanDirectory(basePath, fullPath, files);
63
+ } else if (entry.isFile() && entry.name.endsWith(".ts")) {
64
+ const content = await fs.readFile(fullPath, "utf-8");
65
+ files.push({
66
+ path: relativePath,
67
+ content
68
+ });
69
+ }
70
+ }
71
+ }
72
+ function getFileType(filePath) {
73
+ if (filePath === "package.json") return "json";
74
+ if (filePath.endsWith(".ts")) return "typescript";
75
+ return "";
76
+ }
77
+ var DOCS_SOURCE = fromRepoRoot("docs/src/content/docs");
78
+ var REFERENCE_SOURCE = fromRepoRoot("docs/src/content/reference");
79
+ var DOCS_DEST = fromPackageRoot(".docs/raw");
80
+ var REFERENCE_DEST = path4.join(DOCS_DEST, "reference");
81
+ async function copyDir(src, dest) {
82
+ await fs.mkdir(dest, { recursive: true });
83
+ const entries = await fs.readdir(src, { withFileTypes: true });
84
+ for (const entry of entries) {
85
+ const srcPath = path4.join(src, entry.name);
86
+ const destPath = path4.join(dest, entry.name);
87
+ if (entry.isDirectory()) {
88
+ await copyDir(srcPath, destPath);
89
+ } else if (entry.isFile() && entry.name.endsWith(".mdx")) {
90
+ await fs.copyFile(srcPath, destPath);
91
+ }
92
+ }
93
+ }
94
+ async function copyRaw() {
95
+ try {
96
+ try {
97
+ await fs.rm(DOCS_DEST, { recursive: true });
98
+ } catch {
99
+ }
100
+ await copyDir(DOCS_SOURCE, DOCS_DEST);
101
+ await copyDir(REFERENCE_SOURCE, REFERENCE_DEST);
102
+ log("\u2705 Documentation files copied successfully");
103
+ } catch (error) {
104
+ console.error("\u274C Failed to copy documentation files:", error);
105
+ process.exit(1);
106
+ }
107
+ }
108
+ var SOURCE_DIRS = ["packages", "speech", "stores", "voice", "integrations", "deployers", "client-sdks"].map(
109
+ fromRepoRoot
110
+ );
111
+ var CHANGELOGS_DEST = fromPackageRoot(".docs/organized/changelogs");
112
+ var MAX_LINES = 300;
113
+ function truncateContent(content, maxLines) {
114
+ const lines = content.split("\n");
115
+ if (lines.length <= maxLines) return content;
116
+ const visibleLines = lines.slice(0, maxLines);
117
+ const hiddenCount = lines.length - maxLines;
118
+ return visibleLines.join("\n") + `
119
+
120
+ ... ${hiddenCount} more lines hidden. See full changelog in package directory.`;
121
+ }
122
+ async function processPackageDir(packagePath, outputDir) {
123
+ let packageName;
124
+ try {
125
+ const packageJsonPath = path4.join(packagePath, "package.json");
126
+ const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
127
+ packageName = packageJson.name;
128
+ if (!packageName) {
129
+ log(`Skipping ${path4.basename(packagePath)}: No package name found in package.json`);
130
+ return;
131
+ }
132
+ } catch {
133
+ console.error(`Skipping ${path4.basename(packagePath)}: No valid package.json found`);
134
+ return;
135
+ }
136
+ try {
137
+ const changelogPath = path4.join(packagePath, "CHANGELOG.md");
138
+ let changelog;
139
+ try {
140
+ changelog = await fs.readFile(changelogPath, "utf-8");
141
+ changelog = truncateContent(changelog, MAX_LINES);
142
+ } catch {
143
+ changelog = "No changelog available.";
144
+ }
145
+ const outputFile = path4.join(outputDir, `${encodeURIComponent(packageName)}.md`);
146
+ await fs.writeFile(outputFile, changelog, "utf-8");
147
+ log(`Generated changelog for ${packageName}`);
148
+ } catch (error) {
149
+ console.error(`Error processing changelog for ${packageName}:`, error);
150
+ }
151
+ }
152
+ async function preparePackageChanges() {
153
+ const outputDir = path4.resolve(process.cwd(), CHANGELOGS_DEST);
154
+ try {
155
+ await fs.rm(outputDir, { recursive: true, force: true });
156
+ } catch {
157
+ }
158
+ await fs.mkdir(outputDir, { recursive: true });
159
+ for (const sourceDir of SOURCE_DIRS) {
160
+ const fullSourceDir = path4.resolve(process.cwd(), sourceDir);
161
+ try {
162
+ await fs.access(fullSourceDir);
163
+ const entries = await fs.readdir(fullSourceDir, { withFileTypes: true });
164
+ const packageDirs = entries.filter((entry) => entry.isDirectory()).filter((entry) => entry.name !== "docs-mcp" && entry.name !== "_config");
165
+ for (const dir of packageDirs) {
166
+ const packagePath = path4.join(fullSourceDir, dir.name);
167
+ await processPackageDir(packagePath, outputDir);
168
+ }
169
+ } catch {
170
+ console.error(`Skipping ${sourceDir}: Directory not found or not accessible`);
171
+ }
172
+ }
173
+ }
174
+
175
+ // src/prepare-docs/prepare.ts
176
+ async function prepare() {
177
+ log("Preparing documentation...");
178
+ await copyRaw();
179
+ log("Preparing code examples...");
180
+ await prepareCodeExamples();
181
+ log("Preparing package changelogs...");
182
+ await preparePackageChanges();
183
+ log("Documentation preparation complete!");
184
+ }
185
+ if (process.env.PREPARE === `true`) {
186
+ try {
187
+ await prepare();
188
+ } catch (error) {
189
+ console.error("Error preparing documentation:", error);
190
+ process.exit(1);
191
+ }
192
+ }
193
+
194
+ export { fromPackageRoot, prepare };
@@ -0,0 +1 @@
1
+ export { prepare } from '../_tsup-dts-rollup.js';
@@ -0,0 +1 @@
1
+ export { prepare } from '../chunk-QWYMT5LP.js';
@@ -0,0 +1 @@
1
+ export {};