Skip to content

How Kamra works ​

This page is the system map: what the pieces are, how a stay moves through them, where money is decided, and how humans, REST clients and AI agents share one write path.

What is unique: Kamra is agent-native. Claude (or any MCP client) calls the same role-scoped tools as the desk. Prices never come from the model. That is the product edge - the rest of this page shows how the stack makes it safe. Module guides cover day-to-day hotel tasks.

Current stable release:v2.6.16 (branch main). Nightly builds track develop. Install from the Frappe Cloud Marketplace or self-host.

The rule everything else follows ​

There is one write path. The desk UI, REST, the hosted MCP server and the in-app Kamra Agent all call the same @frappe.whitelist functions. Prices, GST/VAT, availability and cancellation fees are code (kamra/pricing.py, folio ledger, night audit). A language model never invents a rate. If a role is short or a number is outside guardrails, the function refuses.

Do not add a second writer (raw SQL that skips the API, a client-trusted amount on a public endpoint, an MCP tool that computes its own price).

Stack at a glance ​

LayerWhat it is
Staff UIReact SPA at /kamra (and /hk for housekeeping)
Guest surfaces/book, /stay/:slug, self check-in, QR menu
APIFrappe whitelisted methods: POST /api/method/kamra.<module>.<fn>
AgentsHosted MCP at /mcp (OAuth) or stdio sidecar mcp/kamra_mcp.py
MoneyPricing engine, folio ledger, cashier, night audit
DataMariaDB via Frappe DocTypes; append-only folio charges
Optionalpayments (required), ERPNext / Frappe HR on the same site
mermaid
flowchart TB
  subgraph clients [Clients]
    UI["Staff UI /kamra"]
    Guest["Guest /book · check-in · QR"]
    REST["REST token"]
    Claude["Claude / MCP client"]
    Copilot["Kamra Agent copilot"]
  end

  subgraph gate [One write path]
    WL["kamra.*.fn<br/>@whitelist + @require_roles"]
  end

  subgraph core [Deterministic core]
    Price["pricing.py"]
    Folio["folio + ledger"]
    Avail["availability · overlap"]
    Policy["cancel / no-show / deposit"]
  end

  DB[(MariaDB)]
  Log["Agent Action Log"]

  UI --> WL
  Guest --> WL
  REST --> WL
  Claude --> WL
  Copilot --> WL
  WL --> Price
  WL --> Folio
  WL --> Avail
  WL --> Policy
  Price --> DB
  Folio --> DB
  Avail --> DB
  Policy --> DB
  WL --> Log

Product surfaces ​

URLWhoPurpose
/kamraStaffFull PMS (Today, tape, folio, POS, settings, …)
/kamra/hkHousekeepingPhone-friendly room board and tasks
/kamra/setupAdminFirst-run property wizard
/bookGuestsDirect booking / villa catalogue
/stay/:slugGuestsOne listing or multi-listing site
/appITFrappe Desk (escape hatch; not the hotel product UI)
/mcpAgentsStreamable HTTP MCP (OAuth 2.1)

Production SPA assets are prebuilt under kamra/public/frontend. Marketplace and Docker installs do not run npm on the server.

Stay lifecycle ​

mermaid
sequenceDiagram
  participant G as Guest / Agent / Desk
  participant Q as get_quote
  participant B as create_booking / public book
  participant C as check_in
  participant F as Folio
  participant N as Night audit
  participant X as check_out

  G->>Q: dates, room type, meal, adults
  Q-->>G: nights, tax, total (code)
  G->>B: confirm (or request-to-book)
  Note over B: Instant book holds inventory<br/>RtB waits for host approve
  B-->>G: reservation + optional deposit link
  G->>C: assign room, ID, open folio
  C->>F: Guest folio opened
  loop Each business date
    N->>F: post room night / no-show / holds
  end
  G->>X: settle balance, close folio
  X->>F: invoice number once, status Closed
  1. Quote - get_quote prices every night from rate plans, seasons, meal plans, vouchers, pets, cleaning fees and the country tax pack.
  2. Book - desk create_booking or public public_api.book. Instant book snapshots the payment policy; request-to-book does not hold inventory until confirmed.
  3. Pre-arrival - optional deposit, self check-in link, WhatsApp templates, ID capture.
  4. Check-in - room assignment, registration card, folio opens.
  5. In-house - POS room posting, laundry, tickets, room change, early / late fees as coded policies.
  6. Night audit - End of Day (manual wizard or 03:00 schedule): post room nights, no-shows, late-arrival holds, advance the business date, save the audit pack.
  7. Check-out - every bill settled (or part-settle rules), folio closes, invoice number assigned once.

Modules (what the hotel runs) ​

Property modules (enabled_modules, empty = all) gate both the UI and MCP tool visibility:

