mcp-use 1.2.4 → 1.2.5-canary.2

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/index.cjs CHANGED
@@ -6023,41 +6023,3 @@ function useWidgetState(defaultState) {
6023
6023
  return [state, setState];
6024
6024
  }
6025
6025
  __name(useWidgetState, "useWidgetState");
6026
- // Annotate the CommonJS export names for ESM import in node:
6027
- 0 && (module.exports = {
6028
- AcquireActiveMCPServerTool,
6029
- AddMCPServerFromConfigTool,
6030
- BaseAdapter,
6031
- BaseConnector,
6032
- BrowserOAuthClientProvider,
6033
- ConnectMCPServerTool,
6034
- HttpConnector,
6035
- LINEAR_OAUTH_CONFIG,
6036
- LangChainAdapter,
6037
- ListMCPServersTool,
6038
- Logger,
6039
- MCPAgent,
6040
- MCPClient,
6041
- MCPSession,
6042
- OAuthHelper,
6043
- ObservabilityManager,
6044
- ReleaseMCPServerConnectionTool,
6045
- RemoteAgent,
6046
- ServerManager,
6047
- StdioConnector,
6048
- Telemetry,
6049
- WebSocketConnector,
6050
- createOAuthMCPConfig,
6051
- createReadableStreamFromGenerator,
6052
- loadConfigFile,
6053
- logger,
6054
- onMcpAuthorization,
6055
- setTelemetrySource,
6056
- streamEventsToAISDK,
6057
- streamEventsToAISDKWithTools,
6058
- useMcp,
6059
- useWidget,
6060
- useWidgetProps,
6061
- useWidgetState,
6062
- useWidgetTheme
6063
- });
package/dist/index.js CHANGED
@@ -3,6 +3,21 @@ import {
3
3
  streamEventsToAISDK,
4
4
  streamEventsToAISDKWithTools
5
5
  } from "./chunk-EW4MJSHA.js";
