Connect writes ?apikey= URLs for Codex and the generic fallback, which mcp_reject_query_apikey then refuses
Problem
#1696 adds mcp_reject_query_apikey, which answers any MCP request carrying ?apikey= with a 401. The Connect wizard still writes two client entries with the credential in the URL:
- Codex:
internal/connect/clients.gobuildServerEntry,case "codex"writesurl: <base>?apikey=<mcp_cli_…>viacredentialQuery(internal/connect/connect.go:357-366), with a comment saying Codex cannot take a literal header.docs/features/connect-clients.mdsays Codex supportsenv_http_headersand literalhttp_headers, which contradicts that comment. - The generic fallback entry (
default:branch) uses the same query carrier.
Connect mints a credential even with require_mcp_auth off (connect.go:333-350), and nothing in the Connect flow or in doctor / attention knows about the new option. So a user who connects Codex with the wizard and then turns the option on gets a silent 401 from their own proxy, and Connect keeps writing the broken shape.
Expected
One of:
- Connect writes a header carrier for Codex (
env_http_headersplus an env var, orhttp_headersif literal values are supported; reconcile the doc and the code comment first) and for the generic fallback where possible. - While
mcp_reject_query_apikeyis on, Connect refuses or warns for carriers that can only use the query form, anddoctorreports clients configured with?apikey=.
Also: refusals under the option are not logged, so an operator cannot see which client still uses the query form; a single warn-level log line (client name if known, no token) would help migration.
Found during the review of #1696 (maintainer read plus opencode Sol 6.1).