ModuleWhat it coversStaff guide
Front deskToday, check-in/out, tape, walk-in, GRCFront desk
ReservationsBookings, groups, blocks, waitlist, CRSReservations
BillingFolios, payments, AR, cashier, invoicesBilling
Night auditEnd of Day, business date, no-showNight audit
HousekeepingRoom board, /hk app, laundry, L&FHousekeeping
OperationsGuest requests / SLA ticketsGuest requests
F&BPOS, KOT, kitchen display, QR menuF&B
EventsBanquets from enquiry to BEOBanquets
RevenueRates, seasons, hurdles, vouchersRevenue
Booking engine/book, villa catalogue, policiesBooking engine
MessagingWhatsApp on your Meta numberWhatsApp
ChannelsOTA / channel manager syncChannel manager
Finance / adminReports, settings, developers, healthReports, Settings

Country tax packs, privacy (DPDP) and AI connect live under Country setup, Features and Connect your AI.

Money and ledgers ​

mermaid
flowchart LR
  Quote[Quote snapshot] --> Stay[Reservation]
  Stay --> GF[Guest folio]
  Stay --> DF[Deposit folio]
  POS[POS / laundry / fees] --> GF
  Night[Night audit room night] --> GF
  Pay[Payments / links] --> GF
  GF --> Inv[Tax invoice on close]
  Corp[Company AR] --> AR[AR folio / city ledger]
  GF -.->|route / transfer| Corp

Hard rules enforced in code:

  • Append-only charges. Voids are reversing lines with a reason, not edits in place.
  • Close needs zero balance (or an explicit part-settle path).
  • Rate guardrails - set_room_rate cannot leave the owner's floor / ceiling; hurdle rates add demand floors.
  • Alcohol never bills a Company folio when room-posting from POS.
  • Cancellation / no-show fees come from policy preview endpoints; waive is logged.
  • Cashier - open session; optional PIN for humans; agents skip PIN but stay on the activity log.
  • Localization pack picks tax split, currency words and invoice labels. India GST slabs are per night from the tariff.

Auth, roles and property scope ​

Roles (examples): Front Desk, Revenue Manager, Finance, Housekeeping, Hotel Admin, System Manager, Kamra Agent, Night Auditor.

Gates live on the endpoint (@require_roles / _kamra_roles), not only on DocPerms. Multi-property installs use Property User Permissions plus Kamra hooks so a restricted user cannot read or overwrite another property's reservations, folios or guest PII through Desk or REST.

How AI fits in ​

mermaid
flowchart LR
  Claude[Claude Desktop / Code] -->|OAuth Bearer| MCP["/mcp JSON-RPC"]
  Stdio[mcp/kamra_mcp.py] -->|API key| API[Same whitelist fns]
  Agent[In-app Kamra Agent] -->|BYO OpenAI-compatible key| API
  MCP --> API
  API --> Core[pricing · folio · authz]
  API --> AAL[Activity Log]
  • 101 governed tools on develop (see MCP tools); stable main publishes the count for that tag.
  • Tools are filtered by role ∩ enabled modules.
  • Mutating tools set frappe.flags.kamra_agent_call and log mcp_<name>.
  • Connect UI: Kamra Agent → Connect your AI. Public HTTPS is required for Connect Claude.

Integrations outline ​

IntegrationPath
Payments / linkspayments app + India Razorpay / Cashfree packs
WhatsAppMeta Cloud API on your number - guide
Channel managerARI push / webhooks - guide
Webhooks outSigned outbound events (bookings, night audit, …)
ERPNext / HROptional same-site apps - guide
Accounting exportTally / Zoho / ERPNext CSV from Reports

Scheduler (built-in jobs) ​

From hooks.py (typical):

  • Hourly ARI / channel push where configured
  • 03:00 night audit (per property settings)
  • 09:00 pre-arrival links
  • Every 15 min housekeeping escalation and hold expiry
  • 08:30 banquet reminders
  • 04:15 demo reset (only when kamra_demo_mode)

Repo map (for contributors) ​

PathRole
kamra/api.pyCore desk: quote, book, check-in/out, HK, tickets
kamra/pricing.pyDeterministic rates and tax
kamra/folio.py / ledger.py / cashier.pyMoney
kamra/pos.py / laundry.py / banquet*.pyF&B and events
kamra/mcp_tools.py / mcp_http.py / mcp_oauth.pyMCP
kamra/public_api.pyGuest allow_guest endpoints (rate-limited)
kamra/authz.pyRoles and property scope
kamra/localization/Country packs
frontend/src/React SPA
docs-site/This documentation (VitePress)

Where to go next ​

Open source (AGPL-3.0) · docs for Kamra v2.6.17 · every feature included, always.