codex - 💡(How to fix) Fix codex mcp login appears to require dynamic client registration for private OAuth MCP servers; cannot use pre-registered client identity [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#19154Fetched 2026-04-24 05:59:45
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Participants
Timeline (top)
labeled ×4subscribed ×2unlabeled ×1

I’m seeing an interoperability problem between Codex MCP OAuth login and a private remote MCP server that uses FastMCP (Python) with Okta-backed OAuth.

The server is internal/non-public, so I can’t share the real URL or tenant details, but the behavior is consistent and reproducible with a sanitized config.

The key issue seems to be that Codex is attempting Dynamic Client Registration (DCR), while this server/IdP setup works with a pre-registered OAuth client in other MCP clients.

A fixed callback port is not enough to make this work in Codex.

Error Message

Error: Registration failed: Dynamic registration failed: Registration failed: HTTP 403 Forbidden: {"errorCode":"E0000005","errorSummary":"Invalid session","errorLink":"E0000005","errorId":"<redacted>","errorCauses":[]}

Root Cause

There are private enterprise MCP servers that are OAuth-protected but do not behave like public DCR-friendly endpoints. If Codex only supports DCR here, that blocks otherwise valid MCP integrations.

Code Example

mcp_oauth_callback_port = 8080

[mcp_servers.private_internal]
url = "https://redacted.example.internal/mcp"
enabled = true

---

codex mcp login private_internal

---

Error: Registration failed: Dynamic registration failed: Registration failed: HTTP 403 Forbidden: {"errorCode":"E0000005","errorSummary":"Invalid session","errorLink":"E0000005","errorId":"<redacted>","errorCauses":[]}
RAW_BUFFERClick to expand / collapse

Description

I’m seeing an interoperability problem between Codex MCP OAuth login and a private remote MCP server that uses FastMCP (Python) with Okta-backed OAuth.

The server is internal/non-public, so I can’t share the real URL or tenant details, but the behavior is consistent and reproducible with a sanitized config.

The key issue seems to be that Codex is attempting Dynamic Client Registration (DCR), while this server/IdP setup works with a pre-registered OAuth client in other MCP clients.

A fixed callback port is not enough to make this work in Codex.

Environment

What version of Codex CLI is running?

codex-cli 0.122.0

What platform is your computer?

macOS 26.4.1 (build 25E253), arm64

Darwin 25.4.0

What issue are you seeing?

With this config:

mcp_oauth_callback_port = 8080

[mcp_servers.private_internal]
url = "https://redacted.example.internal/mcp"
enabled = true

running:

codex mcp login private_internal

fails with:

Error: Registration failed: Dynamic registration failed: Registration failed: HTTP 403 Forbidden: {"errorCode":"E0000005","errorSummary":"Invalid session","errorLink":"E0000005","errorId":"<redacted>","errorCauses":[]}

This server is a private FastMCP-based streamable HTTP MCP server using Okta for OAuth.

The same server works in another MCP client when configured with a pre-registered OAuth client identity and a fixed callback port.

What I expected

One of these should work:

  1. Codex completes OAuth successfully against this server.
  2. Codex allows configuring a pre-registered/static OAuth client identity per MCP server.
  3. Codex emits a clearer error indicating that this server requires a pre-registered client and that Codex currently only supports DCR for this flow.

What actually happened

Codex appears to attempt Dynamic Client Registration and fails before a usable browser auth flow completes.

Changing the callback port to a fixed value (mcp_oauth_callback_port = 8080) did not change the outcome.

Additional context

This looks related to other Codex MCP OAuth issues involving DCR assumptions and nontrivial OAuth servers:

From the Codex docs, I could find support for:

  • codex mcp login
  • mcp_oauth_callback_port
  • mcp_oauth_callback_url
  • per-server scopes
  • per-server oauth_resource

But I could not find a documented way to provide a per-server static OAuth client id / client identity for MCP login.

Why this matters

There are private enterprise MCP servers that are OAuth-protected but do not behave like public DCR-friendly endpoints. If Codex only supports DCR here, that blocks otherwise valid MCP integrations.

Request

Please clarify whether Codex MCP OAuth login is expected to support:

  • private OAuth MCP servers backed by Okta
  • pre-registered/static OAuth client identities
  • FastMCP-based remote servers that do not support Codex-style DCR assumptions

If not, it would help to either:

  • add support for per-server static client configuration, or
  • document that limitation explicitly and fail with a more precise error.

extent analysis

TL;DR

The issue can be addressed by adding support for per-server static OAuth client configuration or documenting the limitation of Codex MCP OAuth login with private OAuth MCP servers.

Guidance

  • Investigate the possibility of adding support for per-server static OAuth client configuration to Codex MCP OAuth login.
  • Consider documenting the current limitation of Codex MCP OAuth login with private OAuth MCP servers that do not support Dynamic Client Registration (DCR).
  • Review the Codex documentation to ensure it clearly states the supported OAuth flows and configurations.
  • Explore alternative OAuth flows that can work with private enterprise MCP servers, such as using a pre-registered OAuth client identity.

Example

No code snippet is provided as the issue is related to configuration and documentation rather than code implementation.

Notes

The issue highlights the importance of supporting various OAuth configurations to ensure compatibility with different MCP servers. The current implementation of Codex MCP OAuth login assumes DCR, which may not work with all private OAuth MCP servers.

Recommendation

Apply a workaround by documenting the limitation of Codex MCP OAuth login with private OAuth MCP servers and exploring alternative OAuth flows. This will help users understand the current capabilities and limitations of the system.

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