PostHog / PostHog/posthog

MCP EU OAuth flow redirects to US instance, fails with "Invalid client_id"

Open
#49,043 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Bug Description

When authenticating the PostHog MCP server configured for EU (mcp-eu.posthog.com/mcp), the OAuth flow initially opens a US authentication URL. A modal then appears to
switch to the EU instance, but after redirecting, the authentication fails with:

{
"error": "invalid_request",
"error_description": "Invalid client_id parameter value."
}

Steps to reproduce:

  1. Configure the PostHog MCP server with the EU endpoint:
    {
    "posthog": {
    "type": "http",
    "url": "https://mcp-eu.posthog.com/mcp"
    }
    }
  2. Initiate OAuth authentication (e.g. via Claude Code /mcp → auth)
  3. The OAuth flow opens a US PostHog URL instead of EU
  4. A modal suggests switching to the EU instance
  5. After switching, the auth fails with Invalid client_id

Expected behavior:

The OAuth flow from mcp-eu.posthog.com should directly open the EU authentication page and complete successfully without needing to switch regions.

Environment:

Debug info

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 by reproducing OAuth from the https://mcp-eu.posthog.com/mcp entry point using the provided configuration and Claude Code flow. Trace why authentication opens the US URL and why the EU redirect rejects the client_id; done means the EU endpoint opens EU authentication directly and completes successfully without a region switch.

Written by the indexing model from the issue text.

Assessment

Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.