Skip to content

MCP OAuth fails RFC 9207 issuer validation — mcp.higgsfield.ai forwards Clerk's iss unmodified #68

Description

@claaudelane

Filing here as the public tracker; the defect is in the MCP server at mcp.higgsfield.ai, not the CLI itself.

Symptom

Authorizing the Higgsfield MCP server from an RFC 9207-conforming client (Claude Code) always fails:

Issuer mismatch in authorization response (RFC 9207):
expected "https://mcp.higgsfield.ai", received "https://clerk.higgsfield.ai"

Cause

mcp.higgsfield.ai/.well-known/oauth-authorization-server declares:

{"issuer": "https://mcp.higgsfield.ai",
 "authorization_endpoint": "https://mcp.higgsfield.ai/oauth2/authorize"}

That endpoint is a facade over Clerk — your own protected-resource metadata says so:

{"upstream_authorization_server": "https://clerk.higgsfield.ai"}

And Clerk declares:

{"issuer": "https://clerk.higgsfield.ai",
 "authorization_response_iss_parameter_supported": true}

So Clerk stamps iss=https://clerk.higgsfield.ai into the authorization response, and the facade
forwards that value unmodified to the client's redirect_uri. The client compares the received
issuer against the one it learned from your metadata, finds a mismatch, and refuses.

The observed callback confirms it:

http://localhost:<port>/callback?code=...&iss=https%3A%2F%2Fclerk.higgsfield.ai&state=...

Reproduce

  1. Add https://mcp.higgsfield.ai/mcp as an HTTP MCP server in Claude Code.
  2. Authenticate.

Fails on every fresh flow (new PKCE challenge and state each time). Removing and re-adding the
server does not help, since the mismatch is recomputed from published metadata on each attempt.

Suggested fix

Any one of:

  • rewrite iss to https://mcp.higgsfield.ai in the authorization response, or
  • omit the iss parameter, or
  • advertise Clerk as the authorization server in your own metadata.

Notes

  • The device_code flow via fnf-device-auth.higgsfield.ai is unaffected — it has no authorization
    redirect, so there is no iss to validate.
  • A bearer token from an already-authenticated CLI session is accepted by the MCP resource
    (tools/list returns the full surface). That is a usable workaround, not a fix.
  • Client-side suppression of RFC 9207 validation would be a security regression, since that check
    is the defense against authorization-server mix-up attacks. The client is behaving correctly here.

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