Skip to content

Claude Code MCP authentication fails: OAuth 404 and API key 'unauthorized' #10

@minac

Description

@minac

Environment

Problem

When configuring the Render MCP server in Claude Code, authentication fails in two different scenarios:

Scenario 1: With API Key Header

Config:

{
  "render": {
    "type": "http",
    "url": "https://mcp.render.com/mcp",
    "headers": {
      "Authorization": "Bearer <VALID_API_KEY>"
    }
  }
}
  • Claude Code shows: Auth: ✗ not authenticated
  • MCP tools like list_services return unauthorized
  • However, select_workspace and get_selected_workspace work correctly
  • The same API key works perfectly with the REST API (api.render.com/v1/services)

Scenario 2: Without API Key (OAuth flow)

When removing the Authorization header and clicking "Authenticate" in Claude Code:

Error: HTTP 404: Invalid OAuth error response: SyntaxError: JSON Parse error: Unable to parse JSON string. Raw body: 404 page not found

The OAuth endpoint appears to return a 404.

Expected Behavior

Either:

  1. API key authentication should work as documented
  2. OAuth flow should open browser and complete authentication

Steps to Reproduce

  1. Add Render MCP server to Claude Code: claude mcp add --transport http render https://mcp.render.com/mcp --header "Authorization: Bearer <API_KEY>"
  2. Run /mcp in Claude Code
  3. Observe "Auth: ✗ not authenticated"
  4. Try using any tool like list_services → returns "unauthorized"
  5. Alternatively, remove the header and click "Authenticate" → 404 error

Workaround

Using the REST API directly works fine with the same API key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions