Skip to content

Allow spaces or more symbols in MCP server names #19179

@oprypkhantt

Description

@oprypkhantt

What variant of Codex are you using?

CLI

What feature would you like to see?

Hey. Currently the validation for MCP servers warns if name contains anything other than letters, numbers, _ or -. My assumption is this limitation stems from TOML spec, used for Codex config:

Bare keys may only contain ASCII letters, ASCII digits, underscores, and dashes (A-Za-z0-9_-)

But TOML also supports quoted keys, like so:

[mcp_servers."Postgres MCP - Production - Read Only"]
...

[mcp_servers."Postgres MCP - Development"]
...

This is useful for a case like shown above - to give more easily readable names to MCP servers. Would you consider expanding the validation to at least support all ASCII characters?

Additional information

fn validate_server_name(name: &str) -> Result<()> {
let is_valid = !name.is_empty()
&& name
.chars()
.all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_');
if is_valid {

Metadata

Metadata

Assignees

No one assigned

    Labels

    configIssues involving config.toml, config keys, config merging, or config updatesenhancementNew feature or requestmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions