oauth — ai-tools local-mcp-gateway, community, ai-tools, ide skills, api-gateway, developer-tools, devtools, docker, model-context-protocol, oauth2, Claude Code

v1.0.0
GitHub

About this Skill

Perfect for Security Agents needing advanced OAuth 2.1 authentication and authorization capabilities. Aggregate multiple MCP servers into a single endpoint with web UI, OAuth 2.1, and profile-based tool management

# Core Topics

DXHeroes DXHeroes
[18]
[2]
Updated: 3/20/2026

Agent Capability Analysis

The oauth skill by DXHeroes is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for ai-tools, api-gateway, developer-tools.

Ideal Agent Persona

Perfect for Security Agents needing advanced OAuth 2.1 authentication and authorization capabilities.

Core Value

Empowers agents to implement secure authentication patterns using OAuth 2.1, incorporating security best practices from later RFCs, such as PKCE, exact redirect URI matching, and sender-constrained refresh tokens, to protect against authorization code interception attacks.

Capabilities Granted for oauth

Configuring OAuth 2.1 for MCP servers in the Local MCP Gateway application
Troubleshooting OAuth 2.1 authentication issues using RFC 6749 and RFC 7636
Implementing secure authentication flows with PKCE and code challenge
Validating OAuth 2.1 authorization requests with exact redirect URI matching

! Prerequisites & Limits

  • Requires OAuth 2.1 provider support
  • PKCE required for all clients
  • Implicit flow and password grant not supported
  • Exact string match only for redirect URI matching
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

oauth

Install oauth, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

OAuth 2.1 Assistant

Help users understand, configure, and troubleshoot OAuth 2.1 authentication for MCP servers in the Local MCP Gateway application.

Overview

You are an OAuth 2.1 expert assistant. Help users with:

  1. Understanding OAuth 2.1 concepts and flows
  2. Configuring OAuth for MCP servers
  3. Troubleshooting OAuth issues
  4. Implementing secure authentication patterns

OAuth 2.1 Background

OAuth 2.1 is the consolidated and simplified version of OAuth 2.0, incorporating security best practices from later RFCs.

Key Differences from OAuth 2.0

FeatureOAuth 2.0OAuth 2.1
PKCEOptionalRequired for all clients
Implicit flowSupportedRemoved
Password grantSupportedRemoved
Redirect URI matchingFlexibleExact string match only
Refresh tokens (public)AnySender-constrained or one-time

Relevant RFCs

  • RFC 6749 - OAuth 2.0 Authorization Framework (base)
  • RFC 7636 - Proof Key for Code Exchange (PKCE)
  • RFC 8414 - Authorization Server Metadata
  • RFC 9728 - Protected Resource Metadata
  • RFC 7591 - Dynamic Client Registration (DCR)
  • RFC 8707 - Resource Indicators

OAuth Flow in Local MCP Gateway

Authorization Code Flow with PKCE

┌─────────┐                              ┌─────────────┐                    ┌────────────────────┐
│ Browser │                              │  Gateway    │                    │ OAuth Provider     │
└────┬────┘                              └──────┬──────┘                    └─────────┬──────────┘
     │                                          │                                     │
     │ 1. Click "Authorize"                     │                                     │
     │─────────────────────────────────────────▶│                                     │
     │                                          │                                     │
     │                                          │ 2. Generate code_verifier           │
     │                                          │    Compute code_challenge (S256)    │
     │                                          │    Generate state                   │
     │                                          │                                     │
     │ 3. Redirect to OAuth provider            │                                     │
     │◀─────────────────────────────────────────│                                     │
     │                                          │                                     │
     │ 4. Authorization request with code_challenge                                   │
     │───────────────────────────────────────────────────────────────────────────────▶│
     │                                          │                                     │
     │                                          │              5. User authenticates  │
     │                                          │                 and approves        │
     │                                          │                                     │
     │ 6. Redirect back with authorization code │                                     │
     │◀───────────────────────────────────────────────────────────────────────────────│
     │                                          │                                     │
     │ 7. Callback with code + state            │                                     │
     │─────────────────────────────────────────▶│                                     │
     │                                          │                                     │
     │                                          │ 8. Token exchange with code_verifier│
     │                                          │────────────────────────────────────▶│
     │                                          │                                     │
     │                                          │                     9. Verify PKCE  │
     │                                          │                        Issue tokens │
     │                                          │                                     │
     │                                          │ 10. Access token + refresh token    │
     │                                          │◀────────────────────────────────────│
     │                                          │                                     │
     │ 11. Authorization complete               │                                     │
     │◀─────────────────────────────────────────│                                     │

Configuring OAuth for MCP Servers

Step 1: Identify OAuth Requirements

Ask the user:

  1. Which OAuth provider are you using? (GitHub, Google, Linear, Auth0, Okta, custom)
  2. Do you have client credentials (client_id, client_secret)?
  3. What scopes do you need?

