mcp-oauth

Custom MCP trigger node with OAuth2 support for n8n

Package Information

Downloads: 0 weekly / 14 monthly
Latest Version: 1.1.0
Author: Emmanuel Nicolaides

Documentation

n8n-nodes-mcp-oauth

Custom MCP trigger node for n8n with OAuth2 authentication support.

Features

  • OAuth2 authentication for MCP trigger nodes
  • Support for multiple OAuth providers (Google, GitHub, Generic)
  • Configurable token header formats (Bearer or custom headers)
  • Backward compatibility with existing authentication methods (None, Bearer, Header)
  • MCP protocol compliance for JSON-RPC 2.0

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the node:
    npm run build
    
  4. Install in n8n:
    npm link
    
    Or copy the dist folder to your n8n community nodes directory.

Configuration

OAuth2 Setup

  1. Create an OAuth2 application with your provider (Google, GitHub, or custom)
  2. Configure the credential with:
    • Authorization URL
    • Access Token URL
    • Client ID
    • Client Secret
    • Scope (optional)
  3. Select the token header format:
    • Bearer Token: Authorization: Bearer <token>
    • Custom Header: <Custom-Header-Name>: <token>

Node Configuration

  1. Authentication: Choose your authentication method
  2. Path: Set the MCP server endpoint path
  3. Response Mode: Choose how to handle responses
  4. Options: Configure additional settings like token validation

OAuth Providers

Google

  • Authorization URL: https://accounts.google.com/o/oauth2/v2/auth
  • Access Token URL: https://oauth2.googleapis.com/token
  • Required scopes: Depends on your use case

GitHub

  • Authorization URL: https://github.com/login/oauth/authorize
  • Access Token URL: https://github.com/login/oauth/access_token
  • Required scopes: Depends on your use case

Generic

Use any OAuth2 provider by providing custom URLs.

Example Usage

  1. Add the MCP OAuth Trigger node to your workflow
  2. Configure OAuth2 credentials
  3. Connect your workflow nodes
  4. Test the webhook endpoint

Development

# Install dependencies
npm install

# Development mode with watch
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

License

MIT

Discussion