From f51b29e5df05312ed87b2378488e72a5eefcb6d6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Mar 2026 01:20:57 +0000 Subject: [PATCH 1/2] fix: support accented characters in MCP server titles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update title validation regex to use Unicode property escapes (\p{L} and \p{N}) instead of ASCII-only character classes. This allows letters from any language (French, German, Japanese, etc.) in MCP server titles. Also permits apostrophes and hyphens for titles like "Génération d'images". Changes: - packages/data-provider/src/mcp.ts: backend Zod validation - client BasicInfoSection.tsx: frontend form validation - English locale: updated error message text --- .../MCPServerDialog/sections/BasicInfoSection.tsx | 2 +- client/src/locales/en/translation.json | 2 +- packages/data-provider/src/mcp.ts | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx index fd78d0bced..456df19584 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx @@ -52,7 +52,7 @@ export default function BasicInfoSection() { {...register('title', { required: localize('com_ui_field_required'), pattern: { - value: /^[a-zA-Z0-9 ]+$/, + value: /^[\p{L}\p{N} ''\-]+$/u, message: localize('com_ui_mcp_title_invalid'), }, })} diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json index 35d8300489..72cd702622 100644 --- a/client/src/locales/en/translation.json +++ b/client/src/locales/en/translation.json @@ -1135,7 +1135,7 @@ "com_ui_mcp_servers_allow_share": "Allow users to share MCP servers", "com_ui_mcp_servers_allow_share_public": "Allow users to share MCP servers publicly", "com_ui_mcp_servers_allow_use": "Allow users to use MCP servers", - "com_ui_mcp_title_invalid": "Title can only contain letters, numbers, and spaces", + "com_ui_mcp_title_invalid": "Title can only contain letters, numbers, spaces, apostrophes, and hyphens", "com_ui_mcp_tool_options": "Tool Options", "com_ui_mcp_transport": "Transport", "com_ui_mcp_type_sse": "SSE", diff --git a/packages/data-provider/src/mcp.ts b/packages/data-provider/src/mcp.ts index 3911e91ed0..b0042b3b65 100644 --- a/packages/data-provider/src/mcp.ts +++ b/packages/data-provider/src/mcp.ts @@ -3,10 +3,13 @@ import { TokenExchangeMethodEnum } from './types/agents'; import { extractEnvVariable } from './utils'; const BaseOptionsSchema = z.object({ - /** Display name for the MCP server - only letters, numbers, and spaces allowed */ + /** Display name for the MCP server */ title: z .string() - .regex(/^[a-zA-Z0-9 ]+$/, 'Title can only contain letters, numbers, and spaces') + .regex( + /^[\p{L}\p{N} ''\-]+$/u, + 'Title can only contain letters, numbers, spaces, apostrophes, and hyphens', + ) .optional(), /** Description of the MCP server */ description: z.string().optional(), From 6e9033226b08fa7ed707f38d9cad0dfa97aa23a3 Mon Sep 17 00:00:00 2001 From: Lionel Ringenbach Date: Wed, 11 Mar 2026 10:56:42 -0700 Subject: [PATCH 2/2] fix: regex breaking eslint rules --- .../MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx index 456df19584..56f53ef9bd 100644 --- a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx +++ b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx @@ -52,7 +52,7 @@ export default function BasicInfoSection() { {...register('title', { required: localize('com_ui_field_required'), pattern: { - value: /^[\p{L}\p{N} ''\-]+$/u, + value: /^[-\p{L}\p{N} '']+$/u, message: localize('com_ui_mcp_title_invalid'), }, })}