@mastra/mcp-docs-server 0.13.7-alpha.4 → 0.13.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 (77) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fastra.md +8 -8
  2. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +8 -8
  3. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +8 -8
  4. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +7 -7
  5. package/.docs/organized/changelogs/%40mastra%2Fcloud.md +8 -8
  6. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +8 -8
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +9 -9
  8. package/.docs/organized/changelogs/%40mastra%2Fcore.md +3 -3
  9. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +8 -8
  10. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +10 -10
  11. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +10 -10
  12. package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +10 -10
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +13 -13
  14. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +8 -8
  15. package/.docs/organized/changelogs/%40mastra%2Fevals.md +11 -11
  16. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +10 -10
  17. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +8 -8
  18. package/.docs/organized/changelogs/%40mastra%2Flance.md +7 -0
  19. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +11 -11
  20. package/.docs/organized/changelogs/%40mastra%2Floggers.md +8 -8
  21. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +9 -9
  22. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +8 -8
  23. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +9 -9
  24. package/.docs/organized/changelogs/%40mastra%2Fmem0.md +8 -8
  25. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +11 -11
  26. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +8 -8
  27. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +7 -0
  28. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +8 -8
  29. package/.docs/organized/changelogs/%40mastra%2Fpg.md +11 -11
  30. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +9 -9
  31. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +10 -10
  32. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +9 -9
  33. package/.docs/organized/changelogs/%40mastra%2Frag.md +8 -8
  34. package/.docs/organized/changelogs/%40mastra%2Fragie.md +8 -8
  35. package/.docs/organized/changelogs/%40mastra%2Fserver.md +11 -11
  36. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +9 -9
  37. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +11 -11
  38. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +8 -8
  39. package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +8 -8
  40. package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +8 -8
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +8 -8
  42. package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +8 -8
  43. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +8 -8
  44. package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +8 -8
  45. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +8 -8
  46. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +8 -8
  47. package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +8 -8
  48. package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +8 -8
  49. package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +8 -8
  50. package/.docs/organized/changelogs/mastra.md +12 -12
  51. package/.docs/raw/agents/streaming.mdx +118 -0
  52. package/.docs/raw/evals/custom-eval.mdx +4 -0
  53. package/.docs/raw/evals/overview.mdx +4 -0
  54. package/.docs/raw/evals/running-in-ci.mdx +4 -0
  55. package/.docs/raw/evals/textual-evals.mdx +4 -0
  56. package/.docs/raw/reference/agents/streamVNext.mdx +598 -0
  57. package/.docs/raw/reference/evals/answer-relevancy.mdx +4 -0
  58. package/.docs/raw/reference/evals/bias.mdx +4 -0
  59. package/.docs/raw/reference/evals/completeness.mdx +4 -0
  60. package/.docs/raw/reference/evals/content-similarity.mdx +4 -0
  61. package/.docs/raw/reference/evals/context-position.mdx +4 -0
  62. package/.docs/raw/reference/evals/context-precision.mdx +4 -0
  63. package/.docs/raw/reference/evals/context-relevancy.mdx +4 -0
  64. package/.docs/raw/reference/evals/contextual-recall.mdx +4 -0
  65. package/.docs/raw/reference/evals/faithfulness.mdx +4 -0
  66. package/.docs/raw/reference/evals/hallucination.mdx +4 -0
  67. package/.docs/raw/reference/evals/keyword-coverage.mdx +4 -0
  68. package/.docs/raw/reference/evals/prompt-alignment.mdx +4 -0
  69. package/.docs/raw/reference/evals/summarization.mdx +4 -1
  70. package/.docs/raw/reference/evals/textual-difference.mdx +4 -0
  71. package/.docs/raw/reference/evals/tone-consistency.mdx +4 -0
  72. package/.docs/raw/reference/evals/toxicity.mdx +4 -0
  73. package/.docs/raw/reference/workflows/streamVNext.mdx +215 -0
  74. package/.docs/raw/server-db/mastra-client.mdx +10 -6
  75. package/.docs/raw/workflows/control-flow.mdx +3 -3
  76. package/.docs/raw/workflows/streaming.mdx +115 -0
  77. package/package.json +5 -5
@@ -1,5 +1,16 @@
1
1
  # mastra
2
2
 
