SDK for building OAuth-protected Remote MCP servers on Cloudflare Workers with pluggable auth adapters (Supabase already implemented).
Who is this for?
TL;DR: If you are building an MCP server/agent that needs user authentication but your identity provider does not yet offer an OAuth 2.1 flow (e.g., Supabase as of October 2025), this SDK helps you run your MCP behind a reverse-proxy-based OAuth flow and deploy it as a Cloudflare Worker.
Use this if:
SDK for building OAuth-protected Remote MCP servers on Cloudflare Workers with pluggable auth adapters (Supabase already implemented).
2026-11-16
Estrelas
—
Ferramentas
—
Disponibilidade
—
You have an MCP agent/server and need authenticated access per user.
Your IdP lacks a suitable OAuth 2.1 flow for your use case today.
You want a Cloudflare Workers deployment with pluggable auth adapters (Supabase included).
For local development, create a .dev.vars file in your project root:
# .dev.vars (for local development only - DO NOT commit to git)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_ANON_KEY=your-anon-key-here
PROXY_TARGET_URL=http://localhost:3000
Note: .dev.vars is already included in .gitignore to prevent accidental commits of sensitive credentials.
4. Set secrets for production
For production deployment, configure all environment variables as secrets with Wrangler:
# Required secrets
npx wrangler secret put SUPABASE_URL
npx wrangler secret put SUPABASE_ANON_KEY
npx wrangler secret put PROXY_TARGET_URL
5. Run locally or deploy
# Local development (uses .dev.vars)
npx wrangler dev
# Deploy to production (uses wrangler secrets)
npx wrangler deploy
Use npx @modelcontextprotocol/inspector or npx @mcpjam/inspector@latest to connect and test your MCP server.
Example Project
See examples/supabase/ for a complete working Worker with:
Example MCP agent
Your Supabase Auth provider
Runtime adapter construction from env
Dev vars template and Wrangler config
Building a Custom Auth Provider (non-Supabase)
Implement the AuthAdapter interface and pass your adapter to createOAuthProviderWithMCP.
Key responsibilities:
getUser(c): return { id, email } when authenticated, or null.
getSession(c): return { accessToken, refreshToken, ... } or null.
getAuthorizationProps(c, user, session): return properties to persist with the OAuth token. Include anything required for future refreshes (e.g., API base URL, client id/secret, tenant).
A full runnable sample is in examples/custom-adapter/.
API
import {
createOAuthProviderWithMCP,
createAuthProxy,
SupabaseAuthAdapter,
type SupabaseAdapterConfig,
type SupabaseBindings,
type AppConfig,
type AuthAdapter,
type CoreBindings,
type TokenExchangeResult,
} from "@famma/mcp-auth";
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Perguntas
Como instalo @famma/mcp Auth?
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
@famma/mcp Auth precisa de uma chave de API?
Este registro não lista nenhuma variável de ambiente obrigatória.
Qual transporte @famma/mcp Auth usa?
@famma/mcp Auth roda localmente via stdio.
Quando @famma/mcp Auth foi verificado pela última vez?
Última verificação: 2026-11-16. SDK for building OAuth-protected Remote MCP servers on Cloudflare Workers with pluggable auth adapters (Supabase already implemented).