@mastra/mcp-docs-server 0.13.22-alpha.5 → 0.13.22-alpha.7

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 (45) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +10 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +11 -11
  3. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +23 -23
  4. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +10 -10
  5. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +10 -10
  6. package/.docs/organized/changelogs/%40mastra%2Fcore.md +36 -36
  7. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +11 -11
  8. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +18 -18
  9. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +30 -30
  10. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +10 -10
  11. package/.docs/organized/changelogs/%40mastra%2Flance.md +10 -10
  12. package/.docs/organized/changelogs/%40mastra%2Floggers.md +11 -11
  13. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +18 -18
  14. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +11 -11
  15. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
  16. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
  17. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
  18. package/.docs/organized/changelogs/%40mastra%2Fpg.md +10 -10
  19. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +35 -35
  20. package/.docs/organized/changelogs/%40mastra%2Fserver.md +21 -21
  21. package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +9 -0
  22. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +10 -10
  23. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +10 -10
  24. package/.docs/organized/changelogs/create-mastra.md +9 -9
  25. package/.docs/organized/changelogs/mastra.md +28 -28
  26. package/.docs/organized/code-examples/agui.md +1 -1
  27. package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
  28. package/.docs/organized/code-examples/ai-sdk-v5.md +2 -2
  29. package/.docs/organized/code-examples/assistant-ui.md +2 -2
  30. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +2 -2
  31. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +2 -2
  32. package/.docs/organized/code-examples/client-side-tools.md +1 -1
  33. package/.docs/organized/code-examples/crypto-chatbot.md +4 -4
  34. package/.docs/organized/code-examples/openapi-spec-writer.md +2 -2
  35. package/.docs/raw/agents/input-processors.mdx +16 -14
  36. package/.docs/raw/agents/runtime-context.mdx +47 -12
  37. package/.docs/raw/frameworks/agentic-uis/cedar-os.mdx +7 -7
  38. package/CHANGELOG.md +17 -0
  39. package/package.json +8 -8
  40. package/.docs/raw/reference/networks/agent-network.mdx +0 -165
  41. /package/.docs/raw/reference/streaming/{MastraModelOutput.mdx → agents/MastraModelOutput.mdx} +0 -0
  42. /package/.docs/raw/reference/streaming/{stream.mdx → agents/stream.mdx} +0 -0
  43. /package/.docs/raw/reference/streaming/{streamVNext.mdx → agents/streamVNext.mdx} +0 -0
  44. /package/.docs/raw/reference/{workflows/run-methods → streaming/workflows}/stream.mdx +0 -0
  45. /package/.docs/raw/reference/{workflows/run-methods → streaming/workflows}/streamVNext.mdx +0 -0
@@ -20,9 +20,10 @@ The dependency injection system allows you to:
20
20
 
21
21
  Agents can access `runtimeContext` via the `instructions` parameter, and retrieve variables using `runtimeContext.get()`. This allows agent behavior to adapt dynamically based on user input or external configuration, without changing the underlying implementation.
22
22
 
23
- ```typescript {6-7,14} filename="src/mastra/agents/test-weather-agent.ts" showLineNumbers copy
23
+ ```typescript {7-8,15} filename="src/mastra/agents/test-weather-agent.ts" showLineNumbers copy
24
24
  import { openai } from "@ai-sdk/openai";
25
25
  import { Agent } from "@mastra/core/agent";
26
+ import { testWeatherTool } from "../tools/test-weather-tool";
26
27
 
