diff --git a/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx b/client/src/components/SidePanel/MCPBuilder/MCPServerDialog/sections/BasicInfoSection.tsx index fd78d0bced..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: /^[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 3d19f65ad6..cd20bc8a55 100644 --- a/client/src/locales/en/translation.json +++ b/client/src/locales/en/translation.json @@ -1155,7 +1155,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 b22a599b9b..615df11ac5 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(),