@mastra/mcp-docs-server 0.13.28 → 0.13.29-alpha.1

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 (33) hide show
  1. package/.docs/organized/changelogs/%40internal%2Fchangeset-cli.md +3 -1
  2. package/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +9 -9
  3. package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
  4. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +16 -16
  5. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +13 -0
  6. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +10 -10
  7. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +26 -26
  8. package/.docs/organized/changelogs/%40mastra%2Fcore.md +66 -66
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +29 -29
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +21 -21
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +19 -19
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +19 -19
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +41 -41
  14. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +11 -11
  15. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +25 -25
  16. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
  17. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +14 -14
  18. package/.docs/organized/changelogs/%40mastra%2Fpg.md +10 -10
  19. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +61 -61
  20. package/.docs/organized/changelogs/%40mastra%2Freact.md +29 -0
  21. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -0
  22. package/.docs/organized/changelogs/%40mastra%2Fserver.md +30 -30
  23. package/.docs/organized/changelogs/create-mastra.md +32 -32
  24. package/.docs/organized/changelogs/mastra.md +63 -63
  25. package/.docs/organized/code-examples/heads-up-game.md +3 -3
  26. package/.docs/raw/agents/runtime-context.mdx +59 -89
  27. package/.docs/raw/reference/workflows/workflow-methods/dountil.mdx +5 -3
  28. package/.docs/raw/reference/workflows/workflow-methods/dowhile.mdx +5 -3
  29. package/.docs/raw/server-db/middleware.mdx +27 -1
  30. package/.docs/raw/workflows/control-flow.mdx +54 -0
  31. package/CHANGELOG.md +14 -0
  32. package/package.json +4 -4
  33. package/.docs/raw/agents/dynamic-agents.mdx +0 -121
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "0.13.28",
3
+ "version": "0.13.29-alpha.1",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "uuid": "^11.1.0",
34
34
  "zod": "^3.25.76",
35
35
  "zod-to-json-schema": "^3.24.6",
36
- "@mastra/core": "0.20.1",
36
+ "@mastra/core": "0.20.2-alpha.1",
37
37
  "@mastra/mcp": "^0.13.4"
38
38
  },
39
39
  "devDependencies": {
@@ -49,8 +49,8 @@
49
49
  "tsx": "^4.19.4",
50
50
  "typescript": "^5.8.3",
51
51
  "vitest": "^3.2.4",
52
- "@mastra/core": "0.20.1",
53
- "@internal/lint": "0.0.47"
52
+ "@internal/lint": "0.0.47",
53
+ "@mastra/core": "0.20.2-alpha.1"
54
54
  },
55
55
  "homepage": "https://mastra.ai",
56
56
  "repository": {
@@ -1,121 +0,0 @@
1
- ---
2
- title: "Dynamic Agents"
3
- description: Dynamically configure your agent's instruction, model, tools, and memory using runtime context.
4
- ---
5
-
6
- # Dynamic Agents
7
-
8
- Dynamic agents use [runtime context](./runtime-context), like user IDs and other important parameters, to adjust their settings in real-time.
9
-
10
- This means they can change the model they use, update their instructions, select different tools, and configure memory as needed.
11
-
12
- By using this context, agents can better respond to each user's needs. They can also call any API to gather more information, which helps improve what the agents can do.
13
-
14
- ### Example Configuration
15
-
16
- Here's an example of a dynamic support agent that adjusts its behavior based on the user's subscription tier and language preferences:
17
-
18
- ```typescript
19
- const supportAgent = new Agent({
20
- name: "Dynamic Support Agent",
21
-
22
- instructions: async ({ runtimeContext }) => {
23
- const userTier = runtimeContext.get("user-tier");
24
- const language = runtimeContext.get("language");
25
-
26
- // Can return a string
27
- return `You are a customer support agent for our SaaS platform.
28
- The current user is on the ${userTier} tier and prefers ${language} language.
29
-
30
- For ${userTier} tier users:
31
- ${userTier === "free" ? "- Provide basic support and documentation links" : ""}
32
- ${userTier === "pro" ? "- Offer detailed technical support and best practices" : ""}
33
- ${userTier === "enterprise" ? "- Provide priority support with custom solutions" : ""}
34
-
35
- Always respond in ${language} language.`;
36
-
37
- // Alternative: Return a system message object with provider options
38
- // return {
39
- // role: "system",
40
- // content: `You are a customer support agent for ${userTier} tier...`,
41
- // providerOptions: {
42
- // openai: {
43
- // reasoning_effort: userTier === "enterprise" ? "high" : "medium"
44
- // }
45
- // }
46
- // };
47
-
48
- // Alternative: Return an array of system messages for modular instructions
49
- // return [
50
- // { role: "system", content: "You are a customer support agent." },
51
- // { role: "system", content: `User is on ${userTier} tier.` },
52
- // { role: "system", content: `Respond in ${language} language.` }
53
- // ];
54
- },
55
-
56
- model: ({ runtimeContext }) => {
57
- const userTier = runtimeContext.get("user-tier");
58
- return userTier === "enterprise"
59
- ? openai("gpt-4")
60
- : openai("gpt-3.5-turbo");
61
- },
62
-
63
- tools: ({ runtimeContext }) => {
64
- const userTier = runtimeContext.get("user-tier");
65
- const baseTools = [knowledgeBase, ticketSystem];
66
-
67
- if (userTier === "pro" || userTier === "enterprise") {
68
- baseTools.push(advancedAnalytics);
69
- }
70
-
71
- if (userTier === "enterprise") {
72
- baseTools.push(customIntegration);
73
- }
74
-
75
- return baseTools;
76
- },
77
-
78
- memory: ({ runtimeContext }) => {
79
- const userTier = runtimeContext.get("user-tier");
80
-
81
- if (userTier === "enterprise") {
82
- return new Memory({
83
- storage: new LibSQLStore({ url: "file:enterprise.db" }),
84
- options: {
85
- semanticRecall: { topK: 15, messageRange: 8 },
86
- workingMemory: { enabled: true },
87
- },
88
- });
89
- } else if (userTier === "pro") {
90
- return new Memory({
91
- storage: new LibSQLStore({ url: "file:pro.db" }),
92
- options: {
93
- semanticRecall: { topK: 8, messageRange: 4 },
94
- workingMemory: { enabled: true },
95
- },
96
- });
97
- }
98
-
99
- // Basic memory for free tier
100
- return new Memory({
101
- storage: new LibSQLStore({ url: "file:free.db" }),
102
- options: {
103
- semanticRecall: { topK: 3, messageRange: 2 },
104
- workingMemory: { enabled: false },
105
- },
106
- });
107
- },
108
- });
109
- ```
110
-
111
- In this example, the agent:
112
-
113
- - Adjusts its instructions based on the user's subscription tier (free, pro, or enterprise)
114
- - Uses a more powerful model (GPT-4) for enterprise users
115
- - Provides different sets of tools based on the user's tier
116
- - Configures memory with different capabilities based on the user's tier
117
- - Responds in the user's preferred language
118
-
119
- This demonstrates how a single agent can handle different types of users and scenarios by leveraging runtime context, making it more flexible and maintainable than creating separate agents for each use case.
120
-
121
- For a complete implementation example including API routes, middleware setup, and runtime context handling, see our [Dynamic Agents Example](/examples/agents/dynamic-agents).