Skip to main content
Glama
mcp-auth-proxy

mcp-auth-proxy

@thuyphuocthinh/mcp-auth-proxy πŸ”

Zero-config Stdio to Streamable HTTP MCP runtime proxy with automatic OAuth 2.0 PKCE discovery & silent token refresh.

CI NPM Version License: MIT Node.js Zero Dependencies

mcp-auth-proxy acts as a zero-config bridge between your AI Client (Google Antigravity, Cursor, Windsurf, Claude Code, VS Code Copilot) and any remote Model Context Protocol (MCP) server protected by OAuth 2.0 (e.g., 200Lab AI Tutor, Notion, Linear, GitHub).


🌟 Highlights

  • πŸš€ Zero Runtime Dependencies: Pure Node.js (node:http, node:crypto, node:net), lightweight, launches immediately via npx.

  • πŸ” Automated OAuth Discovery: Intercepts 401 Unauthorized, parses WWW-Authenticate: Bearer resource_metadata="..." and resolves .well-known endpoints automatically.

  • πŸ”‘ Dynamic Client Registration (RFC 7591) & PKCE (RFC 7636): Automatically registers client IDs on the fly with S256 challenge, eliminating the need for hardcoded client secrets.

  • 🌐 Cross-Platform Auto Browser Launch: Automatically opens default browser on Windows (start), macOS (open), and Linux (xdg-open).

  • πŸ”„ Silent Background Refresh: Automatically renews expiring tokens in the background via grant_type=refresh_token before the 5-minute expiry threshold.

  • πŸ›‘οΈ Static Header Bypass: Support for --header flag to pass static API keys or personal access tokens directly.

  • 🚦 Dynamic Port Selection: Automatically scans for free local ports starting from 8080 (8081, 8082...), eliminating EADDRINUSE port collision errors.


Related MCP server: Cartena MCP Server

πŸ“¦ Usage

1. Antigravity / Cursor Configuration

Add this entry to your mcp_config.json or claude_desktop_config.json:

{
  "mcpServers": {
    "200lab-ai-tutor": {
      "command": "npx",
      "args": [
        "-y",
        "@thuyphuocthinh/mcp-auth-proxy",
        "https://mcp.200lab.io/mcp/learner"
      ]
    }
  }
}

On first launch, your browser will automatically pop up to approve authorization. Subsequent launches will run silently forever with automatic token refresh!


2. CLI Options

npx @thuyphuocthinh/mcp-auth-proxy <remote-url> [options]

Option

Description

--client-id <id>

Pre-configured Client ID (for servers without RFC 7591 dynamic registration)

--header "Key: Value"

Custom request header (e.g. bypass OAuth with static API key)

--no-browser

Disable automatic browser launch; prints login URL to stderr (for headless/VPS environments)

--login-only

Perform interactive OAuth authentication, save credentials, and exit

-h, --help

Display help instructions

-v, --version

Display version number


πŸ§ͺ Testing

npm run build
npm test

49 unit tests covering all core modules with 100% pass rate.


πŸ“„ License

MIT Β© Thuy Phuoc Thinh

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Bridges stdio-based LLM harnesses to OAuth-protected remote MCP servers via Streamable HTTP, handling PKCE browser login and token refresh automatically.
    5 npm
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI clients like Claude to interact with Cartena tools via MCP, supporting remote OAuth or local stdio authentication.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Bridge that lets stdio-only MCP clients connect to remote MCP servers with OAuth and other auth support, enabling local clients to use remote, authorized MCP servers.
    53 npm
    54
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP clients to connect to remote servers that have OAuth issuer mismatches (e.g., OutSystems) by relaying stdio and handling OAuth flows with optional issuer override.
    9 npm
    MIT