Skip to content

Connect writes ?apikey= URLs for Codex and the generic fallback, which mcp_reject_query_apikey then refuses #1709

Open

Description

@Dumbris

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.go buildServerEntry, case "codex" writes url: <base>?apikey=<mcp_cli_…> via credentialQuery (internal/connect/connect.go:357-366), with a comment saying Codex cannot take a literal header. docs/features/connect-clients.md says Codex supports env_http_headers and literal http_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:

  1. Connect writes a header carrier for Codex (env_http_headers plus an env var, or http_headers if literal values are supported; reconcile the doc and the code comment first) and for the generic fallback where possible.
  2. While mcp_reject_query_apikey is on, Connect refuses or warns for carriers that can only use the query form, and doctor reports 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).

Activity

  1. added
    kind/bugSomething isn't working
    area/proxyCore MCP proxy engine and tool routing
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/proxyCore MCP proxy engine and tool routingkind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions