Back to Home
codewithpassion icon

cf-mcp-server-clerk

Verified Safe

by codewithpassion

Overview

This server provides a Model Context Protocol (MCP) server with Clerk OAuth authentication, enabling secure remote AI tool access.

Installation

Run Command
wrangler dev

Environment Variables

  • CLERK_CLIENT_ID
  • CLERK_CLIENT_SECRET
  • CLERK_SECRET_KEY
  • CLERK_FRONTEND_API
  • COOKIE_ENCRYPTION_KEY

Security Notes

The project demonstrates good security practices for OAuth, including RFC 9700 compliant CSRF and state validation with one-time use tokens stored in KV. Secure cookies (`__Host-` prefix, HttpOnly, Secure, SameSite=Lax) and signed client approval cookies are used. Input URLs and text for display in the approval dialog are sanitized (`sanitizeText`, `sanitizeUrl`) to prevent XSS. The `JSON.parse(atob(encodedState))` is used, but it's protected by prior CSRF validation and later state validation against KV and a session-bound hash, mitigating injection risks. The `README` explicitly warns it's a demo and requires further production-level security measures.

Similar Servers

Stats

Interest Score0
Security Score8
Cost ClassMedium
Avg Tokens50
Stars0
Forks0
Last Update2026-01-07

Tags

MCPOAuthClerkCloudflare WorkersAI Tools