
最佳阅读
STREAMABLE HTTPHTTP-SSE基于Cloudflare的AI图书推荐系统
基于Cloudflare的AI图书推荐系统
This is a remote MCP server, built on Cloudflare Workers, that provides personalized book recommendation.
This was built using Cloudflare's guide on deploying remote MCP servers. It uses the Agents SDK to build the MCP server, Durable Objects to persist the user's book preferences, Workers AI to generate book recommendations, and Cloudflare's OAuth Provider library to add GitHub as an authentication provider. The MCP server supports Server-Sent Events (/sse) and Streamable HTTP (/mcp) transport methods.
To try it out, connect to https://bestreads.dinas.workers.dev/sse
or https://bestreads.dinas.workers.dev/mcp
, if your MCP client supports Streamable HTTP. Or, deploy it yourself using the Deploy to Cloudflare button + instructions below.
git clone <your-repo-url> cd bestreads-mcp-server npm install
wrangler.toml
file[vars]
GITHUB_CLIENT_ID = "your_github_client_id"
GITHUB_CLIENT_SECRET = "your_github_client_secret"
COOKIE_ENCRYPTION_KEY = "your_32_byte_hex_key"
[[kv_namespaces]]
binding = "OAUTH_KV"
id = "your_kv_namespace_id"
[[durable_objects.bindings]]
name = "MCP_OBJECT"
class_name = "MyMCP"
[[durable_objects.bindings]]
name = "USER_BOOK_PREFERENCES"
class_name = "UserBookPreferences"
wrangler deploy