[Remote MCP] Error when trying to log in - Error: Metadata error:

Resolved 💬 6 comments Opened Oct 30, 2025 by MrAshRhodes Closed Mar 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.50.0

What subscription do you have?

api key

Which model were you using?

gpt-5

What platform is your computer?

Darwin 25.1.0 arm64 arm

What issue are you seeing?

Ive set my config to use a remote mcp with oauth.

I have set - experimental_use_rmcp_client = true

[mcp_servers.remote]
type = "http"
url = "https://xxxx.com/mcp/default"

when using codex mcp login remote

Error: Metadata error: Failed to parse metadata: error decoding response body

The mcp server and oauth work in other applications i.e copilot, claude etc

What steps can reproduce the bug?

set config for a remote server

run codex mcp login $server_name

What is the expected behavior?

directed to an oauth login page for authentication.

Additional information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5045
  • #5254

Powered by Codex Action

gpeal contributor · 10 months ago

Can you share the MCP server? Is the url publicly accessible even if I may or may not be able to log in?

benglewis · 9 months ago

I am getting this with HuggingFace's MCP:

$ codex mcp add --url "https://huggingface.co/mcp?login" huggingface

Added global MCP server 'huggingface'.
Detected OAuth support. Starting OAuth flow…
Error: Metadata error: Failed to parse metadata: error decoding response body

sorech · 9 months ago

I had the same problem and traced it to the MCP rust-sdk and fixed it there.
The fix is now incorporated in release:
https://github.com/modelcontextprotocol/rust-sdk/releases/tag/rmcp-v0.9.1

All that is left is to bump
rmcp = { version = "0.9.0", default-features = false } -> rmcp = { version = "0.9.1", default-features = false }
https://github.com/openai/codex/blob/0dd822264a9265749d4f698674553a8d8f747ede/codex-rs/Cargo.toml#L171C1-L171C55

bolinfest collaborator · 8 months ago

https://github.com/openai/codex/releases/tag/rust-v0.64.0 is now available with the updated version of the rust-sdk crate!

etraut-openai contributor · 5 months ago

This bug report hasn't received any upvotes or additional posts in three months. Closing.