3
+ ## 0.10.16-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - f42c4c2: update peer deps for packages to latest core range
8
+ - Updated dependencies [f42c4c2]
9
+ - @mastra/deployer@0.12.0-alpha.5
10
+ - @mastra/loggers@0.10.5-alpha.0
11
+ - @mastra/mcp@0.10.8-alpha.0
12
+ - @mastra/core@0.12.0-alpha.5
13
+
3
14
  ## 0.10.16-alpha.2
4
15
 
5
16
  ### Patch Changes
@@ -287,16 +298,5 @@
287
298
  - Updated dependencies [626b0f4]
288
299
  - Updated dependencies [c22a91f]
289
300
  - Updated dependencies [f7403ab]
290
- - Updated dependencies [6c89d7f]
291
- - @mastra/deployer@0.10.15-alpha.0
292
- - @mastra/core@0.10.15-alpha.0
293
-
294
- ## 0.10.12
295
-
296
- ### Patch Changes
297
-
298
- - 640f47e: move agent model settings into agent settings
299
- - 5d0c163: Scaffold create-mastra projects with zod@^3 to prevent package version conflicts during install
300
- - 53e3f58: Add support for custom instrumentation files
301
301
 
302
- ... 4594 more lines hidden. See full changelog in package directory.
302
+ ... 4605 more lines hidden. See full changelog in package directory.
@@ -0,0 +1,118 @@
1
+ ---
2
+ title: "Using Agent Streaming | Agents | Mastra Docs"
3
+ description: Documentation on how to stream agents
4
+ ---
5
+
6
+ # Agent Streaming
7
+
8
+ Agents in Mastra have access to a powerful streaming protocol! With seamless integration into tools or agents as a tool, you can stream responses directly back to your clients, creating a more interactive and engaging experience.
9
+
10
+ ## Usage
11
+
12
+ To use the new protocol, you can use the `streamVNext` method on an agent. This method will return a custom MastraAgentStream. This stream extends a ReadableStream, so all basic stream methods are available.
13
+
14
+ ```typescript
15
+ const stream = await agent.streamVNext({ role: "user", content: "Tell me a story." });
16
+
17
+ for await (const chunk of stream) {
18
+ console.log(chunk);
19
+ }
20
+ ```
21
+
22
+ Each chunk is a JSON object with the following properties:
23
+
24
+ ```json
25
+ {
26
+ type: string;
27
+ runId: string;
28
+ from: string;
29
+ payload: Record<string, any>;
30
+ }
31
+ ```
32
+
33
+ We have a couple of utility functions on the stream to help you with the streaming process.
34
+
35
+ - `stream.finishReason` - The reason the agent stopped streaming.
36
+ - `stream.toolCalls` - The tool calls made by the agent.
37
+ - `stream.toolResults` - The tool results returned by the agent.
38
+ - `stream.usage` - The total token usage of the agent, including agents/workflows as a tool.
39
+ - `stream.text` - The full text of the agent's response.
40
+ - `stream.object` - The object of the agent's response, if you use output or experimental output.
41
+ - `stream.textStream` - A readable stream that will emit the text of the agent's response.
42
+
43
+ ### How to use the stream in a tool
44
+
45
+ Each tool gets a `writer` argument, which is a writable stream with a custom write function. This write function is used to write the tool's response to the stream.
46
+
47
+ ```typescript filename="src/mastra/tools/test-tool.ts" showLineNumbers copy
48
+ import { createTool } from "@mastra/core/tools";
49
+ import { z } from "zod";
50
+
51
+ export const weatherInfo = createTool({
52
+ id: "Get Weather Information",
53
+ inputSchema: z.object({
54
+ city: z.string(),
55
+ }),
56
+ outputSchema: z.object({
57
+ conditions: z.string(),
58
+ temperature: z.number(),
59
+ }),
60
+ description: `Fetches the current weather information for a given city`,
61
+ execute: async ({ context: { city }, writer }) => {
62
+ writer.write({
63
+ type: "weather-data",
64
+ args: {
65
+ city
66
+ },
67
+ status: "pending"
68
+ })
69
+ // Tool logic here (e.g., API call)
70
+ console.log("Using tool to fetch weather information for", city);
71
+
72
+ writer.write({
73
+ type: "weather-data",
74
+ args: {
75
+ city
76
+ },
77
+ status: "success",
78
+ result: {
79
+ temperature: 20,
80
+ conditions: "Sunny"
81
+ }
82
+ })
83
+
84
+ return { temperature: 20, conditions: "Sunny" }; // Example return
85
+ },
86
+ });
87
+ ```
88
+
89
+ If you want to use the stream in an agent, you can use the `streamVNext` method on the agent and pipe it to the agent's input stream.
90
+
91
+ ```typescript filename="src/mastra/tools/test-tool.ts" showLineNumbers copy
92
+ import { createTool } from "@mastra/core/tools";
93
+ import { z } from "zod";
94
+
95
+ export const weatherInfo = createTool({
96
+ id: "Get Weather Information",
97
+ description: `Fetches the current weather information for a given city`,
98
+ inputSchema: z.object({
99
+ city: z.string(),
100
+ }),
101
+ outputSchema: z.object({
102
+ text: z.string(),
103
+ }),
104
+ execute: async ({ context: { city }, writer, mastra }) => {
105
+ const agent = mastra.getAgent('weatherAgent')
106
+ const stream = await agent.streamVNext(`What is the weather in ${city}?`);
107
+
108
+ await stream.pipeTo(writer);
109
+
110
+ return {
111
+ text: await stream.text,
112
+ }
113
+ },
114
+ });
115
+ ```
116
+
117
+ Piping the stream to the agent's input stream will allow us to automatically sum up the usage of the agent so the total usage count can be calculated.
118
+
@@ -3,8 +3,12 @@ title: "Create a custom eval"
3
3
  description: "Mastra allows you to create your own evals, here is how."
