Castra is a self-hosted backend that runs entirely in your own Cloudflare account — one Worker, one D1 database, your data.
You describe your tables and access rules in TypeScript, and Castra serves them as a REST API with auth, roles and API keys included. Everything is closed by default: a table without a rule is never exposed.
It also ships an MCP server, so AI agents can read and write through the same rules production enforces — they can see exactly what they're allowed to do, and nothing more.
Open source (MIT). Early in development, but deployed and working.
Built with