@mastra/mcp 2.9.0-alpha.2 → 2.9.0-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/dist/client/configuration.d.ts +6 -0
- package/dist/client/configuration.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +19 -19
- package/dist/docs/references/docs-connections-mcp.md +7 -6
- package/dist/docs/references/reference-tools-mcp-client.md +11 -1
- package/dist/index.cjs +27 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -955,6 +955,12 @@ export declare class MCPClient<TServers extends MCPClientServers<TServers> = MCP
|
|
|
955
955
|
private listResourceTemplatesWithErrors;
|
|
956
956
|
private listPromptsWithErrors;
|
|
957
957
|
private discoverValuesWithErrors;
|
|
958
|
+
/**
|
|
959
|
+
* Stores a tool under its `serverName_toolName` key. Server and tool names can both contain `_`,
|
|
960
|
+
* so two different pairs can produce one key (`local` + `x_status` and `local_x` + `status`).
|
|
961
|
+
* The later pair keeps the key, as before; this logs a warning instead of dropping a tool silently.
|
|
962
|
+
*/
|
|
963
|
+
private setNamespacedTool;
|
|
958
964
|
/**
|
|
959
965
|
* Runs a per-server discovery `operation` against every configured server
|
|
960
966
|
* concurrently, isolating and logging per-server failures. Results are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/client/configuration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,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AQT,iBAAiB;YAsCjB,kBAAkB;IAchC,OAAO,CAAC,kBAAkB;YA+BZ,2BAA2B;YAI3B,kBAAkB;YAIlB,iBAAiB;CAuBhC"}
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.9.0-alpha.
|
|
2
|
+
"version": "2.9.0-alpha.3",
|
|
3
3
|
"package": "@mastra/mcp",
|
|
4
4
|
"exports": {
|
|
5
5
|
"InMemoryMCPEventCursorStore": {
|
|
6
6
|
"types": "dist/integrations/events-cursor-store.d.ts",
|
|
7
7
|
"implementation": "dist/index.js",
|
|
8
|
-
"line":
|
|
8
|
+
"line": 25452
|
|
9
9
|
},
|
|
10
10
|
"InMemoryMCPTaskStore": {
|
|
11
11
|
"types": "dist/server/tasks/in-memory-store.d.ts",
|
|
12
12
|
"implementation": "dist/index.js",
|
|
13
|
-
"line":
|
|
13
|
+
"line": 22227
|
|
14
14
|
},
|
|
15
15
|
"InMemoryOAuthStorage": {
|
|
16
16
|
"types": "dist/client/oauth-provider.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"InMemoryWebhookSubscriptionStore": {
|
|
21
21
|
"types": "dist/server/events/webhook-store.d.ts",
|
|
22
22
|
"implementation": "dist/index.js",
|
|
23
|
-
"line":
|
|
23
|
+
"line": 20597
|
|
24
24
|
},
|
|
25
25
|
"InternalMastraMCPClient": {
|
|
26
26
|
"types": "dist/client/client.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"MCPEventsSignalProvider": {
|
|
41
41
|
"types": "dist/integrations/events-signals.d.ts",
|
|
42
42
|
"implementation": "dist/index.js",
|
|
43
|
-
"line":
|
|
43
|
+
"line": 25637
|
|
44
44
|
},
|
|
45
45
|
"MCPOAuthClientProvider": {
|
|
46
46
|
"types": "dist/client/oauth-provider.d.ts",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"MCPServer": {
|
|
51
51
|
"types": "dist/server/server.d.ts",
|
|
52
52
|
"implementation": "dist/index.js",
|
|
53
|
-
"line":
|
|
53
|
+
"line": 23242
|
|
54
54
|
},
|
|
55
55
|
"MCPTaskLimitError": {
|
|
56
56
|
"types": "dist/server/tasks/store.d.ts",
|
|
57
57
|
"implementation": "dist/index.js",
|
|
58
|
-
"line":
|
|
58
|
+
"line": 21409
|
|
59
59
|
},
|
|
60
60
|
"MCP_CALL_TOOL_CONTENT": {
|
|
61
61
|
"types": "dist/client/client.d.ts",
|
|
@@ -80,32 +80,32 @@
|
|
|
80
80
|
"MCP_PROTOCOL_VERSION": {
|
|
81
81
|
"types": "dist/server/types.d.ts",
|
|
82
82
|
"implementation": "dist/index.js",
|
|
83
|
-
"line":
|
|
83
|
+
"line": 25179
|
|
84
84
|
},
|
|
85
85
|
"ServerEventActions": {
|
|
86
86
|
"types": "dist/server/events/actions.d.ts",
|
|
87
87
|
"implementation": "dist/index.js",
|
|
88
|
-
"line":
|
|
88
|
+
"line": 19698
|
|
89
89
|
},
|
|
90
90
|
"ServerPromptActions": {
|
|
91
91
|
"types": "dist/server/actions.d.ts",
|
|
92
92
|
"implementation": "dist/index.js",
|
|
93
|
-
"line":
|
|
93
|
+
"line": 19678
|
|
94
94
|
},
|
|
95
95
|
"ServerResourceActions": {
|
|
96
96
|
"types": "dist/server/actions.d.ts",
|
|
97
97
|
"implementation": "dist/index.js",
|
|
98
|
-
"line":
|
|
98
|
+
"line": 19664
|
|
99
99
|
},
|
|
100
100
|
"ServerToolActions": {
|
|
101
101
|
"types": "dist/server/actions.d.ts",
|
|
102
102
|
"implementation": "dist/index.js",
|
|
103
|
-
"line":
|
|
103
|
+
"line": 19646
|
|
104
104
|
},
|
|
105
105
|
"createIntrospectionValidator": {
|
|
106
106
|
"types": "dist/server/oauth-middleware.d.ts",
|
|
107
107
|
"implementation": "dist/index.js",
|
|
108
|
-
"line":
|
|
108
|
+
"line": 25371
|
|
109
109
|
},
|
|
110
110
|
"createOAuthCallbackServer": {
|
|
111
111
|
"types": "dist/client/oauth-callback-server.d.ts",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"createOAuthMiddleware": {
|
|
116
116
|
"types": "dist/server/oauth-middleware.d.ts",
|
|
117
117
|
"implementation": "dist/index.js",
|
|
118
|
-
"line":
|
|
118
|
+
"line": 25224
|
|
119
119
|
},
|
|
120
120
|
"createSimpleTokenProvider": {
|
|
121
121
|
"types": "dist/client/oauth-provider.d.ts",
|
|
@@ -125,12 +125,12 @@
|
|
|
125
125
|
"createStaticTokenValidator": {
|
|
126
126
|
"types": "dist/server/oauth-middleware.d.ts",
|
|
127
127
|
"implementation": "dist/index.js",
|
|
128
|
-
"line":
|
|
128
|
+
"line": 25340
|
|
129
129
|
},
|
|
130
130
|
"defineEvent": {
|
|
131
131
|
"types": "dist/server/events/define-event.d.ts",
|
|
132
132
|
"implementation": "dist/index.js",
|
|
133
|
-
"line":
|
|
133
|
+
"line": 25442
|
|
134
134
|
},
|
|
135
135
|
"extractBearerToken": {
|
|
136
136
|
"types": "dist/shared/oauth-types.d.ts",
|
|
@@ -165,17 +165,17 @@
|
|
|
165
165
|
"isMCPTaskStoreAdmin": {
|
|
166
166
|
"types": "dist/server/tasks/store.d.ts",
|
|
167
167
|
"implementation": "dist/index.js",
|
|
168
|
-
"line":
|
|
168
|
+
"line": 21460
|
|
169
169
|
},
|
|
170
170
|
"isWorkflowTaskContext": {
|
|
171
171
|
"types": "dist/server/tasks/workflow-runs.d.ts",
|
|
172
172
|
"implementation": "dist/index.js",
|
|
173
|
-
"line":
|
|
173
|
+
"line": 23000
|
|
174
174
|
},
|
|
175
175
|
"principalKeyOf": {
|
|
176
176
|
"types": "dist/server/tasks/store.d.ts",
|
|
177
177
|
"implementation": "dist/index.js",
|
|
178
|
-
"line":
|
|
178
|
+
"line": 21401
|
|
179
179
|
},
|
|
180
180
|
"taskKeyOf": {
|
|
181
181
|
"types": "dist/shared/tasks/task-id.d.ts",
|
|
@@ -162,12 +162,13 @@ See [type generation reference](https://mastra.ai/reference/tools/mcp-client) fo
|
|
|
162
162
|
|
|
163
163
|
Choose how to load tools based on whether the server configuration changes between requests:
|
|
164
164
|
|
|
165
|
-
| | Static tools
|
|
166
|
-
| ----------- |
|
|
167
|
-
| Method | `await mcpClient.listTools()`
|
|
168
|
-
| Use case | Shared, fixed configuration
|
|
169
|
-
| Credentials | Shared by all requests
|
|
170
|
-
| Agent API | `tools` in the `Agent` constructor
|
|
165
|
+
| | Static tools | Runtime toolsets |
|
|
166
|
+
| ----------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
167
|
+
| Method | `await mcpClient.listTools()` | `await mcpClient.listToolsets()` |
|
|
168
|
+
| Use case | Shared, fixed configuration | Per-user or per-request configuration |
|
|
169
|
+
| Credentials | Shared by all requests | Can vary between requests |
|
|
170
|
+
| Agent API | `tools` in the `Agent` constructor | `toolsets` in `generate()` or `stream()` |
|
|
171
|
+
| Tool names | Prefixed with the server name, such as `weather_get_weather` | Raw tool names. Same-named tools from different servers collide. See [`listToolsets()`](https://mastra.ai/reference/tools/mcp-client). |
|
|
171
172
|
|
|
172
173
|
The preceding agent example uses static tools. For runtime credentials, create a client for the request and pass its toolsets when calling the agent:
|
|
173
174
|
|
|
@@ -416,6 +416,8 @@ Retrieves all tools from all configured servers, with tool names namespaced by t
|
|
|
416
416
|
|
|
417
417
|
App-only tools, whose `_meta.ui.visibility` omits `"model"`, are left out. `listToolsets()` and `listToolDefinitions()` leave them out too.
|
|
418
418
|
|
|
419
|
+
Server names and tool names can both contain `_`, so two different pairs can produce the same key. For example, server `local` with tool `x_status` and server `local_x` with tool `status` both produce `local_x_status`. The tool from the server listed later in `servers` keeps the key, and the client logs a warning that names both pairs. Rename one of the servers to keep both tools.
|
|
420
|
+
|
|
419
421
|
```ts
|
|
420
422
|
new Agent({ id: 'agent', tools: await mcp.listTools() })
|
|
421
423
|
```
|
|
@@ -441,7 +443,7 @@ When called without options, the method omits only `durations`; `tools`, `errors
|
|
|
441
443
|
|
|
442
444
|
### `listToolsets()`
|
|
443
445
|
|
|
444
|
-
Returns an object
|
|
446
|
+
Returns an object that maps each server name to that server's tools. Tools keep their raw names, without a server prefix. Intended to be passed at runtime into the generate or stream method.
|
|
445
447
|
|
|
446
448
|
```typescript
|
|
447
449
|
const res = await agent.stream(prompt, {
|
|
@@ -449,6 +451,14 @@ const res = await agent.stream(prompt, {
|
|
|
449
451
|
})
|
|
450
452
|
```
|
|
451
453
|
|
|
454
|
+
The agent combines toolsets by tool name. When two servers expose a tool with the same name, such as `search`, only the tool from the server listed later in `servers` reaches the model, and the agent logs a warning. To keep both tools, pass the prefixed tools from `listTools()` as a single toolset:
|
|
455
|
+
|
|
456
|
+
```typescript
|
|
457
|
+
const res = await agent.stream(prompt, {
|
|
458
|
+
toolsets: { mcp: await mcp.listTools() }, // docs_search, tickets_search
|
|
459
|
+
})
|
|
460
|
+
```
|
|
461
|
+
|
|
452
462
|
### `listToolsetsWithErrors(options?)`
|
|
453
463
|
|
|
454
464
|
Returns toolsets grouped by server name, along with per-server discovery errors. Set `perServerTimeoutMs` to limit each server independently and include per-server `durations` in milliseconds.
|
package/dist/index.cjs
CHANGED
|
@@ -19174,6 +19174,7 @@ onListChanged: async (serverName, handler) => {
|
|
|
19174
19174
|
errorId: "MCP_CLIENT_GET_TOOLS_FAILED",
|
|
19175
19175
|
logMessage: "Failed to list tools from server:"
|
|
19176
19176
|
}, options);
|
|
19177
|
+
const keySources = /* @__PURE__ */ new Map();
|
|
19177
19178
|
for (const { serverName, value, error, duration } of settled) {
|
|
19178
19179
|
durations[serverName] = duration;
|
|
19179
19180
|
if (error !== void 0) {
|
|
@@ -19181,7 +19182,7 @@ onListChanged: async (serverName, handler) => {
|
|
|
19181
19182
|
errorDetails[serverName] = error;
|
|
19182
19183
|
continue;
|
|
19183
19184
|
}
|
|
19184
|
-
for (const [toolName, toolConfig] of Object.entries(value)) connectedTools
|
|
19185
|
+
for (const [toolName, toolConfig] of Object.entries(value)) this.setNamespacedTool(connectedTools, keySources, serverName, toolName, toolConfig);
|
|
19185
19186
|
}
|
|
19186
19187
|
const result = {
|
|
19187
19188
|
tools: connectedTools,
|
|
@@ -19353,16 +19354,18 @@ onListChanged: async (serverName, handler) => {
|
|
|
19353
19354
|
async toolsFromDefinitions({ definitions: catalog }) {
|
|
19354
19355
|
const configuredServers = new Set(Object.keys(this.serverConfigs));
|
|
19355
19356
|
const tools = {};
|
|
19357
|
+
const keySources = /* @__PURE__ */ new Map();
|
|
19356
19358
|
for (const [serverName, definitions] of Object.entries(catalog)) {
|
|
19357
19359
|
if (!configuredServers.has(serverName)) {
|
|
19358
19360
|
this.logger.warn("Skipping cached MCP tool definitions for a server that is no longer configured", { serverName });
|
|
19359
19361
|
continue;
|
|
19360
19362
|
}
|
|
19361
19363
|
for (const [toolName, definition] of Object.entries(modelVisibleDefinitions(definitions))) try {
|
|
19362
|
-
|
|
19364
|
+
const tool = await this.toolFromDefinition({
|
|
19363
19365
|
serverName,
|
|
19364
19366
|
definition
|
|
19365
19367
|
});
|
|
19368
|
+
this.setNamespacedTool(tools, keySources, serverName, toolName, tool);
|
|
19366
19369
|
} catch (error) {
|
|
19367
19370
|
if (!(error instanceof _mastra_core_error.MastraError && error.id === "MCP_CLIENT_INVALID_TOOL_INPUT_SCHEMA")) throw error;
|
|
19368
19371
|
}
|
|
@@ -19423,6 +19426,28 @@ onListChanged: async (serverName, handler) => {
|
|
|
19423
19426
|
} : result;
|
|
19424
19427
|
}
|
|
19425
19428
|
/**
|
|
19429
|
+
* Stores a tool under its `serverName_toolName` key. Server and tool names can both contain `_`,
|
|
19430
|
+
* so two different pairs can produce one key (`local` + `x_status` and `local_x` + `status`).
|
|
19431
|
+
* The later pair keeps the key, as before; this logs a warning instead of dropping a tool silently.
|
|
19432
|
+
*/
|
|
19433
|
+
setNamespacedTool(tools, keySources, serverName, toolName, tool) {
|
|
19434
|
+
const key = `${serverName}_${toolName}`;
|
|
19435
|
+
const replaced = keySources.get(key);
|
|
19436
|
+
if (replaced) this.logger.warn(`MCP tool key "${key}" from server "${serverName}" (tool "${toolName}") replaces the tool from server "${replaced.serverName}" (tool "${replaced.toolName}"), which produces the same key. Only the tool from "${serverName}" is kept. Rename one of the servers in \`servers\` to keep both.`, {
|
|
19437
|
+
key,
|
|
19438
|
+
replaced,
|
|
19439
|
+
replacedBy: {
|
|
19440
|
+
serverName,
|
|
19441
|
+
toolName
|
|
19442
|
+
}
|
|
19443
|
+
});
|
|
19444
|
+
keySources.set(key, {
|
|
19445
|
+
serverName,
|
|
19446
|
+
toolName
|
|
19447
|
+
});
|
|
19448
|
+
tools[key] = tool;
|
|
19449
|
+
}
|
|
19450
|
+
/**
|
|
19426
19451
|
* Runs a per-server discovery `operation` against every configured server
|
|
19427
19452
|
* concurrently, isolating and logging per-server failures. Results are
|
|
19428
19453
|
* returned in configuration order (`Object.keys(serverConfigs)`) so callers
|