4
4
  ---
5
5
 
6
+ import { ScorerCallout } from '@/components/scorer-callout'
7
+
6
8
  # Create a Custom Eval
7
9
 
10
+ <ScorerCallout />
11
+
8
12
  Create a custom eval by extending the `Metric` class and implementing the `measure` method. This gives you full control over how scores are calculated and what information is returned. For LLM-based evaluations, extend the `MastraAgentJudge` class to define how the model reasons and scores output.
9
13
 
10
14
  ## Native JavaScript evaluation
@@ -3,8 +3,12 @@ title: "Overview"
3
3
  description: "Understanding how to evaluate and measure AI agent quality using Mastra evals."
4
4
  ---
5
5
 
6
+ import { ScorerCallout } from '@/components/scorer-callout'
7
+
6
8
  # Testing your agents with evals
7
9
 
10
+ <ScorerCallout />
11
+
8
12
  While traditional software tests have clear pass/fail conditions, AI outputs are non-deterministic — they can vary with the same input. Evals help bridge this gap by providing quantifiable metrics for measuring agent quality.
9
13
 
10
14
  Evals are automated tests that evaluate Agents outputs using model-graded, rule-based, and statistical methods. Each eval returns a normalized score between 0-1 that can be logged and compared. Evals can be customized with your own prompts and scoring functions.
@@ -3,8 +3,12 @@ title: "Running in CI"
3
3
  description: "Learn how to run Mastra evals in your CI/CD pipeline to monitor agent quality over time."
4
4
  ---
5
5
 
6
+ import { ScorerCallout } from '@/components/scorer-callout'
7
+
6
8
  # Running Evals in CI
7
9
 
10
+ <ScorerCallout />
11
+
8
12
  Running evals in your CI pipeline helps bridge this gap by providing quantifiable metrics for measuring agent quality over time.
9
13
 
10
14
  ## Setting Up CI Integration
@@ -3,8 +3,12 @@ title: "Textual Evals"
3
3
  description: "Understand how Mastra uses LLM-as-judge methodology to evaluate text quality."
4
4
  ---
5
5
 
6
+ import { ScorerCallout } from '@/components/scorer-callout'
7
+
6
8
  # Textual Evals
7
9
 
10
+ <ScorerCallout />
11
+
8
12
  Textual evals use an LLM-as-judge methodology to evaluate agent outputs. This approach leverages language models to assess various aspects of text quality, similar to how a teaching assistant might grade assignments using a rubric.
9
13
 
10
14
  Each eval focuses on specific quality aspects and returns a score between 0 and 1, providing quantifiable metrics for non-deterministic AI outputs.