@mastra/mcp 1.10.0-alpha.1 → 1.10.1-alpha.0
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/CHANGELOG.md +47 -0
- package/dist/_types/hono/dist/types/request.d.ts +13 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/server/server.d.ts.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @mastra/mcp
|
|
2
2
|
|
|
3
|
+
## 1.10.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Security remediation for the 2026-06-17 "easy-day-js" supply-chain incident. Patch bump to publish clean versions and move the `latest` dist-tag forward, superseding the compromised versions that declared the malicious `easy-day-js` dependency. ([#18056](https://github.com/mastra-ai/mastra/pull/18056))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`77a2351`](https://github.com/mastra-ai/mastra/commit/77a2351ee79296e360bce822cb3391f7cfd6489d)]:
|
|
10
|
+
- @mastra/core@1.43.1-alpha.0
|
|
11
|
+
|
|
12
|
+
## 1.10.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- Added MCP server Fine-Grained Authorization mapping overrides for tool authorization. ([#17529](https://github.com/mastra-ai/mastra/pull/17529))
|
|
17
|
+
|
|
18
|
+
Use the new `fga` option on `MCPServer` to customize the resource and permission mappings used for `tools/list` and `tools/call` checks without changing the Mastra instance-level `tool` mapping used by internal agent and workflow tool execution.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const server = new MCPServer({
|
|
22
|
+
name: 'My Server',
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
tools: { getData },
|
|
25
|
+
fga: {
|
|
26
|
+
resourceMapping: {
|
|
27
|
+
tool: {
|
|
28
|
+
fgaResourceType: 'user',
|
|
29
|
+
deriveId: ({ user }) => user.id,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
permissionMapping: {
|
|
33
|
+
'tools:execute': 'read',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Fixed `MCPServer` leaking one caller's resources to other callers. The result of the first `resources/list` request was cached on the shared, long-lived server instance and replayed to everyone, so a dynamic resource provider that scopes resources per user or tenant (resolved from `extra.authInfo`) served the first caller's resource index — names and URIs — to subsequent callers. The same stale cache also backed `resources/read` URI resolution and the public `listResources()` method. The `resources/templates/list` handler had the same defect for dynamic resource template providers. ([#17610](https://github.com/mastra-ai/mastra/pull/17610))
|
|
42
|
+
|
|
43
|
+
Resource and resource template providers are now invoked on every request with the current caller's context, so each caller only sees their own resources. See https://github.com/mastra-ai/mastra/issues/17609
|
|
44
|
+
|
|
45
|
+
- Fixed flaky MCP server tests by replacing real weather API calls with deterministic mock tool ([#17572](https://github.com/mastra-ai/mastra/pull/17572))
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`575f815`](https://github.com/mastra-ai/mastra/commit/575f815c5c3567b71c0b83cbb7fa98c8253a9d9c), [`34839c1`](https://github.com/mastra-ai/mastra/commit/34839c1910b6964bf59ed0cee58844efebbb684e), [`053735a`](https://github.com/mastra-ai/mastra/commit/053735a75c2c18e23ce34d9468007efa4a45f4c4), [`306909a`](https://github.com/mastra-ai/mastra/commit/306909a693de77d709b38706e2673c9547d24a28), [`5191af8`](https://github.com/mastra-ai/mastra/commit/5191af80c799eea25357c545fc05d91b3883531d), [`43bd3d4`](https://github.com/mastra-ai/mastra/commit/43bd3d421987463fdf35386a45199c49499ed069), [`e6fa79e`](https://github.com/mastra-ai/mastra/commit/e6fa79ec72a2ddffdd25e85270398951e9d552a4), [`904bcdf`](https://github.com/mastra-ai/mastra/commit/904bcdf7b8004aa7be823f9f70ca63580e47e470), [`7f5ee1d`](https://github.com/mastra-ai/mastra/commit/7f5ee1dca46daee8d2817f2ebe49e6335da81956), [`1e9aab5`](https://github.com/mastra-ai/mastra/commit/1e9aab50ff11e6e88fde4d7cbf512c44a9fe8d61), [`2bccba4`](https://github.com/mastra-ai/mastra/commit/2bccba4c03cadc815c2d54cbf4dd43a922140a8d), [`bf8eb6d`](https://github.com/mastra-ai/mastra/commit/bf8eb6d0ec213a403eb9265a594ad283c44ab3dc), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`493a328`](https://github.com/mastra-ai/mastra/commit/493a328f4346a1deeb9f1e2e44c8f2a3a4d7591b), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`34839c1`](https://github.com/mastra-ai/mastra/commit/34839c1910b6964bf59ed0cee58844efebbb684e), [`014e00f`](https://github.com/mastra-ai/mastra/commit/014e00f2b3a597a016b72f9901c6ab27d491f822), [`029a414`](https://github.com/mastra-ai/mastra/commit/029a4141719793bd3e898a39eb5a0466a55f5f3a), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`b147b29`](https://github.com/mastra-ai/mastra/commit/b147b2907f0cd1aa812efe6d6e3f58d22e66fc88), [`d371ac1`](https://github.com/mastra-ai/mastra/commit/d371ac1d9820afaaf7cfdbc380a475946a994d8f), [`2bccba4`](https://github.com/mastra-ai/mastra/commit/2bccba4c03cadc815c2d54cbf4dd43a922140a8d), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`cf182b7`](https://github.com/mastra-ai/mastra/commit/cf182b7fb495767946d9840ef29f19cfa906f31f), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`a049c2a`](https://github.com/mastra-ai/mastra/commit/a049c2a9dfb41d0ee2e7a28874a88cd64fd5669f), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f), [`b147b29`](https://github.com/mastra-ai/mastra/commit/b147b2907f0cd1aa812efe6d6e3f58d22e66fc88), [`2a96528`](https://github.com/mastra-ai/mastra/commit/2a9652848dfa3c5a2426f952e9d93554c26fd90f), [`f2ab060`](https://github.com/mastra-ai/mastra/commit/f2ab060162bea81505fda553e2cee29c1979fd04), [`5d302c8`](https://github.com/mastra-ai/mastra/commit/5d302c8eda1a6ac74eab5e442c4f64db6cc97a06), [`34839c1`](https://github.com/mastra-ai/mastra/commit/34839c1910b6964bf59ed0cee58844efebbb684e), [`a952852`](https://github.com/mastra-ai/mastra/commit/a952852c971a21fb646cd907c75fcf4443cdc963), [`2656d9c`](https://github.com/mastra-ai/mastra/commit/2656d9c2976d4f3354253bfbbbf9b88a1b2bbf34), [`63e3fe1`](https://github.com/mastra-ai/mastra/commit/63e3fe13cc1ea96f91d7c68aea92f400faf9e4da), [`1d4ce8d`](https://github.com/mastra-ai/mastra/commit/1d4ce8daaa54511f325c1b609d31b8e54009d677), [`8c68372`](https://github.com/mastra-ai/mastra/commit/8c68372e85fe0b066ec12c58bd29ffb93e54c552)]:
|
|
48
|
+
- @mastra/core@1.42.0
|
|
49
|
+
|
|
3
50
|
## 1.10.0-alpha.1
|
|
4
51
|
|
|
5
52
|
### Minor Changes
|
|
@@ -164,6 +164,19 @@ export declare class HonoRequest<P extends string = '/', I extends Input['out']
|
|
|
164
164
|
* ```
|
|
165
165
|
*/
|
|
166
166
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
167
|
+
/**
|
|
168
|
+
* `.bytes()` parses the request body as a `Uint8Array`.
|
|
169
|
+
*
|
|
170
|
+
* @see {@link https://hono.dev/docs/api/request#bytes}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* app.post('/entry', async (c) => {
|
|
175
|
+
* const body = await c.req.bytes()
|
|
176
|
+
* })
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
bytes(): Promise<Uint8Array>;
|
|
167
180
|
/**
|
|
168
181
|
* Parses the request body as a `Blob`.
|
|
169
182
|
* @example
|
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2357,7 +2357,7 @@ function createSimpleTokenProvider(accessToken, options) {
|
|
|
2357
2357
|
});
|
|
2358
2358
|
}
|
|
2359
2359
|
|
|
2360
|
-
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.
|
|
2360
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.21/c401a6c1b505d0adf80740e6e7d31122a2ebd9abaf1de7e5dee418ae2a608e7a/node_modules/hono/dist/utils/stream.js
|
|
2361
2361
|
var StreamingApi = class {
|
|
2362
2362
|
writer;
|
|
2363
2363
|
encoder;
|
|
@@ -2386,7 +2386,9 @@ var StreamingApi = class {
|
|
|
2386
2386
|
done ? controller.close() : controller.enqueue(value);
|
|
2387
2387
|
},
|
|
2388
2388
|
cancel: () => {
|
|
2389
|
-
this.
|
|
2389
|
+
if (!this.closed) {
|
|
2390
|
+
this.abort();
|
|
2391
|
+
}
|
|
2390
2392
|
}
|
|
2391
2393
|
});
|
|
2392
2394
|
}
|
|
@@ -2408,11 +2410,11 @@ var StreamingApi = class {
|
|
|
2408
2410
|
return new Promise((res) => setTimeout(res, ms));
|
|
2409
2411
|
}
|
|
2410
2412
|
async close() {
|
|
2413
|
+
this.closed = true;
|
|
2411
2414
|
try {
|
|
2412
2415
|
await this.writer.close();
|
|
2413
2416
|
} catch {
|
|
2414
2417
|
}
|
|
2415
|
-
this.closed = true;
|
|
2416
2418
|
}
|
|
2417
2419
|
async pipe(body) {
|
|
2418
2420
|
this.writer.releaseLock();
|
|
@@ -2434,7 +2436,7 @@ var StreamingApi = class {
|
|
|
2434
2436
|
}
|
|
2435
2437
|
};
|
|
2436
2438
|
|
|
2437
|
-
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.
|
|
2439
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.21/c401a6c1b505d0adf80740e6e7d31122a2ebd9abaf1de7e5dee418ae2a608e7a/node_modules/hono/dist/helper/streaming/utils.js
|
|
2438
2440
|
var isOldBunVersion = () => {
|
|
2439
2441
|
const version = typeof Bun !== "undefined" ? Bun.version : void 0;
|
|
2440
2442
|
if (version === void 0) {
|
|
@@ -2445,7 +2447,7 @@ var isOldBunVersion = () => {
|
|
|
2445
2447
|
return result;
|
|
2446
2448
|
};
|
|
2447
2449
|
|
|
2448
|
-
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.
|
|
2450
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.21/c401a6c1b505d0adf80740e6e7d31122a2ebd9abaf1de7e5dee418ae2a608e7a/node_modules/hono/dist/utils/html.js
|
|
2449
2451
|
var HtmlEscapedCallbackPhase = {
|
|
2450
2452
|
Stringify: 1};
|
|
2451
2453
|
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
@@ -2476,7 +2478,7 @@ var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) =>
|
|
|
2476
2478
|
}
|
|
2477
2479
|
};
|
|
2478
2480
|
|
|
2479
|
-
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.
|
|
2481
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/hono/4.12.21/c401a6c1b505d0adf80740e6e7d31122a2ebd9abaf1de7e5dee418ae2a608e7a/node_modules/hono/dist/helper/streaming/sse.js
|
|
2480
2482
|
var SSEStreamingApi = class extends StreamingApi {
|
|
2481
2483
|
constructor(writable, readable) {
|
|
2482
2484
|
super(writable, readable);
|
|
@@ -3363,7 +3365,7 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
3363
3365
|
const resource = resources.find((r) => r.uri === uri);
|
|
3364
3366
|
if (!resource) {
|
|
3365
3367
|
this.logger.warn("Unknown resource URI requested", { uri });
|
|
3366
|
-
throw new
|
|
3368
|
+
throw new types_js.McpError(types_js.ErrorCode.InvalidParams, `Resource not found: ${uri}`);
|
|
3367
3369
|
}
|
|
3368
3370
|
try {
|
|
3369
3371
|
const resourcesOrResourceContent = await capturedResourceOptions.getResourceContent({ uri, extra });
|
|
@@ -3472,7 +3474,7 @@ Provided arguments: ${JSON.stringify(request.params.arguments, null, 2)}`
|
|
|
3472
3474
|
if (prompt.arguments) {
|
|
3473
3475
|
for (const arg of prompt.arguments) {
|
|
3474
3476
|
if (arg.required && (args?.[arg.name] === void 0 || args?.[arg.name] === null)) {
|
|
3475
|
-
throw new
|
|
3477
|
+
throw new types_js.McpError(types_js.ErrorCode.InvalidParams, `Missing required argument: ${arg.name}`);
|
|
3476
3478
|
}
|
|
3477
3479
|
}
|
|
3478
3480
|
}
|