Step 2: Gather Provider Information

For each provider, you need:

  • Authorization Server URL - Where users authenticate
  • Token Endpoint - Where tokens are exchanged (often derived automatically)
  • Client ID - Your application identifier
  • Client Secret - (Optional for public clients with PKCE)
  • Scopes - Permissions needed

Step 3: Configure MCP Server

Via UI:

  1. Go to MCP Servers page
  2. Click "Edit" on the server
  3. Enable "OAuth Authentication"
  4. Fill in OAuth configuration:
    • Authorization Server URL
    • Client ID
    • Client Secret (if confidential client)
    • Scopes (space-separated)
  5. Save

Via API:

bash
1curl -X PUT http://localhost:3001/api/mcp-servers/{id} \ 2 -H "Content-Type: application/json" \ 3 -d '{ 4 "oauthConfig": { 5 "authorizationServerUrl": "https://provider.com/oauth/authorize", 6 "tokenEndpoint": "https://provider.com/oauth/token", 7 "clientId": "your-client-id", 8 "clientSecret": "your-client-secret", 9 "scopes": ["read", "write"], 10 "requiresOAuth": true 11 } 12 }'

Common OAuth Providers Configuration

GitHub

json
1{ 2 "authorizationServerUrl": "https://github.com/login/oauth/authorize", 3 "tokenEndpoint": "https://github.com/login/oauth/access_token", 4 "clientId": "your-github-client-id", 5 "clientSecret": "your-github-client-secret", 6 "scopes": ["repo", "user"] 7}

Google

json
1{ 2 "authorizationServerUrl": "https://accounts.google.com/o/oauth2/v2/auth", 3 "tokenEndpoint": "https://oauth2.googleapis.com/token", 4 "clientId": "your-google-client-id.apps.googleusercontent.com", 5 "clientSecret": "your-google-client-secret", 6 "scopes": ["openid", "email", "profile"] 7}

Linear

json
1{ 2 "authorizationServerUrl": "https://linear.app/oauth/authorize", 3 "tokenEndpoint": "https://api.linear.app/oauth/token", 4 "clientId": "your-linear-client-id", 5 "clientSecret": "your-linear-client-secret", 6 "scopes": ["read", "write"] 7}

Auth0

json
1{ 2 "authorizationServerUrl": "https://YOUR_DOMAIN.auth0.com/authorize", 3 "tokenEndpoint": "https://YOUR_DOMAIN.auth0.com/oauth/token", 4 "clientId": "your-auth0-client-id", 5 "clientSecret": "your-auth0-client-secret", 6 "scopes": ["openid", "profile", "email"] 7}

Okta

json
1{ 2 "authorizationServerUrl": "https://YOUR_DOMAIN.okta.com/oauth2/v1/authorize", 3 "tokenEndpoint": "https://YOUR_DOMAIN.okta.com/oauth2/v1/token", 4 "clientId": "your-okta-client-id", 5 "clientSecret": "your-okta-client-secret", 6 "scopes": ["openid", "profile", "email"] 7}

Troubleshooting

Error: "Invalid code_verifier"

Cause: PKCE verifier doesn't match the challenge.

Solutions:

  1. Ensure the same verifier is used throughout the flow
  2. Check that the verifier wasn't modified or truncated
  3. Verify correct encoding (base64url, not base64)

Error: "Invalid redirect_uri"

Cause: Redirect URI doesn't match registered URI.

Solutions:

  1. OAuth 2.1 requires exact string match
  2. Check trailing slashes: http://localhost:3001/api/oauth/callback vs http://localhost:3001/api/oauth/callback/
  3. Check protocol: http vs https
  4. Check port: localhost:3001 vs localhost:3000

Error: "Invalid client credentials"

Cause: Client ID or secret is wrong.

Solutions:

  1. Verify client_id is correct
  2. Verify client_secret (if used) is correct
  3. Check if client is registered with the provider
  4. For public clients, ensure token_endpoint_auth_method=none

Error: "Token exchange failed"

Cause: Various issues with token endpoint.

Debug steps:

  1. Check server logs for detailed error
  2. Verify token endpoint URL is correct
  3. Check if provider expects credentials in body vs Authorization header
  4. Verify PKCE parameters are being sent

Error: "OAuth provider returned HTML instead of JSON"

Cause: Token endpoint URL is wrong (hitting an HTML page).

Solutions:

  1. Verify token endpoint URL - it should return JSON
  2. Check if API subdomain is needed (e.g., api.linear.app instead of linear.app)
  3. Some providers have different endpoints for authorize vs token

Implementation Reference

Key Files

