Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
},
})}
Expand Down
2 changes: 1 addition & 1 deletion client/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,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",
Expand Down
7 changes: 5 additions & 2 deletions packages/data-provider/src/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading