Skip to content

Commit 31aebdf

Browse files
committed
fix(mcp): clarify ASCII-only requirement in server name validation error
Fixes bounty issue #1626 The validate_server_name function uses is_ascii_alphanumeric() but the error message only mentioned 'letters, numbers' without specifying ASCII-only. Users trying unicode names like 'test-日本語' received a generic error without understanding why unicode characters were rejected. Updated the error message to explicitly state 'ASCII letters a-z/A-Z, digits 0-9' so users understand the limitation.
1 parent 8f839ec commit 31aebdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cortex-cli/src/mcp_cmd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
use anyhow::{Context, Result, bail};
44
use clap::{ArgGroup, Parser};
5-
use cortex_common::dirs::get_cortex_home;
65
use cortex_common::CliConfigOverrides;
6+
use cortex_common::dirs::get_cortex_home;
77
use std::io::{self, BufRead, Write};
88

99
// ============================================================================
@@ -918,7 +918,7 @@ fn validate_server_name(name: &str) -> Result<()> {
918918
.all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_');
919919

920920
if !is_valid_chars {
921-
bail!("invalid server name '{name}' (use letters, numbers, '-', '_')");
921+
bail!("invalid server name '{name}' (use ASCII letters a-z/A-Z, digits 0-9, '-', or '_')");
922922
}
923923

924924
// Must start with a letter or underscore

0 commit comments

Comments
 (0)