Skip to main content
Glama
inboxlease

inboxlease

by stone16
README.md
# inboxlease

inboxlease is a self-hosted email gateway for agents. Agents read and draft through MCP. A human reviews every outbound message in the web console.

- Receive and archive email with Cloudflare Email Routing, D1 and R2.
- Connect an agent with a tenant- and domain-scoped token.
- Review drafts, inspect thread history and reconcile ambiguous sends.
- Receive signed webhooks for thread, approval and OTP events.

Use Node.js 24.4 or later. Run `npm ci`, `npm run typecheck` and `npm test` for local verification. The test suite uses workerd with local D1 and R2.

See [deployment](docs/deploy.md) to configure your own Cloudflare account, [architecture](docs/architecture.md) for the request and data flows, and [security](docs/security-model.md) for the trust boundaries.

Licensed under [Apache-2.0](LICENSE).

## Self-hosting

Copy `wrangler.example.jsonc` to `wrangler.jsonc`, configure the Worker bindings and secrets, and apply the D1 migrations before deploying. See the [deployment guide](docs/deploy.md).

## Embed in a Worker

Install an exact version of `inboxlease`. Import `worker` from the package in your Worker entry point. A bundler must support TypeScript source dependencies. Point the D1 migration directory at `node_modules/inboxlease/migrations`. See the [public library contract](docs/architecture.md#library-contract).