MDMCore documentation

MDMCore is a Kotlin Multiplatform Mobile Device Management (MDM) system. A server holds the desired policy for each device; an Android agent (a Device Owner / DPC) pulls that policy, enforces it, and reports back what it actually observes; a Compose Multiplatform console views and edits policy. Everything speaks one shared, compiler-checked wire contract.

If you read nothing else, read The MDM loop — it’s the whole system in one page.

Reading order

  1. Architecture — the four parts, the module dependency star, and the design principles that hold it together.
  2. The MDM loopenroll → pull → enforce → report → detect drift, with sequence and state diagrams.
  3. Protocol — the shared wire contract: every message type, the single compliance rule, and the canonical JSON config.
  4. HTTP API — every server endpoint: method, path, request/response, status codes.
  5. Components, one per part:
    • Server — the authoritative “brain”.
    • Agent — the Android Device Owner that enforces policy.
    • Console — the Compose Multiplatform UI (desktop + web).
  6. The FCM doorbell — how a policy change wakes a device (push wakes, HTTP moves the data).
  7. Firebase setup — getting FCM working on the server and the agent.
  8. Development — build, run, and test every module; version catalog; an end-to-end recipe.
  9. Troubleshooting — the failures you’ll actually hit, and their fixes.

Document map

Document What it answers
architecture.md What are the parts and how do they depend on each other?
mdm-loop.md How does desired policy become enforced reality, and how is drift detected?
protocol.md What exactly travels on the wire, and why can’t the parts disagree?
http-api.md What are the endpoints and their request/response shapes?
server.md How does the brain store policy and decide compliance?
agent.md How does the Android agent enforce policy as Device Owner?
console.md How does the console view and edit policy across desktop/web?
fcm-doorbell.md How does a change reach a device without polling?
firebase-setup.md How do I configure the service-account key and google-services.json?
development.md How do I build, run, and test it — and run the whole loop?
troubleshooting.md Why is enforcement / push / the build not working?
  • ../README.md — project front page: overview + quick start that links back here.
  • ../CLAUDE.md — guidance for AI contributors (Claude Code). It overlaps with these docs but is written for an automated contributor and carries repo-specific working rules.
  • ../SOURCES.md — the external documentation (Android, Firebase, Ktor, Kotlin) that the design was grounded in, with the exact pages and Knowledge-Base ids used.

Conventions in these docs