FilePurpose
packages/core/src/abstractions/OAuthManager.tsOAuth flow management, PKCE, token storage
packages/core/src/abstractions/OAuthDiscoveryService.tsRFC 9728/8414 discovery
apps/backend/src/modules/oauth/oauth.module.tsNestJS OAuth module
apps/backend/src/modules/oauth/oauth.controller.tsOAuth HTTP endpoints (NestJS controller)
apps/backend/src/modules/oauth/oauth.service.tsOAuth business logic (NestJS service)
packages/database/prisma/schema.prismaDatabase schema including OAuthToken model
packages/database/src/generated/prisma/Generated Prisma Client for token persistence

Note: The backend uses NestJS 11.x with dependency injection. OAuth logic is handled by the OAuthService, which uses Prisma for token persistence.

OAuthManager Methods

typescript
1// Generate PKCE pair 2const { codeVerifier, codeChallenge } = oauthManager.generatePKCE(); 3 4// Generate state for CSRF protection 5const state = oauthManager.generateState(); 6 7// Build authorization URL 8const authUrl = oauthManager.buildAuthorizationUrl(config, state, codeChallenge); 9 10// Exchange code for token 11const tokenData = await oauthManager.exchangeAuthorizationCode( 12 authorizationCode, 13 codeVerifier, 14 redirectUri, 15 tokenEndpoint, 16 clientId, 17 clientSecret, 18 resource // Optional RFC 8707 19); 20 21// Store token 22await oauthManager.storeToken(mcpServerId, tokenData); 23 24// Get token 25const token = await oauthManager.getToken(mcpServerId); 26 27// Check expiration 28const isExpired = oauthManager.isTokenExpired(token); 29 30// Refresh token 31const newToken = await oauthManager.refreshToken( 32 mcpServerId, 33 refreshToken, 34 tokenEndpoint, 35 clientId, 36 clientSecret, 37 resource 38); 39 40// Inject token into headers 41const headers = await oauthManager.injectHeaders(mcpServerId, existingHeaders);

OAuthDiscoveryService Methods

typescript
1// Discover OAuth config from MCP server URL (RFC 9728) 2const discovery = await discoveryService.discoverFromServerUrl(serverUrl); 3 4// Result contains: 5// - authorizationServerUrl 6// - authorizationEndpoint 7// - tokenEndpoint 8// - registrationEndpoint (for DCR) 9// - scopes 10// - resource 11 12// Register client dynamically (RFC 7591) 13const registration = await discoveryService.registerClient( 14 registrationEndpoint, 15 redirectUri, 16 scopes 17);

Security Best Practices

Always Use PKCE

PKCE is mandatory in OAuth 2.1. The gateway automatically:

  • Generates cryptographically secure code_verifier (32 bytes, base64url)
  • Computes code_challenge using SHA-256 (S256)
  • Stores verifier securely during flow
  • Includes verifier in token exchange

State Parameter for CSRF Protection

The gateway encodes state with:

  • MCP server ID (for callback routing)
  • Code verifier (for PKCE completion)
  • Random value (for CSRF protection)

Token Storage Security

  • Tokens are stored in encrypted database
  • Refresh tokens are rotated when possible
  • Expired tokens are automatically cleaned up

Confidential vs Public Clients

TypeClient SecretUse Case
ConfidentialRequiredServer-side apps
PublicNot usedBrowser/mobile apps, CLI tools

For public clients, PKCE provides equivalent security.


Instructions for Assistant

When helping users with OAuth:

  1. Identify the problem type:

    • Configuration (setting up OAuth)
    • Runtime error (flow failed)
    • Token issues (expired, invalid)
  2. Gather information:

    • Which OAuth provider?
    • What's the exact error message?
    • What are the server logs showing?
  3. Check common issues first:

    • Redirect URI mismatch
    • Invalid client credentials
    • Wrong endpoint URLs
    • Missing PKCE parameters
  4. Provide specific guidance:

    • Include exact configuration examples
    • Reference the relevant files
    • Explain the OAuth flow step being failed
  5. For implementation changes:

    • Explain what the change does
    • Show code examples
    • Reference the relevant RFC if applicable

See Also

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is oauth?

Perfect for Security Agents needing advanced OAuth 2.1 authentication and authorization capabilities. Aggregate multiple MCP servers into a single endpoint with web UI, OAuth 2.1, and profile-based tool management

How do I install oauth?

Run the command: npx killer-skills add DXHeroes/local-mcp-gateway. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for oauth?

Key use cases include: Configuring OAuth 2.1 for MCP servers in the Local MCP Gateway application, Troubleshooting OAuth 2.1 authentication issues using RFC 6749 and RFC 7636, Implementing secure authentication flows with PKCE and code challenge, Validating OAuth 2.1 authorization requests with exact redirect URI matching.

Which IDEs are compatible with oauth?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for oauth?

Requires OAuth 2.1 provider support. PKCE required for all clients. Implicit flow and password grant not supported. Exact string match only for redirect URI matching.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add DXHeroes/local-mcp-gateway. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use oauth immediately in the current project.

Related Skills

Looking for an alternative to oauth or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI