An open format and embeddable engine for relational reporting
Every report is a portable query graph, a materialized SQLite table, and a parametric layout.
MAD is an embedded relational reporting platform for ad hoc query, reporting, and design: the MAD Designer and MAD Viewer apps for macOS (native AppKit), Windows, and iOS, the headless engine and mad CLI for Linux and Windows, and the open .mad document format. A .mad file holds a report’s whole definition — the database schema snapshot, the query graph (tables, joins, predicates, groupings), and the banded layout of its elements — in under 100 KB, cleanly separated from the materialized SQLite table (.maddb + .mdcache) it produces on refresh. A Composition Report combines several reports — each keeping its own query, layout, and data — into one document, joining MySQL, PostgreSQL, SQL Server, and SQLite without a federation server.
The code is at github.com/mthomason/MAD, MIT-licensed; the names and app artwork are not covered by that licence (see NOTICE).
Platforms. The apps run on macOS, Windows, and iOS (iOS is between releases and returns in early 2027). The headless engine and mad CLI are supported on Linux and Windows. The macOS CLI is a developer build that runs through the iOS Simulator (CLI/build.sh and xcrun simctl spawn booted); it is not a native macOS binary.
Try it in a minute
- macOS (12.0+, Apple Silicon) —
brew install --cask mthomason/tap/mad-designer, or download the DMG / ZIP. For a direct download, runxattr -cr "/Applications/MAD Designer.app"once after copying to/Applications. See the macOS guide. - Windows (10 1903+, 11, 64-bit) — download the ZIP. It is unsigned, so SmartScreen will ask: choose More info → Run anyway. Self-contained; no .NET install. See the Windows guide.
-
Linux CLI (amd64, Docker) — download mad-linux-amd64.tar.gz, then load and run the image:
docker load -i mad-linux-amd64.tar.gz docker run --rm -v "$PWD:/docs:ro" mad-cli:0.8.0 mad inspect /docs/Samples/Reports/Chinook-Standard.mad - Sample reports — open
Samples/Reports/Chinook-Standard.madin MAD Designer and press Refresh. The SQLite sample needs no database server and no credentials.
The published release is app 0.8.0 / engine 9.1 (r5164).
Languages. The application UI is available in English, Simplified Chinese, Japanese, Brazilian Portuguese, German, and Latin American Spanish. Translations are machine-assisted and may contain errors; report them at https://github.com/mthomason/MAD/issues.
Help MAD grow
MAD works today. If it earns a place in your stack, a star on GitHub helps other developers find it — and helps justify the work that goes into the next release. Try it against a database you already understand; if something gets in your way, tell us. That feedback shapes what comes next.
See it
Composition Reports on macOS (top row) and Windows (bottom row): the query designer, the report designer, and the viewer, each over the cross-database sample. Click a thumbnail for the full-size image.
Read the composition guide for the model, the workflow, and the current limits.
MAD Designer for iOS, from choosing a data source to reading the finished report in MAD Viewer:
The same engine headless on Linux: inspect, schema, query, refresh, and
export through the mad CLI, with no database server and no credentials:

The recording’s exported report is plain HTML, opened in any browser.
Build with it
The engine is an embedding surface: an application that links the MAD framework, a database driver (MADMySQL, MADPostgres, MADTdsClient, or the built-in SQLite driver), and MADSqlite3 for the local row cache has relational reporting with no server in the loop. The mad CLI is that engine wearing a command line — inspect, schema, query, refresh, export, write, and the serve JSON protocol. Drivers and export formats self-register (MADDatabaseDriverRegistry, MADReportExporterRegistry), so adding a data source or an output format is a subclass, not a fork; a composed document refreshes through MADOperationRefreshComposed, the same path the apps use. Twelve of the thirteen frameworks are UIKit-free and build headlessly, and the Linux suite runs 130 suites and 1,313 tests.
Start at the developer hub for the embedding surface and the build-and-verify commands, then read the CLI guide, the driver-authoring tutorial, and the data-object design. The repository README carries the one-minute quick start, and mad-action runs a checked-in .mad in GitHub Actions.
Contribute
MAD is one maintainer and an open development process; contributions of every size are welcome. Good first lanes:
- Docs — a correction, a clearer example, or a translation fix.
- Tests — a test that pins a real bug, with the failure understood before the fix.
- An exporter — a new output format through
MADReportExporterRegistry. - A driver fix — an improvement to the existing MySQL, SQL Server, PostgreSQL, or SQLite driver. A brand-new driver is a larger task; the tutorial walks it through.
Look for the good first issue label, ask in Discussions, and read CONTRIBUTING.md before your first pull request.
For agents
An AI agent should start with AGENTS.md and the two repository skills: mad-verify routes a change to the cheapest verification that can pass or fail because of it, and mad-headless-port ports a source file into the headless engine. The good first tasks are the human lanes above: a docs correction, a test that pins a bug, or a small exporter.
Why MAD
- Interoperable by contract. A
.madfile packages the schema contract, the query AST, and the presentation layout into one inspectable, diffable artifact that produces byte-identical SQL and exports across Apple, Windows, and Linux. - Written, not assembled. The SQL generation, the SQL parser, the data-table engine, the store, the layout model, and the renderer are first-party Objective-C across thirteen frameworks. Third-party code is limited to the wire — MariaDB Connector/C, FreeTDS,
libpq, SQLite — pluslibarchive/bzip2andzintfor barcodes. - Mobile-first, embeddable, and portable. A refresh reads the result set once into a SQLite row cache (
MADDataTableFast) and computes groupings and aggregates from there, so paginated rendering stays fast on a phone; twelve of the thirteen frameworks are UIKit-free and pass 1,313 tests on Linux in Docker.
The .mad format
Read the introduction to the specification first, or jump to a chapter:
What a document is ·
The container ·
The store ·
Reading and writing ·
Companion files ·
Hazards ·
Normative v1 ·
Open questions ·
Verification
The direction
Vision — from reports to composable data objects, multi-source queries materialized locally, an embedded and headless engine, presentation beyond the paper paradigm, and AI-authored, editable documents.
The MAD Designer app — the report designer built on this engine — has its own site at mad.everydayapps.com.