@mcp-use/client 2.0.0-beta.15 → 2.0.0-beta.17
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/.tsbuildinfo +1 -1
- package/dist/auth/browser.d.ts +51 -2
- package/dist/auth/browser.d.ts.map +1 -1
- package/dist/auth/node.d.ts +99 -4
- package/dist/auth/node.d.ts.map +1 -1
- package/dist/auth/session-store.d.ts +6 -0
- package/dist/auth/session-store.d.ts.map +1 -1
- package/dist/core/base.d.ts +4 -8
- package/dist/core/base.d.ts.map +1 -1
- package/dist/core/browser.d.ts +14 -2
- package/dist/core/browser.d.ts.map +1 -1
- package/dist/core/config.d.ts +82 -20
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/node.d.ts +7 -10
- package/dist/core/node.d.ts.map +1 -1
- package/dist/core/session.d.ts +18 -4
- package/dist/core/session.d.ts.map +1 -1
- package/dist/index-browser.d.ts +1 -0
- package/dist/index-browser.d.ts.map +1 -1
- package/dist/index-browser.js +142 -21
- package/dist/index-browser.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +218 -31
- package/dist/index.js.map +1 -1
- package/dist/react/McpClientProvider.d.ts +22 -10
- package/dist/react/McpClientProvider.d.ts.map +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +164 -21
- package/dist/react/index.js.map +1 -1
- package/dist/react/rpc-logger.d.ts +5 -0
- package/dist/react/rpc-logger.d.ts.map +1 -1
- package/dist/react/storage.d.ts +47 -0
- package/dist/react/storage.d.ts.map +1 -1
- package/dist/react/types.d.ts +107 -16
- package/dist/react/types.d.ts.map +1 -1
- package/dist/react/useMcp-operations.d.ts.map +1 -1
- package/dist/react/view/ViewRenderer.d.ts +7 -0
- package/dist/react/view/ViewRenderer.d.ts.map +1 -1
- package/dist/react/view/parse-custom-props.d.ts +8 -0
- package/dist/react/view/parse-custom-props.d.ts.map +1 -1
- package/dist/react/view/resolve-view-resource.d.ts +10 -0
- package/dist/react/view/resolve-view-resource.d.ts.map +1 -1
- package/dist/react/view/types.d.ts +89 -0
- package/dist/react/view/types.d.ts.map +1 -1
- package/dist/react/view/view-detection.d.ts +18 -0
- package/dist/react/view/view-detection.d.ts.map +1 -1
- package/dist/react/view/view-host-policy.d.ts +35 -0
- package/dist/react/view/view-host-policy.d.ts.map +1 -1
- package/dist/sandbox.d.ts +2 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +283 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +5 -1
- package/dist/telemetry/telemetry.d.ts.map +1 -1
- package/dist/transport/base.d.ts +85 -13
- package/dist/transport/base.d.ts.map +1 -1
- package/dist/transport/connection-manager.d.ts +1 -1
- package/dist/transport/http.d.ts +51 -2
- package/dist/transport/http.d.ts.map +1 -1
- package/dist/transport/stdio.d.ts +29 -1
- package/dist/transport/stdio.d.ts.map +1 -1
- package/dist/utils/elicitation.d.ts +4 -2
- package/dist/utils/elicitation.d.ts.map +1 -1
- package/dist/utils/logging.d.ts +1 -0
- package/dist/utils/logging.d.ts.map +1 -1
- package/dist/utils/version.d.ts +6 -0
- package/dist/utils/version.d.ts.map +1 -1
- package/package.json +8 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/view/sandbox-blob-url.ts"],"sourcesContent":["/**\n * MCP Apps sandbox-proxy HTML for ViewRenderer blob URLs.\n *\n * Browser-only — no Node/Hono imports. The host iframe loads this document\n * from a blob: URL; it proxies postMessage to the inner widget srcdoc iframe.\n */\n\nimport type {\n McpUiResourceCsp,\n McpUiResourcePermissions,\n} from \"./ext-apps-bridge.js\";\nimport type { ViewCspMode } from \"./types.js\";\n\ntype ViewSandboxBlobUrlOptions = {\n cspMode: ViewCspMode;\n permissions?: McpUiResourcePermissions;\n widgetCsp?: McpUiResourceCsp;\n};\n\n/** Build a configured HTTP(S) sandbox proxy URL. */\nexport function buildViewSandboxUrl(\n sandboxDocumentUrl: URL,\n options: ViewSandboxBlobUrlOptions\n): URL {\n const url = new URL(sandboxDocumentUrl.href);\n applySandboxSearchParams(url, options);\n return url;\n}\n\nfunction applySandboxSearchParams(\n url: URL,\n options: ViewSandboxBlobUrlOptions\n): void {\n const { cspMode, permissions, widgetCsp } = options;\n url.searchParams.set(\n \"v\",\n JSON.stringify({ cspMode, permissions, widgetCsp })\n );\n url.searchParams.set(\"csp_mode\", cspMode);\n if (permissions && Object.keys(permissions).length > 0) {\n url.searchParams.set(\"permissions\", JSON.stringify(permissions));\n }\n if (widgetCsp && Object.keys(widgetCsp).length > 0) {\n url.searchParams.set(\"widget_csp\", JSON.stringify(widgetCsp));\n }\n}\n\n/** Build a blob: sandbox iframe URL (no backend sandbox-proxy route). */\nexport function buildViewSandboxBlobUrl(\n options: ViewSandboxBlobUrlOptions\n): URL {\n const searchUrl = new URL(\"https://sandbox.invalid/\");\n applySandboxSearchParams(searchUrl, options);\n const html = buildSandboxProxyBlobHtml(searchUrl.search);\n return new URL(URL.createObjectURL(new Blob([html], { type: \"text/html\" })));\n}\n\n/**\n * Raw sandbox-proxy document (query config via location.search or __SANDBOX_SEARCH__).\n *\n * Inner guest iframe keeps `allow-same-origin` for srcdoc widget rendering;\n * browsers may warn that allow-scripts + allow-same-origin can escape sandboxing.\n */\nconst SANDBOX_PROXY_HTML: string =\n '<!doctype html>\\n<html>\\n <head>\\n <meta charset=\"utf-8\" />\\n <meta\\n http-equiv=\"Content-Security-Policy\"\\n content=\"default-src \\'self\\'; img-src * data: blob: \\'unsafe-inline\\'; media-src * blob: data:; font-src * blob: data:; script-src * \\'wasm-unsafe-eval\\' \\'unsafe-inline\\' \\'unsafe-eval\\' blob: data:; style-src * blob: data: \\'unsafe-inline\\'; connect-src * data: blob: about:; frame-src * blob: data: http://localhost:* https://localhost:* http://127.0.0.1:* https://127.0.0.1:*;\"\\n />\\n <title>MCP Apps Sandbox Proxy</title>\\n <style>\\n html, body { margin: 0; padding: 0; height: 100%; width: 100%; overflow: hidden; }\\n * { box-sizing: border-box; }\\n iframe { display: block; background-color: transparent; border: 0px none transparent; padding: 0px; width: 100%; height: 100%; }\\n </style>\\n </head>\\n <body>\\n <script>\\n function sanitizeDomain(domain) {\\n if (typeof domain !== \"string\") return \"\";\\n return domain.replace(/[\\'\"<>;]/g, \"\").trim();\\n }\\n\\n function buildAllowAttribute(permissions) {\\n if (!permissions) return \"\";\\n const allowList = [];\\n if (permissions.camera) allowList.push(\"camera *\");\\n if (permissions.microphone) allowList.push(\"microphone *\");\\n if (permissions.geolocation) allowList.push(\"geolocation *\");\\n if (permissions.clipboardWrite) allowList.push(\"clipboard-write *\");\\n return allowList.join(\"; \");\\n }\\n\\n function buildCSP(csp) {\\n if (!csp) {\\n return [\\n \"default-src \\'none\\'\",\\n \"script-src \\'unsafe-inline\\'\",\\n \"style-src \\'unsafe-inline\\'\",\\n \"img-src data:\",\\n \"font-src data:\",\\n \"media-src data:\",\\n \"connect-src \\'none\\'\",\\n \"frame-src \\'none\\'\",\\n \"object-src \\'none\\'\",\\n \"base-uri \\'none\\'\",\\n ].join(\"; \");\\n }\\n\\n const connectDomains = (csp.connectDomains || []).map(sanitizeDomain).filter(Boolean);\\n const resourceDomains = (csp.resourceDomains || []).map(sanitizeDomain).filter(Boolean);\\n const frameDomains = (csp.frameDomains || []).map(sanitizeDomain).filter(Boolean);\\n const baseUriDomains = (csp.baseUriDomains || []).map(sanitizeDomain).filter(Boolean);\\n const scriptDirectives = (csp.scriptDirectives || []).filter(function(d) { return typeof d === \"string\" && d.length > 0; });\\n\\n const connectSrc = connectDomains.length > 0 ? connectDomains.join(\" \") : \"\\'none\\'\";\\n const resourceSrc = resourceDomains.length > 0 ? [\"data:\", \"blob:\", ...resourceDomains].join(\" \") : \"data: blob:\";\\n const frameSrc = frameDomains.length > 0 ? frameDomains.join(\" \") : \"\\'none\\'\";\\n const baseUri = baseUriDomains.length > 0 ? baseUriDomains.join(\" \") : \"\\'none\\'\";\\n const scriptSrcParts = [\"\\'unsafe-inline\\'\", resourceSrc];\\n if (scriptDirectives.length > 0) scriptSrcParts.push(scriptDirectives.join(\" \"));\\n\\n return [\\n \"default-src \\'none\\'\",\\n \"script-src \" + scriptSrcParts.join(\" \"),\\n \"style-src \\'unsafe-inline\\' \" + resourceSrc,\\n \"img-src \" + resourceSrc,\\n \"font-src \" + resourceSrc,\\n \"media-src \" + resourceSrc,\\n \"connect-src \" + connectSrc,\\n \"frame-src \" + frameSrc,\\n \"object-src \\'none\\'\",\\n \"base-uri \" + baseUri,\\n ].join(\"; \");\\n }\\n\\n function buildViolationListenerScript() {\\n return `<script>\\ndocument.addEventListener(\\'securitypolicyviolation\\', function(e) {\\n var violation = {\\n type: \\'mcp-apps:csp-violation\\',\\n directive: e.violatedDirective,\\n blockedUri: e.blockedURI,\\n sourceFile: e.sourceFile || null,\\n lineNumber: e.lineNumber || null,\\n columnNumber: e.columnNumber || null,\\n effectiveDirective: e.effectiveDirective,\\n originalPolicy: e.originalPolicy,\\n disposition: e.disposition,\\n timestamp: Date.now()\\n };\\n console.warn(\\'[MCP Apps CSP Violation]\\', violation.directive, \\':\\', violation.blockedUri);\\n window.parent.postMessage(violation, \\'*\\');\\n});\\n\\nfunction serializeConsoleArgs(args) {\\n try {\\n return Array.from(args || []).map(function(arg) {\\n if (arg instanceof Error) {\\n return {\\n type: \\'Error\\',\\n message: arg.message,\\n stack: arg.stack,\\n name: arg.name,\\n };\\n }\\n if (typeof arg === \\'object\\' && arg !== null) {\\n try {\\n return JSON.parse(JSON.stringify(arg));\\n } catch (e) {\\n return String(arg);\\n }\\n }\\n return arg;\\n });\\n } catch (e) {\\n return [String(args)];\\n }\\n}\\n\\nfunction sendConsoleToParent(level, args) {\\n try {\\n window.parent.postMessage({\\n type: \\'iframe-console-log\\',\\n level: level,\\n args: serializeConsoleArgs(args),\\n timestamp: new Date().toISOString(),\\n url: window.location.href,\\n }, \\'*\\');\\n } catch (e) {}\\n}\\n\\nvar originalConsoleError = console.error.bind(console);\\nconsole.error = function() {\\n var args = Array.from(arguments);\\n originalConsoleError.apply(console, args);\\n sendConsoleToParent(\\'error\\', args);\\n};\\n\\nwindow.addEventListener(\\'error\\', function(event) {\\n sendConsoleToParent(\\'error\\', [{\\n message: event.message,\\n filename: event.filename,\\n lineno: event.lineno,\\n colno: event.colno,\\n error: event.error ? {\\n message: event.error.message,\\n stack: event.error.stack,\\n name: event.error.name,\\n } : null,\\n }]);\\n});\\n\\nwindow.addEventListener(\\'unhandledrejection\\', function(event) {\\n sendConsoleToParent(\\'error\\', [{\\n message: \\'Unhandled Promise Rejection\\',\\n reason: event.reason ? String(event.reason) : \\'Unknown\\',\\n error: event.reason instanceof Error ? {\\n message: event.reason.message,\\n stack: event.reason.stack,\\n name: event.reason.name,\\n } : null,\\n }]);\\n});\\n</` + `script>`;\\n }\\n\\n function injectCSP(html, cspValue) {\\n const cspMeta = \\'<meta http-equiv=\"Content-Security-Policy\" content=\"\\' + cspValue + \\'\">\\';\\n const violationListener = buildViolationListenerScript();\\n const injection = cspMeta + violationListener;\\n\\n if (html.includes(\"<head>\")) {\\n return html.replace(\"<head>\", \"<head>\" + injection);\\n } else if (html.includes(\"<HEAD>\")) {\\n return html.replace(\"<HEAD>\", \"<HEAD>\" + injection);\\n } else if (html.includes(\"<html>\")) {\\n return html.replace(\"<html>\", \"<html><head>\" + injection + \"</head>\");\\n } else if (html.includes(\"<HTML>\")) {\\n return html.replace(\"<HTML>\", \"<HTML><head>\" + injection + \"</head>\");\\n } else if (html.includes(\"<!DOCTYPE\") || html.includes(\"<!doctype\")) {\\n return html.replace(/(<!DOCTYPE[^>]*>|<!doctype[^>]*>)/i, \"$1<head>\" + injection + \"</head>\");\\n } else {\\n return injection + html;\\n }\\n }\\n\\n // Query params from host (csp_mode, permissions, widget_csp). AppFrame only\\n // sends { html, csp } in sandbox-resource-ready; we carry the rest on the URL.\\n // Blob URLs cannot reliably carry search params, so the CDN shell injects\\n // window.__SANDBOX_SEARCH__ via buildSandboxProxyBlobHtml.\\n const query = new URLSearchParams(\\n typeof window.__SANDBOX_SEARCH__ === \"string\"\\n ? window.__SANDBOX_SEARCH__\\n : location.search\\n );\\n const queryCspMode = query.get(\"csp_mode\") || \"permissive\";\\n let queryPermissions = null;\\n let queryWidgetCsp = null;\\n try {\\n const rawPerm = query.get(\"permissions\");\\n if (rawPerm) queryPermissions = JSON.parse(rawPerm);\\n } catch (e) {}\\n try {\\n const rawCsp = query.get(\"widget_csp\");\\n if (rawCsp) queryWidgetCsp = JSON.parse(rawCsp);\\n } catch (e) {}\\n\\n const inner = document.createElement(\"iframe\");\\n inner.style = \"width:100%; height:100%; border:none;\";\\n inner.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\\n document.body.appendChild(inner);\\n\\n window.addEventListener(\"message\", async (event) => {\\n if (event.source === window.parent) {\\n if (event.data && event.data.method === \"ui/notifications/sandbox-resource-ready\") {\\n const params = event.data.params || {};\\n const html = params.html;\\n const sandbox = params.sandbox;\\n // Prefer message csp when present; fall back to URL widget_csp\\n const csp = params.csp != null ? params.csp : queryWidgetCsp;\\n const permissions = params.permissions != null ? params.permissions : queryPermissions;\\n const permissive =\\n typeof params.permissive === \"boolean\"\\n ? params.permissive\\n : queryCspMode === \"permissive\";\\n if (typeof sandbox === \"string\") {\\n inner.setAttribute(\"sandbox\", sandbox);\\n }\\n const allowAttribute = buildAllowAttribute(permissions);\\n if (allowAttribute) {\\n inner.setAttribute(\"allow\", allowAttribute);\\n }\\n if (typeof html === \"string\") {\\n if (permissive) {\\n const permissiveCsp = [\\n \"default-src * \\'unsafe-inline\\' \\'unsafe-eval\\' data: blob: filesystem: about:\",\\n \"script-src * \\'unsafe-inline\\' \\'unsafe-eval\\' data: blob:\",\\n \"style-src * \\'unsafe-inline\\' data: blob:\",\\n \"img-src * data: blob: https: http:\",\\n \"media-src * data: blob: https: http:\",\\n \"font-src * data: blob: https: http:\",\\n \"connect-src * data: blob: https: http: ws: wss: about:\",\\n \"frame-src * data: blob: https: http: about:\",\\n \"object-src * data: blob:\",\\n \"base-uri *\",\\n \"form-action *\",\\n ].join(\"; \");\\n const processedHtml = injectCSP(html, permissiveCsp);\\n inner.srcdoc = processedHtml;\\n } else {\\n const cspValue = buildCSP(csp);\\n const processedHtml = injectCSP(html, cspValue);\\n inner.srcdoc = processedHtml;\\n }\\n }\\n } else {\\n if (inner && inner.contentWindow) {\\n inner.contentWindow.postMessage(event.data, \"*\");\\n }\\n }\\n } else if (event.source === inner.contentWindow) {\\n window.parent.postMessage(event.data, \"*\");\\n }\\n });\\n\\n window.parent.postMessage({\\n jsonrpc: \"2.0\",\\n method: \"ui/notifications/sandbox-proxy-ready\",\\n params: {},\\n }, \"*\");\\n </script>\\n </body>\\n</html>';\n\n/**\n * Build sandbox-proxy HTML for a Blob URL, injecting search params that Blob\n * URLs cannot carry reliably.\n *\n * JSON-escapes the search string (incl. `<` → `\\\\u003c`) so it cannot break\n * out of the inline script tag.\n */\nexport function buildSandboxProxyBlobHtml(search: string): string {\n const escaped = JSON.stringify(search).replace(/</g, \"\\\\u003c\");\n const inject =\n \"<script>window.__SANDBOX_SEARCH__ = \" + escaped + \";</script>\";\n return SANDBOX_PROXY_HTML.replace(\"<body>\", \"<body>\" + inject);\n}\n"],"mappings":";AA+DA,IAAM,qBACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AAAA;AASK,SAAS,0BAA0B,QAAwB;AAChE,QAAM,UAAU,KAAK,UAAU,MAAM,EAAE,QAAQ,MAAM,SAAS;AAC9D,QAAM,SACJ,yCAAyC,UAAU;AACrD,SAAO,mBAAmB,QAAQ,UAAU,WAAW,MAAM;AAC/D;","names":[]}
|
|
@@ -63,7 +63,11 @@ export declare class Telemetry {
|
|
|
63
63
|
flush(): void;
|
|
64
64
|
shutdown(): Promise<void>;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Backward-compatible name for {@link Telemetry}.
|
|
68
|
+
*
|
|
69
|
+
* @alias
|
|
70
|
+
*/
|
|
67
71
|
export declare const Tel: typeof Telemetry;
|
|
68
72
|
export declare function setTelemetrySource(source: string): void;
|
|
69
73
|
export declare function setProductVersion(version: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/telemetry/telemetry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAoBrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,KAAK,kBAAkB,GACnB,SAAS,GACT,MAAM,GACN,oBAAoB,GACpB,MAAM,GACN,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,KAAK,iBAAiB,GAAG,YAAY,GAAG,cAAc,CAAC;AASvD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAEzE;AAyHD;;;;GAIG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA0B;IAEjD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;IAErD,OAAO,C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AE,MAAM,GAAG,IAAI,CAEvD"}
|
package/dist/transport/base.d.ts
CHANGED
|
@@ -4,9 +4,12 @@ import type { ConnectionManager } from "./connection-manager.js";
|
|
|
4
4
|
import type { ConnectorInitEventData } from "../telemetry/events.js";
|
|
5
5
|
import type { MCPServerInfo } from "../core/session.js";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Handles a notification received from an MCP server.
|
|
8
|
+
*
|
|
9
|
+
* @param notification - Notification envelope supplied by the server.
|
|
8
10
|
*/
|
|
9
11
|
export type NotificationHandler = (notification: Notification) => void | Promise<void>;
|
|
12
|
+
/** Shared initialization options for all connector transports. */
|
|
10
13
|
export interface ConnectorInitOptions {
|
|
11
14
|
/**
|
|
12
15
|
* Options forwarded to the underlying MCP `Client` instance.
|
|
@@ -65,14 +68,22 @@ export interface ConnectorInitOptions {
|
|
|
65
68
|
* Controls retry behavior of the underlying `StreamableHTTPClientTransport`.
|
|
66
69
|
*/
|
|
67
70
|
reconnectionOptions?: {
|
|
71
|
+
/** Maximum delay between reconnection attempts in milliseconds. */
|
|
68
72
|
maxReconnectionDelay?: number;
|
|
73
|
+
/** Delay before the first reconnection attempt in milliseconds. */
|
|
69
74
|
initialReconnectionDelay?: number;
|
|
75
|
+
/** Multiplier applied to the delay after each failed attempt. */
|
|
70
76
|
reconnectionDelayGrowFactor?: number;
|
|
77
|
+
/** Maximum number of reconnection attempts. */
|
|
71
78
|
maxRetries?: number;
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
81
|
/**
|
|
75
|
-
*
|
|
82
|
+
* Implements protocol operations shared by MCP transport connectors.
|
|
83
|
+
*
|
|
84
|
+
* Subclasses provide transport-specific connection setup and a public
|
|
85
|
+
* identifier. Call {@link BaseConnector.connect}, then
|
|
86
|
+
* {@link BaseConnector.initialize}, before invoking protocol operations.
|
|
76
87
|
*/
|
|
77
88
|
export declare abstract class BaseConnector {
|
|
78
89
|
protected client: Client | null;
|
|
@@ -85,6 +96,11 @@ export declare abstract class BaseConnector {
|
|
|
85
96
|
protected notificationHandlers: NotificationHandler[];
|
|
86
97
|
protected rootsCache: Root[];
|
|
87
98
|
private activeProgressHandlers;
|
|
99
|
+
/**
|
|
100
|
+
* Creates a connector with shared SDK and callback options.
|
|
101
|
+
*
|
|
102
|
+
* @param opts - Connector initialization options.
|
|
103
|
+
*/
|
|
88
104
|
constructor(opts?: ConnectorInitOptions);
|
|
89
105
|
/**
|
|
90
106
|
* Track connector initialization event
|
|
@@ -155,7 +171,9 @@ export declare abstract class BaseConnector {
|
|
|
155
171
|
*/
|
|
156
172
|
setRoots(roots: Root[]): Promise<void>;
|
|
157
173
|
/**
|
|
158
|
-
*
|
|
174
|
+
* Returns the roots currently advertised to the server.
|
|
175
|
+
*
|
|
176
|
+
* @returns A copy of the configured roots.
|
|
159
177
|
*/
|
|
160
178
|
getRoots(): Root[];
|
|
161
179
|
/**
|
|
@@ -174,13 +192,25 @@ export declare abstract class BaseConnector {
|
|
|
174
192
|
* Must be registered after Client construction and before connect().
|
|
175
193
|
*/
|
|
176
194
|
protected setupElicitationHandler(): void;
|
|
177
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Establishes the transport connection and creates the SDK client.
|
|
197
|
+
*
|
|
198
|
+
* @returns A promise that resolves when the connector is connected.
|
|
199
|
+
*/
|
|
178
200
|
abstract connect(): Promise<void>;
|
|
179
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* Returns transport-specific fields suitable for logs and telemetry.
|
|
203
|
+
*
|
|
204
|
+
* @returns A record identifying the connector without exposing credentials.
|
|
205
|
+
*/
|
|
180
206
|
abstract get publicIdentifier(): Record<string, string>;
|
|
181
|
-
/**
|
|
207
|
+
/**
|
|
208
|
+
* Disconnects the SDK client and releases transport resources.
|
|
209
|
+
*
|
|
210
|
+
* @returns A promise that resolves after cleanup completes.
|
|
211
|
+
*/
|
|
182
212
|
disconnect(): Promise<void>;
|
|
183
|
-
/**
|
|
213
|
+
/** Whether an SDK client currently exists for this connector. */
|
|
184
214
|
get isClientConnected(): boolean;
|
|
185
215
|
/**
|
|
186
216
|
* Initialise the MCP session **after** `connect()` has succeeded.
|
|
@@ -188,13 +218,21 @@ export declare abstract class BaseConnector {
|
|
|
188
218
|
* In the SDK, `Client.connect(transport)` automatically performs the
|
|
189
219
|
* protocol‑level `initialize` handshake, so we only need to cache the list of
|
|
190
220
|
* tools and expose some server info.
|
|
221
|
+
*
|
|
222
|
+
* @param defaultRequestOptions - Options used while fetching the initial tool list.
|
|
223
|
+
* @returns The capabilities advertised by the server.
|
|
224
|
+
* @throws When {@link BaseConnector.connect} has not completed.
|
|
191
225
|
*/
|
|
192
226
|
initialize(defaultRequestOptions?: RequestOptions): Promise<ReturnType<Client["getServerCapabilities"]>>;
|
|
193
|
-
/**
|
|
227
|
+
/**
|
|
228
|
+
* Returns the tool list cached during initialization.
|
|
229
|
+
*
|
|
230
|
+
* @throws When {@link BaseConnector.initialize} has not completed.
|
|
231
|
+
*/
|
|
194
232
|
get tools(): Tool[];
|
|
195
|
-
/**
|
|
233
|
+
/** Capabilities cached during initialization, or an empty object. */
|
|
196
234
|
get serverCapabilities(): Record<string, unknown>;
|
|
197
|
-
/**
|
|
235
|
+
/** Server identity cached during initialization, or `null`. */
|
|
198
236
|
get serverInfo(): MCPServerInfo | null;
|
|
199
237
|
/** Instructions supplied by the connected server, if any. */
|
|
200
238
|
get instructions(): string | undefined;
|
|
@@ -207,7 +245,15 @@ export declare abstract class BaseConnector {
|
|
|
207
245
|
get protocolEra(): ProtocolEra | undefined;
|
|
208
246
|
/** The protocol version string negotiated for the active connection. */
|
|
209
247
|
get negotiatedProtocolVersion(): string | undefined;
|
|
210
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* Calls a tool on the connected server.
|
|
250
|
+
*
|
|
251
|
+
* @param name - Tool name.
|
|
252
|
+
* @param args - Tool arguments.
|
|
253
|
+
* @param options - Per-request timeout, cancellation, and progress options.
|
|
254
|
+
* @returns The tool result returned by the server.
|
|
255
|
+
* @throws When the connector is not connected or the tool call fails.
|
|
256
|
+
*/
|
|
211
257
|
callTool(name: string, args: Record<string, any>, options?: RequestOptions): Promise<CallToolResult>;
|
|
212
258
|
/**
|
|
213
259
|
* List all available tools from the MCP server.
|
|
@@ -273,6 +319,7 @@ export declare abstract class BaseConnector {
|
|
|
273
319
|
* @returns Complete list of all resources
|
|
274
320
|
*/
|
|
275
321
|
listAllResources(options?: RequestOptions): Promise<{
|
|
322
|
+
/** Resources returned across all result pages. */
|
|
276
323
|
resources: any[];
|
|
277
324
|
}>;
|
|
278
325
|
/**
|
|
@@ -330,7 +377,13 @@ export declare abstract class BaseConnector {
|
|
|
330
377
|
* @returns Completion suggestions from the server
|
|
331
378
|
*/
|
|
332
379
|
complete(params: CompleteRequestParams, options?: RequestOptions): Promise<CompleteResult>;
|
|
333
|
-
/**
|
|
380
|
+
/**
|
|
381
|
+
* Reads a resource by URI.
|
|
382
|
+
*
|
|
383
|
+
* @param uri - Resource URI to read.
|
|
384
|
+
* @param options - Per-request options.
|
|
385
|
+
* @returns The resource contents returned by the server.
|
|
386
|
+
*/
|
|
334
387
|
readResource(uri: string, options?: RequestOptions): Promise<{
|
|
335
388
|
[x: string]: unknown;
|
|
336
389
|
contents: ({
|
|
@@ -413,6 +466,11 @@ export declare abstract class BaseConnector {
|
|
|
413
466
|
} | undefined;
|
|
414
467
|
} | undefined;
|
|
415
468
|
}>;
|
|
469
|
+
/**
|
|
470
|
+
* Lists prompts exposed by the server.
|
|
471
|
+
*
|
|
472
|
+
* @returns The prompt list, or an empty list when prompts are unsupported.
|
|
473
|
+
*/
|
|
416
474
|
listPrompts(): Promise<{
|
|
417
475
|
[x: string]: unknown;
|
|
418
476
|
prompts: {
|
|
@@ -452,6 +510,13 @@ export declare abstract class BaseConnector {
|
|
|
452
510
|
} | undefined;
|
|
453
511
|
nextCursor?: string | undefined;
|
|
454
512
|
}>;
|
|
513
|
+
/**
|
|
514
|
+
* Gets a prompt with the supplied arguments.
|
|
515
|
+
*
|
|
516
|
+
* @param name - Prompt name.
|
|
517
|
+
* @param args - Prompt arguments.
|
|
518
|
+
* @returns The rendered prompt returned by the server.
|
|
519
|
+
*/
|
|
455
520
|
getPrompt(name: string, args: Record<string, any>): Promise<{
|
|
456
521
|
[x: string]: unknown;
|
|
457
522
|
messages: {
|
|
@@ -558,7 +623,14 @@ export declare abstract class BaseConnector {
|
|
|
558
623
|
} | undefined;
|
|
559
624
|
description?: string | undefined;
|
|
560
625
|
}>;
|
|
561
|
-
/**
|
|
626
|
+
/**
|
|
627
|
+
* Sends a raw, potentially non-standard request through the SDK client.
|
|
628
|
+
*
|
|
629
|
+
* @param method - JSON-RPC method name.
|
|
630
|
+
* @param params - Request parameters. Defaults to an empty object.
|
|
631
|
+
* @param options - Per-request options.
|
|
632
|
+
* @returns The unvalidated result returned by the server.
|
|
633
|
+
*/
|
|
562
634
|
request(method: string, params?: Record<string, any> | null, options?: RequestOptions): Promise<unknown>;
|
|
563
635
|
/**
|
|
564
636
|
* Helper to tear down the client & connection manager safely.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/transport/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,YAAY,EAEZ,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,IAAI,EACJ,IAAI,EACL,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,mBAAmB,CAAC;AAe3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD
|
|
1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AAO,CAAC,cAAc,CAAC;IAY1B;;;;;;OAMG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUxD;;;;;OAKG;IACG,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;IAS/D;;;;;OAKG;IACG,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;;;;;;;;;;;;;;;;;;IASnE;;;;OAIG;IACG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyBjB;;;;;;OAMG;IACG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASvD;;;;;;;OAOG;IACG,OAAO,CACX,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAW,EACzC,OAAO,CAAC,EAAE,cAAc;IAiB1B;;OAEG;cACa,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAkClD"}
|
|
@@ -26,7 +26,7 @@ export declare abstract class ConnectionManager<T = any> {
|
|
|
26
26
|
* This method should be implemented by subclasses to close the specific type
|
|
27
27
|
* of connection.
|
|
28
28
|
*
|
|
29
|
-
* @param connection The connection to close.
|
|
29
|
+
* @param connection - The connection to close.
|
|
30
30
|
*/
|
|
31
31
|
protected abstract closeConnection(connection: T): Promise<void>;
|
|
32
32
|
/**
|
package/dist/transport/http.d.ts
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
import { type VersionNegotiationMode } from "@modelcontextprotocol/client";
|
|
2
2
|
import type { ConnectorInitOptions } from "./base.js";
|
|
3
3
|
import { BaseConnector } from "./base.js";
|
|
4
|
+
/** Client identity advertised to an MCP server during connection setup. */
|
|
4
5
|
export type ClientInfo = {
|
|
6
|
+
/** Stable programmatic client name. */
|
|
5
7
|
name: string;
|
|
8
|
+
/** Optional human-readable client title. */
|
|
6
9
|
title?: string;
|
|
10
|
+
/** Client version string. */
|
|
7
11
|
version: string;
|
|
12
|
+
/** Human-readable client description. */
|
|
8
13
|
description?: string;
|
|
14
|
+
/** Icons representing the client. */
|
|
9
15
|
icons?: Array<{
|
|
16
|
+
/** Icon URL. */
|
|
10
17
|
src: string;
|
|
18
|
+
/** Icon media type. */
|
|
11
19
|
mimeType?: string;
|
|
20
|
+
/** Supported icon sizes, such as `"48x48"`. */
|
|
12
21
|
sizes?: string[];
|
|
13
22
|
}>;
|
|
23
|
+
/** Public website describing the client. */
|
|
14
24
|
websiteUrl?: string;
|
|
15
25
|
};
|
|
26
|
+
/** HTTP-specific connector options. */
|
|
16
27
|
interface HttpConnectorOptions extends ConnectorInitOptions {
|
|
28
|
+
/** Bearer token added to the `Authorization` header. */
|
|
17
29
|
authToken?: string;
|
|
30
|
+
/** Fetch implementation used by transport requests. */
|
|
18
31
|
fetch?: typeof fetch;
|
|
32
|
+
/** Additional transport request headers. */
|
|
19
33
|
headers?: Record<string, string>;
|
|
34
|
+
/** Connection timeout in milliseconds. Defaults to `10000`. */
|
|
20
35
|
timeout?: number;
|
|
36
|
+
/** Client identity advertised to the server. */
|
|
21
37
|
clientInfo?: ClientInfo;
|
|
22
38
|
/**
|
|
23
39
|
* Protocol version negotiation mode passed to the SDK `Client`.
|
|
@@ -32,15 +48,28 @@ interface HttpConnectorOptions extends ConnectorInitOptions {
|
|
|
32
48
|
* - `{ pin: "2026-07-28" }`: modern era only, no fallback.
|
|
33
49
|
*/
|
|
34
50
|
protocolNegotiation?: VersionNegotiationMode;
|
|
51
|
+
/** Gateway endpoint through which MCP transport requests are routed. */
|
|
35
52
|
gatewayUrl?: string;
|
|
53
|
+
/** Server identifier forwarded to the gateway for observability. */
|
|
36
54
|
serverId?: string;
|
|
55
|
+
/** Retry settings for streamable HTTP reconnection. */
|
|
37
56
|
reconnectionOptions?: {
|
|
57
|
+
/** Maximum delay between reconnection attempts in milliseconds. */
|
|
38
58
|
maxReconnectionDelay?: number;
|
|
59
|
+
/** Delay before the first reconnection attempt in milliseconds. */
|
|
39
60
|
initialReconnectionDelay?: number;
|
|
61
|
+
/** Multiplier applied after each failed attempt. */
|
|
40
62
|
reconnectionDelayGrowFactor?: number;
|
|
63
|
+
/** Maximum number of reconnection attempts. */
|
|
41
64
|
maxRetries?: number;
|
|
42
65
|
};
|
|
43
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Connects to an MCP server using streamable HTTP.
|
|
69
|
+
*
|
|
70
|
+
* The connector negotiates modern and legacy protocol eras by default and can
|
|
71
|
+
* route transport requests through an HTTP gateway.
|
|
72
|
+
*/
|
|
44
73
|
export declare class HttpConnector extends BaseConnector {
|
|
45
74
|
private readonly baseUrl;
|
|
46
75
|
private readonly headers;
|
|
@@ -53,11 +82,22 @@ export declare class HttpConnector extends BaseConnector {
|
|
|
53
82
|
private readonly reconnectionOptions?;
|
|
54
83
|
private transportType;
|
|
55
84
|
private streamableTransport;
|
|
85
|
+
/**
|
|
86
|
+
* Creates an HTTP connector.
|
|
87
|
+
*
|
|
88
|
+
* @param baseUrl - MCP endpoint URL.
|
|
89
|
+
* @param opts - Authentication, transport, SDK, and reconnection options.
|
|
90
|
+
*/
|
|
56
91
|
constructor(baseUrl: string, opts?: HttpConnectorOptions);
|
|
57
92
|
private buildClientOptions;
|
|
58
93
|
private unwrapStreamableError;
|
|
59
94
|
private classifyStreamableHttpFailure;
|
|
60
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Establishes a streamable HTTP connection to the MCP server.
|
|
97
|
+
*
|
|
98
|
+
* @returns A promise that resolves after protocol negotiation completes.
|
|
99
|
+
* @throws An error with `code: 401` when authentication is required.
|
|
100
|
+
*/
|
|
61
101
|
connect(): Promise<void>;
|
|
62
102
|
/**
|
|
63
103
|
* Tee an SSE response so v2 MRTR progress can be correlated even when the
|
|
@@ -65,8 +105,17 @@ export declare class HttpConnector extends BaseConnector {
|
|
|
65
105
|
*/
|
|
66
106
|
private observeSseProgress;
|
|
67
107
|
private connectWithStreamableHttp;
|
|
108
|
+
/**
|
|
109
|
+
* Returns fields that identify the endpoint and negotiated transport.
|
|
110
|
+
*
|
|
111
|
+
* @returns HTTP connector identity metadata.
|
|
112
|
+
*/
|
|
68
113
|
get publicIdentifier(): Record<string, string>;
|
|
69
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Returns the active transport type.
|
|
116
|
+
*
|
|
117
|
+
* @returns `"streamable-http"` after connection, otherwise `null`.
|
|
118
|
+
*/
|
|
70
119
|
getTransportType(): "streamable-http" | null;
|
|
71
120
|
protected cleanupResources(): Promise<void>;
|
|
72
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/transport/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAsB1C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC,CAAC;IACH,UAAU,CAAC,EAAE,MAAM,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@ -6,7 +6,9 @@ import { ConnectionManager } from "./connection-manager.js";
|
|
|
6
6
|
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
|
|
7
7
|
import { BaseConnector } from "./base.js";
|
|
8
8
|
import type { ClientInfo } from "./http.js";
|
|
9
|
+
/** Stdio-specific connector options. */
|
|
9
10
|
interface StdioConnectorOptions extends ConnectorInitOptions {
|
|
11
|
+
/** Client identity advertised to the server. */
|
|
10
12
|
clientInfo?: ClientInfo;
|
|
11
13
|
/**
|
|
12
14
|
* Protocol version negotiation mode. Defaults to `"legacy"` for stdio: the
|
|
@@ -17,6 +19,9 @@ interface StdioConnectorOptions extends ConnectorInitOptions {
|
|
|
17
19
|
*/
|
|
18
20
|
protocolNegotiation?: VersionNegotiationMode;
|
|
19
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Launches and connects to a local MCP server over standard input and output.
|
|
24
|
+
*/
|
|
20
25
|
export declare class StdioConnector extends BaseConnector {
|
|
21
26
|
private readonly command;
|
|
22
27
|
private readonly args;
|
|
@@ -25,6 +30,11 @@ export declare class StdioConnector extends BaseConnector {
|
|
|
25
30
|
private readonly errlog;
|
|
26
31
|
private readonly clientInfo;
|
|
27
32
|
private readonly protocolNegotiation;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a stdio connector.
|
|
35
|
+
*
|
|
36
|
+
* @param options - Process launch, client identity, and shared connector options.
|
|
37
|
+
*/
|
|
28
38
|
constructor({ command, args, env, errlog, ...rest }?: {
|
|
29
39
|
command?: string;
|
|
30
40
|
args?: string[];
|
|
@@ -32,14 +42,32 @@ export declare class StdioConnector extends BaseConnector {
|
|
|
32
42
|
errlog?: Writable;
|
|
33
43
|
cwd?: string;
|
|
34
44
|
} & StdioConnectorOptions);
|
|
35
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Starts the child process and establishes an MCP connection.
|
|
47
|
+
*
|
|
48
|
+
* @returns A promise that resolves after protocol negotiation completes.
|
|
49
|
+
*/
|
|
36
50
|
connect(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Returns fields identifying the launched command and arguments.
|
|
53
|
+
*
|
|
54
|
+
* @returns Stdio connector identity metadata.
|
|
55
|
+
*/
|
|
37
56
|
get publicIdentifier(): Record<string, string>;
|
|
38
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Owns the lifecycle of a stdio client transport.
|
|
60
|
+
*/
|
|
39
61
|
export declare class StdioConnectionManager extends ConnectionManager<StdioClientTransport> {
|
|
40
62
|
private readonly serverParams;
|
|
41
63
|
private readonly errlog;
|
|
42
64
|
private _transport;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a connection manager for a local server process.
|
|
67
|
+
*
|
|
68
|
+
* @param serverParams - Process parameters passed to the SDK transport.
|
|
69
|
+
* @param errlog - Destination for the child process's standard error stream.
|
|
70
|
+
*/
|
|
43
71
|
constructor(serverParams: StdioServerParameters, errlog?: Writable);
|
|
44
72
|
protected establishConnection(): Promise<StdioClientTransport>;
|
|
45
73
|
protected closeConnection(_connection: StdioClientTransport): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["../../src/transport/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAItD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,UAAU,qBAAsB,SAAQ,oBAAoB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|
10
10
|
export type ElicitContent = Record<string, string | number | boolean | string[]>;
|
|
11
11
|
/** Result of validate(params, content). */
|
|
12
12
|
export type ElicitValidationResult = {
|
|
13
|
+
/** Whether the submitted content satisfies the requested schema. */
|
|
13
14
|
valid: boolean;
|
|
15
|
+
/** Validation error messages when `valid` is `false`. */
|
|
14
16
|
errors?: string[];
|
|
15
17
|
};
|
|
16
18
|
type ElicitParams = ElicitRequestFormParams | ElicitRequestURLParams;
|
|
@@ -34,7 +36,7 @@ export declare function acceptWithDefaults(params: ElicitParams): ElicitResult;
|
|
|
34
36
|
export declare function accept(content: ElicitContent): ElicitResult;
|
|
35
37
|
/**
|
|
36
38
|
* Return an ElicitResult that declines the elicitation (user chose not to provide).
|
|
37
|
-
* Optional reason is for logging; the SDK result is { action: "decline" }
|
|
39
|
+
* Optional reason is for logging; the SDK result is `{ action: "decline" }`.
|
|
38
40
|
*/
|
|
39
41
|
export declare function decline(_reason?: string): ElicitResult;
|
|
40
42
|
/**
|
|
@@ -45,7 +47,7 @@ export declare function cancel(): ElicitResult;
|
|
|
45
47
|
* Validate content against the request's requestedSchema using Zod.
|
|
46
48
|
* Converts requestedSchema (JSON Schema) via `z.fromJSONSchema`, then
|
|
47
49
|
* safeParse(content). If conversion fails, returns
|
|
48
|
-
* { valid: false, errors: ["Unsupported or invalid schema"] }
|
|
50
|
+
* `{ valid: false, errors: ["Unsupported or invalid schema"] }`.
|
|
49
51
|
*/
|
|
50
52
|
export declare function validate(params: ElicitParams, content: ElicitContent): ElicitValidationResult;
|
|
51
53
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elicitation.d.ts","sourceRoot":"","sources":["../../src/utils/elicitation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACb,MAAM,8BAA8B,CAAC;AAGtC,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,M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CAAC;IACf,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,KAAK,YAAY,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;AAQrE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAoB/D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa,GACtB,aAAa,CAIf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAErE;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAE3D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAEtD;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,YAAY,CAErC;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,aAAa,GACrB,sBAAsB,CAiBxB"}
|
package/dist/utils/logging.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare class Logger {
|
|
|
27
27
|
static setDebug(enabled: boolean | 0 | 1 | 2): void;
|
|
28
28
|
static setFormat(format: LogFormat): void;
|
|
29
29
|
}
|
|
30
|
+
/** Default package logger used by client and connector operations. */
|
|
30
31
|
export declare const logger: SimpleConsoleLogger;
|
|
31
32
|
export {};
|
|
32
33
|
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/utils/logging.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,OAAO,GACP,OAAO,CAAC;AAEZ,KAAK,SAAS,GAAG,SA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GAAG,CAAC,IAAI,SAAY,GAAG,mBAAmB;IAQjD,MAAM,CAAC,SAAS,CAAC,EACf,KAAkB,EAClB,MAAkB,GACnB,GAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,CAAA;KAAO,GAAG,IAAI;IASvD,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;IAcnD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAG1C;AAED,sEAAsE;AACtE,eAAO,MAAM,MAAM,qBAAe,CAAC"}
|
package/dist/utils/version.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/** Installed `@mcp-use/client` package version. */
|
|
1
2
|
export declare const VERSION: string;
|
|
3
|
+
/**
|
|
4
|
+
* Returns the installed `@mcp-use/client` package version.
|
|
5
|
+
*
|
|
6
|
+
* @returns Package version string.
|
|
7
|
+
*/
|
|
2
8
|
export declare function getPackageVersion(): string;
|
|
3
9
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,QAA8B,CAAC;AAEnD,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAEA,mDAAmD;AACnD,eAAO,MAAM,OAAO,QAA8B,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-use/client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.17",
|
|
5
5
|
"description": "MCP client for connecting to Model Context Protocol servers — sessions, connectors, and OAuth. Part of the mcp-use v2 framework.",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"./react": {
|
|
40
40
|
"types": "./dist/react/index.d.ts",
|
|
41
41
|
"import": "./dist/react/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./sandbox": {
|
|
44
|
+
"types": "./dist/sandbox.d.ts",
|
|
45
|
+
"import": "./dist/sandbox.js"
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
48
|
"module": "./dist/index.js",
|
|
@@ -50,9 +54,9 @@
|
|
|
50
54
|
"node": ">=22.22.2"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
|
-
"@modelcontextprotocol/client": "2.0.0
|
|
54
|
-
"@modelcontextprotocol/core": "2.0.0
|
|
55
|
-
"@modelcontextprotocol/ext-apps": "npm:@mcp-use/ext-apps@1.7.4-pr720.
|
|
57
|
+
"@modelcontextprotocol/client": "2.0.0",
|
|
58
|
+
"@modelcontextprotocol/core": "2.0.0",
|
|
59
|
+
"@modelcontextprotocol/ext-apps": "npm:@mcp-use/ext-apps@1.7.4-pr720.1"
|
|
56
60
|
},
|
|
57
61
|
"peerDependencies": {
|
|
58
62
|
"@e2b/code-interpreter": "^2.6.1",
|