Home / Companies / PropelAuth / Blog / Post Details
Content Deep Dive

Production-ready MCP server using Cloudflare Workers

Blog post from PropelAuth

Post Details
Company
Date Published
Author
Andrew Israel
Word Count
3,207
Language
English
Hacker News Points
-
Summary

Setting up a Model Context Protocol (MCP) server allows AI applications like Claude, Gemini, and ChatGPT to interact with your product, and this blog post outlines the process of developing a basic MCP server using a Cloudflare Worker. The guide walks through creating a simple calculator tool within the server, which handles basic math operations, and details the integration of necessary dependencies such as @modelcontextprotocol/sdk, Cloudflare's Agent library, and the validation library zod. Once the server is functional, the post addresses authentication and authorization by introducing PropelAuth as an MCP authorization server, enabling OAuth 2.1 compliance, and detailing how to validate AI client requests. Additionally, it emphasizes the importance of secure connections and proper scope management to ensure only authorized users can perform certain actions. The blog also discusses the full workflow of an authenticated interaction between an AI client and the MCP server, offering real-world use cases where such a setup could be beneficial, such as querying SEO data with Ahrefs or managing calendar operations with Google Calendar MCP servers.