@mastra/mcp 0.10.11 → 0.10.12-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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/client/client.d.ts +3 -3
- package/dist/client/configuration.d.ts +3 -3
- package/dist/client/resourceActions.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/integration-tests/node_modules/.bin/vitest +2 -2
- package/package.json +3 -3
- package/src/client/client.test.ts +2 -2
- package/src/server/server.test.ts +2 -2
- package/src/server/server.ts +1 -1
- package/integration-tests/node_modules/.bin/mastra +0 -21
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@
|
|
13
|
+
export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules/vitest/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@
|
|
15
|
+
export NODE_PATH="/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules/vitest/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@20.19.9_@vitest+ui@3.2.3_jiti@2.4.2_jsdom@_01cfaf0d6bf085f2477a8f2d60758c73/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.12-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@apidevtools/json-schema-ref-parser": "^14.1.1",
|
|
26
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.17.0",
|
|
27
27
|
"date-fns": "^4.1.0",
|
|
28
28
|
"exit-hook": "^4.0.0",
|
|
29
29
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"vitest": "^3.2.4",
|
|
52
52
|
"zod": "^3.25.67",
|
|
53
53
|
"zod-to-json-schema": "^3.24.5",
|
|
54
|
+
"@mastra/core": "0.14.0-alpha.4",
|
|
54
55
|
"@internal/lint": "0.0.29",
|
|
55
|
-
"@mastra/core": "0.13.2",
|
|
56
56
|
"@internal/types-builder": "0.0.4"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
@@ -356,7 +356,7 @@ describe('MastraMCPClient - Elicitation Tests', () => {
|
|
|
356
356
|
it('should handle elicitation request with reject response', async () => {
|
|
357
357
|
const mockHandler = vi.fn(async (request) => {
|
|
358
358
|
expect(request.message).toBe('Please provide sensitive information');
|
|
359
|
-
return { action: '
|
|
359
|
+
return { action: 'decline' as const };
|
|
360
360
|
});
|
|
361
361
|
|
|
362
362
|
client = new InternalMastraMCPClient({
|
|
@@ -383,7 +383,7 @@ describe('MastraMCPClient - Elicitation Tests', () => {
|
|
|
383
383
|
expect(result.content[0].type).toBe('text');
|
|
384
384
|
|
|
385
385
|
const elicitationResult = JSON.parse(result.content[0].text);
|
|
386
|
-
expect(elicitationResult.action).toBe('
|
|
386
|
+
expect(elicitationResult.action).toBe('decline');
|
|
387
387
|
});
|
|
388
388
|
|
|
389
389
|
it('should handle elicitation request with cancel response', async () => {
|
|
@@ -1564,7 +1564,7 @@ describe('MCPServer - Elicitation', () => {
|
|
|
1564
1564
|
it('should handle elicitation request with reject response', async () => {
|
|
1565
1565
|
const mockElicitationHandler = vi.fn(async request => {
|
|
1566
1566
|
expect(request.message).toBe('Please provide sensitive data');
|
|
1567
|
-
return { action: '
|
|
1567
|
+
return { action: 'decline' as const };
|
|
1568
1568
|
});
|
|
1569
1569
|
|
|
1570
1570
|
elicitationClient = new InternalMastraMCPClient({
|
|
@@ -1586,7 +1586,7 @@ describe('MCPServer - Elicitation', () => {
|
|
|
1586
1586
|
});
|
|
1587
1587
|
|
|
1588
1588
|
expect(mockElicitationHandler).toHaveBeenCalledTimes(1);
|
|
1589
|
-
expect(JSON.parse(result.content[0].text)).toEqual({ action: '
|
|
1589
|
+
expect(JSON.parse(result.content[0].text)).toEqual({ action: 'decline' });
|
|
1590
1590
|
});
|
|
1591
1591
|
|
|
1592
1592
|
it('should handle elicitation request with cancel response', async () => {
|
package/src/server/server.ts
CHANGED
|
@@ -1197,10 +1197,10 @@ export class MCPServer extends MCPServerBase {
|
|
|
1197
1197
|
while (true) {
|
|
1198
1198
|
// This will keep the connection alive
|
|
1199
1199
|
// You can also await for a promise that never resolves
|
|
1200
|
+
await stream.sleep(60_000);
|
|
1200
1201
|
const sessionIds = Array.from(this.sseHonoTransports.keys() || []);
|
|
1201
1202
|
this.logger.debug('Active Hono SSE sessions:', { sessionIds });
|
|
1202
1203
|
await stream.write(':keep-alive\n\n');
|
|
1203
|
-
await stream.sleep(60_000);
|
|
1204
1204
|
}
|
|
1205
1205
|
} catch (e) {
|
|
1206
1206
|
const mastraError = new MastraError(
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/runner/work/mastra/mastra/packages/cli/dist/node_modules:/home/runner/work/mastra/mastra/packages/cli/node_modules:/home/runner/work/mastra/mastra/packages/node_modules:/home/runner/work/mastra/mastra/node_modules:/home/runner/work/mastra/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/runner/work/mastra/mastra/packages/cli/dist/node_modules:/home/runner/work/mastra/mastra/packages/cli/node_modules:/home/runner/work/mastra/mastra/packages/node_modules:/home/runner/work/mastra/mastra/node_modules:/home/runner/work/mastra/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/mastra/mastra/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../mastra/dist/index.js" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../mastra/dist/index.js" "$@"
|
|
21
|
-
fi
|