MCP OAuth Cloudflare

Implement OAuth authentication for MCP servers on Cloudflare Workers.

961|99|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/jezweb/claude-skills --skill mcp-oauth-cloudflare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: MCP OAuth Cloudflare
Source: https://github.com/jezweb/claude-skills/tree/main/skills/mcp-oauth-cloudflare
Command: npx skills add https://github.com/jezweb/claude-skills --skill mcp-oauth-cloudflare

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @cloudflare/workers-oauth-provider, @modelcontextprotocol/sdk, agents, hono, zod, and includes templates (resource) and rules (resource) and references (resource) components.

What problem does it solve?

This Skill eliminates the complexity of implementing secure OAuth authentication for MCP servers, saving developers days of security implementation work and preventing common authentication vulnerabilities.

Core Features & Use Cases

  • Complete OAuth Flow: Automatically handles Google OAuth integration with proper security measures.
  • Claude.ai Compatibility: Provides Dynamic Client Registration (DCR) out of the box for seamless Claude.ai integration.
  • Use Case: Imagine you're building an MCP server that needs user-specific data. Use this Skill to replace static auth tokens with a secure OAuth flow that gives you user email, name, and profile information automatically.

Quick Start

Add OAuth authentication to my MCP server on Cloudflare Workers.

Frequently Asked Questions about MCP OAuth Cloudflare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OAuth authentication to an MCP server on Cloudflare Workers?

OAuth authentication for MCP servers on Cloudflare Workers automates user sign-in and replaces static tokens with secure flows. This Skill handles Google OAuth integration, CSRF protection, state validation, and session binding using KV storage and Durable Objects, eliminating days of security implementation work.

Can I use OAuth with Claude.ai and MCP without manual client registration?

Yes. Dynamic Client Registration (DCR) is built in, enabling seamless Claude.ai integration without static credentials. The Skill automatically handles the registration handshake so MCP deployments requiring user sign-in work with Claude.ai out of the box.

What user information can I retrieve after OAuth authentication?

After OAuth token exchange, you retrieve user email, name, and profile information from Google. This enables user-specific data access and personalization within your MCP server while maintaining secure authentication state.

Does this approach prevent common OAuth vulnerabilities in MCP deployments?

Yes. The Skill enforces CSRF protection, state validation, and session binding by default. These security measures prevent token interception, replay attacks, and unauthorized state manipulation in MCP environments on Cloudflare Workers.

How does the Skill store OAuth state and session data?

OAuth state is stored in Cloudflare KV for distributed access, while MCP sessions are managed via Durable Objects for stateful, consistent session handling. This architecture ensures scalability and reliability across Cloudflare Workers instances.

What dependencies and frameworks does this Skill require?

The Skill uses @cloudflare/workers-oauth-provider, @modelcontextprotocol/sdk, Hono for routing, and Zod for schema validation. It integrates with agents and works within the Cloudflare Workers environment for MCP server deployments.