Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Bridges stdio-based LLM harnesses to OAuth-protected remote MCP servers via Streamable HTTP, handling PKCE browser login and token refresh automatically.

README.md

mcp-auth-proxy

Stdio-to-HTTP MCP proxy with OAuth 2.1 authentication (PKCE + browser login).

Bridges the gap when your LLM harness only supports stdio MCP servers but the remote MCP server requires OAuth (e.g., Microsoft Entra ID).

LLM Harness (stdio only)
  ↕ stdin/stdout (JSON-RPC)
mcp-auth-proxy
  ↕ Streamable HTTP + Bearer token
Remote MCP Server (OAuth-protected)

Features

  • RFC 9728 discovery — auto-discovers authorization server and scopes from the MCP server's protected resource metadata
  • OAuth 2.1 + PKCE — browser-based login, no client secrets needed (public client)
  • Random callback port — each instance uses a random port, safe to run multiple instances simultaneously
  • Auto token refresh — handled transparently by the SDK transport
  • In-memory only — tokens are never written to disk
  • Full proxy — tools, resources, and prompts are all proxied

Installation

⚠️ This package is not published on npm. Install from source using npm link.

git clone https://github.com/manio143/mcp-stdio-proxy.git
cd mcp-stdio-proxy
npm install
npm run build
npm link

Usage

# Basic — discovers client ID from server metadata
mcp-auth-proxy https://mcp.company.com/api

# With explicit client ID
mcp-auth-proxy https://mcp.company.com/api --clientId=my-app-client-id

In MCP client config (e.g., Claude Desktop, VS Code)

{
  "mcpServers": {
    "my-server": {
      "command": "mcp-auth-proxy",
      "args": ["https://mcp.company.com/api", "--clientId=my-app-id"]
    }
  }
}

How authentication works

  1. Proxy probes the remote MCP endpoint → gets 401
  2. Parses WWW-Authenticate header for resource metadata URL (RFC 9728)
  3. Fetches protected resource metadata → finds authorization server + scopes
  4. Fetches authorization server metadata (RFC 8414 / OIDC Discovery)
  5. Opens browser for OAuth 2.1 authorization code flow with PKCE
  6. Receives callback on http://localhost:{random-port}/callback
  7. Exchanges code for tokens
  8. All subsequent requests include Authorization: Bearer <token>
  9. Token refresh happens automatically when tokens expire

Client ID resolution

  1. If --clientId is provided, uses that
  2. If the server's protected resource metadata advertises a client ID, uses that
  3. If the server supports dynamic client registration (RFC 7591), registers automatically
  4. Otherwise, exits with an error

Requirements

  • Node.js ≥ 20
  • A browser for the OAuth login flow
  • The remote MCP server must support Streamable HTTP transport

Security

  • Tokens held in memory only — process exit clears them
  • PKCE prevents authorization code interception
  • Callback server binds to 127.0.0.1 only
  • Random port prevents port conflicts and prediction

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Browser & Scraping servers.