openai / openai/codex

Lovable MCP OAuth discovery fails before browser: missing protected resource field

Open
#41,288 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auth bug CLI mcp windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

Codex Desktop and its bundled CLI cannot authenticate to Lovable's official Streamable HTTP MCP server. The OAuth flow fails before a browser or authorization URL is opened.

Environment

  • Codex Desktop: 26.825.3734.0
  • Bundled CLI: codex-cli 0.150.0-alpha.12.2 (Windows ARM64)
  • OS: Windows 11
  • MCP server URL: https://mcp.lovable.dev
  • Configuration: project-scoped .codex/config.toml, auth = "oauth", server enabled

Expected behavior

codex mcp login lovable should start the OAuth browser flow and store credentials, as documented for OAuth-capable remote MCP servers.

Actual behavior

The command exits before opening a browser:

Error: Metadata error: Protected resource metadata missing required resource field

The same result occurs with the default registration strategy and with both explicit alternatives:

codex mcp login lovable
codex mcp login lovable --oauth-client-registration dcr
codex mcp login lovable --oauth-client-registration cimd

The Codex Desktop MCP UI lists the server as enabled but its controls/tools remain unavailable. Desktop logs mark startup as failed because the server is not logged in.

Independent endpoint checks

Unauthenticated checks of the public server return the expected OAuth discovery data:

  • POST https://mcp.lovable.dev with an MCP initialize request returns 401 Unauthorized and:
    WWW-Authenticate: Bearer realm="mcp", resource_metadata="https://mcp.lovable.dev/.well-known/oauth-protected-resource"
    
  • GET https://mcp.lovable.dev/.well-known/oauth-protected-resource returns JSON containing:
    {
      "resource": "https://mcp.lovable.dev",
      "authorization_servers": ["https://lovable.dev/oauth"]
    }
    

Adding oauth_resource = "https://mcp.lovable.dev" to the MCP configuration did not change the error.

Reproduction

  1. Configure the Lovable endpoint as an enabled streamable HTTP MCP server with OAuth.
  2. Run codex mcp login lovable.
  3. Observe the metadata error before any browser login begins.

No credentials, user identifiers, project identifiers, or private logs are included in this report.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the codex mcp login lovable entry point and trace protected-resource metadata handling for the Streamable HTTP OAuth flow. Reproduce against https://mcp.lovable.dev and compare the parsed response with its resource field; done means the metadata is accepted and the browser authorization flow starts for the documented configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.