Skip to content

Commit 35ce3bf

Browse files
fylornclaude
andcommitted
fix(mcp-store): make Install gating opt-in — only block on a hard test failure
The previous PR (`920735f`) gated Install on a successful Test connection, mirroring the wizard's Step 3 gate. Wrong call for the store: catalog templates ship with curated URLs and the backend's `install_template` already runs its own probe + rejects on hard failure, so a forced test before Install is just friction — for public/no-auth templates like AWS Documentation it adds an extra click for zero validation benefit. New gating logic on the Install button: - No test result yet → enabled (the common path) - Test passed (`success` true) → enabled - Test soft-success (`requires_auth` true, OAuth/PAT) → enabled - Test hard-failed → disabled, with a tooltip explaining why (saves the user one round-trip we know would 400) Test connection stays as an optional preview that surfaces the upstream's tool list before commit, useful for unfamiliar templates. The /servers wizard's Step 3 gate is unchanged — there the URL is typed by the operator, so the test result is the *only* thing validating the input. i18n: dropped `mcpServers.mustTestFirst` from the store install tooltip (it was wrong even before — that string is the wizard's contract). New `mcpStore.installBlockedByTestFailure` describes the narrow case where Install is actually disabled. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c73f7d0 commit 35ce3bf

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

web/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
"oauthCredentialsTitle": "OAuth client credentials",
141141
"oauthCredentialsHint": "From your OAuth app on {{issuer}}. Templates ship the issuer + endpoints; you supply the client_id and secret.",
142142
"advancedSection": "Advanced (custom headers)",
143+
"installBlockedByTestFailure": "Connection test failed. Fix the error or clear the test result before installing.",
143144
"endpointUrl": "Endpoint URL",
144145
"authInstructions": "Auth Instructions",
145146
"deployInstructions": "Deployment Instructions",

web/src/i18n/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
"oauthCredentialsTitle": "OAuth 客户端凭证",
141141
"oauthCredentialsHint": "来自你在 {{issuer}} 上的 OAuth 应用。模板提供 issuer 与端点;你提供 client_id 和 secret。",
142142
"advancedSection": "高级(自定义请求头)",
143+
"installBlockedByTestFailure": "连接测试失败。请修复错误或重新测试后再安装。",
143144
"endpointUrl": "端点地址",
144145
"authInstructions": "认证说明",
145146
"deployInstructions": "部署说明",

web/src/routes/mcp/store.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,25 @@ export function McpStorePage() {
553553
</Button>
554554
<Button
555555
type="submit"
556-
disabled={installing || !(testResult?.success || testResult?.requires_auth)}
556+
// Store templates ship with curated URLs and the
557+
// backend's `install_template` runs its own probe, so
558+
// the Test button is an optional *preview* (it shows
559+
// the tool list before commit) rather than a gate.
560+
// Only block Install when the user explicitly tested
561+
// and got a hard failure — at that point we know the
562+
// install would fail too, so saving them the click is
563+
// friendlier than letting the backend reject.
564+
disabled={
565+
installing
566+
|| (testResult != null
567+
&& !testResult.success
568+
&& !testResult.requires_auth)
569+
}
557570
title={
558-
!(testResult?.success || testResult?.requires_auth)
559-
? t('mcpServers.mustTestFirst')
571+
testResult != null
572+
&& !testResult.success
573+
&& !testResult.requires_auth
574+
? t('mcpStore.installBlockedByTestFailure')
560575
: undefined
561576
}
562577
>

0 commit comments

Comments
 (0)