Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
⚙️ feat: Add configurable trust checkbox labels for MCP Server Dialog (#10820)
Atef Bellaaj9400148175ed
diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog.tsxindex 4a210dfadc..e978ee7114 100644--- a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog.tsx+++ b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog.tsx@@ -22,7 +22,8 @@ import {} from '~/data-provider/MCP';import MCPAuth, { type AuthConfig, AuthTypeEnum, AuthorizationTypeEnum } from './MCPAuth';import MCPIcon from '~/components/SidePanel/Agents/MCPIcon';-import { useLocalize } from '~/hooks';+import { useLocalize, useLocalizedConfig } from '~/hooks';+import { useGetStartupConfig } from '~/data-provider';import { cn } from '~/utils';import {SystemRoles,@@ -69,6 +70,8 @@ export default function MCPServerDialog({}: MCPServerDialogProps) {const localize = useLocalize();const { showToast } = useToastContext();+ const { data: startupConfig } = useGetStartupConfig();+ const getLocalizedValue = useLocalizedConfig();// Mutationsconst createMutation = useCreateMCPServerMutation();@@ -575,13 +578,38 @@ export default function MCPServerDialog({<Labelid="trust-this-mcp-label"htmlFor="trust"- className="flex cursor-pointer flex-col text-sm font-medium"+ className="flex cursor-pointer flex-col break-words text-sm font-medium"><span>- {localize('com_ui_trust_app')} <span className="text-red-500">*</span>+ {startupConfig?.interface?.mcpServers?.trustCheckbox?.label ? (+ <span+ /** No sanitization required. trusted admin-controlled source (yml) */+ dangerouslySetInnerHTML={{+ __html: getLocalizedValue(+ startupConfig.interface.mcpServers.trustCheckbox.label,+ localize('com_ui_trust_app'),+ ),+ }}+ />+ ) : (+ localize('com_ui_trust_app')+ )}{' '}+ <span className="text-red-500">*</span></span><span className="text-xs font-normal text-text-secondary">- {localize('com_agents_mcp_trust_subtext')}+ {startupConfig?.interface?.mcpServers?.trustCheckbox?.subLabel ? (+ <span+ /** No sanitization required. trusted admin-controlled source (yml) */+ dangerouslySetInnerHTML={{+ __html: getLocalizedValue(+ startupConfig.interface.mcpServers.trustCheckbox.subLabel,+ localize('com_agents_mcp_trust_subtext'),+ ),+ }}+ />+ ) : (+ localize('com_agents_mcp_trust_subtext')+ )}</span></Label></div>diff --git a/client/src/hooks/index.ts b/client/src/hooks/index.tsindex a33d1d0b92..4df82be15a 100644--- a/client/src/hooks/index.ts+++ b/client/src/hooks/index.ts@@ -34,3 +34,4 @@ export { default as useSpeechToText } from './Input/useSpeechToText';export { default as useTextToSpeech } from './Input/useTextToSpeech';export { default as useGenerationsByLatest } from './useGenerationsByLatest';export { useResourcePermissions } from './useResourcePermissions';+export { default as useLocalizedConfig } from './useLocalizedConfig';diff --git a/client/src/hooks/useLocalizedConfig.ts b/client/src/hooks/useLocalizedConfig.tsnew file mode 100644index 0000000000..6cd759be5d--- /dev/null+++ b/client/src/hooks/useLocalizedConfig.ts@@ -0,0 +1,36 @@+import { useRecoilValue } from 'recoil';+import store from '~/store';++type LocalizedValue = string | Record<string, string> | undefined;++/**+ * Hook to resolve localized config values based on current user language.+ * Automatically retrieves the current language from Recoil state.+ *+ * @returns A function to resolve localized values+ */+export default function useLocalizedConfig() {+ const lang = useRecoilValue(store.lang);++ /**+ * Resolves a localized config value.+ * @param value - Either a string or object with language codes as keys+ * @param fallback - Fallback value if config is undefined or language not found+ * @returns The resolved string value+ */+ return (value: LocalizedValue, fallback: string): string => {+ if (value === undefined) {+ return fallback;+ }+ if (typeof value === 'string') {+ return value;+ }+ // Extract base language code (e.g., 'de' from 'de-DE')+ const baseLang = lang?.split('-')[0] ?? 'en';++ // Try exact locale (de-DE), then base language (de), then 'en', then first available+ return (+ (lang && value[lang]) || value[baseLang] || value['en'] || Object.values(value)[0] || fallback+ );+ };+}diff --git a/librechat.example.yaml b/librechat.example.yamlindex da0b0b7bb1..2d0cb80abd 100644--- a/librechat.example.yaml+++ b/librechat.example.yaml@@ -105,6 +105,18 @@ interface:use: falsecreate: falseshare: false+ # Creation / edit MCP server config Dialog config example+ # trustCheckbox:+ # label:+ # en: 'I understand and I want to continue'+ # de: 'Ich verstehe und möchte fortfahren'+ # de-DE: 'Ich verstehe und möchte fortfahren' # You can narrow translation to regions like (de-DE or de-CH)+ # subLabel:+ # en: |+ # Librechat hasn't reviewed this MCP server. Attackers may attempt to steal your data or trick the model into taking unintended actions, including destroying data. <a href="https://google.de" target="_blank"><strong>Learn more.</strong></a>+ # de: |+ # LibreChat hat diesen MCP-Server nicht überprüft. Angreifer könnten versuchen, Ihre Daten zu stehlen oder das Modell zu unbeabsichtigten Aktionen zu verleiten, einschließlich der Zerstörung von Daten. <a href="https://google.de" target="_blank"><strong>Mehr erfahren.</strong></a>+# Temporary chat retention period in hours (default: 720, min: 1, max: 8760)# temporaryChatRetention: 1diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.tsindex e4ed1f5ef0..bcbcb58cc2 100644--- a/packages/data-provider/src/config.ts+++ b/packages/data-provider/src/config.ts@@ -516,12 +516,22 @@ const termsOfServiceSchema = z.object({export type TTermsOfService = z.infer<typeof termsOfServiceSchema>;+// Schema for localized string (either simple string or language-keyed object)+const localizedStringSchema = z.union([z.string(), z.record(z.string())]);+export type LocalizedString = z.infer<typeof localizedStringSchema>;+const mcpServersSchema = z.object({placeholder: z.string().optional(),use: z.boolean().optional(),create: z.boolean().optional(),share: z.boolean().optional(),+ trustCheckbox: z+ .object({+ label: localizedStringSchema.optional(),+ subLabel: localizedStringSchema.optional(),+ })+ .optional(),}).optional();