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
Estrellas
—
Herramientas
—
Disponibilidad
—
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";
Aún no hay lista de herramientas. Los servidores remotos la reciben tras la primera comprobación de estado.
Preguntas frecuentes
Preguntas
¿Cómo instalo @famma/mcp Auth?
Copia en esta página la configuración stdio para Cursor, Claude Desktop, Claude Code o VS Code. Usa la instalación del publicador, no un proxy de PlugMCP.
¿@famma/mcp Auth necesita una clave de API?
Este registro no indica ninguna variable de entorno obligatoria.
¿Qué transporte usa @famma/mcp Auth?
@famma/mcp Auth se ejecuta localmente por stdio.
¿Cuándo se comprobó @famma/mcp Auth por última vez?
Última comprobación: 2026-11-16. SDK for building OAuth-protected Remote MCP servers on Cloudflare Workers with pluggable auth adapters (Supabase already implemented).