Hubspot MCP server <> n8n - Bad Client ID

Hey guys,

I’m kind of stuck as neither Gemini nor Claude can help me solve this.

I am trying to use the Hubspot MCP server node with the MCP OAuth2 API inside n8n with the following settings:

Grant Type PKCE
Authorization URL https://mcp.hubspot.com/oauth/authorize
Access Token URL https://api.hubapi.com/oauth/v1/token
Client ID Hubspot ID
Client Secret Hubspot MCP App Secret
Scope oauth
Authentication Send credentials in Body
Auth URI Query Parameters Leave empty

Once i try to connect the app, choose my account and enable different permission scopes i finally retrieve this error.

Anyone knows how to solve this?

THANKS!

Runnning the n8n instance on 2.2.3 via Hostinger VPS.

@Simpson007 so hubspot’s standard OAuth2 flow doesn’t use PKCE (Proof Key for Code Exchange) by default, and the authorization URL you’re using appears to be for HubSpot’s MCP (Marketing Contacts Platform) which has different requirements.

@Miliaga Thanks for the reply.

I swapped to “Authorization Code” as Grant Type and tried different URLs.

Getting another error this time. Can you help us out and maybe test this on your side here?

n8n docs for this unfortunately lead to a404 blank page.
Much appreciated.

@Simpson007

Update your URLs to:

Authorization URL: https://app.hubspot.com/oauth/authorize

Access Token URL: https://api.hubapi.com/oauth/v1/token

Hi :waving_hand:
The error you’re seeing is due to HubSpot MCP OAuth flow limitations, not n8n.
Key points:
PKCE grant type is not fully supported by HubSpot MCP.
The authorization succeeds, but token exchange fails.
oauth alone is not a valid scope — HubSpot requires specific scopes like crm.objects.contacts.read.
Solutions:
:one: Use standard HubSpot OAuth (Authorization Code grant)
Auth URL: https://app.hubspot.com/oauth/authorize
Token URL: https://api.hubapi.com/oauth/v1/token
Define proper scopes
Redirect URI must match n8n exactly
:two: Use MCP via Private App / Bearer Token
Create a private app in HubSpot
Use HTTP Request node in n8n instead of OAuth
Bypasses PKCE limitations

Thanks guys. Adjusted the URLs and now I get this error message:

”Error: Insufficient parameters for OAuth2 callback.

More details
Received following query parameters: {"error":"invalid_request","error_description":"Missing or unknown code challenge","

Any ideas?

//Claude tells me this:
The issue is tracked here: GitHub Issue #22103

Hi @Simpson007 ,

Instead of using the generic OAuth2 API credential, look for “HubSpot” in the credentials list this should work without these OAuth issues.

And the GitHub issue is being tracked, but no ETA on a fix yet.

nope, does not work.

seems like i go back to classic work and just add different API endpoint calls as tools attached to an agent…

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.