OAuth 2.1 Support for MCP Client Node

It would help if there was a node for:

The existing MCP Client node needs OAuth 2.1 authentication support. Currently, the MCP Client node only accepts static credentials (stored Bearer tokens or Header auth), which is incompatible with MCP servers that follow OAuth 2.1 patterns with short-lived tokens and token
refresh flows.

Specifically needed:

  • Dynamic token acquisition from OAuth endpoints
  • Automatic token refresh before expiration
  • Support for Client Credentials flow
  • Support for Authorization Code flow (with PKCE)
  • Ability to inject tokens from previous workflow nodes (expressions)

My use case:

Scenario 1: Enterprise MCP Server with Short-Lived Tokens

My MCP server implements security best practices with OAuth 2.1:

  1. Authentication endpoint (POST /mcp/auth) returns short-lived tokens (60-90 min)
  2. AI Agent needs to call MCP tools throughout the day
  3. Current MCP Client node can’t refresh expired tokens automatically
  4. Result: Workflows fail after token expiration, requiring manual intervention

Scenario 2: Multi-Step OAuth Flow

Current workflow that fails:

  1. HTTP Request β†’ POST /mcp/auth β†’ Returns {access_token: β€œβ€¦β€, expires_in: 3600}
  2. AI Agent β†’ Connected to MCP Client Tool
  3. MCP Client β†’ :cross_mark: Cannot receive dynamic token from step 1
  4. MCP Client β†’ Uses static credential β†’ :cross_mark: Token expires, integration breaks

Scenario 3: Third-Party SaaS MCP APIs

Many modern MCP providers (following the MCP Security Best Practices) use OAuth for access control:

  • User authenticates via OAuth
  • Receives temporary access token
  • n8n workflows need to use these tokens with MCP Client
  • Current blocker: No way to pass OAuth tokens to MCP Client

Impact:

  • Cannot integrate with OAuth-protected MCP servers
  • Must violate security policies by using long-lived tokens
  • Complex workarounds (proxy servers, manual HTTP requests) lose MCP Client benefits
  • Blocks enterprise adoption where OAuth is mandatory

Any resources to support this?

MCP Specification:

OAuth Standards:

Community Discussions:

Related n8n Issues:

  • #14539 - MCP Client connection problems (mentions auth challenges)
  • #14478 - OAuth2 implementation issues in n8n
  • #17450 - OAuth2 token refresh problems

Are you willing to work on this?

Yes! I would be really excited to work on this. I have the ability, skills, and time to contribute to implementing OAuth 2.1 support for the MCP Client node. I’m happy to collaborate with the n8n team on architecture, implementation, and testing.

Hey @Yassel_Piloto, OAuth for MCP Client tool was 1.119.0, see PR here: feat(MCP Client Tool Node): Add support for OAuth2 with Dynamic Client Registration by RomanDavydchuk Β· Pull Request #21034 Β· n8n-io/n8n Β· GitHub

1 Like