6
+ import {
7
+ AcquireActiveMCPServerTool,
8
+ AddMCPServerFromConfigTool,
9
+ BaseAdapter,
10
+ ConnectMCPServerTool,
11
+ LangChainAdapter,
12
+ ListMCPServersTool,
13
+ MCPAgent,
14
+ ObservabilityManager,
15
+ ReleaseMCPServerConnectionTool,
16
+ RemoteAgent,
17
+ ServerManager,
18
+ Telemetry,
19
+ setTelemetrySource
20
+ } from "./chunk-73SH52J2.js";
6
21
  import {
7
22
  useMcp,
8
23
  useWidget,
@@ -20,21 +35,6 @@ import {
20
35
  WebSocketConnector,
21
36
  onMcpAuthorization
22
37
  } from "./chunk-37MPZ3D6.js";
23
- import {
24
- AcquireActiveMCPServerTool,
25
- AddMCPServerFromConfigTool,
26
- BaseAdapter,
27
- ConnectMCPServerTool,
28
- LangChainAdapter,
29
- ListMCPServersTool,
30
- MCPAgent,
31
- ObservabilityManager,
32
- ReleaseMCPServerConnectionTool,
33
- RemoteAgent,
34
- ServerManager,
35
- Telemetry,
36
- setTelemetrySource
37
- } from "./chunk-73SH52J2.js";
38
38
  import "./chunk-YURRUCIM.js";
39
39
  import {
40
40
  Logger,
@@ -3181,9 +3181,3 @@ ${formatPrompt}`
3181
3181
  }
3182
3182
  }
3183
3183
  };
3184
- // Annotate the CommonJS export names for ESM import in node:
3185
- 0 && (module.exports = {
3186
- BaseAgent,
3187
- MCPAgent,
3188
- RemoteAgent
3189
- });
@@ -4642,23 +4642,3 @@ async function* streamEventsToAISDKWithTools(streamEvents) {
4642
4642
  }
4643
4643
  }
4644
4644
  __name(streamEventsToAISDKWithTools, "streamEventsToAISDKWithTools");
4645
- // Annotate the CommonJS export names for ESM import in node:
4646
- 0 && (module.exports = {
4647
- BaseAdapter,
4648
- BaseConnector,
4649
- BrowserOAuthClientProvider,
4650
- HttpConnector,
4651
- LangChainAdapter,
4652
- Logger,
4653
- MCPAgent,
4654
- MCPClient,
4655
- MCPSession,
4656
- ObservabilityManager,
4657
- RemoteAgent,
4658
- WebSocketConnector,
4659
- createReadableStreamFromGenerator,
4660
- logger,
4661
- onMcpAuthorization,
4662
- streamEventsToAISDK,
4663
- streamEventsToAISDKWithTools
4664
- });
@@ -3,6 +3,13 @@ import {
3
3
  streamEventsToAISDK,
4
4
  streamEventsToAISDKWithTools
5
5
  } from "../chunk-EW4MJSHA.js";
6
+ import {
7
+ BaseAdapter,
8
+ LangChainAdapter,
9
+ MCPAgent,
10
+ ObservabilityManager,
11
+ RemoteAgent
12
+ } from "../chunk-73SH52J2.js";
6
13
  import {
7
14
  BaseConnector,
8
15
  BrowserMCPClient,
@@ -12,13 +19,6 @@ import {
12
19
  WebSocketConnector,
13
20
  onMcpAuthorization
14
21
  } from "../chunk-37MPZ3D6.js";
15
- import {
16
- BaseAdapter,
17
- LangChainAdapter,
18
- MCPAgent,
19
- ObservabilityManager,
20
- RemoteAgent
21
- } from "../chunk-73SH52J2.js";
22
22
  import "../chunk-YURRUCIM.js";
23
23
  import {
24
24
  Logger,
@@ -2441,12 +2441,3 @@ function useWidgetState(defaultState) {
2441
2441
  return [state, setState];
2442
2442
  }
2443
2443
  __name(useWidgetState, "useWidgetState");
2444
- // Annotate the CommonJS export names for ESM import in node:
2445
- 0 && (module.exports = {
2446
- onMcpAuthorization,
2447
- useMcp,
2448
- useWidget,
2449
- useWidgetProps,
2450
- useWidgetState,
2451
- useWidgetTheme
2452
- });
@@ -0,0 +1,31 @@
1
+ import type { MiddlewareHandler } from "hono";
2
+ /**
3
+ * Detects if a middleware is Express/Connect style or Hono style
4
+ *
5
+ * Express/Connect middleware: (req, res, next) => void or (err, req, res, next) => void
6
+ * Hono middleware: (c, next) => Promise<Response | void> or (c, next) => Response | void
7
+ *
8
+ * @param middleware - The middleware function to check
9
+ * @returns true if it's Express/Connect middleware, false if it's Hono middleware
10
+ */
11
+ export declare function isExpressMiddleware(middleware: any): boolean;
12
+ /**
13
+ * Automatically adapts middleware to work with Hono
14
+ * Detects if the middleware is Express/Connect style and adapts it accordingly
15
+ * If it's already Hono-compatible middleware, returns it as-is
16
+ *
17
+ * @param middleware - The middleware function (Express/Connect or Hono)
18
+ * @param middlewarePath - The path pattern the middleware is mounted at (optional, only used for Express/Connect middleware)
19
+ * @returns A Hono middleware function
20
+ */
21
+ export declare function adaptMiddleware(middleware: any, middlewarePath?: string): Promise<MiddlewareHandler>;
22
+ /**
23
+ * Adapts Connect/Express middleware to work with Hono
24
+ * Based on @hono/connect approach using node-mocks-http
25
+ *
26
+ * @param connectMiddleware - The Connect middleware handler
27
+ * @param middlewarePath - The path pattern the middleware is mounted at (e.g., "/mcp-use/widgets/*")
28
+ * @returns A Hono middleware function
29
+ */
30
+ export declare function adaptConnectMiddleware(connectMiddleware: any, middlewarePath: string): Promise<MiddlewareHandler>;
31
+ //# sourceMappingURL=connect-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-adapter.d.ts","sourceRoot":"","sources":["../../../src/server/connect-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,iBAAiB,EAAQ,MAAM,MAAM,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CA0C5D;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,GAAG,EACf,cAAc,GAAE,MAAY,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAQ5B;AAED;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,iBAAiB,EAAE,GAAG,EACtB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,iBAAiB,CAAC,CAqJ5B"}