aicoolies logo
Cloudflare logo
Cloudflare logo

workers-oauth-provider

OAuth 2.1 provider framework for Cloudflare Workers

freeopen sourceverified Aug 22, 2026

workers-oauth-provider is Cloudflare's official OAuth provider library for Workers. It implements the provider side of the OAuth 2.1 protocol with PKCE support and RFC 8414 compliance. Handles token management automatically via Cloudflare KV storage. Gives fullstack teams a path to implement OAuth at the edge without heavy auth servers. TypeScript-native with npm package available.

Workers OAuth Provider is Cloudflare's official TypeScript library that implements the provider side of the OAuth 2.1 protocol for Cloudflare Workers, designed specifically to add authorization to remote MCP servers and API endpoints. It implements the full suite of specifications required by the MCP authorization standard: OAuth 2.1 with PKCE (draft-ietf-oauth-v2-1-13), Authorization Server Metadata (RFC 8414), Protected Resource Metadata (RFC 9728), Dynamic Client Registration (RFC 7591), and Client ID Metadata Documents. The library wraps around existing Worker code, automatically handling token management, authorization flows, and session validation while passing authenticated user details directly to API handlers.

The library emerged as a critical piece of MCP infrastructure after the Model Context Protocol specification mandated OAuth 2.1 with PKCE for all public remote servers in November 2025. Without it, developers building remote MCP servers on Cloudflare Workers would need to implement the full OAuth 2.1 flow from scratch — a complex and security-sensitive task involving PKCE code challenges, token rotation, and metadata endpoint configuration. The library reduces this to a few lines of configuration, making it practical for individual developers and small teams to deploy authenticated MCP servers. It integrates naturally with Cloudflare's Durable Objects for session storage and KV for token persistence.

Published on npm as @cloudflare/workers-oauth-provider with over 1,700 GitHub stars, the library has become the de facto standard for adding authentication to Cloudflare-hosted MCP servers. The project maintains active development with security-conscious practices — a PKCE bypass vulnerability discovered through responsible disclosure was quickly patched, demonstrating the security scrutiny the library receives. It ships under the MIT license with comprehensive documentation on Cloudflare's developer docs, example implementations, and integration guides for popular identity providers including Stytch, Auth0, and Clerk.

Pricing

Free, open-source MIT-licensed npm library. No paid package or provider-hosted edition is documented; deployment uses Cloudflare Workers and KV, whose infrastructure usage may incur separate charges.

full pricing breakdown →

Platforms

Cloudflare Workers, TypeScript

Categories

Tags

Use Cases

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

Cilium logo

Cilium

eBPF-based networking, security, and observability for Kubernetes

Cilium is a CNCF Graduated, Apache-2.0 project for Kubernetes networking, security, and observability using eBPF. It can replace kube-proxy, enforce identity-aware L3-L7 network policies, and add Hubble flow observability plus Tetragon runtime-security signals. Current source checks support GKE Dataplane V2 using Cilium/eBPF and Azure CNI Powered by Cilium for AKS.

Open Source
OrbStack logo

OrbStack

Fast and lightweight Docker Desktop alternative for macOS

OrbStack is a macOS application that replaces Docker Desktop with lightweight container and Linux VM management. Its docs emphasize fast starts, lower CPU and memory overhead, and native macOS integration with menu bar controls, file sharing, and network access to containers by name, with exact gains depending on workload. Supports Docker, Kubernetes, and full Linux VMs.

freemium
Ray logo

Ray

Distributed AI compute engine for scaling Python and ML workloads

Ray is an open-source distributed computing framework built for scaling AI and Python applications from a laptop to thousands of GPUs. It provides libraries for distributed training, hyperparameter tuning, model serving, reinforcement learning, and data processing under a single unified API. Ray's public site highlights OpenAI and other enterprise users. Maintained by Anyscale with Apache-2.0 open-source licensing.

Open Source
Act logo

Act

Run GitHub Actions locally for fast feedback

Act is an open-source tool that runs GitHub Actions workflows locally using Docker containers that match GitHub's execution environment. It provides instant feedback on workflow changes without pushing to a repository, supports matrix builds, secret management, and artifact handling. Act can also replace Makefiles by using workflow files as task definitions, making it useful for both CI/CD development and local task automation across development teams.

Open Source
Clerk logo

Clerk

Drop-in authentication for modern JavaScript apps

Clerk is a complete authentication and user management platform for React, Next.js, and modern JavaScript frameworks. It provides pre-built UI for sign-in, sign-up, user profiles, organizations, MFA, passkeys, JWT sessions, webhooks, and billing. The Hobby plan supports up to 50,000 monthly retained users per app, with Pro, Business, and Enterprise tiers for growing teams.

freemium
Docker logo

Docker

Build, share, and run containers

Industry-standard container platform for building, shipping, and running applications in isolated, reproducible environments. Package apps with all dependencies into portable containers using Dockerfiles and images. Docker Compose orchestrates multi-container applications. Docker Hub hosts millions of pre-built images. Docker Desktop provides GUI management on Mac/Windows. Essential for local development, CI/CD, and production deployments. The foundation of modern containerized infrastructure.

freemiumOpen SourceTelemetry

FAQ

What is workers-oauth-provider?

workers-oauth-provider is Cloudflare's official OAuth provider library for Workers. It implements the provider side of the OAuth 2.1 protocol with PKCE support and RFC 8414 compliance. Handles token management automatically via Cloudflare KV storage. Gives fullstack teams a path to implement OAuth at the edge without heavy auth servers. TypeScript-native with npm package available.

Is workers-oauth-provider free?

Yes — workers-oauth-provider is free to use. Free, open-source MIT-licensed npm library. No paid package or provider-hosted edition is documented; deployment uses Cloudflare Workers and KV, whose infrastructure usage may incur separate charges.

Is workers-oauth-provider open source?

Yes — workers-oauth-provider is open source.

Is workers-oauth-provider still maintained?

Yes — workers-oauth-provider is active. Its listing was last verified on August 22, 2026.

What are the best workers-oauth-provider alternatives?

The top editor-verified workers-oauth-provider alternatives are Authentik, TypeORM.