# Mason is a DuckDB-backed Postgres read replica that gives each AI agent its own limits

> Mason is an open-source, Postgres-compatible read replica that syncs chosen tables into DuckDB so analytical queries run faster, with per-agent access controls and a built-in MCP server.

- Project: Mason by tagspace
- List: Built for AI
- Kind: tool
- Works with: Claude Code, ChatGPT
- Noticed: 100 points on Hacker News (when we found it)
- Added: 2026-11-25T21:11:00+00:00
- Web page: https://ai-news.ikangai.com/built/mason/

Mason is an Apache-2.0 licensed program. Its README calls it a drop-in replacement for a Postgres read replica. You choose which tables and columns to sync. Mason keeps them in DuckDB's columnar engine and rewrites incoming Postgres queries into forms DuckDB runs faster. The author's benchmark shows a count over 10 million rows taking 15.7 seconds on the Postgres primary and 0.193 seconds on Mason, 81 times faster. The same benchmark shows primary-key lookups running 6.0 times slower on Mason.

Setup starts with npm i -g @mason-data/cli, followed by mason init with a Postgres connection string, mason add for the tables, and mason start. Clients connect with any Postgres client on port 5433. Agents connect through Mason's MCP server, and the README includes a Claude Code command for it. Each agent gets its own user under role-based access control. Every query is logged with who ran it and how long it took. Mason runs as a Node.js process, and the README mentions no GPU or API key.

The author's launch post says the team first tried ClickHouse, then ran 5,410 hand-written queries from 159 databases against synthetic data. By their count, DuckDB matched Postgres results on 84.1% of those queries, and Mason now matches on 96%. The rest return an error. These are the author's own figures, not independently checked.

## In the author's words

> Built for AI agents: Add a user per agent, with role-based access control (RBAC) that limits the tables, columns and rows each one can read.

## When to reach for it

If agents or dashboards run many aggregate queries against a Postgres database you'd rather not load directly, check Mason's per-user table, column and row limits and its query log before weighing the speed numbers.

## See it

- [Mason](https://masondata.ai/)
- [Discussion on Hacker News](https://news.ycombinator.com/item?id=50630294)

---

AI wrote this entry from the project's own README or its author's post. What the project does, and that AI built it where the entry says so, are the author's statements, quoted here. Nobody at IKANGAI ran or tested it.
