{ "$schema": "node_modules/wrangler/config-schema.json", "name": "whatsapp-mcp", "main": "src/index.ts", "compatibility_date": "2025-09-01", "compatibility_flags": ["nodejs_compat"], "observability": { "enabled": true }, // Baileys needs three things workerd doesn't have. See "What to know before changing things" in the README. "alias": { "ws": "./src/ws-shim.ts", "lru-cache": "./src/lru-shim.ts", "whatsapp-rust-bridge": "./vendor/whatsapp-rust-bridge/index.js" }, "rules": [{ "type": "CompiledWasm", "globs": ["**/*.wasm"], "fallthrough": true }], // One Durable Object holds the linked WhatsApp session and the message store (its SQLite). // The registry counts accounts, so signups can be capped. Only many-user mode uses it. "durable_objects": { "bindings": [{ "name": "WA", "class_name": "WhatsAppStore" }, { "name": "REGISTRY", "class_name": "Registry" }] }, "migrations": [ { "tag": "v1", "new_sqlite_classes": ["WhatsAppStore"] }, { "tag": "v2", "new_sqlite_classes": ["Registry"] } ], // The OAuth provider's token store. Create it, then paste the id: // npx wrangler kv namespace create OAUTH_KV "kv_namespaces": [{ "binding": "OAUTH_KV", "id": "REPLACE_WITH_KV_NAMESPACE_ID" }], // First history import decodes a lot of protobuf; the default CPU budget is too small. Needs Workers Paid. "limits": { "cpu_ms": 300000 }, // There is no daily pull: messages are encrypted with a key that exists only while someone is signed in, // so syncing happens when an agent asks (see "Things to know" in the README). // Sign-in. Pick one: // - Just you: `npx wrangler secret put OWNER_PASSWORD` (12+ characters). The first sign-in creates your account. // - Many people: leave OWNER_PASSWORD unset and set the var "OPEN_SIGNUP": "true". People sign in with Google // through a login service ("LOGIN_URL", default https://login.finereli.com) that also gives the server a // data key for them. The service's operator can derive those keys; see the README. // With neither, nobody can sign in. // // Optional: your own domain instead of workers.dev. // "routes": [{ "pattern": "whatsapp.example.com", "custom_domain": true }], // // Many-user mode only: // "SIGNUP_LIMIT": "100" most accounts. Deleting an account frees its seat. // "MAX_MESSAGES": "250000" most messages in one account (these are the defaults; "0" means no cap) // "MAX_DB_MB": "300" most storage in one account // Email alerts when seats are nearly gone and when they are. Needs Email Routing on your domain, with your // address verified there: // "send_email": [{ "name": "ALERT_EMAIL", "destination_address": "you@example.com" }], // "vars": { "ALERT_TO": "you@example.com", "ALERT_FROM": "whatsapp-mcp@your-domain.com" } // Seat and waitlist counts go to the log once a day (needs "triggers": { "crons": ["17 3 * * *"] }). // // Optional: voice note transcription (the transcribe_audio tool) with Workers AI, billed to your account: // "ai": { "binding": "AI" }, // The default model is Whisper large-v3-turbo. Another one: "vars": { "TRANSCRIBE_MODEL": "@cf/openai/whisper" } // // Optional: "vars": { "TIMEZONE": "Europe/Lisbon", "OPERATOR_NAME": "Your name", "CONTACT_X": "yourhandle", "DEFAULT_COUNTRY_CODE": "351" } }