@mcp-use/cli 3.5.2-canary.8 → 3.5.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/README.md +1 -1
- package/dist/commands/client.d.ts.map +1 -1
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/index.cjs +83 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +83 -67
- package/dist/index.js.map +1 -1
- package/dist/utils/api.d.ts +2 -0
- package/dist/utils/api.d.ts.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -464,7 +464,7 @@ For deploying to Manufact cloud, see the environment variables in this section f
|
|
|
464
464
|
MCP_WEB_URL=https://mcp-use.com
|
|
465
465
|
|
|
466
466
|
# Backend API URL (where /api/v1 endpoints are)
|
|
467
|
-
MCP_API_URL=https://cloud.
|
|
467
|
+
MCP_API_URL=https://cloud.manufact.com
|
|
468
468
|
|
|
469
469
|
# Example: Local development
|
|
470
470
|
export MCP_WEB_URL=http://localhost:3000
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/commands/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqDpC;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,aAMtC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,aAQ5B,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/commands/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqDpC;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,aAMtC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,aAQ5B,CAAC;AA8iCH;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAyC7C;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CA2H5D"}
|
|
@@ -30,6 +30,8 @@ interface DeployOptions {
|
|
|
30
30
|
region?: "US" | "EU" | "APAC";
|
|
31
31
|
buildCommand?: string;
|
|
32
32
|
startCommand?: string;
|
|
33
|
+
/** Path to a non-default Dockerfile (relative to rootDir / repo root). */
|
|
34
|
+
dockerfile?: string;
|
|
33
35
|
/**
|
|
34
36
|
* Deploy branch. Defaults to the current git branch (managed flow: "main").
|
|
35
37
|
* Also scopes env-var sync to that branch's preview env.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EAGf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,SAAS,EACV,MAAM,iBAAiB,CAAC;AAgGzB;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,cAAc,EAAE,CAAA;CAAE,GAC1D,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAiC/C;AA0CD,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MA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AAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAynBD,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgyBzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/commands/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/commands/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwRpC,wBAAgB,gBAAgB,IAAI,OAAO,CAmE1C"}
|
package/dist/index.cjs
CHANGED
|
@@ -1156,7 +1156,7 @@ var import_node_os3 = __toESM(require("os"), 1);
|
|
|
1156
1156
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
1157
1157
|
var CONFIG_DIR = import_node_path2.default.join(import_node_os3.default.homedir(), ".mcp-use");
|
|
1158
1158
|
var CONFIG_FILE = import_node_path2.default.join(CONFIG_DIR, "config.json");
|
|
1159
|
-
var DEFAULT_API_URL = process.env.MCP_API_URL ? process.env.MCP_API_URL.replace(/\/api\/v1$/, "") + "/api/v1" : "https://cloud.
|
|
1159
|
+
var DEFAULT_API_URL = process.env.MCP_API_URL ? process.env.MCP_API_URL.replace(/\/api\/v1$/, "") + "/api/v1" : "https://cloud.manufact.com/api/v1";
|
|
1160
1160
|
var DEFAULT_WEB_URL = process.env.MCP_WEB_URL ? process.env.MCP_WEB_URL : "https://manufact.com";
|
|
1161
1161
|
async function ensureConfigDir() {
|
|
1162
1162
|
try {
|
|
@@ -4046,6 +4046,71 @@ async function describeToolCommand(name, toolName) {
|
|
|
4046
4046
|
}
|
|
4047
4047
|
await cleanupAndExit(0);
|
|
4048
4048
|
}
|
|
4049
|
+
async function processToolScreenshot(session, toolName, args, callResult, options) {
|
|
4050
|
+
const toolWithMeta = session.tools.find((t) => t.name === toolName);
|
|
4051
|
+
const resourceUri = detectToolResourceUri(toolWithMeta);
|
|
4052
|
+
const wantsScreenshot = options?.screenshot === true || options?.screenshotOutput !== void 0 || options?.screenshotDeviceScaleFactor !== void 0;
|
|
4053
|
+
let screenshot = null;
|
|
4054
|
+
let screenshotError = null;
|
|
4055
|
+
let widgetHintUri = null;
|
|
4056
|
+
if (resourceUri) {
|
|
4057
|
+
if (wantsScreenshot) {
|
|
4058
|
+
console.error(
|
|
4059
|
+
formatInfo(`Capturing widget screenshot (${resourceUri})...`)
|
|
4060
|
+
);
|
|
4061
|
+
try {
|
|
4062
|
+
const screenshotOpts = {};
|
|
4063
|
+
if (options?.screenshotOutput) {
|
|
4064
|
+
screenshotOpts.output = options.screenshotOutput;
|
|
4065
|
+
}
|
|
4066
|
+
if (options?.screenshotDeviceScaleFactor) {
|
|
4067
|
+
screenshotOpts.deviceScaleFactor = parseDeviceScaleFactor(
|
|
4068
|
+
options.screenshotDeviceScaleFactor
|
|
4069
|
+
);
|
|
4070
|
+
}
|
|
4071
|
+
const shot = await captureToolScreenshot(
|
|
4072
|
+
{
|
|
4073
|
+
session,
|
|
4074
|
+
toolName,
|
|
4075
|
+
toolArgs: args,
|
|
4076
|
+
toolOutput: callResult,
|
|
4077
|
+
resourceUri
|
|
4078
|
+
},
|
|
4079
|
+
screenshotOpts
|
|
4080
|
+
);
|
|
4081
|
+
screenshot = {
|
|
4082
|
+
path: shot.outputPath,
|
|
4083
|
+
width: shot.width,
|
|
4084
|
+
height: shot.height,
|
|
4085
|
+
view: shot.view
|
|
4086
|
+
};
|
|
4087
|
+
} catch (err) {
|
|
4088
|
+
screenshotError = err?.message ?? String(err);
|
|
4089
|
+
}
|
|
4090
|
+
} else {
|
|
4091
|
+
widgetHintUri = resourceUri;
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
if (screenshot) {
|
|
4095
|
+
console.error(
|
|
4096
|
+
formatSuccess(
|
|
4097
|
+
`Saved widget screenshot: ${screenshot.path} (${screenshot.width}\xD7${screenshot.height})`
|
|
4098
|
+
)
|
|
4099
|
+
);
|
|
4100
|
+
}
|
|
4101
|
+
if (screenshotError) {
|
|
4102
|
+
console.error(
|
|
4103
|
+
formatWarning(`Skipped widget screenshot: ${screenshotError}`)
|
|
4104
|
+
);
|
|
4105
|
+
}
|
|
4106
|
+
if (widgetHintUri) {
|
|
4107
|
+
console.error(
|
|
4108
|
+
formatInfo(
|
|
4109
|
+
`This tool renders a widget (${widgetHintUri}). Re-run with --screenshot to save a PNG of it.`
|
|
4110
|
+
)
|
|
4111
|
+
);
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4049
4114
|
async function callToolCommand(name, toolName, argsList, options) {
|
|
4050
4115
|
try {
|
|
4051
4116
|
const result = await getOrRestoreSession(name);
|
|
@@ -4095,74 +4160,12 @@ async function callToolCommand(name, toolName, argsList, options) {
|
|
|
4095
4160
|
const callResult = await session.callTool(toolName, args, {
|
|
4096
4161
|
timeout: options?.timeout
|
|
4097
4162
|
});
|
|
4098
|
-
|
|
4099
|
-
const resourceUri = detectToolResourceUri(toolWithMeta);
|
|
4100
|
-
const wantsScreenshot = options?.screenshot === true || options?.screenshotOutput !== void 0 || options?.screenshotDeviceScaleFactor !== void 0;
|
|
4101
|
-
let screenshot = null;
|
|
4102
|
-
let screenshotError = null;
|
|
4103
|
-
let widgetHintUri = null;
|
|
4104
|
-
if (resourceUri) {
|
|
4105
|
-
if (wantsScreenshot) {
|
|
4106
|
-
console.error(
|
|
4107
|
-
formatInfo(`Capturing widget screenshot (${resourceUri})...`)
|
|
4108
|
-
);
|
|
4109
|
-
try {
|
|
4110
|
-
const screenshotOpts = {};
|
|
4111
|
-
if (options?.screenshotOutput) {
|
|
4112
|
-
screenshotOpts.output = options.screenshotOutput;
|
|
4113
|
-
}
|
|
4114
|
-
if (options?.screenshotDeviceScaleFactor) {
|
|
4115
|
-
screenshotOpts.deviceScaleFactor = parseDeviceScaleFactor(
|
|
4116
|
-
options.screenshotDeviceScaleFactor
|
|
4117
|
-
);
|
|
4118
|
-
}
|
|
4119
|
-
const shot = await captureToolScreenshot(
|
|
4120
|
-
{
|
|
4121
|
-
session,
|
|
4122
|
-
toolName,
|
|
4123
|
-
toolArgs: args,
|
|
4124
|
-
toolOutput: callResult,
|
|
4125
|
-
resourceUri
|
|
4126
|
-
},
|
|
4127
|
-
screenshotOpts
|
|
4128
|
-
);
|
|
4129
|
-
screenshot = {
|
|
4130
|
-
path: shot.outputPath,
|
|
4131
|
-
width: shot.width,
|
|
4132
|
-
height: shot.height,
|
|
4133
|
-
view: shot.view
|
|
4134
|
-
};
|
|
4135
|
-
} catch (err) {
|
|
4136
|
-
screenshotError = err?.message ?? String(err);
|
|
4137
|
-
}
|
|
4138
|
-
} else {
|
|
4139
|
-
widgetHintUri = resourceUri;
|
|
4140
|
-
}
|
|
4141
|
-
}
|
|
4163
|
+
await processToolScreenshot(session, toolName, args, callResult, options);
|
|
4142
4164
|
if (options?.json) {
|
|
4143
4165
|
console.log(formatJson(callResult));
|
|
4144
4166
|
} else {
|
|
4145
4167
|
console.log(formatToolCall(callResult));
|
|
4146
4168
|
}
|
|
4147
|
-
if (screenshot) {
|
|
4148
|
-
console.error(
|
|
4149
|
-
formatSuccess(
|
|
4150
|
-
`Saved widget screenshot: ${screenshot.path} (${screenshot.width}\xD7${screenshot.height})`
|
|
4151
|
-
)
|
|
4152
|
-
);
|
|
4153
|
-
}
|
|
4154
|
-
if (screenshotError) {
|
|
4155
|
-
console.error(
|
|
4156
|
-
formatWarning(`Skipped widget screenshot: ${screenshotError}`)
|
|
4157
|
-
);
|
|
4158
|
-
}
|
|
4159
|
-
if (widgetHintUri) {
|
|
4160
|
-
console.error(
|
|
4161
|
-
formatInfo(
|
|
4162
|
-
`This tool renders a widget (${widgetHintUri}). Re-run with --screenshot to save a PNG of it.`
|
|
4163
|
-
)
|
|
4164
|
-
);
|
|
4165
|
-
}
|
|
4166
4169
|
if (callResult.isError) {
|
|
4167
4170
|
await cleanupAndExit(1);
|
|
4168
4171
|
}
|
|
@@ -4392,7 +4395,7 @@ async function interactiveCommand(name) {
|
|
|
4392
4395
|
console.log(source_default.gray(" tools list - List available tools"));
|
|
4393
4396
|
console.log(
|
|
4394
4397
|
source_default.gray(
|
|
4395
|
-
" tools call <name>
|
|
4398
|
+
" tools call <name> [--screenshot] - Call a tool (will prompt for args)"
|
|
4396
4399
|
)
|
|
4397
4400
|
);
|
|
4398
4401
|
console.log(source_default.gray(" tools describe <name> - Show tool details"));
|
|
@@ -4439,6 +4442,7 @@ async function interactiveCommand(name) {
|
|
|
4439
4442
|
)
|
|
4440
4443
|
);
|
|
4441
4444
|
} else if (command === "call" && arg) {
|
|
4445
|
+
const wantsScreenshot = parts.includes("--screenshot");
|
|
4442
4446
|
rl.question(
|
|
4443
4447
|
"Arguments (JSON, or press Enter for none): ",
|
|
4444
4448
|
async (argsInput) => {
|
|
@@ -4446,6 +4450,9 @@ async function interactiveCommand(name) {
|
|
|
4446
4450
|
const args = argsInput.trim() ? JSON.parse(argsInput) : {};
|
|
4447
4451
|
const result2 = await session.callTool(arg, args);
|
|
4448
4452
|
console.log(formatToolCall(result2));
|
|
4453
|
+
await processToolScreenshot(session, arg, args, result2, {
|
|
4454
|
+
screenshot: wantsScreenshot
|
|
4455
|
+
});
|
|
4449
4456
|
} catch (error) {
|
|
4450
4457
|
console.error(formatError(error.message));
|
|
4451
4458
|
}
|
|
@@ -5978,6 +5985,10 @@ async function deployCommand(options) {
|
|
|
5978
5985
|
console.log(source_default.gray(` Port: `) + source_default.cyan(port));
|
|
5979
5986
|
if (options.region)
|
|
5980
5987
|
console.log(source_default.gray(` Region: `) + source_default.cyan(options.region));
|
|
5988
|
+
if (options.dockerfile)
|
|
5989
|
+
console.log(
|
|
5990
|
+
source_default.gray(` Dockerfile: `) + source_default.cyan(options.dockerfile)
|
|
5991
|
+
);
|
|
5981
5992
|
if (options.buildCommand)
|
|
5982
5993
|
console.log(
|
|
5983
5994
|
source_default.gray(` Build command: `) + source_default.cyan(options.buildCommand)
|
|
@@ -6146,7 +6157,8 @@ async function deployCommand(options) {
|
|
|
6146
6157
|
env: Object.keys(envVars).length > 0 ? envVars : void 0,
|
|
6147
6158
|
region: options.region,
|
|
6148
6159
|
buildCommand: options.buildCommand,
|
|
6149
|
-
startCommand: options.startCommand
|
|
6160
|
+
startCommand: options.startCommand,
|
|
6161
|
+
dockerfilePath: options.dockerfile
|
|
6150
6162
|
});
|
|
6151
6163
|
deploymentId = serverResult.deploymentId ?? "";
|
|
6152
6164
|
if (!deploymentId) {
|
|
@@ -6829,7 +6841,7 @@ async function addEnvCommand(assignment, options) {
|
|
|
6829
6841
|
async function updateEnvCommand(keyOrId, options) {
|
|
6830
6842
|
try {
|
|
6831
6843
|
await requireLogin();
|
|
6832
|
-
if (
|
|
6844
|
+
if (options.value === void 0 && !options.env && options.sensitive === void 0) {
|
|
6833
6845
|
console.error(
|
|
6834
6846
|
source_default.red(
|
|
6835
6847
|
"\u2717 Nothing to update. Provide at least one of --value, --env, --sensitive."
|
|
@@ -9890,6 +9902,9 @@ program.command("deploy").description("Deploy MCP server from GitHub to Manufact
|
|
|
9890
9902
|
).option(
|
|
9891
9903
|
"--start-command <cmd>",
|
|
9892
9904
|
"Custom start command (overrides auto-detection)"
|
|
9905
|
+
).option(
|
|
9906
|
+
"--dockerfile <path>",
|
|
9907
|
+
"Path to a non-default Dockerfile (relative to rootDir / repo root)"
|
|
9893
9908
|
).option(
|
|
9894
9909
|
"--no-github",
|
|
9895
9910
|
"Upload local source without connecting GitHub (repo hosted in the platform-managed org)"
|
|
@@ -9909,6 +9924,7 @@ program.command("deploy").description("Deploy MCP server from GitHub to Manufact
|
|
|
9909
9924
|
region: options.region,
|
|
9910
9925
|
buildCommand: options.buildCommand,
|
|
9911
9926
|
startCommand: options.startCommand,
|
|
9927
|
+
dockerfile: options.dockerfile,
|
|
9912
9928
|
noGithub: options.github === false
|
|
9913
9929
|
});
|
|
9914
9930
|
});
|