Skip to content

MCP Store: Supabase template OAuth fails with "Unrecognized client_id" #2262

Description

@KarloAldrete

Bug Description

Installing the Supabase MCP server template from the MCP Store fails during OAuth authorization. The browser redirects to Supabase with a client_id that Supabase rejects as unrecognized.

How to reproduce

  1. Open PostHog Code
  2. Go to MCP Servers / MCP Store
  3. Click install on the Supabase template
  4. Browser opens:
    https://api.supabase.com/v1/oauth/authorize?client_id=18038368-50b4-4095-a1b6-b67b73417452&redirect_uri=https%3A%2F%2Fus.posthog.com%2Fapi%2Fmcp_store%2Foauth_redirect%2F&response_type=code&...
    
  5. Supabase returns: {"message": "Unrecognized client_id"}

Expected behavior

OAuth flow should complete successfully and the Supabase MCP server should be installed and connected.

Actual behavior

The client_id embedded in the authorization URL is rejected by Supabase. This means the OAuth app credentials stored in the Supabase template (MCPServerTemplate.oauth_credentials on the PostHog backend) are either stale, incorrect, or the app was never properly registered on Supabase's side.

Environment

  • PostHog Code: v0.52.9 (commit 890696c)
  • Platform: Linux x86_64
  • PostHog region: US (us.posthog.com)

Pointers

The OAuth flow for template-based installs is handled in:

  • apps/code/src/renderer/features/mcp-servers/hooks/useMcpServers.tsinstallTemplateWithOAuth()
  • apps/code/src/renderer/api/posthogClient.tsinstallTemplateWithOAuth() API call
  • Backend template model: products/mcp_store/backend/models.py in PostHog/posthogMCPServerTemplate.oauth_credentials

The fix likely requires updating the client_id/client_secret in the Supabase template record via Django admin on the PostHog backend, or re-registering the OAuth app on Supabase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions