Back to Home
webrix-ai icon

mcp-s-oauth

by webrix-ai

Overview

Universal OAuth middleware for MCP (Model Context Protocol) servers, enabling authentication with various OAuth providers.

Installation

Run Command
npm run dev

Environment Variables

  • BASE_URL
  • GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET
  • DB_PATH
  • TOKEN_EXPIRATION_TIME

Security Notes

Critical Open Redirect Vulnerability: In `src/services/mcp-auth-provider.ts`, the `redirectUri` provided by the client in the `/auth/authorize` request is stored in the OAuth `state` parameter and later used directly for `res.redirect()` in the `/oauth/callback` without validation. An attacker can craft a malicious `redirectUri` to redirect users to their own site after successful external OAuth authentication, potentially intercepting the internal MCP authorization code. Additionally, `skipLocalPkceValidation: true` means the internal MCP authorization code flow does not enforce PKCE, making it vulnerable to authorization code interception attacks. Sensitive OAuth and internal MCP tokens are stored in a local SQLite database, which requires careful management (permissions, encryption at rest) in production.

Similar Servers

Stats

Interest Score34
Security Score3
Cost ClassLow
Stars4
Forks0
Last Update2025-11-23

Tags

OAuthMiddlewareExpressAuthenticationMCP