@mastra/mcp-docs-server 1.3.14-alpha.2 → 1.3.14-alpha.3
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/docs/memory/observational-memory.md +8 -0
- package/.docs/docs/server/mastra-client.md +2 -0
- package/.docs/integrations/file-storage/amazon-s3.md +2 -0
- package/.docs/integrations/file-storage/google-cloud-storage.md +2 -0
- package/.docs/integrations/sandboxes/e2b.md +23 -0
- package/.docs/integrations/vectors/couchbase.md +3 -2
- package/.docs/models/gateways/mastra.md +4 -0
- package/.docs/reference/client-js/mastra-client.md +1 -1
- package/.docs/reference/rag/chunk.md +1 -1
- package/.docs/reference/tools/mcp-server.md +2 -0
- package/package.json +3 -3
|
@@ -146,6 +146,14 @@ Token counts are local `tokenx` estimates. The provider's own count is often hig
|
|
|
146
146
|
|
|
147
147
|
A provider can reject a request for exceeding its context window before OM's estimate reaches the threshold. When that happens, OM activates any prepared observations, observes everything still pending, and retries the request once with the smaller context. This is on by default; set `observation.observeOnContextOverflow: false` to let the error reach your code instead.
|
|
148
148
|
|
|
149
|
+
### Gateway models
|
|
150
|
+
|
|
151
|
+
A [Mastra Gateway](https://mastra.ai/models/gateways/mastra) model can keep a thread's observations on the gateway instead of your storage adapter. The gateway only does that for a Gateway project key (`msk_...`) that it serves with its own provider keys and with memory enabled for the project. An organization key (`msk-gateway-...` or `mskv2_...`) is served by a gateway without the memory API, so OM keeps running locally against the `Memory` you configured.
|
|
152
|
+
|
|
153
|
+
Keep `Memory` configured with `observationalMemory: true` in both cases. With a project key the gateway owns the thread, which means your storage adapter stays empty and `memory.recall()` doesn't return those messages.
|
|
154
|
+
|
|
155
|
+
> **Warning:** A project key alone doesn't mean the gateway stores the thread. When the request is routed with your own provider key, or memory is disabled for the project, the gateway proxies it without storing observations, while Mastra still skips local OM for a `mastra/` model on a project key. Neither the gateway nor your storage adapter keeps the conversation in that case. Use gateway-managed provider keys with project memory enabled, or a directly configured provider model, when the thread has to be stored.
|
|
156
|
+
|
|
149
157
|
## Choosing models
|
|
150
158
|
|
|
151
159
|
The Observer and Reflector are model calls that run beside your agent. By default both use `model: 'auto'`, which resolves each time a role runs:
|
|
@@ -183,6 +183,8 @@ const testAgent = async () => {
|
|
|
183
183
|
|
|
184
184
|
`MastraClient` accepts optional parameters like `retries`, `backoffMs`, and `headers` to control request behavior. These parameters are useful for controlling retry behavior and including diagnostic metadata.
|
|
185
185
|
|
|
186
|
+
By default, retries apply to read requests only. `GET`, `HEAD`, and `OPTIONS` are retried on failure, while `POST`, `PUT`, `PATCH`, and `DELETE` are sent once unless you set `retries` explicitly, so a failed write can't repeat a state-changing request such as an agent generation or workflow start. The observability queries that travel as `POST` only read server state, so `aggregateTraces()`, `aggregateSpans()`, `queryTraceThreads()`, and `querySpans()` keep the read default.
|
|
187
|
+
|
|
186
188
|
```typescript
|
|
187
189
|
import { MastraClient } from '@mastra/client-js'
|
|
188
190
|
|
|
@@ -210,6 +210,8 @@ Tigris uses virtual-hosted-style addressing, so `forcePathStyle` must be set to
|
|
|
210
210
|
|
|
211
211
|
**readOnly** (`boolean`): When true, all write operations are blocked (Default: `false`)
|
|
212
212
|
|
|
213
|
+
**owner** (`{ uid: number; gid: number }`): Owner of the files inside a FUSE mount when this filesystem is mounted in a sandbox, as numeric uid and gid. Set it when sandbox commands run as a user other than the one that mounts, so that user can read and write the mounted files. When unset, the sandbox probes the default user's uid and gid.
|
|
214
|
+
|
|
213
215
|
## Properties
|
|
214
216
|
|
|
215
217
|
**id** (`string`): Filesystem instance identifier
|
|
@@ -110,6 +110,8 @@ const filesystem = new GCSFilesystem({
|
|
|
110
110
|
|
|
111
111
|
**readOnly** (`boolean`): When true, all write operations are blocked (Default: `false`)
|
|
112
112
|
|
|
113
|
+
**owner** (`{ uid: number; gid: number }`): Owner of the files inside a FUSE mount when this filesystem is mounted in a sandbox, as numeric uid and gid. Set it when sandbox commands run as a user other than the one that mounts, so that user can read and write the mounted files. When unset, the sandbox probes the default user's uid and gid.
|
|
114
|
+
|
|
113
115
|
**endpoint** (`string`): Custom API endpoint URL. Used for local development with emulators.
|
|
114
116
|
|
|
115
117
|
## Properties
|
|
@@ -68,6 +68,8 @@ const agent = new Agent({
|
|
|
68
68
|
|
|
69
69
|
**env** (`Record<string, string>`): Environment variables to set in the sandbox
|
|
70
70
|
|
|
71
|
+
**user** (`string`): OS user to run sandbox commands as, by name. Defaults to the template's own user. Use it to run agent commands as a second, unprivileged user: mounting still runs as the default user, which needs sudo. Set owner on a mount to give the command user read and write access to it. The user must already exist in the template.
|
|
72
|
+
|
|
71
73
|
**workingDirectory** (`string`): Default directory for command execution when no per-command cwd is given. A per-command cwd always wins; when neither is set, commands run from the sandbox home directory. Use an absolute path.
|
|
72
74
|
|
|
73
75
|
**id** (`string`): Unique identifier for this sandbox instance (Default: `Auto-generated`)
|
|
@@ -197,6 +199,27 @@ E2B sandboxes use FUSE (Filesystem in Userspace) to mount cloud storage:
|
|
|
197
199
|
|
|
198
200
|
The E2B sandbox automatically installs the required FUSE tools when mounting is used. For best performance, pre-build a custom template with the tools installed.
|
|
199
201
|
|
|
202
|
+
### Running commands as another user
|
|
203
|
+
|
|
204
|
+
Mounting needs `sudo`, so the template's default user is privileged: any command it runs can read the credentials staged for a mount and become root. To give agent commands less privilege, run them as a second user and set the owner of each mount to that user's uid and gid:
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
const workspace = new Workspace({
|
|
208
|
+
mounts: {
|
|
209
|
+
'/s3-data': new S3Filesystem({
|
|
210
|
+
bucket: 'my-s3-bucket',
|
|
211
|
+
region: 'us-east-1',
|
|
212
|
+
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
|
|
213
|
+
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
|
|
214
|
+
owner: { uid: 1001, gid: 1001 },
|
|
215
|
+
}),
|
|
216
|
+
},
|
|
217
|
+
sandbox: new E2BSandbox({ id: 'dev-sandbox', user: 'agent' }),
|
|
218
|
+
})
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
`owner` sets the uid and gid of the files inside the mount, so the `user` running commands can read and write them. Without it, the mount is owned by the user that mounted it. Create the user in the template first; E2B runs a command as that user but doesn't create it.
|
|
222
|
+
|
|
200
223
|
## Custom templates
|
|
201
224
|
|
|
202
225
|
By default, when no template is specified, E2BSandbox automatically builds a template with `s3fs` installed for S3 mounting support, a current Node.js LTS installed over the base image's older runtime, and corepack enabled so `pnpm` and `yarn` resolve to whatever a repository's `packageManager` field pins. This template is cached and reused across sandbox instances.
|
|
@@ -101,7 +101,7 @@ Adds or updates vectors and their metadata in the collection.
|
|
|
101
101
|
|
|
102
102
|
Searches for similar vectors.
|
|
103
103
|
|
|
104
|
-
> **Warning:** The `filter` and `includeVector` parameters aren't currently supported.
|
|
104
|
+
> **Warning:** The `filter` and `includeVector` parameters aren't currently supported. A `filter` is ignored, and the store logs a warning the first time one is passed. Passing `includeVector: true` throws a `MastraError`. Filter results client-side after retrieving them, or use the Couchbase SDK's Search capabilities. Retrieve the vector embedding by fetching the full document by ID with the Couchbase SDK.
|
|
105
105
|
|
|
106
106
|
**indexName** (`string`): Name of the index to search in
|
|
107
107
|
|
|
@@ -109,7 +109,7 @@ Searches for similar vectors.
|
|
|
109
109
|
|
|
110
110
|
**topK** (`number`): Number of results to return (Default: `10`)
|
|
111
111
|
|
|
112
|
-
**filter** (`Record<string, any>`): Not supported. Filters passed here are ignored.
|
|
112
|
+
**filter** (`Record<string, any>`): Not supported. Filters passed here are ignored, and a warning is logged the first time one is passed.
|
|
113
113
|
|
|
114
114
|
**includeVector** (`boolean`): Not supported. Setting this to true throws an error. (Default: `false`)
|
|
115
115
|
|
|
@@ -225,6 +225,7 @@ try {
|
|
|
225
225
|
- Index creation delays may impact immediate querying after creation.
|
|
226
226
|
- Vector dimension is enforced at ingest only after `createIndex()` creates a new index on the same `CouchbaseVector` instance. Calling `createIndex()` for an index that already exists doesn't turn on the ingest check. When the check is on, `upsert()` and `updateVector()` throw on a dimension mismatch. `query()` always checks the query vector against the index dimension.
|
|
227
227
|
- `deleteVectors()` supports deletion by ID only. Metadata-filter deletion isn't supported.
|
|
228
|
+
- `query()` can't filter by metadata. When Couchbase is Mastra memory's vector store, semantic recall still stays within the current thread or resource, because Memory checks each result itself. Results from other threads or resources still count toward `topK`, so recall may return fewer messages than `topK`.
|
|
228
229
|
- Vector insertion and index updates are eventually consistent. Strong consistency isn't guaranteed immediately after writes.
|
|
229
230
|
|
|
230
231
|
## Related
|
|
@@ -60,6 +60,10 @@ for await (const chunk of result.textStream) {
|
|
|
60
60
|
}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
A gateway with a Gateway project key (`msk_...`) stores each thread's observations when it serves the request with its own provider keys and memory is enabled for the project. A gateway with an organization key (`msk-gateway-...` or `mskv2_...`) is served without the memory API, so it doesn't. Configure [`Memory`](https://mastra.ai/docs/memory/observational-memory) with `observationalMemory: true` in that case: Observational Memory then runs against your storage adapter instead of the gateway.
|
|
64
|
+
|
|
65
|
+
When a request is routed with your own provider key, or memory is disabled for the project, the gateway proxies it without storing observations while Mastra skips local Observational Memory for a `mastra/` model on a project key. Use gateway-managed provider keys with project memory enabled when the thread has to be stored.
|
|
66
|
+
|
|
63
67
|
## Configuration
|
|
64
68
|
|
|
65
69
|
```bash
|
|
@@ -43,7 +43,7 @@ You can also pass `requestContext` as a `Record<string, any>`.
|
|
|
43
43
|
|
|
44
44
|
**baseUrl** (`string`): The base URL for the Mastra API. All requests will be sent relative to this URL.
|
|
45
45
|
|
|
46
|
-
**retries** (`number`): The number of times a request will be retried on failure before throwing an error. (Default: `3`)
|
|
46
|
+
**retries** (`number`): The number of times a request will be retried on failure before throwing an error. Retries apply to read requests (GET, HEAD, OPTIONS) by default, and to the observability queries that read server state even though they are sent as POST (aggregateTraces, aggregateSpans, queryTraceThreads, querySpans). Write requests (POST, PUT, PATCH, DELETE) are sent once unless you set this explicitly, so a server error can't repeat a state-changing request. (Default: `3 for read requests, 0 for write requests`)
|
|
47
47
|
|
|
48
48
|
**backoffMs** (`number`): The initial delay in milliseconds before retrying a failed request. This value is doubled with each retry (exponential backoff). (Default: `300`)
|
|
49
49
|
|
|
@@ -200,7 +200,7 @@ When using the `headers` option, the markdown strategy ignores all general optio
|
|
|
200
200
|
|
|
201
201
|
### JSON
|
|
202
202
|
|
|
203
|
-
**maxSize** (`number`): Target maximum size of each JSON chunk. Must be at least 21. Long values
|
|
203
|
+
**maxSize** (`number`): Target maximum size of each JSON chunk. Must be at least 21. Long string values are split so chunks stay within this limit, and no content is discarded. A chunk can exceed the limit when a field path leaves no room for a single character, when ensureAscii escaping expands a value (the default), or when a long value is nested in an object.
|
|
204
204
|
|
|
205
205
|
**minSize** (`number`): Accepted for compatibility. Has no effect on JSON chunking: chunks smaller than this are kept, so no data is discarded.
|
|
206
206
|
|
|
@@ -97,6 +97,8 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
|
|
|
97
97
|
|
|
98
98
|
**legacy** (`'reject' | 'stateless'`): How HTTP requests from 2025-era clients (those that open with initialize, such as VS Code and Cursor) are served. 'reject' (default) answers them with an unsupported-protocol-version error. 'stateless' answers each request without a session: listing and calling tools, reading resources and getting prompts work, GET and DELETE session requests get 405, and features that need 2026-07-28 (suspend/resume, subscriptions/listen, events) aren't available to these clients.
|
|
99
99
|
|
|
100
|
+
**maxRequestBodySize** (`number`): Upper bound, in bytes, on the HTTP request body the server reads from the request stream. A larger body is answered with a 413 JSON-RPC error before it is parsed, so no tool runs. It bounds only the body the server reads itself: when body-parsing middleware supplies the parsed body, this bound does not apply, so set the size limit on that parser as well. Defaults to 4194304 (4 MiB). Raise it on servers that receive large tools/call payloads, such as base64-encoded documents. Must be a positive number. Not applied to stdio, which has no request bodies.
|
|
101
|
+
|
|
100
102
|
**toolResult** (`MCPServerToolResultOptions`): Controls how completed tool calls become MCP results. modelOutput: true builds the result content from each tool's toModelOutput, so tools can return images, audio, and files. transform rewrites a result before it's sent. See Tool results for details.
|
|
101
103
|
|
|
102
104
|
**jsonSchemaValidator** (`jsonSchemaValidator`): Custom JSON Schema validator used for tool input, output and continuation answers, for runtimes where the SDK default is unavailable.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.14-alpha.
|
|
3
|
+
"version": "1.3.14-alpha.3",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.2.1",
|
|
28
28
|
"zod": "^4.6.7",
|
|
29
|
-
"@mastra/core": "1.84.0-alpha.
|
|
30
|
-
"@mastra/mcp": "^2.
|
|
29
|
+
"@mastra/core": "1.84.0-alpha.3",
|
|
30
|
+
"@mastra/mcp": "^2.10.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.1.3",
|