Demo project: this repository is a proof-of-concept for running an MCP server on Cloudflare to manage agent-owned repos and Worker preview/deploy flows. It is intentionally not production-hardened.
This Worker exposes MCP tools that let an authenticated agent:
- create and manage Git repositories
- seed new repos with deploy-ready Worker starter files
- create preview builds and promote them to production
- create and merge pull requests
- Cloudflare Workers (runtime and deployment): Workers docs
- Agents SDK (
agents/agents/mcp): Agents docs - Durable Objects (stateful per-agent/per-repo coordination): Durable Objects docs
- D1 (metadata and control-plane persistence): D1 docs
- Workers KV (OAuth/session-related key-value state): KV docs
- Wrangler (local dev, deploy, types generation): Wrangler docs
- Node.js compatibility in Workers (
nodejs_compat): Node.js compatibility docs - Cloudflare MCP docs (protocol and integration reference): MCP docs
- Cloudflare Sandbox SDK (
@cloudflare/sandbox): SDK package - Workers OAuth Provider (
@cloudflare/workers-oauth-provider): SDK package
- Node.js 20+
- A Cloudflare account
- Artifacts beta access (at the time of writing, Artifacts is not public)
- Wrangler authenticated (
npx wrangler login)
npm install
npm run devnpm run deployRun this when bindings in wrangler.jsonc change:
npm run cf-typegen- Some values (for example account identifiers in scripts) are demo-oriented and should be parameterized for real environments.
- Security, tenancy, and operational controls are simplified to keep the demo focused.
- Error handling and observability are good enough for exploration, not full production reliability targets.
- The OAuth flow is deliberately simple, real use cases would need a more robust auth flow