@mastra/mcp-docs-server 0.0.13 → 0.0.14-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 +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +33 -0
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +33 -0
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +32 -32
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +34 -0
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +38 -38
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +38 -38
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +43 -43
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Ffastembed.md +7 -0
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +33 -0
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +49 -49
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +33 -0
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +35 -1
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +45 -45
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Frag.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fspeech-azure.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-deepgram.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-elevenlabs.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-google.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-ibm.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-murf.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-openai.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-playai.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-replicate.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fspeech-speechify.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +35 -35
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +34 -34
- package/.docs/organized/changelogs/create-mastra.md +12 -12
- package/.docs/organized/changelogs/mastra.md +46 -46
- package/.docs/organized/code-examples/a2a.md +202 -0
- package/.docs/organized/code-examples/agent-network.md +1 -1
- package/.docs/organized/code-examples/agent.md +113 -26
- package/.docs/organized/code-examples/ai-sdk-useChat.md +2 -2
- package/.docs/organized/code-examples/client-side-tools.md +1 -1
- package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
- package/.docs/organized/code-examples/fireworks-r1.md +2 -2
- package/.docs/organized/code-examples/mcp-configuration.md +579 -0
- package/.docs/organized/code-examples/mcp-registry-registry.md +1 -1
- package/.docs/organized/code-examples/memory-with-context.md +1 -1
- package/.docs/organized/code-examples/memory-with-processors.md +609 -0
- package/.docs/organized/code-examples/openapi-spec-writer.md +588 -0
- package/.docs/organized/code-examples/quick-start.md +1 -1
- package/.docs/raw/agents/dynamic-agents.mdx +47 -0
- package/.docs/raw/agents/using-tools-and-mcp.mdx +19 -0
- package/.docs/raw/memory/working-memory.mdx +78 -1
- package/.docs/raw/reference/cli/mcp-docs-server.mdx +82 -0
- package/.docs/raw/reference/deployer/cloudflare.mdx +7 -0
- package/.docs/raw/reference/deployer/netlify.mdx +5 -0
- package/.docs/raw/reference/deployer/vercel.mdx +6 -0
- package/dist/{chunk-OKBMABZO.js → chunk-JWLYN5OI.js} +3 -2
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +3 -3
|
@@ -79,7 +79,84 @@ const memory = new Memory({
|
|
|
79
79
|
});
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
## Designing Effective Templates
|
|
83
|
+
|
|
84
|
+
A well-structured template keeps the information easy for the agent to parse and update. Treat the
|
|
85
|
+
template as a short form that you want the assistant to keep up to date.
|
|
86
|
+
|
|
87
|
+
- **Short, focused labels.** Avoid paragraphs or very long headings. Keep labels brief (for example
|
|
88
|
+
`## Personal Info` or `- Name:`) so updates are easy to read and less likely to be truncated.
|
|
89
|
+
- **Use consistent casing.** Inconsistent capitalization (`Timezone:` vs `timezone:`) can cause messy
|
|
90
|
+
updates. Stick to Title Case or lower case for headings and bullet labels.
|
|
91
|
+
- **Keep placeholder text simple.** Use hints such as `[e.g., Formal]` or `[Date]` to help the LLM
|
|
92
|
+
fill in the correct spots.
|
|
93
|
+
- **Abbreviate very long values.** If you only need a short form, include guidance like
|
|
94
|
+
`- Name: [First name or nickname]` or `- Address (short):` rather than the full legal text.
|
|
95
|
+
- **Mention update rules in `instructions`.** You can instruct how and when to fill or clear parts of
|
|
96
|
+
the template directly in the agent's `instructions` field.
|
|
97
|
+
|
|
98
|
+
### Alternative Template Styles
|
|
99
|
+
|
|
100
|
+
Use a shorter single block if you only need a few items:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
const basicMemory = new Memory({
|
|
104
|
+
options: {
|
|
105
|
+
workingMemory: {
|
|
106
|
+
enabled: true,
|
|
107
|
+
template: `User Facts:\n- Name:\n- Favorite Color:\n- Current Topic:`,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
You can also store the key facts in a short paragraph format if you prefer a more narrative style:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
const paragraphMemory = new Memory({
|
|
117
|
+
options: {
|
|
118
|
+
workingMemory: {
|
|
119
|
+
enabled: true,
|
|
120
|
+
template: `Important Details:\n\nKeep a short paragraph capturing the user's important facts (name, main goal, current task).`,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Example: Multi-step Retention
|
|
127
|
+
|
|
128
|
+
Below is a simplified view of how the `User Profile` template updates across a short user
|
|
129
|
+
conversation:
|
|
130
|
+
|
|
131
|
+
```nohighlight
|
|
132
|
+
# User Profile
|
|
133
|
+
|
|
134
|
+
## Personal Info
|
|
135
|
+
|
|
136
|
+
- Name:
|
|
137
|
+
- Location:
|
|
138
|
+
- Timezone:
|
|
139
|
+
|
|
140
|
+
--- After user says "My name is **Sam** and I'm from **Berlin**" ---
|
|
141
|
+
|
|
142
|
+
# User Profile
|
|
143
|
+
- Name: Sam
|
|
144
|
+
- Location: Berlin
|
|
145
|
+
- Timezone:
|
|
146
|
+
|
|
147
|
+
--- After user adds "By the way I'm normally in **CET**" ---
|
|
148
|
+
|
|
149
|
+
# User Profile
|
|
150
|
+
- Name: Sam
|
|
151
|
+
- Location: Berlin
|
|
152
|
+
- Timezone: CET
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The agent can now refer to `Sam` or `Berlin` in later responses without requesting the information
|
|
156
|
+
again because it has been stored in working memory.
|
|
157
|
+
|
|
158
|
+
If your agent is not properly updating working memory when you expect it to, you can add system
|
|
159
|
+
instructions on _how_ and _when_ to use this template in your agent's `instructions` setting.
|
|
83
160
|
|
|
84
161
|
## Examples
|
|
85
162
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@mastra/mcp-docs-server"
|
|
3
|
+
description: "Serve Mastra docs, examples and blog posts over MCP"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The `@mastra/mcp-docs-server` package runs a small [Model Context
|
|
7
|
+
Protocol](https://github.com/modelcontextprotocol/mcp) server that makes
|
|
8
|
+
Mastra documentation, code examples, blog posts and changelogs
|
|
9
|
+
queryable by an LLM agent. It can be invoked manually from the command
|
|
10
|
+
line or configured inside an MCP-aware IDE such as Cursor or Windsurf.
|
|
11
|
+
|
|
12
|
+
## Running from the CLI
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx -y @mastra/mcp-docs-server@latest
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The command above runs a stdio based MCP server. The process will keep
|
|
19
|
+
reading requests from `stdin` and returning responses on `stdout`. This
|
|
20
|
+
is the same command that IDE integrations use. When run manually it can
|
|
21
|
+
be pointed at the `@wong2/mcp-cli` package for exploration.
|
|
22
|
+
|
|
23
|
+
### Examples
|
|
24
|
+
|
|
25
|
+
Rebuild the docs before serving (useful if you've modified docs locally):
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
REBUILD_DOCS_ON_START=true npx -y @mastra/mcp-docs-server@latest
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Enable verbose logging while experimenting:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
DEBUG=1 npx -y @mastra/mcp-docs-server@latest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Serve blog posts from a custom domain:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
BLOG_URL=https://my-blog.example npx -y @mastra/mcp-docs-server@latest
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Environment variables
|
|
44
|
+
|
|
45
|
+
`@mastra/mcp-docs-server` honours a few environment variables that tweak
|
|
46
|
+
its behaviour:
|
|
47
|
+
|
|
48
|
+
- **`REBUILD_DOCS_ON_START`** - when set to `true` the server rebuilds
|
|
49
|
+
the `.docs` directory before binding to stdio. This can be helpful
|
|
50
|
+
after editing or adding documentation locally.
|
|
51
|
+
- **`PREPARE`** - the docs build step (`pnpm mcp-docs-server
|
|
52
|
+
prepare-docs`) looks for `PREPARE=true` to copy Markdown sources from
|
|
53
|
+
the repository into `.docs`.
|
|
54
|
+
- **`BLOG_URL`** - base URL used for fetching blog posts.
|
|
55
|
+
Defaults to `https://mastra.ai`.
|
|
56
|
+
- **`DEBUG`** or **`NODE_ENV=development`** - increase logging written
|
|
57
|
+
to `stderr`.
|
|
58
|
+
|
|
59
|
+
No other variables are required for a basic run; the server ships with a
|
|
60
|
+
pre-built docs directory.
|
|
61
|
+
|
|
62
|
+
## Rebuilding with custom docs
|
|
63
|
+
|
|
64
|
+
The package includes a precompiled copy of the documentation. If you
|
|
65
|
+
want to experiment with additional content you can rebuild the
|
|
66
|
+
`.docs` directory locally:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pnpm mcp-docs-server prepare-docs
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The script will copy documentation from
|
|
73
|
+
`mastra/docs/src/content/en/docs` and
|
|
74
|
+
`mastra/docs/src/content/en/reference` into the package. Once rebuilt,
|
|
75
|
+
start the server with `REBUILD_DOCS_ON_START=true` so the fresh content
|
|
76
|
+
is served.
|
|
77
|
+
|
|
78
|
+
A rebuild is only necessary if you need to serve customised docs. For
|
|
79
|
+
regular use you can rely on the published package contents.
|
|
80
|
+
|
|
81
|
+
For IDE configuration details see the
|
|
82
|
+
[Getting started guide](/docs/getting-started/mcp-docs-server).
|
|
@@ -133,6 +133,13 @@ The CloudflareDeployer handles environment variables from multiple sources:
|
|
|
133
133
|
2. **Configuration**: Variables passed through the `env` parameter.
|
|
134
134
|
|
|
135
135
|
|
|
136
|
+
## Lint Mastra Project
|
|
137
|
+
Lint your Mastra project to make sure it's fine to build
|
|
138
|
+
```bash
|
|
139
|
+
npx mastra lint
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
|
|
136
143
|
## Build Mastra Project
|
|
137
144
|
|
|
138
145
|
To build your Mastra project for cloudflare deployment:
|
|
@@ -59,6 +59,11 @@ The NetlifyDeployer handles environment variables from multiple sources:
|
|
|
59
59
|
2. **Configuration**: Variables passed through the Mastra configuration.
|
|
60
60
|
3. **Netlify Dashboard**: Variables can also be managed through Netlify's web interface.
|
|
61
61
|
|
|
62
|
+
## Lint Mastra Project
|
|
63
|
+
Lint your Mastra project to make sure it's fine to build
|
|
64
|
+
```bash
|
|
65
|
+
npx mastra lint
|
|
66
|
+
```
|
|
62
67
|
|
|
63
68
|
## Build Mastra Project
|
|
64
69
|
|
|
@@ -61,6 +61,12 @@ The VercelDeployer handles environment variables from multiple sources:
|
|
|
61
61
|
|
|
62
62
|
The deployer automatically synchronizes environment variables between your local development environment and Vercel's environment variable system, ensuring consistency across all deployment environments (production, preview, and development).
|
|
63
63
|
|
|
64
|
+
## Lint Mastra Project
|
|
65
|
+
Lint your Mastra project to make sure it's fine to build
|
|
66
|
+
```bash
|
|
67
|
+
npx mastra lint
|
|
68
|
+
```
|
|
69
|
+
|
|
64
70
|
## Build Mastra Project
|
|
65
71
|
|
|
66
72
|
To build your Mastra project for Vercel deployment:
|
|
@@ -46,8 +46,9 @@ ${file.content}
|
|
|
46
46
|
\`\`\`
|
|
47
47
|
`).join("\n");
|
|
48
48
|
const totalLines = output.split("\n").length;
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const limit = 1e3;
|
|
50
|
+
if (totalLines > limit) {
|
|
51
|
+
log(`Skipping ${dir.name}: ${totalLines} lines exceeds limit of ${limit}`);
|
|
51
52
|
continue;
|
|
52
53
|
}
|
|
53
54
|
await fs.writeFile(outputFile, output, "utf-8");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { prepare } from '../chunk-
|
|
1
|
+
export { prepare } from '../chunk-JWLYN5OI.js';
|
package/dist/stdio.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-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",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
33
|
"zod": "^3.24.3",
|
|
34
34
|
"zod-to-json-schema": "^3.24.5",
|
|
35
|
-
"@mastra/core": "^0.9.
|
|
36
|
-
"@mastra/mcp": "^0.
|
|
35
|
+
"@mastra/core": "^0.9.4-alpha.1",
|
|
36
|
+
"@mastra/mcp": "^0.5.0-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@hono/node-server": "^1.13.8",
|