awesome-ai-native-cloudflare-app MCP Server
Enables AI agents to interact with the app via MCP tools and resources, supporting self-improvement through goal-setting and metrics tracking on Cloudflare Workers.
README
awesome-ai-native-cloudflare-app
A batteries-included starting point for AI-native apps on Cloudflare
Workers: one Worker that is simultaneously an HTTP app, an MCP server
(so AI agents and workspaces like deco studio can
operate it), an embeddable MCP-App UI, and a WhatsApp bot — deployed
by git push via Workers Builds.
Start with PROMPT.md — the master prompt / field guide.
Read it yourself, or paste it into your AI coding agent (as CLAUDE.md or
system context) and describe the app you want. The scaffold in this repo is
the reference implementation of every pattern it describes.
What's inside
PROMPT.md ← the master prompt (read this first)
wrangler.jsonc one Worker: D1 + KV bindings, Text-import rules
src/server/
main.ts Hono app: / (SPA), /mcp, /webhook, /healthz
mcp/server.ts complete MCP server in ~150 lines (JSON-RPC 2.0, no SDK)
mcp/tools.ts tool registry — plain objects, hand-written JSON Schema
mcp/resources.ts ui:// resources — the SPA served as an MCP App
routes/webhook.ts Meta WhatsApp webhook (HMAC, dedupe, ack-fast + waitUntil)
pipeline/inbound.ts LLM reply pipeline with KV thread memory
services/meta.ts zero-dependency WhatsApp Cloud API client
ai/gateway.ts all LLM calls via Cloudflare AI Gateway
lib/auth.ts bearer gate for /mcp (3 vectors, constant-time, fail closed)
src/client/ React 19 MCP-App UI → ONE self-contained HTML file
migrations/ numbered D1 SQL migrations
prompts/system.md system prompt, bundled as a string
The demo domain is a trivial notes app + WhatsApp assistant — deliberately boring, so the architecture is the interesting part. Replace the tools and views with your own.
Self-improving by design
The app measures itself (first-party analytics in D1 — no GA/PostHog: a
track() helper, a POST /e beacon, cookieless daily-hash uniques) and
exposes goals, memory, and hypotheses as MCP tools. Connect Claude Code to
the deployed app (.mcp.json — set APP_MCP_URL / APP_MCP_TOKEN), and
CLAUDE.md turns any session into an improvement cycle:
get_briefing → conclude testing hypotheses against real metrics →
pick one proposed bet → edit the code locally → deploy → record to memory
Set a few goals (goal_set), throw an agent at it, spend tokens, watch the
metrics move. Humans stay in the loop at consequence: user-facing messages,
money, data deletion. Full pattern in PROMPT.md §10.
Quickstart
bun install
cp .dev.vars.example .dev.vars # set MCP_AUTH_TOKEN at minimum
# create resources, paste the printed ids into wrangler.jsonc
bunx wrangler d1 create app-db
bunx wrangler kv namespace create THREADS
bunx wrangler kv namespace create DEDUPE
bun run db:local # apply migrations locally
bun run dev:worker # builds UI + runs the Worker on :8787
Try it:
curl -X POST 'http://localhost:8787/mcp?token=dev-token-change-me' \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Deploy: bun run deploy once by hand, then connect the repo to Workers
Builds in the Cloudflare dashboard so every push to main deploys and every
PR gets a preview URL. Apply remote migrations with bun run db:remote and
set secrets with wrangler secret put.
Register in deco studio: Registry → Add MCP Server → URL
https://<your-worker>.workers.dev/mcp?token=<MCP_AUTH_TOKEN>, type http.
Your tools appear in the workspace and the dashboard renders as an MCP App.
WhatsApp: create a Meta developer app + WhatsApp Business number, set the
META_* secrets, point the webhook at https://<your-worker>/webhook with
your verify token. Full recipe and gotchas in PROMPT.md §6.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。