codex - 💡(How to fix) Fix Allow spaces or more symbols in MCP server names [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19179Fetched 2026-04-24 05:59:20
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×4unlabeled ×1

Code Example

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

[mcp_servers."Postgres MCP - Development"]
...
RAW_BUFFERClick to expand / collapse

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

https://github.com/openai/codex/blob/f1923a38b1af106eeac46c306670d56e83d3740a/codex-rs/cli/src/mcp_cmd.rs#L912-L918

extent analysis

TL;DR

The validation for MCP server names may need to be updated to support quoted keys as per the TOML spec, allowing for more flexible naming conventions.

Guidance

  • Review the TOML specification to understand the supported characters for quoted keys.
  • Consider updating the validation in mcp_cmd.rs to allow for quoted keys with ASCII characters.
  • Verify that the updated validation does not break existing functionality or introduce security vulnerabilities.
  • Test the updated validation with example use cases, such as the provided "Postgres MCP - Production - Read Only" server name.

Example

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

This example demonstrates how quoted keys can be used to create more readable MCP server names.

Notes

The current limitation may be due to the interpretation of the TOML spec, and updating the validation may require careful consideration of potential security implications.

Recommendation

Apply workaround by updating the validation to support quoted keys, as this would provide more flexibility in naming MCP servers while following the TOML spec.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Allow spaces or more symbols in MCP server names [1 participants]