mcp-use 1.11.0-canary.15 → 1.11.0-canary.16
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/{chunk-HWBQAAP5.js → chunk-2FOTPDUJ.js} +1 -1
- package/dist/{chunk-C5MVPCV2.js → chunk-6AB7U4KA.js} +2 -2
- package/dist/{chunk-HK4BXTYV.js → chunk-76F72Y73.js} +1 -1
- package/dist/{chunk-NEIO2CWV.js → chunk-FMK46JYP.js} +2 -2
- package/dist/{chunk-COZWUWRK.js → chunk-GVHS2DDJ.js} +2 -2
- package/dist/{chunk-XTPTD37Z.js → chunk-J56ACHX4.js} +2 -2
- package/dist/{chunk-4A6AEYDD.js → chunk-MGYJYTTX.js} +1 -1
- package/dist/{chunk-HUOCLQT4.js → chunk-RU7FIJVM.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -13
- package/dist/src/agents/index.cjs +1 -1
- package/dist/src/agents/index.js +5 -5
- package/dist/src/browser.cjs +1 -1
- package/dist/src/browser.js +10 -10
- package/dist/src/client.cjs +1 -1
- package/dist/src/client.js +3 -3
- package/dist/src/react/index.cjs +1 -1
- package/dist/src/react/index.js +5 -5
- package/dist/src/server/index.cjs +76 -68
- package/dist/src/server/index.js +80 -72
- package/dist/src/server/widgets/ui-resource-registration.d.ts.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/{tool-execution-helpers-UZAPEVA6.js → tool-execution-helpers-7ZZVUHAM.js} +2 -2
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseMCPClient,
|
|
3
3
|
HttpConnector
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MGYJYTTX.js";
|
|
5
5
|
import {
|
|
6
6
|
Tel,
|
|
7
7
|
getPackageVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2FOTPDUJ.js";
|
|
9
9
|
import {
|
|
10
10
|
logger
|
|
11
11
|
} from "./chunk-FRUZDWXH.js";
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
ConnectionManager,
|
|
5
5
|
HttpConnector,
|
|
6
6
|
MCPSession
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MGYJYTTX.js";
|
|
8
8
|
import {
|
|
9
9
|
Tel,
|
|
10
10
|
getPackageVersion
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2FOTPDUJ.js";
|
|
12
12
|
import {
|
|
13
13
|
logger
|
|
14
14
|
} from "./chunk-FRUZDWXH.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCPClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FMK46JYP.js";
|
|
4
4
|
import {
|
|
5
5
|
LangChainAdapter
|
|
6
6
|
} from "./chunk-MFSO5PUW.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Telemetry,
|
|
9
9
|
extractModelInfo,
|
|
10
10
|
getPackageVersion
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2FOTPDUJ.js";
|
|
12
12
|
import {
|
|
13
13
|
logger
|
|
14
14
|
} from "./chunk-FRUZDWXH.js";
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -8,10 +8,9 @@ import {
|
|
|
8
8
|
streamEventsToAISDK,
|
|
9
9
|
streamEventsToAISDKWithTools
|
|
10
10
|
} from "./chunk-LGDFGYRL.js";
|
|
11
|
-
import "./chunk-GXNAXUDI.js";
|
|
12
11
|
import {
|
|
13
12
|
PROMPTS
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-76F72Y73.js";
|
|
15
14
|
import {
|
|
16
15
|
AcquireActiveMCPServerTool,
|
|
17
16
|
AddMCPServerFromConfigTool,
|
|
@@ -26,7 +25,7 @@ import {
|
|
|
26
25
|
getSupportedProviders,
|
|
27
26
|
isValidLLMString,
|
|
28
27
|
parseLLMString
|
|
29
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GVHS2DDJ.js";
|
|
30
29
|
import "./chunk-JRGQRPTN.js";
|
|
31
30
|
import {
|
|
32
31
|
BaseCodeExecutor,
|
|
@@ -36,11 +35,12 @@ import {
|
|
|
36
35
|
VMCodeExecutor,
|
|
37
36
|
isVMAvailable,
|
|
38
37
|
loadConfigFile
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-FMK46JYP.js";
|
|
39
|
+
import "./chunk-JQKKMUCT.js";
|
|
40
|
+
import "./chunk-GXNAXUDI.js";
|
|
40
41
|
import {
|
|
41
42
|
BaseAdapter
|
|
42
43
|
} from "./chunk-MFSO5PUW.js";
|
|
43
|
-
import "./chunk-JQKKMUCT.js";
|
|
44
44
|
import {
|
|
45
45
|
ErrorBoundary,
|
|
46
46
|
Image,
|
|
@@ -52,28 +52,28 @@ import {
|
|
|
52
52
|
useWidgetProps,
|
|
53
53
|
useWidgetState,
|
|
54
54
|
useWidgetTheme
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-J56ACHX4.js";
|
|
56
|
+
import "./chunk-6AB7U4KA.js";
|
|
57
57
|
import {
|
|
58
58
|
BaseConnector,
|
|
59
59
|
HttpConnector,
|
|
60
60
|
MCPSession
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-MGYJYTTX.js";
|
|
62
62
|
import {
|
|
63
63
|
Tel,
|
|
64
64
|
Telemetry,
|
|
65
65
|
VERSION,
|
|
66
66
|
getPackageVersion,
|
|
67
67
|
setTelemetrySource
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import {
|
|
70
|
-
Logger,
|
|
71
|
-
logger
|
|
72
|
-
} from "./chunk-FRUZDWXH.js";
|
|
68
|
+
} from "./chunk-2FOTPDUJ.js";
|
|
73
69
|
import {
|
|
74
70
|
BrowserOAuthClientProvider,
|
|
75
71
|
onMcpAuthorization
|
|
76
72
|
} from "./chunk-J75I2C26.js";
|
|
73
|
+
import {
|
|
74
|
+
Logger,
|
|
75
|
+
logger
|
|
76
|
+
} from "./chunk-FRUZDWXH.js";
|
|
77
77
|
import {
|
|
78
78
|
__name
|
|
79
79
|
} from "./chunk-3GQAWCBQ.js";
|
package/dist/src/agents/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseAgent,
|
|
3
3
|
PROMPTS
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-76F72Y73.js";
|
|
5
5
|
import {
|
|
6
6
|
MCPAgent,
|
|
7
7
|
RemoteAgent
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-GVHS2DDJ.js";
|
|
9
9
|
import "../../chunk-JRGQRPTN.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-FMK46JYP.js";
|
|
11
11
|
import "../../chunk-MFSO5PUW.js";
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-MGYJYTTX.js";
|
|
13
|
+
import "../../chunk-2FOTPDUJ.js";
|
|
14
14
|
import "../../chunk-FRUZDWXH.js";
|
|
15
15
|
import "../../chunk-3GQAWCBQ.js";
|
|
16
16
|
export {
|
package/dist/src/browser.cjs
CHANGED
package/dist/src/browser.js
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
streamEventsToAISDK,
|
|
4
4
|
streamEventsToAISDKWithTools
|
|
5
5
|
} from "../chunk-LGDFGYRL.js";
|
|
6
|
-
import "../chunk-GXNAXUDI.js";
|
|
7
6
|
import {
|
|
8
7
|
MCPAgent,
|
|
9
8
|
ObservabilityManager,
|
|
@@ -12,35 +11,36 @@ import {
|
|
|
12
11
|
getSupportedProviders,
|
|
13
12
|
isValidLLMString,
|
|
14
13
|
parseLLMString
|
|
15
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-GVHS2DDJ.js";
|
|
16
15
|
import "../chunk-JRGQRPTN.js";
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-FMK46JYP.js";
|
|
17
|
+
import "../chunk-GXNAXUDI.js";
|
|
18
18
|
import {
|
|
19
19
|
BaseAdapter
|
|
20
20
|
} from "../chunk-MFSO5PUW.js";
|
|
21
21
|
import {
|
|
22
22
|
BrowserMCPClient
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-6AB7U4KA.js";
|
|
24
24
|
import {
|
|
25
25
|
BaseConnector,
|
|
26
26
|
HttpConnector,
|
|
27
27
|
MCPSession
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-MGYJYTTX.js";
|
|
29
29
|
import {
|
|
30
30
|
Tel,
|
|
31
31
|
Telemetry,
|
|
32
32
|
VERSION,
|
|
33
33
|
getPackageVersion,
|
|
34
34
|
setTelemetrySource
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import {
|
|
37
|
-
Logger,
|
|
38
|
-
logger
|
|
39
|
-
} from "../chunk-FRUZDWXH.js";
|
|
35
|
+
} from "../chunk-2FOTPDUJ.js";
|
|
40
36
|
import {
|
|
41
37
|
BrowserOAuthClientProvider,
|
|
42
38
|
onMcpAuthorization
|
|
43
39
|
} from "../chunk-J75I2C26.js";
|
|
40
|
+
import {
|
|
41
|
+
Logger,
|
|
42
|
+
logger
|
|
43
|
+
} from "../chunk-FRUZDWXH.js";
|
|
44
44
|
import "../chunk-3GQAWCBQ.js";
|
|
45
45
|
export {
|
|
46
46
|
BaseAdapter,
|
package/dist/src/client.cjs
CHANGED
package/dist/src/client.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
MCPClient,
|
|
5
5
|
VMCodeExecutor,
|
|
6
6
|
isVMAvailable
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FMK46JYP.js";
|
|
8
8
|
import {
|
|
9
9
|
MCPSession
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-MGYJYTTX.js";
|
|
11
|
+
import "../chunk-2FOTPDUJ.js";
|
|
12
12
|
import "../chunk-FRUZDWXH.js";
|
|
13
13
|
import "../chunk-3GQAWCBQ.js";
|
|
14
14
|
export {
|
package/dist/src/react/index.cjs
CHANGED
package/dist/src/react/index.js
CHANGED
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
useWidgetProps,
|
|
10
10
|
useWidgetState,
|
|
11
11
|
useWidgetTheme
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-J56ACHX4.js";
|
|
13
|
+
import "../../chunk-6AB7U4KA.js";
|
|
14
|
+
import "../../chunk-MGYJYTTX.js";
|
|
15
15
|
import {
|
|
16
16
|
Tel,
|
|
17
17
|
Telemetry,
|
|
18
18
|
setTelemetrySource
|
|
19
|
-
} from "../../chunk-
|
|
20
|
-
import "../../chunk-FRUZDWXH.js";
|
|
19
|
+
} from "../../chunk-2FOTPDUJ.js";
|
|
21
20
|
import {
|
|
22
21
|
onMcpAuthorization
|
|
23
22
|
} from "../../chunk-J75I2C26.js";
|
|
23
|
+
import "../../chunk-FRUZDWXH.js";
|
|
24
24
|
import "../../chunk-3GQAWCBQ.js";
|
|
25
25
|
export {
|
|
26
26
|
Tel as BrowserTelemetry,
|
|
@@ -761,7 +761,7 @@ var VERSION;
|
|
|
761
761
|
var init_version = __esm({
|
|
762
762
|
"src/version.ts"() {
|
|
763
763
|
"use strict";
|
|
764
|
-
VERSION = "1.11.0-canary.
|
|
764
|
+
VERSION = "1.11.0-canary.16";
|
|
765
765
|
__name(getPackageVersion, "getPackageVersion");
|
|
766
766
|
}
|
|
767
767
|
});
|
|
@@ -2221,7 +2221,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2221
2221
|
// src/server/mcp-server.ts
|
|
2222
2222
|
var import_mcp2 = require("@mcp-use/modelcontextprotocol-sdk/server/mcp.js");
|
|
2223
2223
|
var import_types2 = require("@mcp-use/modelcontextprotocol-sdk/types.js");
|
|
2224
|
-
var
|
|
2224
|
+
var import_zod3 = require("zod");
|
|
2225
2225
|
init_telemetry2();
|
|
2226
2226
|
init_version();
|
|
2227
2227
|
|
|
@@ -3900,6 +3900,7 @@ function setupWidgetRoutes(app, serverConfig) {
|
|
|
3900
3900
|
__name(setupWidgetRoutes, "setupWidgetRoutes");
|
|
3901
3901
|
|
|
3902
3902
|
// src/server/widgets/ui-resource-registration.ts
|
|
3903
|
+
var import_zod = __toESM(require("zod"), 1);
|
|
3903
3904
|
function uiResourceRegistration(server, definition) {
|
|
3904
3905
|
const displayName = definition.title || definition.name;
|
|
3905
3906
|
if (definition.type === "appsSdk" && definition._meta) {
|
|
@@ -4005,69 +4006,76 @@ function uiResourceRegistration(server, definition) {
|
|
|
4005
4006
|
}
|
|
4006
4007
|
}
|
|
4007
4008
|
}
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4009
|
+
const widgetMetadata2 = definition._meta?.["mcp-use/widget"];
|
|
4010
|
+
const propsOrSchema = definition.props || widgetMetadata2?.props || widgetMetadata2?.inputs || widgetMetadata2?.schema;
|
|
4011
|
+
const isZodSchema = propsOrSchema && typeof propsOrSchema === "object" && propsOrSchema instanceof import_zod.default.ZodObject;
|
|
4012
|
+
const toolDefinition = {
|
|
4013
|
+
name: definition.name,
|
|
4014
|
+
title: definition.title,
|
|
4015
|
+
description: definition.description,
|
|
4016
|
+
annotations: definition.toolAnnotations,
|
|
4017
|
+
_meta: Object.keys(toolMetadata).length > 0 ? toolMetadata : void 0
|
|
4018
|
+
};
|
|
4019
|
+
if (isZodSchema) {
|
|
4020
|
+
toolDefinition.schema = propsOrSchema;
|
|
4021
|
+
} else if (propsOrSchema) {
|
|
4022
|
+
toolDefinition.inputs = convertPropsToInputs(
|
|
4023
|
+
propsOrSchema
|
|
4024
|
+
);
|
|
4025
|
+
}
|
|
4026
|
+
server.tool(toolDefinition, async (params) => {
|
|
4027
|
+
const uiResource = await createWidgetUIResource(
|
|
4028
|
+
definition,
|
|
4029
|
+
params,
|
|
4030
|
+
serverConfig
|
|
4031
|
+
);
|
|
4032
|
+
if (definition.type === "appsSdk") {
|
|
4033
|
+
const randomId = Math.random().toString(36).substring(2, 15);
|
|
4034
|
+
const uniqueUri = generateWidgetUri(
|
|
4035
|
+
definition.name,
|
|
4036
|
+
server.buildId,
|
|
4037
|
+
".html",
|
|
4038
|
+
randomId
|
|
4022
4039
|
);
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
} else {
|
|
4041
|
-
toolOutputResult = {
|
|
4042
|
-
content: [
|
|
4043
|
-
{
|
|
4044
|
-
type: "text",
|
|
4045
|
-
text: `Displaying ${displayName}`
|
|
4046
|
-
}
|
|
4047
|
-
]
|
|
4048
|
-
};
|
|
4049
|
-
}
|
|
4050
|
-
const content = toolOutputResult.content || [
|
|
4051
|
-
{ type: "text", text: `Displaying ${displayName}` }
|
|
4052
|
-
];
|
|
4053
|
-
return {
|
|
4054
|
-
_meta: uniqueToolMetadata,
|
|
4055
|
-
content,
|
|
4056
|
-
structuredContent: toolOutputResult.structuredContent
|
|
4040
|
+
const uniqueToolMetadata = {
|
|
4041
|
+
...toolMetadata,
|
|
4042
|
+
"openai/outputTemplate": uniqueUri,
|
|
4043
|
+
"mcp-use/props": params
|
|
4044
|
+
// Pass params as widget props
|
|
4045
|
+
};
|
|
4046
|
+
let toolOutputResult;
|
|
4047
|
+
if (definition.toolOutput) {
|
|
4048
|
+
toolOutputResult = typeof definition.toolOutput === "function" ? definition.toolOutput(params) : definition.toolOutput;
|
|
4049
|
+
} else {
|
|
4050
|
+
toolOutputResult = {
|
|
4051
|
+
content: [
|
|
4052
|
+
{
|
|
4053
|
+
type: "text",
|
|
4054
|
+
text: `Displaying ${displayName}`
|
|
4055
|
+
}
|
|
4056
|
+
]
|
|
4057
4057
|
};
|
|
4058
4058
|
}
|
|
4059
|
+
const content = toolOutputResult.content || [
|
|
4060
|
+
{ type: "text", text: `Displaying ${displayName}` }
|
|
4061
|
+
];
|
|
4059
4062
|
return {
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
text: `Displaying ${displayName}`,
|
|
4064
|
-
description: `Show MCP-UI widget for ${displayName}`
|
|
4065
|
-
},
|
|
4066
|
-
uiResource
|
|
4067
|
-
]
|
|
4063
|
+
_meta: uniqueToolMetadata,
|
|
4064
|
+
content,
|
|
4065
|
+
structuredContent: toolOutputResult.structuredContent
|
|
4068
4066
|
};
|
|
4069
4067
|
}
|
|
4070
|
-
|
|
4068
|
+
return {
|
|
4069
|
+
content: [
|
|
4070
|
+
{
|
|
4071
|
+
type: "text",
|
|
4072
|
+
text: `Displaying ${displayName}`,
|
|
4073
|
+
description: `Show MCP-UI widget for ${displayName}`
|
|
4074
|
+
},
|
|
4075
|
+
uiResource
|
|
4076
|
+
]
|
|
4077
|
+
};
|
|
4078
|
+
});
|
|
4071
4079
|
}
|
|
4072
4080
|
return server;
|
|
4073
4081
|
}
|
|
@@ -4129,9 +4137,9 @@ async function mountInspectorUI(app, serverHost, serverPort, isProduction) {
|
|
|
4129
4137
|
__name(mountInspectorUI, "mountInspectorUI");
|
|
4130
4138
|
|
|
4131
4139
|
// src/server/tools/schema-helpers.ts
|
|
4132
|
-
var
|
|
4140
|
+
var import_zod2 = require("zod");
|
|
4133
4141
|
function convertZodSchemaToParams(zodSchema) {
|
|
4134
|
-
if (!(zodSchema instanceof
|
|
4142
|
+
if (!(zodSchema instanceof import_zod2.z.ZodObject)) {
|
|
4135
4143
|
throw new Error("schema must be a Zod object schema (z.object({...}))");
|
|
4136
4144
|
}
|
|
4137
4145
|
const shape = zodSchema.shape;
|
|
@@ -4148,22 +4156,22 @@ function createParamsSchema(inputs) {
|
|
|
4148
4156
|
let zodType;
|
|
4149
4157
|
switch (input.type) {
|
|
4150
4158
|
case "string":
|
|
4151
|
-
zodType =
|
|
4159
|
+
zodType = import_zod2.z.string();
|
|
4152
4160
|
break;
|
|
4153
4161
|
case "number":
|
|
4154
|
-
zodType =
|
|
4162
|
+
zodType = import_zod2.z.number();
|
|
4155
4163
|
break;
|
|
4156
4164
|
case "boolean":
|
|
4157
|
-
zodType =
|
|
4165
|
+
zodType = import_zod2.z.boolean();
|
|
4158
4166
|
break;
|
|
4159
4167
|
case "object":
|
|
4160
|
-
zodType =
|
|
4168
|
+
zodType = import_zod2.z.object({});
|
|
4161
4169
|
break;
|
|
4162
4170
|
case "array":
|
|
4163
|
-
zodType =
|
|
4171
|
+
zodType = import_zod2.z.array(import_zod2.z.any());
|
|
4164
4172
|
break;
|
|
4165
4173
|
default:
|
|
4166
|
-
zodType =
|
|
4174
|
+
zodType = import_zod2.z.any();
|
|
4167
4175
|
}
|
|
4168
4176
|
if (input.description) {
|
|
4169
4177
|
zodType = zodType.describe(input.description);
|
|
@@ -6663,7 +6671,7 @@ var MCPServerClass = class {
|
|
|
6663
6671
|
);
|
|
6664
6672
|
}
|
|
6665
6673
|
newServer.server.setRequestHandler(
|
|
6666
|
-
|
|
6674
|
+
import_zod3.z.object({ method: import_zod3.z.literal("logging/setLevel") }).passthrough(),
|
|
6667
6675
|
(async (request, extra) => {
|
|
6668
6676
|
const level = request.params?.level;
|
|
6669
6677
|
if (!level) {
|