@mastra/mcp-docs-server 0.0.3 → 0.0.4-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.
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fcomposio.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +36 -36
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +32 -32
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +26 -0
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Frag.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-azure.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-deepgram.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-elevenlabs.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-google.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-ibm.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-murf.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-openai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-playai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-replicate.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fspeech-speechify.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fstabilityai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +25 -0
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +9 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +25 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +27 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +26 -26
- package/.docs/organized/changelogs/create-mastra.md +22 -22
- package/.docs/organized/changelogs/mastra.md +47 -47
- package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -1
- package/.docs/raw/agents/02-adding-tools.mdx +6 -0
- package/.docs/raw/agents/02a-mcp-guide.mdx +192 -0
- package/.docs/raw/agents/03-adding-voice.mdx +8 -8
- package/.docs/raw/deployment/deployment.mdx +5 -42
- package/.docs/raw/deployment/server.mdx +45 -3
- package/.docs/raw/evals/00-overview.mdx +2 -2
- package/.docs/raw/evals/03-running-in-ci.mdx +7 -4
- package/.docs/raw/getting-started/mcp-docs-server.mdx +5 -2
- package/.docs/raw/guides/04-research-assistant.mdx +273 -0
- package/.docs/raw/local-dev/mastra-dev.mdx +2 -2
- package/.docs/raw/observability/logging.mdx +38 -0
- package/.docs/raw/observability/nextjs-tracing.mdx +102 -0
- package/.docs/raw/observability/tracing.mdx +110 -0
- package/.docs/raw/rag/overview.mdx +3 -3
- package/.docs/raw/rag/retrieval.mdx +7 -4
- package/.docs/raw/rag/vector-databases.mdx +107 -40
- package/.docs/raw/reference/client-js/memory.mdx +6 -3
- package/.docs/raw/reference/client-js/workflows.mdx +1 -0
- package/.docs/raw/reference/observability/providers/langsmith.mdx +2 -0
- package/.docs/raw/reference/rag/libsql.mdx +3 -3
- package/.docs/raw/reference/rag/upstash.mdx +50 -1
- package/.docs/raw/reference/rag/vectorize.mdx +48 -3
- package/.docs/raw/reference/tools/client.mdx +10 -2
- package/.docs/raw/reference/tools/vector-query-tool.mdx +1 -1
- package/.docs/raw/reference/voice/sarvam.mdx +260 -0
- package/.docs/raw/reference/workflows/afterEvent.mdx +76 -0
- package/.docs/raw/reference/workflows/events.mdx +305 -0
- package/.docs/raw/reference/workflows/resumeWithEvent.mdx +134 -0
- package/.docs/raw/reference/workflows/snapshots.mdx +204 -0
- package/.docs/raw/reference/workflows/step-retries.mdx +203 -0
- package/.docs/raw/voice/overview.mdx +135 -0
- package/.docs/raw/voice/speech-to-text.mdx +45 -0
- package/.docs/raw/voice/text-to-speech.mdx +52 -0
- package/.docs/raw/voice/voice-to-voice.mdx +310 -0
- package/.docs/raw/workflows/dynamic-workflows.mdx +4 -0
- package/.docs/raw/workflows/error-handling.mdx +183 -0
- package/.docs/raw/workflows/steps.mdx +12 -2
- package/.docs/raw/workflows/suspend-and-resume.mdx +207 -2
- package/.docs/raw/workflows/variables.mdx +23 -3
- package/dist/_tsup-dts-rollup.d.ts +83 -0
- package/dist/chunk-YEOOTUPA.js +191 -0
- package/dist/prepare-docs/prepare.d.ts +1 -1
- package/dist/prepare-docs/prepare.js +1 -13
- package/dist/stdio.d.ts +0 -1
- package/dist/stdio.js +352 -5
- package/package.json +9 -15
- package/.docs/raw/deployment/logging-and-tracing.mdx +0 -242
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -19
- package/dist/prepare-docs/code-examples.d.ts +0 -4
- package/dist/prepare-docs/code-examples.js +0 -91
- package/dist/prepare-docs/copy-raw.d.ts +0 -1
- package/dist/prepare-docs/copy-raw.js +0 -41
- package/dist/prepare-docs/index.d.ts +0 -1
- package/dist/prepare-docs/index.js +0 -8
- package/dist/prepare-docs/package-changes.d.ts +0 -4
- package/dist/prepare-docs/package-changes.js +0 -92
- package/dist/sse.d.ts +0 -1
- package/dist/sse.js +0 -9
- package/dist/tools/__tests__/blog.test.d.ts +0 -1
- package/dist/tools/__tests__/blog.test.js +0 -48
- package/dist/tools/__tests__/changes.test.d.ts +0 -1
- package/dist/tools/__tests__/changes.test.js +0 -37
- package/dist/tools/__tests__/docs.test.d.ts +0 -1
- package/dist/tools/__tests__/docs.test.js +0 -46
- package/dist/tools/__tests__/examples.test.d.ts +0 -1
- package/dist/tools/__tests__/examples.test.js +0 -53
- package/dist/tools/blog.d.ts +0 -15
- package/dist/tools/blog.js +0 -73
- package/dist/tools/changes.d.ts +0 -11
- package/dist/tools/changes.js +0 -69
- package/dist/tools/docs.d.ts +0 -11
- package/dist/tools/docs.js +0 -176
- package/dist/tools/examples.d.ts +0 -11
- package/dist/tools/examples.js +0 -61
- package/dist/utils.d.ts +0 -6
- package/dist/utils.js +0 -9
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @mastra/voice-speechify
|
|
2
2
|
|
|
3
|
+
## 0.1.8-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [6794797]
|
|
8
|
+
- @mastra/core@0.6.4-alpha.1
|
|
9
|
+
|
|
10
|
+
## 0.1.8-alpha.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [fb68a80]
|
|
15
|
+
- Updated dependencies [b56a681]
|
|
16
|
+
- Updated dependencies [248cb07]
|
|
17
|
+
- @mastra/core@0.6.4-alpha.0
|
|
18
|
+
|
|
19
|
+
## 0.1.7
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 404640e: AgentNetwork changeset
|
|
24
|
+
- Updated dependencies [404640e]
|
|
25
|
+
- Updated dependencies [3bce733]
|
|
26
|
+
- @mastra/core@0.6.3
|
|
27
|
+
|
|
3
28
|
## 0.1.7-alpha.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -274,29 +299,4 @@
|
|
|
274
299
|
|
|
275
300
|
### Patch Changes
|
|
276
301
|
|
|
277
|
-
|
|
278
|
-
- @mastra/core@0.4.4-alpha.0
|
|
279
|
-
|
|
280
|
-
## 0.1.1
|
|
281
|
-
|
|
282
|
-
### Patch Changes
|
|
283
|
-
|
|
284
|
-
- bb4f447: Add support for commonjs
|
|
285
|
-
- Updated dependencies [0d185b1]
|
|
286
|
-
- Updated dependencies [ed55f1d]
|
|
287
|
-
- Updated dependencies [06aa827]
|
|
288
|
-
- Updated dependencies [0fd78ac]
|
|
289
|
-
- Updated dependencies [2512a93]
|
|
290
|
-
- Updated dependencies [e62de74]
|
|
291
|
-
- Updated dependencies [0d25b75]
|
|
292
|
-
- Updated dependencies [fd14a3f]
|
|
293
|
-
- Updated dependencies [8d13b14]
|
|
294
|
-
- Updated dependencies [3f369a2]
|
|
295
|
-
- Updated dependencies [3ee4831]
|
|
296
|
-
- Updated dependencies [4d4e1e1]
|
|
297
|
-
- Updated dependencies [bb4f447]
|
|
298
|
-
- Updated dependencies [108793c]
|
|
299
|
-
- Updated dependencies [5f28f44]
|
|
300
|
-
- Updated dependencies [dabecf4]
|
|
301
|
-
|
|
302
|
-
... 104 more lines hidden. See full changelog in package directory.
|
|
302
|
+
... 129 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# create-mastra
|
|
2
2
|
|
|
3
|
+
## 0.2.2-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 77e4c35: Pop a dialog showing the functional condition when a functional condition is clicked on workflow graph
|
|
8
|
+
|
|
9
|
+
## 0.2.2-alpha.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 933ea4d: Fix messages in thread not showing latest when switching between threads
|
|
14
|
+
- 9cba774: Fix new thread title not reflecting until refresh or new message is sent
|
|
15
|
+
- 248cb07: Allow ai-sdk Message type for messages in agent generate and stream
|
|
16
|
+
Fix sidebar horizontal overflow in playground
|
|
17
|
+
|
|
18
|
+
## 0.2.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 404640e: AgentNetwork changeset
|
|
23
|
+
|
|
3
24
|
## 0.2.1-alpha.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -277,26 +298,5 @@
|
|
|
277
298
|
|
|
278
299
|
## 0.1.0-alpha.40
|
|
279
300
|
|
|
280
|
-
### Patch Changes
|
|
281
|
-
|
|
282
|
-
- de60682: Fix playground thread navigation
|
|
283
|
-
|
|
284
|
-
## 0.1.0-alpha.39
|
|
285
|
-
|
|
286
|
-
### Patch Changes
|
|
287
|
-
|
|
288
|
-
- b97ca96: Tracing into default storage
|
|
289
|
-
- fee6d63: Republish
|
|
290
|
-
|
|
291
|
-
## 0.1.0-alpha.38
|
|
292
|
-
|
|
293
|
-
### Patch Changes
|
|
294
|
-
|
|
295
|
-
- 4f1d1a1: Enforce types ann cleanup package.json
|
|
296
|
-
|
|
297
|
-
## 0.1.0-alpha.37
|
|
298
|
-
|
|
299
|
-
### Patch Changes
|
|
300
|
-
|
|
301
301
|
|
|
302
|
-
...
|
|
302
|
+
... 274 more lines hidden. See full changelog in package directory.
|
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# mastra
|
|
2
2
|
|
|
3
|
+
## 0.4.3-alpha.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6794797: Check for eval values before inserting into storage
|
|
8
|
+
- 77e4c35: Pop a dialog showing the functional condition when a functional condition is clicked on workflow graph
|
|
9
|
+
- Updated dependencies [6794797]
|
|
10
|
+
- Updated dependencies [709aa2c]
|
|
11
|
+
- Updated dependencies [85a2461]
|
|
12
|
+
- @mastra/core@0.6.4-alpha.1
|
|
13
|
+
- @mastra/deployer@0.2.4-alpha.1
|
|
14
|
+
|
|
15
|
+
## 0.4.3-alpha.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2348e30: When running pnpm create mastra and selecting to install MCP docs server for Windsurf, the prompt placement was confusing as there was an additional confirm step during initialization later. Now the prompts all happen at the same time. Also added a check so we don't re-install global Windsurf if it's already installed
|
|
20
|
+
|
|
21
|
+
## 0.4.3-alpha.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 933ea4d: Fix messages in thread not showing latest when switching between threads
|
|
26
|
+
- 9cba774: Fix new thread title not reflecting until refresh or new message is sent
|
|
27
|
+
- 248cb07: Allow ai-sdk Message type for messages in agent generate and stream
|
|
28
|
+
Fix sidebar horizontal overflow in playground
|
|
29
|
+
- Updated dependencies [e764fd1]
|
|
30
|
+
- Updated dependencies [fb68a80]
|
|
31
|
+
- Updated dependencies [e764fd1]
|
|
32
|
+
- Updated dependencies [05ef3e0]
|
|
33
|
+
- Updated dependencies [95c5745]
|
|
34
|
+
- Updated dependencies [b56a681]
|
|
35
|
+
- Updated dependencies [248cb07]
|
|
36
|
+
- @mastra/deployer@0.2.4-alpha.0
|
|
37
|
+
- @mastra/core@0.6.4-alpha.0
|
|
38
|
+
|
|
39
|
+
## 0.4.2
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 404640e: AgentNetwork changeset
|
|
44
|
+
- Updated dependencies [404640e]
|
|
45
|
+
- Updated dependencies [3bce733]
|
|
46
|
+
- @mastra/deployer@0.2.3
|
|
47
|
+
- @mastra/core@0.6.3
|
|
48
|
+
|
|
3
49
|
## 0.4.2-alpha.1
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
|
@@ -252,51 +298,5 @@
|
|
|
252
298
|
|
|
253
299
|
## 0.3.0-alpha.11
|
|
254
300
|
|
|
255
|
-
### Patch Changes
|
|
256
|
-
|
|
257
|
-
- dbd9f2d: Handle different condition types on workflow graph
|
|
258
|
-
- 8deb34c: Better workflow watch api + watch workflow by runId
|
|
259
|
-
- 36d970e: Make tools discovery work in mastra dev
|
|
260
|
-
- fd4a1d7: Update cjs bundling to make sure files are split
|
|
261
|
-
- Updated dependencies [7a7a547]
|
|
262
|
-
- Updated dependencies [c93798b]
|
|
263
|
-
- Updated dependencies [dbd9f2d]
|
|
264
|
-
- Updated dependencies [8deb34c]
|
|
265
|
-
- Updated dependencies [5d41958]
|
|
266
|
-
- Updated dependencies [a171b37]
|
|
267
|
-
- Updated dependencies [fd4a1d7]
|
|
268
|
-
- @mastra/deployer@0.1.8-alpha.11
|
|
269
|
-
- @mastra/core@0.5.0-alpha.11
|
|
270
|
-
|
|
271
|
-
## 0.3.0-alpha.10
|
|
272
|
-
|
|
273
|
-
### Minor Changes
|
|
274
|
-
|
|
275
|
-
- dd7a09a: Added new MCPConfiguration class for managing multiple MCP server tools/toolsets. Fixed a bug where MCPClient env would overwrite PATH env var. Fixed a bug where MCP servers would be killed non-gracefully leading to printing huge errors on every code save when running mastra dev
|
|
276
|
-
|
|
277
|
-
### Patch Changes
|
|
278
|
-
|
|
279
|
-
- Updated dependencies [a910463]
|
|
280
|
-
- @mastra/core@0.5.0-alpha.10
|
|
281
|
-
- @mastra/deployer@0.1.8-alpha.10
|
|
282
|
-
|
|
283
|
-
## 0.2.9-alpha.9
|
|
284
|
-
|
|
285
|
-
### Patch Changes
|
|
286
|
-
|
|
287
|
-
- Updated dependencies [e9fbac5]
|
|
288
|
-
- Updated dependencies [1e8bcbc]
|
|
289
|
-
- Updated dependencies [aeb5e36]
|
|
290
|
-
- Updated dependencies [f2301de]
|
|
291
|
-
- @mastra/deployer@0.1.8-alpha.9
|
|
292
|
-
- @mastra/core@0.5.0-alpha.9
|
|
293
|
-
|
|
294
|
-
## 0.2.9-alpha.8
|
|
295
|
-
|
|
296
|
-
### Patch Changes
|
|
297
|
-
|
|
298
|
-
- Updated dependencies [506f1d5]
|
|
299
|
-
- @mastra/core@0.5.0-alpha.8
|
|
300
|
-
- @mastra/deployer@0.1.8-alpha.8
|
|
301
301
|
|
|
302
|
-
...
|
|
302
|
+
... 2092 more lines hidden. See full changelog in package directory.
|
|
@@ -222,3 +222,9 @@ Tools are more likely to be used effectively when:
|
|
|
222
222
|
- Unclear parameter descriptions or missing examples
|
|
223
223
|
|
|
224
224
|
Following these practices helps ensure your tools are discoverable and usable by agents while maintaining clean separation between purpose (main description) and implementation details (parameter schemas).
|
|
225
|
+
|
|
226
|
+
## Model Context Protocol (MCP) Tools
|
|
227
|
+
|
|
228
|
+
Mastra also supports tools from MCP-compatible servers through the `@mastra/mcp` package. MCP provides a standardized way for AI models to discover and interact with external tools and resources. This makes it easy to integrate third-party tools into your agents without writing custom integrations.
|
|
229
|
+
|
|
230
|
+
For detailed information about using MCP tools, including configuration options and best practices, see our [MCP guide](/docs/agents/02a-mcp-guide).
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Using MCP With Mastra | Agents | Mastra Docs"
|
|
3
|
+
description: "Use MCP in Mastra to integrate third party tools and resources in your AI agents."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using MCP With Mastra
|
|
7
|
+
|
|
8
|
+
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is a standardized way for AI models to discover and interact with external tools and resources.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
MCP in Mastra provides a standardized way to connect to tool servers and supports both stdio and SSE-based connections.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Using pnpm:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @mastra/mcp@latest
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Using npm:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @mastra/mcp@latest
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Using MCP in Your Code
|
|
29
|
+
|
|
30
|
+
The `MCPConfiguration` class provides a way to manage multiple tool servers in your Mastra applications without managing multiple MCP clients. You can configure both stdio-based and SSE-based servers:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { MCPConfiguration } from "@mastra/mcp";
|
|
34
|
+
import { Agent } from "@mastra/core/agent";
|
|
35
|
+
import { openai } from "@ai-sdk/openai";
|
|
36
|
+
|
|
37
|
+
const mcp = new MCPConfiguration({
|
|
38
|
+
servers: {
|
|
39
|
+
// stdio example
|
|
40
|
+
sequential: {
|
|
41
|
+
name: "sequential-thinking",
|
|
42
|
+
server: {
|
|
43
|
+
command: "npx",
|
|
44
|
+
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
// SSE example
|
|
48
|
+
weather: {
|
|
49
|
+
url: new URL("http://localhost:8080/sse"),
|
|
50
|
+
requestInit: {
|
|
51
|
+
headers: {
|
|
52
|
+
Authorization: "Bearer your-token",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Tools vs Toolsets
|
|
61
|
+
|
|
62
|
+
The `MCPConfiguration` class provides two ways to access MCP tools, each suited for different use cases:
|
|
63
|
+
|
|
64
|
+
#### Using Tools (`getTools()`)
|
|
65
|
+
|
|
66
|
+
Use this approach when:
|
|
67
|
+
|
|
68
|
+
- You have a single MCP connection
|
|
69
|
+
- The tools are used by a single user/context
|
|
70
|
+
- Tool configuration (API keys, credentials) remains constant
|
|
71
|
+
- You want to initialize an Agent with a fixed set of tools
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const agent = new Agent({
|
|
75
|
+
name: "CLI Assistant",
|
|
76
|
+
instructions: "You help users with CLI tasks",
|
|
77
|
+
model: openai("gpt-4o-mini"),
|
|
78
|
+
tools: await mcp.getTools(), // Tools are fixed at agent creation
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Using Toolsets (`getToolsets()`)
|
|
83
|
+
|
|
84
|
+
Use this approach when:
|
|
85
|
+
|
|
86
|
+
- You need per-request tool configuration
|
|
87
|
+
- Tools need different credentials per user
|
|
88
|
+
- Running in a multi-user environment (web app, API, etc)
|
|
89
|
+
- Tool configuration needs to change dynamically
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
const mcp = new MCPConfiguration({
|
|
93
|
+
servers: {
|
|
94
|
+
example: {
|
|
95
|
+
command: "npx",
|
|
96
|
+
args: ["-y", "@example/fakemcp"],
|
|
97
|
+
env: {
|
|
98
|
+
API_KEY: "your-api-key",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Get the current toolsets configured for this user
|
|
105
|
+
const toolsets = await mcp.getToolsets();
|
|
106
|
+
|
|
107
|
+
// Use the agent with user-specific tool configurations
|
|
108
|
+
const response = await agent.stream(
|
|
109
|
+
"What's new in Mastra and how's the weather?",
|
|
110
|
+
{
|
|
111
|
+
toolsets,
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## MCP Registries
|
|
117
|
+
|
|
118
|
+
MCP servers can be accessed through registries that provide curated collections of tools. Here's how to use tools from different registries:
|
|
119
|
+
|
|
120
|
+
### Composio.dev Registry
|
|
121
|
+
|
|
122
|
+
[Composio.dev](https://composio.dev) provides a registry of [SSE-based MCP servers](https://mcp.composio.dev) that can be easily integrated with Mastra. The SSE URL that's generated for Cursor is compatible with Mastra - you can use it directly in your configuration:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
const mcp = new MCPConfiguration({
|
|
126
|
+
servers: {
|
|
127
|
+
googleSheets: {
|
|
128
|
+
url: new URL("https://mcp.composio.dev/googlesheets/[private-url-path]"),
|
|
129
|
+
},
|
|
130
|
+
gmail: {
|
|
131
|
+
url: new URL("https://mcp.composio.dev/gmail/[private-url-path]"),
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
When using Composio-provided tools, you can authenticate with services (like Google Sheets or Gmail) directly through conversation with your agent. The tools include authentication capabilities that guide you through the process while chatting.
|
|
138
|
+
|
|
139
|
+
Note: The Composio.dev integration is best suited for single-user scenarios like personal automation, as the SSE URL is tied to your account and can't be used for multiple users. Each URL represents a single account's authentication context.
|
|
140
|
+
|
|
141
|
+
### Smithery.ai Registry
|
|
142
|
+
|
|
143
|
+
[Smithery.ai](https://smithery.ai) provides a registry of MCP servers that you can easily use with Mastra:
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
// Unix/Mac
|
|
147
|
+
const mcp = new MCPConfiguration({
|
|
148
|
+
servers: {
|
|
149
|
+
sequentialThinking: {
|
|
150
|
+
command: "npx",
|
|
151
|
+
args: [
|
|
152
|
+
"-y",
|
|
153
|
+
"@smithery/cli@latest",
|
|
154
|
+
"run",
|
|
155
|
+
"@smithery-ai/server-sequential-thinking",
|
|
156
|
+
"--config",
|
|
157
|
+
"{}",
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Windows
|
|
164
|
+
const mcp = new MCPConfiguration({
|
|
165
|
+
servers: {
|
|
166
|
+
sequentialThinking: {
|
|
167
|
+
command: "cmd",
|
|
168
|
+
args: [
|
|
169
|
+
"/c",
|
|
170
|
+
"npx",
|
|
171
|
+
"-y",
|
|
172
|
+
"@smithery/cli@latest",
|
|
173
|
+
"run",
|
|
174
|
+
"@smithery-ai/server-sequential-thinking",
|
|
175
|
+
"--config",
|
|
176
|
+
"{}",
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This example is adapted from the Claude integration example in the Smithery documentation.
|
|
184
|
+
|
|
185
|
+
## Using the Mastra Documentation Server
|
|
186
|
+
|
|
187
|
+
Looking to use Mastra's MCP documentation server in your IDE? Check out our [MCP Documentation Server guide](/docs/getting-started/mcp-docs-server) to get started.
|
|
188
|
+
|
|
189
|
+
## Next Steps
|
|
190
|
+
|
|
191
|
+
- Learn more about [MCPConfiguration](/docs/reference/tools/mcp-configuration)
|
|
192
|
+
- Check out our [example projects](/examples) that use MCP
|
|
@@ -25,7 +25,7 @@ export const agent = new Agent({
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
// The agent can now use voice for interaction
|
|
28
|
-
await agent.speak("Hello, I'm your AI assistant!");
|
|
28
|
+
await agent.voice.speak("Hello, I'm your AI assistant!");
|
|
29
29
|
|
|
30
30
|
// Read audio file and transcribe
|
|
31
31
|
const audioFilePath = path.join(process.cwd(), "/audio.m4a");
|
|
@@ -135,17 +135,17 @@ export const agent = new Agent({
|
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
// Establish a WebSocket connection
|
|
138
|
-
await voice.connect();
|
|
138
|
+
await agent.voice.connect();
|
|
139
139
|
|
|
140
140
|
// Start a conversation
|
|
141
|
-
|
|
141
|
+
agent.voice.speak("Hello, I'm your AI assistant!");
|
|
142
142
|
|
|
143
143
|
// Stream audio from a microphone
|
|
144
144
|
const microphoneStream = getMicrophoneStream();
|
|
145
|
-
|
|
145
|
+
agent.voice.send(microphoneStream);
|
|
146
146
|
|
|
147
147
|
// When done with the conversation
|
|
148
|
-
voice.close();
|
|
148
|
+
agent.voice.close();
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
### Event System
|
|
@@ -154,17 +154,17 @@ The realtime voice provider emits several events you can listen for:
|
|
|
154
154
|
|
|
155
155
|
```typescript
|
|
156
156
|
// Listen for speech audio data sent from voice provider
|
|
157
|
-
voice.on('speaking', ({ audio }) => {
|
|
157
|
+
agent.voice.on('speaking', ({ audio }) => {
|
|
158
158
|
// audio contains ReadableStream or Int16Array audio data
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
// Listen for transcribed text sent from both voice provider and user
|
|
162
|
-
voice.on('writing', ({ text, role }) => {
|
|
162
|
+
agent.voice.on('writing', ({ text, role }) => {
|
|
163
163
|
console.log(`${role} said: ${text}`);
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
// Listen for errors
|
|
167
|
-
voice.on('error', (error) => {
|
|
167
|
+
agent.voice.on('error', (error) => {
|
|
168
168
|
console.error('Voice error:', error);
|
|
169
169
|
});
|
|
170
170
|
```
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Deployment"
|
|
2
|
+
title: "Serverless Deployment"
|
|
3
3
|
description: "Build and deploy Mastra applications using platform-specific deployers or standard HTTP servers"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Serverless Deployment
|
|
7
7
|
|
|
8
|
-
Mastra
|
|
8
|
+
This guide covers deploying Mastra to Cloudflare Workers, Vercel, and Netlify using platform-specific deployers
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
2. **Universal Deployment**: Using `mastra build` to generate a standard Node.js server that can run anywhere
|
|
10
|
+
For self-hosted Node.js server deployment, see the [Creating A Mastra Server](/docs/deployment/server) guide.
|
|
12
11
|
|
|
13
12
|
## Prerequisites
|
|
14
13
|
|
|
@@ -19,7 +18,7 @@ Before you begin, ensure you have:
|
|
|
19
18
|
- An account with your chosen platform
|
|
20
19
|
- Required API keys or credentials
|
|
21
20
|
|
|
22
|
-
##
|
|
21
|
+
## Serverless Platform Deployers
|
|
23
22
|
|
|
24
23
|
Platform-specific deployers handle configuration and deployment for:
|
|
25
24
|
- **[Cloudflare Workers](/docs/reference/deployer/cloudflare)**
|
|
@@ -99,42 +98,6 @@ new NetlifyDeployer({
|
|
|
99
98
|
|
|
100
99
|
[View Netlify Deployer Reference →](/docs/reference/deployer/netlify)
|
|
101
100
|
|
|
102
|
-
## Universal Deployment
|
|
103
|
-
|
|
104
|
-
Since Mastra builds to a standard Node.js server, you can deploy to any platform that runs Node.js applications:
|
|
105
|
-
- Cloud VMs (AWS EC2, DigitalOcean Droplets, GCP Compute Engine)
|
|
106
|
-
- Container platforms (Docker, Kubernetes)
|
|
107
|
-
- Platform as a Service (Heroku, Railway)
|
|
108
|
-
- Self-hosted servers
|
|
109
|
-
|
|
110
|
-
### Building
|
|
111
|
-
|
|
112
|
-
Build the application:
|
|
113
|
-
|
|
114
|
-
```bash copy
|
|
115
|
-
# Build from current directory
|
|
116
|
-
mastra build
|
|
117
|
-
|
|
118
|
-
# Or specify a directory
|
|
119
|
-
mastra build --dir ./my-project
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The build process:
|
|
123
|
-
1. Locates entry file (`src/mastra/index.ts` or `src/mastra/index.js`)
|
|
124
|
-
2. Creates `.mastra` output directory
|
|
125
|
-
3. Bundles code using Rollup with tree shaking and source maps
|
|
126
|
-
4. Generates [Hono](https://hono.dev) HTTP server
|
|
127
|
-
|
|
128
|
-
See [`mastra build`](/docs/reference/cli/build) for all options.
|
|
129
|
-
|
|
130
|
-
### Running the Server
|
|
131
|
-
|
|
132
|
-
Start the HTTP server:
|
|
133
|
-
|
|
134
|
-
```bash copy
|
|
135
|
-
node .mastra/index.js
|
|
136
|
-
```
|
|
137
|
-
|
|
138
101
|
## Environment Variables
|
|
139
102
|
|
|
140
103
|
Required variables:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Creating A Mastra Server"
|
|
3
3
|
description: "Configure and customize the Mastra server with middleware and other options"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Mastra Server
|
|
6
|
+
# Creating A Mastra Server
|
|
7
7
|
|
|
8
8
|
While developing or when you deploy a Mastra application, it runs as an HTTP server that exposes your agents, workflows, and other functionality as API endpoints. This page explains how to configure and customize the server behavior.
|
|
9
9
|
|
|
@@ -111,4 +111,46 @@ Each middleware function:
|
|
|
111
111
|
console.log(`${c.req.method} ${c.req.url} - ${duration}ms`);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
```
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Deployment
|
|
117
|
+
|
|
118
|
+
Since Mastra builds to a standard Node.js server, you can deploy to any platform that runs Node.js applications:
|
|
119
|
+
- Cloud VMs (AWS EC2, DigitalOcean Droplets, GCP Compute Engine)
|
|
120
|
+
- Container platforms (Docker, Kubernetes)
|
|
121
|
+
- Platform as a Service (Heroku, Railway)
|
|
122
|
+
- Self-hosted servers
|
|
123
|
+
|
|
124
|
+
### Building
|
|
125
|
+
|
|
126
|
+
Build the application:
|
|
127
|
+
|
|
128
|
+
```bash copy
|
|
129
|
+
# Build from current directory
|
|
130
|
+
mastra build
|
|
131
|
+
|
|
132
|
+
# Or specify a directory
|
|
133
|
+
mastra build --dir ./my-project
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
The build process:
|
|
137
|
+
1. Locates entry file (`src/mastra/index.ts` or `src/mastra/index.js`)
|
|
138
|
+
2. Creates `.mastra` output directory
|
|
139
|
+
3. Bundles code using Rollup with tree shaking and source maps
|
|
140
|
+
4. Generates [Hono](https://hono.dev) HTTP server
|
|
141
|
+
|
|
142
|
+
See [`mastra build`](/docs/reference/cli/build) for all options.
|
|
143
|
+
|
|
144
|
+
### Running the Server
|
|
145
|
+
|
|
146
|
+
Start the HTTP server:
|
|
147
|
+
|
|
148
|
+
```bash copy
|
|
149
|
+
node .mastra/output/index.mjs
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Serverless Deployment
|
|
153
|
+
|
|
154
|
+
Mastra also supports serverless deployment on Cloudflare Workers, Vercel, and Netlify.
|
|
155
|
+
|
|
156
|
+
See our [Serverless Deployment](/docs/deployment/deployment) guide for setup instructions.
|
|
@@ -81,8 +81,8 @@ Once you're hitting your targets:
|
|
|
81
81
|
3. Test edge cases - Add examples that cover unusual scenarios
|
|
82
82
|
4. Fine-tune - Look for ways to improve efficiency
|
|
83
83
|
|
|
84
|
-
See [Textual Evals](/docs/evals/textual-evals) for more info on what evals can do.
|
|
84
|
+
See [Textual Evals](/docs/evals/01-textual-evals) for more info on what evals can do.
|
|
85
85
|
|
|
86
86
|
For more info on how to create your own evals, see the [Custom Evals](/docs/evals/02-custom-eval) guide.
|
|
87
87
|
|
|
88
|
-
For running evals in your CI pipeline, see the [Running in CI](/docs/evals/running-in-ci) guide.
|
|
88
|
+
For running evals in your CI pipeline, see the [Running in CI](/docs/evals/03-running-in-ci) guide.
|
|
@@ -13,7 +13,8 @@ We support any testing framework that supports ESM modules. For example, you can
|
|
|
13
13
|
|
|
14
14
|
```typescript copy showLineNumbers filename="src/mastra/agents/index.test.ts"
|
|
15
15
|
import { describe, it, expect } from 'vitest';
|
|
16
|
-
import { evaluate } from
|
|
16
|
+
import { evaluate } from "@mastra/evals";
|
|
17
|
+
import { ToneConsistencyMetric } from "@mastra/evals/nlp";
|
|
17
18
|
import { myAgent } from './index';
|
|
18
19
|
|
|
19
20
|
describe('My Agent', () => {
|
|
@@ -32,7 +33,7 @@ You will need to configure a testSetup and globalSetup script for your testing f
|
|
|
32
33
|
|
|
33
34
|
### Vitest Setup
|
|
34
35
|
|
|
35
|
-
Add these files to your project to run evals in your CI/CD pipeline
|
|
36
|
+
Add these files to your project to run evals in your CI/CD pipeline:
|
|
36
37
|
|
|
37
38
|
```typescript copy showLineNumbers filename="globalSetup.ts"
|
|
38
39
|
import { globalSetup } from '@mastra/evals';
|
|
@@ -64,9 +65,11 @@ export default defineConfig({
|
|
|
64
65
|
|
|
65
66
|
## Storage Configuration
|
|
66
67
|
|
|
67
|
-
To store eval results in Mastra Storage:
|
|
68
|
+
To store eval results in Mastra Storage and capture results in the Mastra dashboard:
|
|
68
69
|
|
|
69
|
-
```typescript
|
|
70
|
+
```typescript copy showLineNumbers filename="testSetup.ts"
|
|
71
|
+
import { beforeAll } from 'vitest';
|
|
72
|
+
import { attachListeners } from '@mastra/evals';
|
|
70
73
|
import { mastra } from './your-mastra-setup';
|
|
71
74
|
|
|
72
75
|
beforeAll(async () => {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Using with Cursor/Windsurf | Getting Started | Mastra Docs"
|
|
3
3
|
description: "Learn how to use the Mastra MCP documentation server in your IDE to turn it into an agentic Mastra expert."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
import YouTube from "../../../components/youtube";
|
|
7
|
+
|
|
6
8
|
# Mastra Tools for your agentic IDE
|
|
7
9
|
|
|
8
10
|
`@mastra/mcp-docs-server` provides direct access to Mastra's complete knowledge base in Cursor, Windsurf, Cline, or any other IDE that supports MCP.
|
|
9
11
|
|
|
10
12
|
It has access to documentation, code examples, technical blog posts / feature announcements, and package changelogs which your IDE can read to help you build with Mastra.
|
|
11
13
|
|
|
14
|
+
<YouTube id="vciV57lF0og" />
|
|
15
|
+
|
|
12
16
|
The MCP server tools have been designed to allow an agent to query the specific information it needs to complete a Mastra related task - for example: adding a Mastra feature to an agent, scaffolding a new project, or helping you understand how something works.
|
|
13
17
|
|
|
14
18
|
## How it works
|
|
@@ -135,4 +139,3 @@ Track updates for Mastra and `@mastra/*` packages:
|
|
|
135
139
|
2. **Tool Calls Failing**
|
|
136
140
|
- Restart the MCP server and/or your IDE
|
|
137
141
|
- Update to the latest version of your IDE
|
|
138
|
-
|