# MCP OAuth authentication failed error 500

**URL:** <https://community.hubspot.com/t/mcp-oauth-authentication-failed-error-500/146211>\
**Category:** Marketplace Apps\
**Tags:** third-party-apps\
**Created:** [February 13, 2026, 2:24pm UTC](https://community.hubspot.com/t/mcp-oauth-authentication-failed-error-500/146211 "2026-02-13T14:24:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NKing80](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@NKing80](https://community.hubspot.com/u/NKing80)\
**Post date:** [February 13, 2026, 2:24pm UTC](https://community.hubspot.com/t/mcp-oauth-authentication-failed-error-500/146211/1 "2026-02-13T14:24:22Z")

</div>

Hello all. I am working with a self hosted N8N Instance which will connect to the Hubspot MCP with the MCP Client Node.

In Hubspot, I have setup an MCP app:

- App ID: 31008355

- Redirect URL: [https://n8n.mydomain.com/rest/oauth2-credential/callback](https://n8n.mydomain.com/rest/oauth2-credential/callback) (provided my n8n)

I am setting up MCP OAuth2 API creditials in N8N to connect in this:

- Grant type: PKCE

- Auth URL: [https://mcp.hubspot.com/oauth/authorize/user](https://mcp.hubspot.com/oauth/authorize/user)

- Access URL: [https://mcp.hubspot.com/oauth/v3/token](https://mcp.hubspot.com/oauth/v3/token)

- Client ID: (provided from hubspot)

- Client Secrent: (Provided from hubspot)

When press connect my account I go through the following steps:

- A new page with the code\_challenge in the URL opens, I see my hubspot account and can choose it

- I see the available scopes (view details about invoices etc) and can select these

- When I press Connect App I get the following errror

#### Error: Request failed with status code 500

More details

Failed to connect. The window can be closed now.

There are no further details on the config or in the browser. Any assistance with this would be greatly appreciated, as I understand the MCP server is in Beta. Thankyou.

 ![Screenshot 2026-02-13 at 2.22.54 pm.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/3/832ab6f7b1bbbe05bb0ce82e508243ddc4b6e9a9.png)

---

<div class="post-metadata">

**Author:** ![GiantFocal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/giantfocal/32/41969_2.png) [@GiantFocal](https://community.hubspot.com/u/GiantFocal)\
**Post date:** [February 14, 2026, 3:25am UTC](https://community.hubspot.com/t/mcp-oauth-authentication-failed-error-500/146211/2 "2026-02-14T03:25:43Z")

</div>

Hi @NKing80,

The 500 error is likely due to a handshake failure caused by your n8n instance not recognizing its own public address. Since you are self-hosting, do double-check that your WEBHOOK\_URL environment variable is set to [https://n8n.mydomain.com/](https://n8n.mydomain.com/), matching your redirect URI base.

---

<div class="post-metadata">

**Author:** ![NKing80](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@NKing80](https://community.hubspot.com/u/NKing80)\
**Post date:** [February 16, 2026, 10:37am UTC](https://community.hubspot.com/t/mcp-oauth-authentication-failed-error-500/146211/3 "2026-02-16T10:37:19Z")

</div>

Hello thankyou for this. Our env is setup with the webhook url correctly (with our actual domain instead):

# -- Webhook node configurations  
webhook:  
# -- Use `regular` to use main node as webhook node, or use `queue` to have webhook nodes  
mode: queue  
# -- Webhook url together with http or https schema  
url: “[https://n8n.mydomain.com](https://n8n.mydomain.com)”

---

<div class="post-metadata">

**Author:** ![RubenBurdin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rubenburdin/32/75212_2.png) [@RubenBurdin](https://community.hubspot.com/u/RubenBurdin)\
**Post date:** [February 18, 2026, 11:42pm UTC](https://community.hubspot.com/t/mcp-oauth-authentication-failed-error-500/146211/4 "2026-02-18T23:42:41Z")

</div>

Hey @NKing80

GiantFocal’s suggestion about the WEBHOOK\_URL is a good first check. On top of that, since you’re using PKCE grant type, one thing worth verifying is whether the token exchange endpoint is actually expecting PKCE or a standard authorization code flow. HubSpot’s MCP server is still in beta and I’ve seen cases where the OAuth implementation doesnt fully support PKCE yet even if the authorize step accepts the code\_challenge. The 500 on the token request (not a 400 or 401) suggests the server itself is failing to process something, not just rejecting your credentials.

A couple things I’d try. First, check if n8n is sending the `code_verifier` correctly in the token request body. You can inspect the outgoing request in n8n’s execution log or with your browser dev tools. Second, try switching the grant type to a standard Authorization Code flow (without PKCE) as a test to see if the token exchange succeeds. If it does, then you know the issue is specifically with how HubSpot’s MCP beta handles the PKCE verification step. Also worth checking that your client secret isnt being sent alongside the PKCE parameters since some implementations choke when they receive both.

Since MCP is beta, I’d also recommend opening a ticket with HubSpot support and referencing the 500 error specifically. A 500 is a server side failure on their end and theres only so much you can debug from your side. We’ve had similar experiences at Stacksync when integrating with newer HubSpot API features, sometimes its just a matter of waiting for a fix on their side. Note This response was written based on my own experience and lightly reformatted with AI for clarity.

Hope you get it sorted!
