@mcp-use/cli 2.21.0-canary.4 → 2.21.0
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/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/index.cjs +113 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +113 -39
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AA6KA,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,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AA6KA,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,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAmqBD;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAghBzE"}
|
package/dist/index.cjs
CHANGED
|
@@ -3412,7 +3412,7 @@ function getMcpServerUrl(deployment) {
|
|
|
3412
3412
|
return `https://${deployment.domain}/mcp`;
|
|
3413
3413
|
}
|
|
3414
3414
|
}
|
|
3415
|
-
async function displayDeploymentProgress(api, deployment) {
|
|
3415
|
+
async function displayDeploymentProgress(api, deployment, progressOptions) {
|
|
3416
3416
|
const frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
3417
3417
|
let frameIndex = 0;
|
|
3418
3418
|
let spinnerInterval = null;
|
|
@@ -3534,11 +3534,20 @@ async function displayDeploymentProgress(api, deployment) {
|
|
|
3534
3534
|
console.log(source_default.red("Error: ") + finalDeployment.error);
|
|
3535
3535
|
if (finalDeployment.error.includes("No GitHub installations found")) {
|
|
3536
3536
|
console.log();
|
|
3537
|
-
const retry = await promptGitHubInstallation(
|
|
3537
|
+
const retry = await promptGitHubInstallation(
|
|
3538
|
+
api,
|
|
3539
|
+
"not_connected",
|
|
3540
|
+
void 0,
|
|
3541
|
+
{ yes: progressOptions?.yes }
|
|
3542
|
+
);
|
|
3538
3543
|
if (retry) {
|
|
3539
3544
|
console.log(source_default.cyan("\n\u{1F504} Retrying deployment...\n"));
|
|
3540
3545
|
const newDeployment = await api.redeployDeployment(deployment.id);
|
|
3541
|
-
await displayDeploymentProgress(
|
|
3546
|
+
await displayDeploymentProgress(
|
|
3547
|
+
api,
|
|
3548
|
+
newDeployment,
|
|
3549
|
+
progressOptions
|
|
3550
|
+
);
|
|
3542
3551
|
return;
|
|
3543
3552
|
}
|
|
3544
3553
|
} else if (finalDeployment.error.includes("Authenticated git clone failed")) {
|
|
@@ -3555,12 +3564,17 @@ async function displayDeploymentProgress(api, deployment) {
|
|
|
3555
3564
|
const retry = await promptGitHubInstallation(
|
|
3556
3565
|
api,
|
|
3557
3566
|
"no_access",
|
|
3558
|
-
repoName
|
|
3567
|
+
repoName,
|
|
3568
|
+
{ yes: progressOptions?.yes }
|
|
3559
3569
|
);
|
|
3560
3570
|
if (retry) {
|
|
3561
3571
|
console.log(source_default.cyan("\n\u{1F504} Retrying deployment...\n"));
|
|
3562
3572
|
const newDeployment = await api.redeployDeployment(deployment.id);
|
|
3563
|
-
await displayDeploymentProgress(
|
|
3573
|
+
await displayDeploymentProgress(
|
|
3574
|
+
api,
|
|
3575
|
+
newDeployment,
|
|
3576
|
+
progressOptions
|
|
3577
|
+
);
|
|
3564
3578
|
return;
|
|
3565
3579
|
}
|
|
3566
3580
|
}
|
|
@@ -3611,7 +3625,52 @@ async function checkRepoAccess(api, owner, repo) {
|
|
|
3611
3625
|
return false;
|
|
3612
3626
|
}
|
|
3613
3627
|
}
|
|
3614
|
-
|
|
3628
|
+
var GITHUB_SETUP_POLL_INTERVAL_MS = 2e3;
|
|
3629
|
+
var GITHUB_SETUP_POLL_MAX_MS = 12e4;
|
|
3630
|
+
async function waitForGitHubSetupAfterBrowser(api, repoName, yes) {
|
|
3631
|
+
if (!yes) {
|
|
3632
|
+
console.log(source_default.gray("Waiting for GitHub configuration..."));
|
|
3633
|
+
await prompt(
|
|
3634
|
+
source_default.white("Press Enter when you've completed the GitHub setup..."),
|
|
3635
|
+
"y"
|
|
3636
|
+
);
|
|
3637
|
+
return;
|
|
3638
|
+
}
|
|
3639
|
+
console.log(
|
|
3640
|
+
source_default.gray(
|
|
3641
|
+
"Waiting for GitHub configuration (polling every 2s, up to 2 min)..."
|
|
3642
|
+
)
|
|
3643
|
+
);
|
|
3644
|
+
const deadline = Date.now() + GITHUB_SETUP_POLL_MAX_MS;
|
|
3645
|
+
while (Date.now() < deadline) {
|
|
3646
|
+
try {
|
|
3647
|
+
const status = await api.getGitHubConnectionStatus();
|
|
3648
|
+
if (!status.is_connected) {
|
|
3649
|
+
await new Promise((r) => setTimeout(r, GITHUB_SETUP_POLL_INTERVAL_MS));
|
|
3650
|
+
continue;
|
|
3651
|
+
}
|
|
3652
|
+
if (repoName) {
|
|
3653
|
+
const parts = repoName.split("/");
|
|
3654
|
+
const owner = parts[0];
|
|
3655
|
+
const repo = parts[1];
|
|
3656
|
+
if (owner && repo && await checkRepoAccess(api, owner, repo)) {
|
|
3657
|
+
return;
|
|
3658
|
+
}
|
|
3659
|
+
} else {
|
|
3660
|
+
return;
|
|
3661
|
+
}
|
|
3662
|
+
} catch {
|
|
3663
|
+
}
|
|
3664
|
+
await new Promise((r) => setTimeout(r, GITHUB_SETUP_POLL_INTERVAL_MS));
|
|
3665
|
+
}
|
|
3666
|
+
console.log(
|
|
3667
|
+
source_default.yellow(
|
|
3668
|
+
"\u26A0\uFE0F Timed out waiting for GitHub setup. Continuing with verification..."
|
|
3669
|
+
)
|
|
3670
|
+
);
|
|
3671
|
+
}
|
|
3672
|
+
async function promptGitHubInstallation(api, reason, repoName, opts) {
|
|
3673
|
+
const yes = !!opts?.yes;
|
|
3615
3674
|
console.log();
|
|
3616
3675
|
if (reason === "not_connected") {
|
|
3617
3676
|
console.log(source_default.yellow("\u26A0\uFE0F GitHub account not connected"));
|
|
@@ -3629,7 +3688,7 @@ async function promptGitHubInstallation(api, reason, repoName) {
|
|
|
3629
3688
|
)
|
|
3630
3689
|
);
|
|
3631
3690
|
}
|
|
3632
|
-
const shouldInstall = await prompt(
|
|
3691
|
+
const shouldInstall = yes ? true : await prompt(
|
|
3633
3692
|
source_default.white(
|
|
3634
3693
|
`Would you like to ${reason === "not_connected" ? "connect" : "configure"} GitHub now? (Y/n): `
|
|
3635
3694
|
),
|
|
@@ -3676,11 +3735,7 @@ Opening browser to ${reason === "not_connected" ? "install" : "configure"} GitHu
|
|
|
3676
3735
|
console.log();
|
|
3677
3736
|
}
|
|
3678
3737
|
await open_default(installUrl);
|
|
3679
|
-
|
|
3680
|
-
await prompt(
|
|
3681
|
-
source_default.white("Press Enter when you've completed the GitHub setup..."),
|
|
3682
|
-
"y"
|
|
3683
|
-
);
|
|
3738
|
+
await waitForGitHubSetupAfterBrowser(api, repoName, yes);
|
|
3684
3739
|
console.log(source_default.gray("Verifying GitHub connection..."));
|
|
3685
3740
|
let verified = false;
|
|
3686
3741
|
try {
|
|
@@ -3737,6 +3792,14 @@ async function deployCommand(options) {
|
|
|
3737
3792
|
const cwd = process.cwd();
|
|
3738
3793
|
if (!await isLoggedIn()) {
|
|
3739
3794
|
console.log(source_default.red("\u2717 You are not logged in."));
|
|
3795
|
+
if (options.yes) {
|
|
3796
|
+
console.log(
|
|
3797
|
+
source_default.gray(
|
|
3798
|
+
"Run " + source_default.white("npx mcp-use login") + " first. Non-interactive deploy requires an existing session."
|
|
3799
|
+
)
|
|
3800
|
+
);
|
|
3801
|
+
process.exit(1);
|
|
3802
|
+
}
|
|
3740
3803
|
const shouldLogin = await prompt(
|
|
3741
3804
|
source_default.white("Would you like to login now? (Y/n): "),
|
|
3742
3805
|
"y"
|
|
@@ -3788,12 +3851,14 @@ async function deployCommand(options) {
|
|
|
3788
3851
|
"\u26A0\uFE0F This doesn't appear to be an MCP server project (no mcp-use or @modelcontextprotocol/sdk dependency found)."
|
|
3789
3852
|
)
|
|
3790
3853
|
);
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3854
|
+
if (!options.yes) {
|
|
3855
|
+
const shouldContinue = await prompt(
|
|
3856
|
+
source_default.white("Continue anyway? (y/n): ")
|
|
3857
|
+
);
|
|
3858
|
+
if (!shouldContinue) {
|
|
3859
|
+
console.log(source_default.gray("Deployment cancelled."));
|
|
3860
|
+
process.exit(0);
|
|
3861
|
+
}
|
|
3797
3862
|
}
|
|
3798
3863
|
console.log();
|
|
3799
3864
|
}
|
|
@@ -3837,12 +3902,14 @@ async function deployCommand(options) {
|
|
|
3837
3902
|
"Local changes will not be included until you commit and push.\n"
|
|
3838
3903
|
)
|
|
3839
3904
|
);
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3905
|
+
if (!options.yes) {
|
|
3906
|
+
const shouldContinue = await prompt(
|
|
3907
|
+
source_default.white("Continue with deployment from GitHub? (y/n): ")
|
|
3908
|
+
);
|
|
3909
|
+
if (!shouldContinue) {
|
|
3910
|
+
console.log(source_default.gray("Deployment cancelled."));
|
|
3911
|
+
process.exit(0);
|
|
3912
|
+
}
|
|
3846
3913
|
}
|
|
3847
3914
|
console.log();
|
|
3848
3915
|
}
|
|
@@ -3864,15 +3931,17 @@ async function deployCommand(options) {
|
|
|
3864
3931
|
);
|
|
3865
3932
|
}
|
|
3866
3933
|
console.log();
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3934
|
+
if (!options.yes) {
|
|
3935
|
+
const shouldDeploy = await prompt(
|
|
3936
|
+
source_default.white(
|
|
3937
|
+
`Deploy from GitHub repository ${gitInfo.owner}/${gitInfo.repo}? (Y/n): `
|
|
3938
|
+
),
|
|
3939
|
+
"y"
|
|
3940
|
+
);
|
|
3941
|
+
if (!shouldDeploy) {
|
|
3942
|
+
console.log(source_default.gray("Deployment cancelled."));
|
|
3943
|
+
process.exit(0);
|
|
3944
|
+
}
|
|
3876
3945
|
}
|
|
3877
3946
|
const projectName = options.name || await getProjectName(projectDir);
|
|
3878
3947
|
const runtime = options.runtime || await detectRuntime(projectDir);
|
|
@@ -3943,7 +4012,8 @@ async function deployCommand(options) {
|
|
|
3943
4012
|
const installed = await promptGitHubInstallation(
|
|
3944
4013
|
api,
|
|
3945
4014
|
"not_connected",
|
|
3946
|
-
repoFullName
|
|
4015
|
+
repoFullName,
|
|
4016
|
+
{ yes: options.yes }
|
|
3947
4017
|
);
|
|
3948
4018
|
if (!installed) {
|
|
3949
4019
|
console.log(source_default.gray("Deployment cancelled."));
|
|
@@ -3978,7 +4048,8 @@ async function deployCommand(options) {
|
|
|
3978
4048
|
const configured = await promptGitHubInstallation(
|
|
3979
4049
|
api,
|
|
3980
4050
|
"no_access",
|
|
3981
|
-
repoFullName
|
|
4051
|
+
repoFullName,
|
|
4052
|
+
{ yes: options.yes }
|
|
3982
4053
|
);
|
|
3983
4054
|
if (!configured) {
|
|
3984
4055
|
console.log(source_default.gray("Deployment cancelled."));
|
|
@@ -4066,7 +4137,9 @@ async function deployCommand(options) {
|
|
|
4066
4137
|
...existingLink,
|
|
4067
4138
|
linkedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4068
4139
|
});
|
|
4069
|
-
await displayDeploymentProgress(api, deployment2
|
|
4140
|
+
await displayDeploymentProgress(api, deployment2, {
|
|
4141
|
+
yes: options.yes
|
|
4142
|
+
});
|
|
4070
4143
|
if (options.open && deployment2.domain) {
|
|
4071
4144
|
console.log();
|
|
4072
4145
|
console.log(source_default.gray("Opening deployment in browser..."));
|
|
@@ -4139,7 +4212,7 @@ async function deployCommand(options) {
|
|
|
4139
4212
|
);
|
|
4140
4213
|
console.log(source_default.gray(` Future deploys will reuse the same URL
|
|
4141
4214
|
`));
|
|
4142
|
-
await displayDeploymentProgress(api, deployment);
|
|
4215
|
+
await displayDeploymentProgress(api, deployment, { yes: options.yes });
|
|
4143
4216
|
if (options.open && deployment.domain) {
|
|
4144
4217
|
console.log();
|
|
4145
4218
|
console.log(source_default.gray("Opening deployment in browser..."));
|
|
@@ -6872,7 +6945,7 @@ program.command("deploy").description("Deploy MCP server from GitHub to Manufact
|
|
|
6872
6945
|
).option(
|
|
6873
6946
|
"--org <slug-or-id>",
|
|
6874
6947
|
"Deploy to a specific organization (by slug or ID)"
|
|
6875
|
-
).action(async (options) => {
|
|
6948
|
+
).option("-y, --yes", "Skip confirmation prompts").action(async (options) => {
|
|
6876
6949
|
await deployCommand({
|
|
6877
6950
|
open: options.open,
|
|
6878
6951
|
name: options.name,
|
|
@@ -6882,7 +6955,8 @@ program.command("deploy").description("Deploy MCP server from GitHub to Manufact
|
|
|
6882
6955
|
env: options.env,
|
|
6883
6956
|
envFile: options.envFile,
|
|
6884
6957
|
rootDir: options.rootDir,
|
|
6885
|
-
org: options.org
|
|
6958
|
+
org: options.org,
|
|
6959
|
+
yes: options.yes
|
|
6886
6960
|
});
|
|
6887
6961
|
});
|
|
6888
6962
|
program.addCommand(createClientCommand());
|