27
28
  export const testWeatherAgent = new Agent({
28
29
  name: "test-weather-agent",
@@ -38,7 +39,47 @@ export const testWeatherAgent = new Agent({
38
39
  - If no city is mentioned, ask for a city name
39
40
  `;
40
41
  },
41
- model: openai("gpt-4o-mini")
42
+ model: openai("gpt-4o-mini"),
43
+ tools: { testWeatherTool }
44
+ });
45
+ ```
46
+
47
+ ### Example tool
48
+
49
+ This tool exports a `WeatherRuntimeContext` type, which can be used anywhere `RuntimeContext` is used to enable type-safe access to runtime configuration.
50
+
51
+ ```typescript {4-6} filename="src/mastra/tools/test-weather-tool.ts" showLineNumbers copy
52
+ import { createTool } from "@mastra/core/tools";
53
+ import { z } from "zod";
54
+
55
+ export type WeatherRuntimeContext = {
56
+ "temperature-unit": "celsius" | "fahrenheit";
57
+ };
58
+
59
+ export const testWeatherTool = createTool({
60
+ id: "test-weather-tool",
61
+ description: "Get weather for a location",
62
+ inputSchema: z.object({
63
+ location: z.string()
64
+ }),
65
+ outputSchema: z.object({
66
+ metric: z.string(),
67
+ temperature: z.number(),
68
+ weather: z.string()
69
+ }),
70
+ execute: async ({ context, runtimeContext }) => {
71
+ const { location } = context;
72
+ const unit = runtimeContext.get("temperature-unit") as WeatherRuntimeContext["temperature-unit"];
73
+
74
+ const temperature = 30;
75
+ const weather = "Sunny";
76
+
77
+ return {
78
+ metric: unit === "celsius" ? "°C" : "°F",
79
+ temperature,
80
+ weather
81
+ };
82
+ }
42
83
  });
43
84
  ```
44
85
 
@@ -46,16 +87,13 @@ export const testWeatherAgent = new Agent({
46
87
 
47
88
  In this example, `temperature-unit` is set using `runtimeContext.set()` to either **celsius** or **fahrenheit**, allowing the agent to respond with temperatures in the appropriate unit.
48
89
 
49
- ```typescript {12} filename="src/test-weather-agent.ts" showLineNumbers copy
90
+ ```typescript {9, 12} filename="src/test-weather-agent.ts" showLineNumbers copy
50
91
  import { mastra } from "./mastra";
51
92
  import { RuntimeContext } from "@mastra/core/runtime-context";
93
+ import { WeatherRuntimeContext } from "./mastra/tools/test-weather-tool";
52
94
 
53
95
  const agent = mastra.getAgent("testWeatherAgent");
54
96
 
55
- export type WeatherRuntimeContext = {
56
- "temperature-unit": "celsius" | "fahrenheit";
57
- };
58
-
59
97
  const runtimeContext = new RuntimeContext<WeatherRuntimeContext>();
60
98
 
61
99
  runtimeContext.set("temperature-unit", "fahrenheit");
@@ -71,14 +109,11 @@ console.log(response.text);
71
109
 
72
110
  You can populate `runtimeContext` dynamically in server middleware by extracting information from the request. In this example, the `temperature-unit` is set based on the Cloudflare `CF-IPCountry` header to ensure responses match the user's locale.
73
111
 
74
- ```typescript {2,12-21} filename="src/mastra/index.ts" showLineNumbers copy
112
+ ```typescript {2,4,9-18} filename="src/mastra/index.ts" showLineNumbers copy
75
113
  import { Mastra } from "@mastra/core/mastra";
76
114
  import { RuntimeContext } from "@mastra/core/runtime-context";
77
115
  import { testWeatherAgent } from "./agents/test-weather-agent";
78
-
79
- type WeatherRuntimeContext = {
80
- "temperature-unit": "celsius" | "fahrenheit";
81
- };
116
+ import { WeatherRuntimeContext } from "./mastra/tools/test-weather-tool";
82
117
 
83
118
  export const mastra = new Mastra({
84
119
  agents: { testWeatherAgent },
@@ -8,19 +8,19 @@ import { Tabs, Steps } from "nextra/components";
8
8
 
9
9
  # Integrate Cedar-OS with Mastra
10
10
 
11
- Cedar-OS is an open-source agentic UI framework designed specifically for building the most ambitious AI-native applications. We built Cedar with Mastra in mind.
11
+ Cedar-OS is an open-source agentic UI framework designed specifically for building the most ambitious AI-native applications. Cedar was built with Mastra in mind.
12
12
 
13
13
  ## Should you use Cedar?
14
14
 
15
- There are a few pillars we care about strongly that you can read more about [here](https://docs.cedarcopilot.com/introduction/philosophy):
15
+ There are a few pillars Cedar cares about strongly that you can read more about [here](https://docs.cedarcopilot.com/introduction/philosophy):
16
16
 
17
17
  #### 1. Developer experience
18
18
  - **Every single component is downloaded shadcn-style** – You own all the code and can style it however you want
19
- - **Works out of the box** – Just drop in our chat component, and it'll work
19
+ - **Works out of the box** – Just drop in the chat component, and it'll work
20
20
  - **Fully extensible** - Built on a [Zustand store architecture](https://docs.cedarcopilot.com/introduction/architecture) that you can customize completely. Every single internal function can be overridden in one line.
21
21
 
22
22
  #### 2. Enabling truly AI-native applications
23
- For the first time in history, products can come to life. We want to help you build something with life.
23
+ For the first time in history, products can come to life. Cedar is aimed at helping you build something with life.
24
24
  - **[Spells](https://docs.cedarcopilot.com/spells/spells#what-are-spells)** - Users can trigger AI from keyboard shortcuts, mouse events, text selection, and other components
25
25
  - **[State Diff Management](https://docs.cedarcopilot.com/state-diff/using-state-diff)** - Give users control over accepting/rejecting agent outputs
26
26
  - **[Voice Integration](https://docs.cedarcopilot.com/voice/voice-integration)** - Let users control your app with their voice
@@ -38,7 +38,7 @@ npx cedar-os-cli plant-seed
38
38
  If starting from scratch, select the **Mastra starter** template for a complete setup with both frontend and backend in a monorepo
39
39
 
40
40
  If you already have a Mastra backend, use the **blank frontend cedar repo** option instead.
41
- - This will give you the option to download components and download all dependencies for Cedar. We recommend at least downloading one of the chat components to get started.
41
+ - This will give you the option to download components and download all dependencies for Cedar. It is recommended to download at least one of the chat components to get started.
42
42
 
43
43
  ### Wrap your app with CedarCopilot
44
44
 
@@ -101,8 +101,8 @@ Your backend and frontend are now linked! You're ready to start building AI-nati
101
101
  ## More information
102
102
 
103
103
  - Check out the [detailed Mastra integration guide](https://docs.cedarcopilot.com/agent-backend-connection/mastra#extending-mastra) for more configuration options (or for manual installation instructions if something goes wrong)
104
- - Explore Mastra-specific optimizations and features we've built
104
+ - Explore Mastra-specific optimizations and features Cedar has built
105
105
  - **Seamless event streaming** - Automatic rendering of [Mastra streamed events](https://docs.cedarcopilot.com/chat/custom-message-rendering#mastra-event-renderer)
106
106
  - **Voice endpoint support** - Built-in [voice backend integration](https://docs.cedarcopilot.com/voice/agentic-backend#endpoint-configuration)
107
107
  - **End-to-End type safety** - [Types](https://docs.cedarcopilot.com/type-safety/typing-agent-requests) for communicating between your app and Mastra backend
108
- - [Join our Discord!](https://discord.gg/4AWawRjNdZ) We're excited to have you :)
108
+ - [Join the Discord!](https://discord.gg/4AWawRjNdZ) The Cedar team is excited to have you :)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 0.13.22-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689)]:
8
+ - @mastra/core@0.17.0-alpha.7
9
+
10
+ ## 0.13.22-alpha.6
11
+
12
+ ### Patch Changes
13
+
14
+ - dependencies updates: ([#7907](https://github.com/mastra-ai/mastra/pull/7907))
15
+ - Updated dependency [`turndown@^7.2.1` ↗︎](https://www.npmjs.com/package/turndown/v/7.2.1) (from `^7.2.0`, in `dependencies`)
16
+ - Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e)]:
17
+ - @mastra/core@0.17.0-alpha.6
18
+ - @mastra/mcp@0.13.0-alpha.2
19
+
3
20
  ## 0.13.22-alpha.5
4
21
 
5
22
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "0.13.22-alpha.5",
3
+ "version": "0.13.22-alpha.7",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,28 +29,28 @@
29
29
  "date-fns": "^4.1.0",
30
30
  "exit-hook": "^4.0.0",
31
31
  "jsdom": "^26.1.0",
32
- "turndown": "^7.2.0",
32
+ "turndown": "^7.2.1",
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.17.0-alpha.5",
37
- "@mastra/mcp": "^0.13.0-alpha.1"
36
+ "@mastra/mcp": "^0.13.0-alpha.2",
37
+ "@mastra/core": "0.17.0-alpha.7"
38
38
  },
39
39
  "devDependencies": {
40
- "@hono/node-server": "^1.19.2",
40
+ "@hono/node-server": "^1.19.3",
41
41
  "@types/jsdom": "^21.1.7",
42
42
  "@types/node": "^20.19.0",
43
43
  "@types/turndown": "^5.0.5",
44
44
  "@wong2/mcp-cli": "^1.10.0",
45
45
  "cross-env": "^7.0.3",
46
- "eslint": "^9.30.1",
47
- "hono": "^4.9.6",
46
+ "eslint": "^9.35.0",
47
+ "hono": "^4.9.7",
48
48
  "tsup": "^8.5.0",
49
49
  "tsx": "^4.19.4",
50
50
  "typescript": "^5.8.3",
51
51
  "vitest": "^3.2.4",
52
52
  "@internal/lint": "0.0.39",
53
- "@mastra/core": "0.17.0-alpha.5"
53
+ "@mastra/core": "0.17.0-alpha.7"
54
54
  },
55
55
  "homepage": "https://mastra.ai",
56
56
  "repository": {
@@ -1,165 +0,0 @@
1
- ---
2
- title: "AgentNetwork (Experimental)"
3
- description: "Reference documentation for the AgentNetwork class"
4
- ---
5
-
6
- # AgentNetwork (Experimental)
7
-
8
- > **Note:** The AgentNetwork feature is experimental and may change in future releases.
9
-
10
- The `AgentNetwork` class provides a way to create a network of specialized agents that can collaborate to solve complex tasks. Unlike Workflows, which require explicit control over execution paths, AgentNetwork uses an LLM-based router to dynamically determine which agent to call next.
11
-
12
- ## Key Concepts
13
-
14
- - **LLM-based Routing**: AgentNetwork exclusively uses an LLM to figure out the best way to use your agents
15
- - **Agent Collaboration**: Multiple specialized agents can work together to solve complex tasks
16
- - **Dynamic Decision Making**: The router decides which agent to call based on the task requirements
17
-
18
- ## Usage
19
-
20
- ```typescript
21
- import { AgentNetwork } from "@mastra/core/network";
22
- import { openai } from "@mastra/openai";
23
-
24
- // Create specialized agents
25
- const webSearchAgent = new Agent({
26
- name: "Web Search Agent",
27
- instructions: "You search the web for information.",
28
- model: openai("gpt-4o"),
29
- tools: {
30
- /* web search tools */
31
- },
32
- });
33
-
34
- const dataAnalysisAgent = new Agent({
35
- name: "Data Analysis Agent",
36
- instructions: "You analyze data and provide insights.",
37
- model: openai("gpt-4o"),
38
- tools: {
39
- /* data analysis tools */
40
- },
41
- });
42
-
43
- // Create the network
44
- const researchNetwork = new AgentNetwork({
45
- name: "Research Network",
46
- instructions: "Coordinate specialized agents to research topics thoroughly.",
47
- model: openai("gpt-4o"),
48
- agents: [webSearchAgent, dataAnalysisAgent],
49
- });
50
-
51
- // Use the network
52
- const result = await researchNetwork.generate(
53
- "Research the impact of climate change on agriculture",
54
- );
55
- console.log(result.text);
56
- ```
57
-
58
- ## Constructor
59
-
60
- ```typescript
61
- constructor(config: AgentNetworkConfig)
62
- ```
63
-
64
- ### Parameters
65
-
66
- - `config`: Configuration object for the AgentNetwork
67
- - `name`: Name of the network
68
- - `instructions`: Instructions for the routing agent
69
- - `model`: Language model to use for routing
70
- - `agents`: Array of specialized agents in the network
71
-
72
- ## Methods
73
-
74
- ### generate()
75
-
76
- Generates a response using the agent network. This method has replaced the deprecated `run()` method for consistency with the rest of the codebase.
77
-
78
- ```typescript
79
- async generate(
80
- messages: string | string[] | CoreMessage[],
81
- args?: AgentGenerateOptions
82
- ): Promise<GenerateTextResult>
83
- ```
84
-
85
- ### stream()
86
-
87
- Streams a response using the agent network.
88
-
89
- ```typescript
90
- async stream(
91
- messages: string | string[] | CoreMessage[],
92
- args?: AgentStreamOptions
93
- ): Promise<StreamTextResult>
94
- ```
95
-
96
- ### getRoutingAgent()
97
-
98
- Returns the routing agent used by the network.
99
-
100
- ```typescript
101
- getRoutingAgent(): Agent
102
- ```
103
-
104
- ### getAgents()
105
-
106
- Returns the array of specialized agents in the network.
107
-
108
- ```typescript
109
- getAgents(): Agent[]
110
- ```
111
-
112
- ### getAgentHistory()
113
-
114
- Returns the history of interactions for a specific agent.
115
-
116
- ```typescript
117
- getAgentHistory(agentId: string): Array<{
118
- input: string;
119
- output: string;
120
- timestamp: string;
121
- }>
122
- ```
123
-
124
- ### getAgentInteractionHistory()
125
-
126
- Returns the history of all agent interactions that have occurred in the network.
127
-
128
- ```typescript
129
- getAgentInteractionHistory(): Record<
130
- string,
131
- Array<{
132
- input: string;
133
- output: string;
134
- timestamp: string;
135
- }>
136
- >
137
- ```
138
-
139
- ### getAgentInteractionSummary()
140
-
141
- Returns a formatted summary of agent interactions in chronological order.
142
-
143
- ```typescript
144
- getAgentInteractionSummary(): string
145
- ```
146
-
147
- ## When to Use AgentNetwork vs Workflows
148
-
149
- - **Use AgentNetwork when:** You want the AI to figure out the best way to use your agents, with dynamic routing based on the task requirements.
150
-
151
- - **Use Workflows when:** You need explicit control over execution paths, with predetermined sequences of agent calls and conditional logic.
152
-
153
- ## Internal Tools
154
-
155
- The AgentNetwork uses a special `transmit` tool that allows the routing agent to call specialized agents. This tool handles:
156
-
157
- - Single agent calls
158
- - Multiple parallel agent calls
159
- - Context sharing between agents
160
-
161
- ## Limitations
162
-
163
- - The AgentNetwork approach may use more tokens than a well-designed Workflow for the same task
164
- - Debugging can be more challenging as the routing decisions are made by the LLM
165
- - Performance may vary based on the quality of the routing instructions and the capabilities of the specialized agents