diff --git a/web/app/components/tools/mcp/modal.tsx b/web/app/components/tools/mcp/modal.tsx index 00caa695fe..987a517ef5 100644 --- a/web/app/components/tools/mcp/modal.tsx +++ b/web/app/components/tools/mcp/modal.tsx @@ -106,7 +106,7 @@ const MCPModal = ({ const appIconRef = useRef(null) const isHovering = useHover(appIconRef) const [authMethod, setAuthMethod] = useState(MCPAuthMethod.authentication) - const [isDynamicRegistration, setIsDynamicRegistration] = useState(data?.is_dynamic_registration || false) + const [isDynamicRegistration, setIsDynamicRegistration] = useState(isCreate ? true : data?.is_dynamic_registration) const [clientID, setClientID] = useState(data?.authentication?.client_id || '') const [credentials, setCredentials] = useState(data?.authentication?.client_secret || '') @@ -120,6 +120,9 @@ const MCPModal = ({ setSseReadTimeout(data.sse_read_timeout || 300) setHeaders(Object.entries(data.masked_headers || {}).map(([key, value]) => ({ id: uuid(), key, value }))) setAppIcon(getIcon(data)) + setIsDynamicRegistration(data.is_dynamic_registration) + setClientID(data.authentication?.client_id || '') + setCredentials(data.authentication?.client_secret || '') } else { // Reset for create mode @@ -130,6 +133,9 @@ const MCPModal = ({ setSseReadTimeout(300) setHeaders([]) setAppIcon(DEFAULT_ICON as AppIconSelection) + setIsDynamicRegistration(true) + setClientID('') + setCredentials('') } }, [data]) @@ -322,13 +328,13 @@ const MCPModal = ({
- {t('tools.mcp.modal.credentials')} + {t('tools.mcp.modal.clientSecret')}
setCredentials(e.target.value)} onBlur={e => handleBlur(e.target.value.trim())} - placeholder={t('tools.mcp.modal.credentialsPlaceholder')} + placeholder={t('tools.mcp.modal.clientSecretPlaceholder')} disabled={isDynamicRegistration} />
diff --git a/web/i18n/en-US/tools.ts b/web/i18n/en-US/tools.ts index 02720ef5bd..ff04a87f6c 100644 --- a/web/i18n/en-US/tools.ts +++ b/web/i18n/en-US/tools.ts @@ -206,8 +206,8 @@ const translation = { authentication: 'Authentication', useDynamicClientRegistration: 'Use Dynamic Client Registration', clientID: 'Client ID', - credentials: 'Credentials', - credentialsPlaceholder: 'Client secret', + clientSecret: 'Client Secret', + clientSecretPlaceholder: 'Client Secret', configurations: 'Configurations', }, delete: 'Remove MCP Server', diff --git a/web/i18n/zh-Hans/tools.ts b/web/i18n/zh-Hans/tools.ts index ad85aa91fd..6c51f991f6 100644 --- a/web/i18n/zh-Hans/tools.ts +++ b/web/i18n/zh-Hans/tools.ts @@ -206,8 +206,8 @@ const translation = { authentication: '认证', useDynamicClientRegistration: '使用动态客户端注册', clientID: '客户端 ID', - credentials: '凭证', - credentialsPlaceholder: '客户端密钥', + clientSecret: '客户端密钥', + clientSecretPlaceholder: '客户端密钥', configurations: '配置', }, delete: '删除 MCP 服务',