@mcp-ts/sdk 2.3.1 → 2.3.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/adapters/agui-adapter.d.mts +1 -1
- package/dist/adapters/agui-adapter.d.ts +1 -1
- package/dist/adapters/agui-middleware.d.mts +1 -1
- package/dist/adapters/agui-middleware.d.ts +1 -1
- package/dist/adapters/ai-adapter.d.mts +1 -1
- package/dist/adapters/ai-adapter.d.ts +1 -1
- package/dist/adapters/langchain-adapter.d.mts +1 -1
- package/dist/adapters/langchain-adapter.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/dist/server/index.js +15 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +15 -0
- package/dist/server/index.mjs.map +1 -1
- package/dist/shared/index.d.mts +2 -2
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.js +18 -1
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +18 -1
- package/dist/shared/index.mjs.map +1 -1
- package/dist/{tool-router-CP7qLk1J.d.ts → tool-router-BMzhoNYt.d.ts} +2 -0
- package/dist/{tool-router-BfE_9tay.d.mts → tool-router-BhHsvBfP.d.mts} +2 -0
- package/package.json +1 -1
- package/src/server/mcp/oauth-client.ts +22 -0
- package/src/shared/tool-router.ts +32 -1
package/dist/shared/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ export { D as Disposable, a as DisposableStore, E as Emitter, b as Event, M as M
|
|
|
2
2
|
export { A as AuthenticationError, C as ConfigurationError, a as ConnectionError, I as InvalidStateError, M as McpError, N as NotConnectedError, R as RpcErrorCode, b as RpcErrorCodes, S as SessionNotFoundError, c as SessionValidationError, T as ToolExecutionError, U as UnauthorizedError, s as sanitizeServerLabel } from '../utils-DELRKQPU.mjs';
|
|
3
3
|
import { v as ToolInfo } from '../types-CxFaaZrM.mjs';
|
|
4
4
|
export { C as CallToolParams, a as CallToolRequest, b as CallToolResponse, c as ConnectAuthRequiredResponse, d as ConnectErrorResponse, e as ConnectParams, f as ConnectRequest, g as ConnectResponse, h as ConnectResult, i as ConnectSuccessResponse, D as DisconnectParams, j as DisconnectResult, F as FinishAuthParams, k as FinishAuthResult, G as GetPromptParams, l as GetSessionResult, L as ListPromptsResult, m as ListResourcesResult, n as ListToolsResponse, o as ListToolsRpcResult, M as McpRpcMethod, p as McpRpcParams, q as McpRpcRequest, r as McpRpcResponse, R as ReadResourceParams, S as SessionInfo, s as SessionListResult, t as SessionParams, T as ToolClient, u as ToolClientProvider, w as TransportType, x as isCallToolSuccess, y as isConnectAuthRequired, z as isConnectError, A as isConnectSuccess, B as isListToolsSuccess } from '../types-CxFaaZrM.mjs';
|
|
5
|
-
import { d as ToolRouter } from '../tool-router-
|
|
6
|
-
export { C as CompactTool, E as EmbedFn, I as IndexedTool, S as SchemaCompressor, T as ToolGroupInfo, a as ToolIndex, b as ToolIndexOptions, c as ToolListResult, e as ToolRouterClientInput, f as ToolRouterOptions, g as ToolRouterStrategy, h as ToolSearchOptions, i as ToolServerSummary, j as ToolSummary } from '../tool-router-
|
|
5
|
+
import { d as ToolRouter } from '../tool-router-BhHsvBfP.mjs';
|
|
6
|
+
export { C as CompactTool, E as EmbedFn, I as IndexedTool, S as SchemaCompressor, T as ToolGroupInfo, a as ToolIndex, b as ToolIndexOptions, c as ToolListResult, e as ToolRouterClientInput, f as ToolRouterOptions, g as ToolRouterStrategy, h as ToolSearchOptions, i as ToolServerSummary, j as ToolSummary } from '../tool-router-BhHsvBfP.mjs';
|
|
7
7
|
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
8
8
|
|
|
9
9
|
/**
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export { D as Disposable, a as DisposableStore, E as Emitter, b as Event, M as M
|
|
|
2
2
|
export { A as AuthenticationError, C as ConfigurationError, a as ConnectionError, I as InvalidStateError, M as McpError, N as NotConnectedError, R as RpcErrorCode, b as RpcErrorCodes, S as SessionNotFoundError, c as SessionValidationError, T as ToolExecutionError, U as UnauthorizedError, s as sanitizeServerLabel } from '../utils-DELRKQPU.js';
|
|
3
3
|
import { v as ToolInfo } from '../types-CxFaaZrM.js';
|
|
4
4
|
export { C as CallToolParams, a as CallToolRequest, b as CallToolResponse, c as ConnectAuthRequiredResponse, d as ConnectErrorResponse, e as ConnectParams, f as ConnectRequest, g as ConnectResponse, h as ConnectResult, i as ConnectSuccessResponse, D as DisconnectParams, j as DisconnectResult, F as FinishAuthParams, k as FinishAuthResult, G as GetPromptParams, l as GetSessionResult, L as ListPromptsResult, m as ListResourcesResult, n as ListToolsResponse, o as ListToolsRpcResult, M as McpRpcMethod, p as McpRpcParams, q as McpRpcRequest, r as McpRpcResponse, R as ReadResourceParams, S as SessionInfo, s as SessionListResult, t as SessionParams, T as ToolClient, u as ToolClientProvider, w as TransportType, x as isCallToolSuccess, y as isConnectAuthRequired, z as isConnectError, A as isConnectSuccess, B as isListToolsSuccess } from '../types-CxFaaZrM.js';
|
|
5
|
-
import { d as ToolRouter } from '../tool-router-
|
|
6
|
-
export { C as CompactTool, E as EmbedFn, I as IndexedTool, S as SchemaCompressor, T as ToolGroupInfo, a as ToolIndex, b as ToolIndexOptions, c as ToolListResult, e as ToolRouterClientInput, f as ToolRouterOptions, g as ToolRouterStrategy, h as ToolSearchOptions, i as ToolServerSummary, j as ToolSummary } from '../tool-router-
|
|
5
|
+
import { d as ToolRouter } from '../tool-router-BMzhoNYt.js';
|
|
6
|
+
export { C as CompactTool, E as EmbedFn, I as IndexedTool, S as SchemaCompressor, T as ToolGroupInfo, a as ToolIndex, b as ToolIndexOptions, c as ToolListResult, e as ToolRouterClientInput, f as ToolRouterOptions, g as ToolRouterStrategy, h as ToolSearchOptions, i as ToolServerSummary, j as ToolSummary } from '../tool-router-BMzhoNYt.js';
|
|
7
7
|
import { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
8
8
|
|
|
9
9
|
/**
|
package/dist/shared/index.js
CHANGED
|
@@ -1143,7 +1143,7 @@ var ToolRouter = class {
|
|
|
1143
1143
|
* If tool name is ambiguous, use namespace to specify the server.
|
|
1144
1144
|
*/
|
|
1145
1145
|
getToolSchema(toolName, namespace, options = {}) {
|
|
1146
|
-
const matches = this.
|
|
1146
|
+
const matches = this.getIndexedToolMatches(toolName, namespace, options);
|
|
1147
1147
|
if (matches.length === 0) return void 0;
|
|
1148
1148
|
if (matches.length > 1) {
|
|
1149
1149
|
const servers = matches.map((m) => m.serverId).join(", ");
|
|
@@ -1350,6 +1350,23 @@ var ToolRouter = class {
|
|
|
1350
1350
|
getDirectlyVisibleTools() {
|
|
1351
1351
|
return this.allTools.filter((tool) => !this.matchesDeferredTool(tool) || this.matchesPinnedTool(tool.name));
|
|
1352
1352
|
}
|
|
1353
|
+
getIndexedToolMatches(toolName, namespace, options = {}) {
|
|
1354
|
+
const indexedMatches = this.index.getTool(toolName, namespace, options);
|
|
1355
|
+
if (indexedMatches.length > 0 || !this.matchesPinnedTool(toolName)) {
|
|
1356
|
+
return indexedMatches;
|
|
1357
|
+
}
|
|
1358
|
+
return this.matchTools(this.pinnedTools.filter((tool) => tool.name === toolName), namespace, options);
|
|
1359
|
+
}
|
|
1360
|
+
matchTools(tools, namespace, options = {}) {
|
|
1361
|
+
if (!namespace) return tools;
|
|
1362
|
+
const exactMatches = tools.filter(
|
|
1363
|
+
(tool) => tool.sessionId === namespace || tool.serverId === namespace
|
|
1364
|
+
);
|
|
1365
|
+
if (exactMatches.length > 0) return exactMatches;
|
|
1366
|
+
if (!options.allowServerNameFragment) return [];
|
|
1367
|
+
const namespaceLower = namespace.toLowerCase();
|
|
1368
|
+
return tools.filter((tool) => tool.serverName.toLowerCase().includes(namespaceLower));
|
|
1369
|
+
}
|
|
1353
1370
|
};
|
|
1354
1371
|
function globToRegExp(pattern) {
|
|
1355
1372
|
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, "\\$&");
|