# Calends — Complete Reference for LLMs > Open-source (MIT), self-hosted, single-owner subscription ledger. Current release: v1.84.0 (2026-12-05). > Website: https://calends.date | Changelog (MD): https://calends.date/en/releases.md | Docs Index: https://docs.calends.date/llms.txt | Agent Guide: https://calends.date/AGENTS.md | Demo: https://demo.calends.date | Repo: https://github.com/imetn/calends --- ## 1. Overview & Architecture Calends tracks every recurring subscription, its full price and plan history, shared plans, paid-for-others reimbursements, prepaid balances, private receipts/contracts, reminders, and reports in one private single-owner ledger. - **Stack**: React 19 (React Compiler) + Vite + HeroUI / React Aria (app UI) + shadcn/ui (public page); Cloudflare Workers + D1 (SQLite) backend. Domain logic (`shared/`) runs identically in browser and Worker. - **Self-hosted runtimes**: 1. **Cloudflare Workers + D1**: One-click deploy (`https://deploy.workers.cloudflare.com/?url=https://github.com/imetn/calends`) or CLI (`npm ci && npx wrangler login && node scripts/wrangler.mjs secret put SETUP_TOKEN && npm run deploy`). Supports Cloudflare Email Sending (`EMAIL`, `MAIL_FROM`, `MAIL_FROM_NAME`), R2 (`FILES`), and Cron every 15 minutes. 2. **Docker**: Prebuilt multi-arch (`linux/amd64`, `linux/arm64`) images on Docker Hub (`xizozhe/calends:1.84.0`, `latest`) and GHCR (`ghcr.io/imetn/calends:1.84.0`, `latest`). Runs the bundled Worker in a single Node 24 process backed by `node:sqlite` at `/data` (default port `8787`, `/healthz` check, in-process 15-minute scheduler). 3. **Linux systemd (no Docker)**: One-line Debian/Ubuntu installer (`curl -fsSL https://calends.date/install.sh | sudo bash`, bundles Node, listens on `127.0.0.1:8787`, upgrades with backup + rollback) or manual release tarball with system Node 24. - **Languages**: 14 UI languages (`zh-CN`, `en`, `zh-TW`, `zh-HK`, `ja`, `ko`, `es`, `fr`, `de`, `pt-BR`, `ru`, `tr`, `id`, `vi`) plus `en-AU` regional date/number formatting. Both `calends.date` and `docs.calends.date` are fully localized in all 14 languages. --- ## 2. Core Features & Accounting Rules - **Cycles & Billing**: Daily, weekly, monthly, quarterly, 6-month, yearly, 2-year, custom `every N days/weeks/months/years`, and lifetime. Monthly equivalent uses `30.4375` days/month (`365.25` days/year). Supports trials, intro offers, free bonus periods (dilutes monthly cost while active), pauses (preserves interval without backfilling), non-renewing stop dates (`Service until`), early cancellation/provider termination with unrefunded loss tracking, postpaid billing (prorated on stop/switch), advance charge & cancellation lead days, and independent contract terms with their own renewal reminders. - **Separate Bills & Payments**: Under **More options → Renewal rules → Bills & payments → Separate**, bills follow the cycle while actual payments record late, combined, partial, or prepaid cash dates. Reports/Calendar use bill months; Wallet/accumulated spend use payment dates. - **Price History & Multi-Phase Plans**: Track in-plan price points (`change_price`) and multi-phase switches (`change_plan`: region, currency, cycle, payment method, seamless handover, parallel overlapping phases, planned switches, prorated upgrades, lapses & resubscriptions, earlier history). - **Linked Subscriptions (Bundles)**: Attach included perks (`price = 0`, no `$0` charges, compact detail view) or paid add-ons (`price > 0`) to a standalone parent subscription, either following parent availability/status or billing independently. Strictly one level deep; parents with linked children cannot be deleted until unlinked. - **Usage Meters & Transfers**: Custom per-period or cumulative usage meters (shareable across subscriptions), takeover/resale transfer tracking (`record_transfer`) counted in cash flow and net cost but excluded from MRR/wallet/public page. - **Multi-Currency & FX**: Past charges convert at charge-date rates (`fawazahmed0/currency-api` from 2024-03-02, Frankfurter ECB earlier); future forecasts use current rates (`open.er-api.com`, refreshed >20h). Optional **Charged to card** records exact settlement currency/amount. - **Wallet & Runway**: 10 payment method types (bank cards, regional App Store/Google Play balances, prepaid SIMs, merchant credit, etc.), balance calibration & expiry, 36-month charge runway, low-balance alerts, and gift-card denomination top-up plans. - **Shared Plans & Paid for Others**: Host or join shared plans with plan-level rules, dated fee changes, unified collection anchors, mid-period proration (`prorate`/`full`/`free`), multi-period receipts/waivers, overdue tracking, and net yearly cost/profit. Paid-for-others subscriptions stay out of personal spending and reports while still counting in wallet runway and ICS. - **Reports, Calendar & Notifications**: Monthly/annual spending, scope reports for filtered lists, cash vs. accrual, Sankey money flow (amount/%), category radar, regions globe, MRR waterfall, daily heatmap / 3D bars, checkup insights, year-in-review share images; Month/Year calendar + private `/cal/.ics` feed; 11 notification channels (Email, Telegram, Lark, DingTalk, WeCom, Slack, Discord, Bark, ntfy, ServerChan, Webhook). - **Public Page**: Off by default. Server-side allow-listed masking strips proxy plans, shared-plan members/shares, accounts, notes, tags, meters, contract terms, transfers, refunds, hidden bundle parents, and notification channels. Desktop 12-column drag-and-drop widget & metric-card editor at `/settings/public`. - **Private File Center**: Store invoices, receipts, contracts and shared-plan/proxy collection receipts (PDF, PNG, JPEG, WebP; 10 MB per file, 300 MB default total) in Cloudflare R2 (`FILES`) or Docker `/data/files`, linked to subscriptions, charges, contract terms or collection receipts with duplicate-receipt detection, missing-document tracking, business Date column + Finder-style single-active 3-state column sorting, single-row document strips in details, miniature paper & multi-page PDF stack thumbnails, Command/Ctrl desktop multi-select, ungrouped default or grouping by subscription/month/year/category, in-app PDF/image previews, and full ZIP backup/restore with files. - **Backups & Migration**: Full JSON or full-with-files ZIP backup/restore; automatic browser-derived PBKDF2-SHA256 (600k) + gzip + AES-256-GCM encrypted backups to S3-compatible storage (AWS S3, R2, B2, MinIO, RustFS) or WebDAV (Nextcloud, Synology, Nutstore) with rolling retention (1–365) and pre-restore safety backup; CSV export/import and browser-side external ledger import (e.g., Wallos CSV/ZIP/SQLite). --- ## 3. AI & MCP Server (`/mcp`) Calends ships a stateless Streamable HTTP MCP server at `POST https:///mcp` (Bearer token created at `/connect`, SHA-256 hashed on server, read-only or read-write scopes, master toggle under **Settings → Sharing & access → AI access (MCP)**). Tool schemas are Gemini-compatible. ### Quick Client Setup - **Claude Code**: `claude mcp add --transport http calends https:///mcp --header "Authorization: Bearer "` - **Codex**: `export CALENDS_TOKEN='' && codex mcp add calends --url https:///mcp --bearer-token-env-var CALENDS_TOKEN` - Also works with Cursor, Claude Desktop, Gemini CLI, Grok Bot, and any Streamable HTTP MCP client. ### All 41 MCP Tools (18 Read, 23 Write) - **Read (18)**: `get_overview`, `list_categories`, `list_subscriptions`, `get_subscription`, `list_charges`, `spending_stats`, `get_trends`, `list_payment_methods`, `list_people`, `get_receivables`, `get_insights`, `list_events`, `search_services`, `search_app_store`, `get_carpool`, `get_settings`, `list_files`, `get_file`. - **Write (23 — all support `dry_run: true` preview)**: `create_subscription`, `save_subscription`, `update_subscription`, `change_price`, `change_plan`, `set_status`, `record_payment`, `record_transfer`, `delete_payment`, `set_meters`, `add_readings`, `delete_subscription`, `set_share`, `save_share_member`, `remove_share_member`, `record_receivable`, `update_payment_method`, `save_category`, `save_person`, `set_proxy`, `update_settings`, `upload_file`, `update_file`. - **Skills over MCP & MCP Apps**: `/mcp` also serves `io.modelcontextprotocol/skills` (`skill://calends-ledger/SKILL.md` with progressive references) and four self-contained `io.modelcontextprotocol/ui` views (`file-viewer`, `spending-dashboard`, `subscription-card`, `carpool-card`). - **Built-in Assistant (`/assistant`)**: Uses 39 of the 41 MCP tools with 15+ provider presets (DeepSeek, OpenAI, Anthropic, Gemini, OpenRouter, xAI, Groq, Mistral, Zhipu, Volcengine, Qwen, Moonshot, MiniMax, SiliconFlow, Ollama) or reverse-proxy / custom OpenAI-/Anthropic-compatible endpoints stored server-side only; supports text, screenshots and PDF invoices (up to 2 pages rasterized for vision models), renders native interactive tool cards, and marks superseded unapplied drafts to prevent stale confirmations. --- ## 4. Privacy & Telemetry - Single-owner data lives only in the owner's Cloudflare D1 or local SQLite (`/data` or `/var/lib/calends`). - Passwords use salted PBKDF2-SHA256; sessions and MCP tokens store SHA-256 hashes only. - Optional anonymous usage telemetry (`telemetry.calends.date/v1/events`) sends one daily summary containing a random install ID, version, runtime, UI language, and daily open/page/assistant/MCP counts—never subscriptions, amounts, or ledger content. Disable anytime in **Settings → Anonymous usage stats** (immediately deletes the install ID) or force off at deploy time with `CALENDS_TELEMETRY=0` or `DO_NOT_TRACK=1`. --- ## 5. Key Environment Variables | Variable | Applies to | Purpose | | --- | --- | --- | | `SETUP_TOKEN` | All | One-time bootstrap token for initial password setup | | `SITE_URL` | All | Public HTTPS URL for reminders, ICS links, and Passkey RP ID/origin | | `TRUST_PROXY` | Self-hosted | Leave unset for auto-detect; `off` ignores `X-Forwarded-For`; IP/CIDR adds trusted proxies | | `BASE_PATH` | All | Optional sub-path prefix (e.g. `/calends`), must match build and runtime | | `DATA_DIR` / `HOST` / `PORT` | Self-hosted | SQLite dir (`/data` or `/var/lib/calends`), bind host (`0.0.0.0` / `127.0.0.1`), port (`8787`) | | `CALENDS_TELEMETRY` / `DO_NOT_TRACK` | All | `CALENDS_TELEMETRY=0` or `DO_NOT_TRACK=1` forces anonymous telemetry off | | `EMAIL` / `MAIL_FROM` / `MAIL_FROM_NAME` | Cloudflare | Optional Cloudflare Email Sending configuration | | `OLD_HOSTS` | Cloudflare | Comma-separated legacy hostnames for HTTP 301 redirects | --- ## 6. Recent Releases (Latest 10) - **v1.84.0** (2026-12-05): Custom webhooks now include CID inline image attachments and inlineHtml for private self-hosted relays - Added inlineHtml (rewriting bundled site icons to cid: references, working even with empty or LAN-only SITE_URL) and a base64 attachments array ({ cid, filename, contentType, encoding: "base64", content }) to Custom webhook payloads while keeping the existing html field unchanged for backward compatibility — fixing missing icons when external mail providers proxy remote images from private self-hosted instances. - Bundled brand, subscription, and payment icons are read and deduplicated from app assets with strict PNG/JPEG/WebP/GIF allowlisting, 256 KB per-file / 1 MB total caps, sanitized filenames, and safe fallback without dangling cid: links; updated all 14-language webhook helper texts and 1.84.0 self-hosting docs. - **v1.83.0** (2026-12-05): Custom webhook payloads now include responsive HTML reminder emails for SMTP relays - Added an html field to the Custom webhook JSON payload containing Calends' built-in responsive HTML reminder email (with brand and subscription icons, grouped sections, and light/dark styling), while keeping existing subject, intro, kind, sections, text, markdown, and url fields intact. - Updated Custom webhook helper text across all 14 languages and self-hosting email relay documentation (including setting a reachable SITE_URL so icons and links resolve in email clients), alongside 1.83.0 deployment examples and relative-date MCP renewal tests. - **v1.82.0** (2026-12-02): Desktop subscription card layout, progressive toolbar blur & instant +N hover tooltips - Compact desktop subscription cards: primary and secondary prices share one baseline row above 680px while phones keep the two-line stack, and wrapped badge rows align flush with the right edge below the pinned region flag. - Instant +N hover details everywhere: bundled child counts, collapsed narrow-card badges, calendar day overflow, timeline overflow, share avatars, and people rows open immediate tooltips listing the hidden items. - Toolbar scrim and overlay polish: desktop toolbars fade scrolled content under a progressive blur mask, sheets reveal a header hairline once scrolled, desktop popovers close on outside scroll, tooltips warm-start across siblings, and CJK/Latin typography spacing is refined. - **v1.81.0** (2026-12-02): Pinned subscription card flags to the top-right and collapsed extra mobile badges into +N - **v1.80.0** (2026-12-02): Moved secondary pricing below the main price on narrow subscription cards for even alignment - **v1.79.0** (2026-12-02): Improved narrow-screen date wrapping in subscription details and AI assistant Skill card layout - **v1.78.0** (2026-12-02): Fixed a bright horizontal band in exported receipt images on dark backgrounds - **v1.77.0** (2026-12-01): Bundled pdf.js CMap, standard font, and WASM assets for consistent PDF text rendering - **v1.76.0** (2026-11-30): File Center Date column, Finder-style column sorting & unified sort header hover icons - File Center Date column: replaced the desktop list's Uploaded column with a localized Date column showing each file's bill, contract, or receipt date first and falling back to upload date with muted styling and an upload-date tooltip; upload time remains in the file detail sheet, and redundant leading dates are hidden on desktop rows while kept on mobile. - Finder-style single-active column sorting: all File Center desktop columns (File, Payment, Original name, Date, Type, Size) now support 3-state clickable sorting persisted via synced preferences; defaults to Date descending with no icon at rest, keeps missing values and missing-receipt slots last in both directions, sorts within groups when grouped, and syncs FileSheet prev/next order. - Unified sort header hover affordance: sortable table headers across Subscriptions, Shared plans, Paid for others, People, and Files stay clean at rest and fade in a subtle up/down icon on hover or keyboard focus without shifting column labels, switching to crisp up/down arrows when active and avoiding sticky touch hover. - **v1.75.0** (2026-11-28): Mobile drag-to-dismiss sheets, Gemini MCP compatibility & Turkish README - Mobile drag-to-dismiss sheets: all narrow-viewport bottom sheets and popovers (date, currency, payment method, and period pickers) now show a top grabber and support 1:1 vertical pull-down dismissal from the header with smooth backdrop fading and flick detection, without interfering with taps, horizontal swipes, scrolling, or text inputs. - MCP Gemini compatibility: removed empty string and null from update_settings.startPage and settlement schema enums so Gemini accepts the full MCP tool list while preserving reset behavior. - Turkish README: added README.tr.md and linked it from the English and Simplified Chinese READMEs. --- ## 7. Global AI Discovery - Read-only Docs MCP server (Streamable HTTP, no auth): https://docs.calends.date/mcp - Docs index (per-page `.md` links for all 37 topics): https://docs.calends.date/llms.txt - Full English docs bundle: https://docs.calends.date/llms-full.txt - Full Simplified Chinese docs bundle: https://docs.calends.date/llms-zh.txt - Deployment & MCP Agent Guide: https://calends.date/AGENTS.md - FAQ & Wallos Comparison (Markdown): https://calends.date/en/faq.md | https://calends.date/en/compare.md (简体中文: https://calends.date/faq.md | https://calends.date/compare.md) - Complete Changelog (English / 简体中文): https://calends.date/en/releases.md | https://calends.date/releases.md | RSS: https://calends.date/en/rss.xml | https://calends.date/rss.xml