Writing the same API routes for every table?

Your database as a REST API and MCP server. No routes to write.

One binary over the Postgres, MySQL, MariaDB or ClickHouse you already run, behind the sign-in you already have. When direct CRUD needs logic around it, ask your AI agent, in plain English, to build it through the integrated MCP server.

Free for 60 days: 3M requests, every feature, no card. Your database stays where it is.

For the developer: one table, three calls

Acme’s employee table, read, refused, and read by an agent.

The organization acme, the project people, a Postgres database registered as acme. Every request below is lifted from the Book of Minimal and runs as printed against a deployment.

The table is the last segment of the path. fc picks columns, oy orders, ps and pg page. No route was written for this; none is written for the other ten relations either.

http
GET /minimal/api/rest/auto/v1/acme/people/pg/acme/employee?fc=id,full_name,department_id&oy=id.as&ps=5&pg=0 HTTP/1.1
Host: api.acme.example
LB-Access-Token: <your-access-token>
json · 200
[
  { "id": 1, "full_name": "Rafael Delacroix", "department_id": 11 },
  { "id": 2, "full_name": "Rafael Müller", "department_id": 7 },
  { "id": 3, "full_name": "Rafael Novak", "department_id": 8 },
  { "id": 4, "full_name": "Kwame Haddad", "department_id": 6 },
  { "id": 5, "full_name": "Rafael Haddad", "department_id": 6 }
]

Filters are column=operator.value, for example department_id=gt.6 or full_name=like.Raf*. Page size and page number are mandatory, so no call ever reads a table whole by accident. Vol. I, Chapter 5 is the full query language.

The same path, a DELETE, sent with a token minted for hr-analyst. The table’s permission template lists hr-admin alone on delete. The refusal names the roles the caller held, not the rows it would have touched.

http
DELETE /minimal/api/rest/auto/v1/acme/people/pg/acme/employee?id=eq.5 HTTP/1.1
Host: api.acme.example
LB-Access-Token: <token · roles hr-analyst · key_type -r-->
json · 403
{
  "code": 403,
  "status": "Forbidden",
  "message": "insufficient permissions for this operation on this table, got [hr-analyst]"
}

Three gates, checked in order: a lock mask says whether anyone may delete here at all; the template says which roles may; a row scope, if set, says which rows. The token itself could not have helped: -r-- is read-only, and a token never carries more than its minter held. Vol. I, Chapter 6.

An agent that has the skill file knows the session rule, the order to discover a project in, and which headers to send. It opens a session, lists the databases and tables its token can see, then reads the same five rows. Every call on the right is from Vol. I, Chapter 7.

shell · once per project
mkdir -p .claude/skills/minimal-core
curl -o .claude/skills/minimal-core/SKILL.md \
  https://littlebitlabs.com/skills/minimal-core/SKILL.md
tool calls · one session
start_ai_session    {name, context}
  → session_id 01M20681V68Y5421QC5N23F9DB
meta_list_databases
  → [{"type":"pg","schema":"acme"}]
meta_list_tables    {type: pg, schema: acme}
  → employee, department, salary, … 11 tables
auto_read_rows      {type: pg, schema: acme, table: employee,
                     page_size: 5, page_number: 0, query: {oy: "id.as"}}
  → 5 rows, recorded to the session

MCP invents no capability of its own: everything an agent can reach this way, a backend can reach over REST, refused for the same reasons. What MCP adds is the session: a persistent record of what the agent actually did. The skill file is one page, written from the same chapters. Vol. I, Chapter 7.

Run these calls now.

The hosted deployment at selectstar.wtf is free: no card, no expiry. Volume I runs against it as printed, and Chapter 2 has you reading rows before the end of the page.

Your sign-in stays

It drops in behind the sign-in you already have.

Minimal Core has no login screen and no user table. It runs on a private address, such as an internal sub-domain, that only your gateway can reach. Your gateway has already checked who is calling, so it says so in five headers on each request.

HeaderWhat your gateway is saying
X-Org-IdWhich organisation the caller belongs to: your company, or one of your customers.
X-Project-IdWhich project: one application and the databases registered for it.
X-Space-IdWhich environment: dev, staging or prod.
X-User-IdWho is calling: a person, a service or an AI agent.
X-User-RolesThe roles the caller holds, as a comma-separated list.

What that saves you. No users to migrate, no second login to build and no password store to protect. Your gateway maps the groups your identity provider already has to the roles a table checks. A service or an agent can carry one access token that stands in for the five headers.

What it asks of you. The gateway must be the only way in, and it must set the five headers itself, replacing any a caller sent, because Minimal Core trusts them as given. Vol. III builds this once with Zitadel for identity and APISIX as the gateway, every file printed, so you can copy it.

Two doors into every table.

Both open at once. Choosing between them is the first design decision you make for any piece of data.

Auto API: the routes that are just routes.

List, filter, insert, update, delete, on every table a project has indexed, with no authoring step. GET, POST, PUT, DELETE; column selection, ordering, grouping and paging as query parameters; JSON, CSV or YAML back. This is the door for the admin screen, the mobile backend, the fifty handlers that only move rows.

Custom API: the logic that is actually yours.

One YAML definition: a method, a path, a version, the roles allowed to call it, and an ordered waterfall of steps. A sql step is one statement with ?:name placeholders; a lua or lark step reshapes what the step before fetched. Mark a step omit and its raw rows never leave the server. Written in dev, copied to prod once staging has proven it.

The payroll total is a definition. The payroll table is not. Vol. II, Chapter 1 writes the first one end to end. Or have your AI agent write it.

Several engines, one project

The right engine for each job. One way to call them all.

One project can register more than one database, and they need not be the same engine: Postgres for orders, ClickHouse for analytics. A second engine usually means a second API layer to write and secure. Here it is one segment of the URL.

the Auto API path
/minimal/api/rest/auto/v1/{organization}/{project}/{engine}/{database}/{table}

/minimal/api/rest/auto/v1/acme/people/pg/acme/employee

pg is Postgres, ch is ClickHouse, ms is MySQL and ma is MariaDB. The filters, the paging, the refusals and the permission templates are the same on every engine, so your client code and your agents learn one grammar.

Minimal Core serves Postgres, MySQL, MariaDB and ClickHouse, and the databases that speak their protocols: Aurora MySQL, Percona, TimescaleDB, Vitess, TiDB, CockroachDB, Citus, YugabyteDB, SingleStore, StarRocks and RisingWave.

What does differ by engine, such as transactions on ClickHouse, is on one page each: Postgres · MySQL and MariaDB · ClickHouse.

For AI agents

Two MCP servers. One for your team, one for your customers.

MCP is the standard way an AI agent calls tools. Building an MCP server is usually a project of its own. Here the first is already running, and the second is made from the APIs you already have.

Integrated: MCP for your data

Minimal Core’s own MCP listener gives an AI agent what your backend reaches over REST, as 115 tools, under the caller’s roles. An agent is refused for the same reasons a backend is, and each session is recorded. This is the server your developers and your internal agents use, to work with data and to build the API itself. One page teaches a coding agent to use it.

minimal-mcp: your APIs as your product’s MCP service

A paid add-on, for the people who use your product. You choose which Auto and Custom APIs to offer. Each becomes a named tool of your product, behind OAuth 2.1, described by the documentation you supply. You do not write an MCP server. It does not expose your tables: only the APIs you chose.

Building with AI

When CRUD needs logic around it, your AI agent builds it.

Generated routes cover every table. An AI agent builds the rest. That is close to an API layer with no code of your own. The integrated MCP server carries the tools that build the API itself, not only the ones that read and write rows. So a coding agent such as Claude Code, Cursor or Codex takes a request in plain English to a working endpoint with its permissions set. You write no route and deploy nothing. You review what it built.

1. It reads your schema

The agent describes each table live from the database, so it works from the columns you have today. meta_describe_table

2. It changes the schema, if you allow it

Schema changes are open only to the roles you name. The SQL runs as one all-or-nothing batch, and each run is kept with the exact statements sent. ddl_execute_run

3. It writes the logic

A Starlark or Lua module holds the code. When a module is replaced, the earlier version stays readable. create_lark_module create_lua_module

4. It registers the endpoint

One YAML document declares the path, the method, the roles allowed and the steps. The endpoint is live in the space the agent works in, such as dev, when the call succeeds. You copy it to prod once staging has proven it. create_definition

5. It calls what it built

Once the definition is opened to agents, the agent calls it as a tool, reads the answer and corrects the document. Every write to a definition is kept in its history. call_api

What you still do

Say what the endpoint must do, and read what the agent wrote: a short YAML document and a small module, not a pull request of routes. The agent works under the roles you gave it, is refused as a backend would be, and each session is recorded.

Start with the skill file: one page that teaches your agent how to do this.

If AI agents write your code

An agent asks for the API instead of writing it.

That is 90% fewer AI tokens on the API layer. An agent building on Minimal Core asks for each table’s API instead of writing it and then keeping it alive.

Modelled, not measured. An AI agent building and maintaining the API layer of 100 tables in Go for a year (routes, validation, per-role permission, audit, MCP tools and tests) spends about 6.74 million tokens; with Minimal Core, about 0.12 million. We quote 90%. Your own screens, integrations and logic outside the database cost the same either way.

Agent skill

Teach your agent Minimal Core in one page.

A coding agent that has this file knows the MCP session rule, the order to discover a project in, which headers to send, and what to do when it is refused. Four kilobytes, written from Vol. I, Chapter 7.

  • Before any call
  • REST addressing
  • Reading rows
  • Writing rows
  • MCP
  • Refusals
  • Rules for the agent
mkdir -p .claude/skills/minimal-core
curl -o .claude/skills/minimal-core/SKILL.md \
  https://littlebitlabs.com/skills/minimal-core/SKILL.md

Saves into the project; Claude Code loads skills from .claude/skills/.Saves into the project as a Cursor rule.Appends to AGENTS.md in the project root.

.claude/skills/minimal-core/SKILL.md68 lines · 4.2 KB
---
name: minimal-core
description: Read and change data through Minimal Core, the data access layer over a database you already run. Use when a task names a Minimal deployment, an LB-Access-Token, the Auto API path /minimal/api/rest/auto/v1, or the MCP endpoint /minimal/mcp/rpc/v1.
---

# Minimal Core

Minimal Core serves every table of a registered database two ways: REST (Auto API) and MCP tools. Both pass the same permission checks, so a call refused on one is refused on the other.
Full reference: the Book of Minimal, https://littlebitlabs.com/docs (three volumes). Minimal Core is in beta.

## Before any call

- Send an access token in the `LB-Access-Token` header. It carries organization, project, space, user and roles. Never pass those as arguments.
- A token never holds more than the identity that minted it. `key_type` reads in create-read-update-delete order: `crud` is everything, `-r--` is read-only.
- MCP needs a token owned by an MCP identity, with MCP switched on for its space.

53 more lines · the REST and MCP rules, refusals, and what the agent must never do

Who may do what

Permission lives on the table.

A role is a word your gateway sends. Minimal Core never decides what a role means; each table says which roles may read, create, update or delete. A newly indexed table answers direct reads and nothing else: writes, AI agents and service callers stay locked until you open them.

Permission template

A named policy, assigned to as many tables as you like. Twelve role lists: four verbs across the REST, MCP and machine-to-machine channels. Change the template and every table on it changes. An empty list means nobody, not everybody.

Lock mask and visibility

A lock switches a verb off for everyone on a channel, whoever they are: a table nobody should delete from stays that way even for the role that could. A hidden table is not offered to a caller at all.

Row-level security

One column bound to one request header. Every read is filtered to rows where they match; an insert has the column set from the header whatever the body said. department ← X-Department turns one view into a different table per caller.

Access tokens, spaces and schema changes are in the Book of Minimal.

What you run

One binary, one YAML file, one definition store.

Minimal reads a single configuration file at startup. Its own state (organizations, projects, templates and definitions) lives in a definition store you point it at: a Postgres or MariaDB database, with connection secrets sealed under an encryption key you hold. Your tenant databases are registered, read and written in place. Nothing is copied out of them.

The record

Every call leaves an audit row: who, which route, which status, how long, from which address, under which token and session. Readable at three scopes: your own trail, your organization’s, the deployment’s. Traces export to any OpenTelemetry collector; a caller’s request is never blocked on telemetry.

The whole file, setting by setting, including the one default that deliberately is not safe: Vol. II, Chapter 9.

Where it fits

The layer over a database. Three neighbours look similar.

Every team that puts a database behind an API writes the same routing, auth middleware and tenant checks, then the same list, get, insert, update and delete handler for the eleventh table. Minimal Core removes that work. What is left to write is the one endpoint that computes a payroll total, not the fifty that move rows. Vol. I, Chapter 1 makes the argument in full.

A database: Supabase, Neon, PlanetScale

These hold your data. Minimal Core goes over the database you already run and leaves the rows where they are, so there is no migration and no second copy. Minimal Core vs Supabase, side by side.

An API generator: PostgREST, Hasura

These give you an API. Minimal Core also serves every table as MCP tools and permissions each caller by identity, so an agent receives what its role allows. Microsoft’s Data API builder now serves MCP too. Minimal Core vs Data API builder, side by side.

An MCP gateway

A gateway sits in front of existing endpoints and allows or denies each call. Minimal Core decides on the table: one permission template answers REST and MCP alike, so an agent is refused for the same reasons a backend is.

Who it is not for

You have no database yet and want one hosted for you: that is Supabase or Neon. You need the tool itself to sign users in: Minimal Core has no login, by design. You need GraphQL: it serves REST and MCP only, by choice. You cannot make your gateway the only way in: it trusts five headers as given.

For the engineering manager

Take the API layer out of the backlog.

The queue you have now

Every new screen, report and agent waits for a backend developer to write, secure and test another route. The database is ready. The API layer is where the work queues.

What comes out of the queue

The routes that only move rows, the permission checks, the row filters that keep one customer’s data from another, the audit trail and the tracing. What stays is the handful of endpoints that are really your product. An AI agent can write those through MCP, and each one is a file your team reviews.

Changing engines

Change engines without rewriting your routes.

In most stacks the cost of changing engines grows with every route you ever wrote. Here it does not.

  • Generated routes (the Auto API). The engine and the database are segments of the URL. Change your app’s base path once. How many routes you call does not matter.
  • Custom APIs. Each one names its database in one block. Read the definition, swap the block, save it: two calls, and the same edit every time. A script or a coding agent can run them side by side and check each one before saving.
  • So the work grows only with the number of Custom APIs you have, and it divides by the number of workers you run.

Two things come on top. SQL written in one engine’s dialect needs a review on the new one. And moving the data itself takes as long as the data is large.

Is it ready

Beta by label. Two years in use.

Minimal Core carries a beta label. It has also served the analytics of a production call-dialling app for two years, stopped only to move to the next version, and it runs the chat on this site. Judge it on the 60-day trial, on your own database, before you pay anything.

For whoever signs it off

What an API layer costs to own.

Choosing a tool is one decision. Owning an API layer is eight costs that arrive every month, whoever wrote it. Here is what each becomes with Minimal Core.

What you are trusting

Minimal Core does not authenticate anyone. It trusts five headers from your gateway as given. If anything but your gateway can reach it, a caller can claim any role. So it runs on a private address, the gateway is the only way in, and the gateway overwrites the five headers. After that, every call is checked on the table and leaves an audit row.

What it depends on from us

Minimal Core is licensed by the request. Every instance connects to a Relay, a small service you run beside it, and the Relay reports usage to our licence service. The report is a request count. Your rows and queries are not in it. Minimal Core does not start without a Relay, and a Relay does not run without a valid licence.

When your prepaid requests reach zero, Minimal Core keeps serving for 72 hours at a reduced rate. After that it stops answering calls until you top up. The licensing site shows the requests you have left.

Cannot allow an outbound connection? An air-gapped version is supplied on request. It is not a download on the licensing site. Ask us.

With Minimal Core
DevelopmentList, read, insert, update and delete routes are generated. Your developers write only the endpoints that are yours, or have an AI agent write them and review the result.
Testing and QAGenerated routes behave the same on every table. You test the Custom APIs you wrote, not the plumbing.
DevOpsOne binary, one config file and one small database for its own state, on the machines you already run.
UptimeOne production analytics workload has run on it for two years, stopped only for upgrades.
TroubleshootingOpenTelemetry traces to the collector you already use, and an audit row for every call: who, which route, which status, how long.
PerformanceEvery read must be paged and the page size is capped (100 rows unless you change it), so no caller pulls a whole table in one request.
Security and patchingA new table answers direct reads only. Writes, AI agents and service callers stay locked until you open them, role by role. One binary to patch.
Scaling with trafficPriced per request, prepaid, and requests never expire, so a quiet month costs less than a busy one.

AI tokens: modelled at about 90% fewer on the API layer. See the model.

What you pay us

Nothing for 60 days: 3,000,000 requests, every feature, no card. Then $100 a year, plus $1 per 1,000 requests. One million requests is $1,000. It runs on your hardware, and nothing is copied out of your database.

Try it on your own hardware

Your own licence, free for 60 days.

The full Minimal Core licence with 3,000,000 requests, on a database you choose. Sign in, set up your organisation and download the licence file: six steps, shown below as you will see them.

Open license.littlebitlabs.com and continue with Google or GitHub. The portal reads only your name and email; there are no passwords.

The Minimal Connect sign-in page, with Continue with Google and Continue with GitHub
The first time you sign in, you set up a second factor with an authenticator app.

Name your organisation and choose its slug: one permanent word that also names your licence file. Add a contact phone with its country code, pick your country and timezone, and accept the terms of service.

Step 1 of 4: the organisation form with name, slug, contact, country, timezone and the terms of service checkbox
Every date in the portal uses the timezone you choose.

Choose how many requests you want, up to 3,000,000, read the trial agreement and agree to it. Free, with no card.

Step 2 of 4: request amounts from 100,000 to 3,000,000, the trial agreement and the Agree and start trial button
Your acceptance is recorded with the agreement version, the time, your account and your IP address.

Add the address your Relay calls from. A Relay is refused until its address is on the list; you can skip this and add it later from the Relay page.

Step 3 of 4: adding the Relay address or range that the licence accepts
One address, or a range up to /24 for IPv4 and /48 for IPv6.

Create your licence secret. It is shown once: set it as LICENSE_SECRET on the machines that run your Relay and Minimal.

Your licence secret dialog, with the secret and its environment variable line masked
Keep the secret apart from the licence file, for example in a password manager. Together they unlock your licence.

Download the licence file. The overview shows the requests left, the days left and what happens at zero; the portal has the setup steps for your Relay and Minimal.

The overview: 3,000,000 trial requests left, the licence dates and the Download license file button
The trial is free: there is no card on file and nothing is charged.

Opens license.littlebitlabs.com in a new tab. Sign in, then follow the six steps above.

No marketing follow-up. No spam.

The trial is governed by our Terms and Privacy policy.

When the trial ends, the licence is $100 a year plus $1 per 1,000 requests. See pricing →

3,000,000 requests loaded, 60 days to use them · every feature unlocked · free: no card, no commitment · sign in with Google or GitHub, with any email address · for evaluating, on development, staging or production databases; serving production traffic needs the paid licence · at zero, requests continue at a reduced rate for 72 hours, then stop; nothing is ever charged.

The ask

Four ways in. Three of them cost nothing.

Try it · $0

The hosted deployment at selectstar.wtf. Free tier, no card, no expiry. Volume I runs against it as printed; Chapter 2 has you reading rows before the end of the page.

Start free

Try it on your hardware · $0 for 60 days

The full licence on a machine you control: 3,000,000 requests, every feature, no card. Sign in with Google or GitHub at license.littlebitlabs.com.

Start the trial

Run it · $100 a year

The full licence on hardware you control, air-gapped if you need it. Every feature unlocked, plus $1 per 1,000 requests, prepaid and never expiring, topped up on the licensing site at license.littlebitlabs.com rather than from an API Bay wallet. Support is free; an on-call engineer is $150 an hour.

See pricing

Be granted it · $0 for twelve months

Ostrich: companies, a Minimal Core licence of $100K to $300K a year, roughly 100M to 300M requests. Pelican: qualifying non-profits, renewed on review, no cap. Both open on 1 Nov 2026.

Read the grant terms

Questions

The short answers.

What is Minimal Core?

One binary that serves the tables of a database you already run as a REST API and through an MCP server, with permissions per role and an audit row for every call. Nothing is copied out of the database.

Does Minimal Core handle sign-in?

No, by design. It runs on a private address behind the gateway or single sign-on you already have. That gateway adds five headers to each request: organisation, project, environment, user and roles. Minimal Core applies permissions from them.

Which databases does it serve?

Postgres, MySQL, MariaDB and ClickHouse, and the databases that speak their protocols: Aurora MySQL, Percona, TimescaleDB, Vitess, TiDB, CockroachDB, Citus, YugabyteDB, SingleStore, StarRocks and RisingWave.

Can one project use more than one database engine?

Yes. One project can register databases on different engines together. The engine is one segment of the URL; the filters, paging and permissions are the same on each.

Can my own APIs be served to my customers over MCP?

Yes, without writing an MCP server. minimal-mcp, a paid add-on, turns the Auto and Custom APIs you choose into named MCP tools of your product behind OAuth 2.1, using the documentation you supply. It does not expose your tables.

Can an AI agent build my APIs on it?

Yes. When direct CRUD needs logic around it, you ask a coding agent in plain English. It reads your schema, writes the logic and registers the endpoint through the integrated MCP server. The endpoint is live in the space the agent works in, such as dev, and you copy it to prod once staging has proven it. You review a short YAML document and a small module. The agent works under the roles you gave it, and changes are kept in history.

Does it serve GraphQL?

No. Minimal Core serves REST and MCP tools, by choice.

Is it ready for production?

It carries a beta label. It has served the analytics of a production call-dialling app for two years and runs the chat on this site. The 60-day trial is there so you can judge it on your own database.

What does it cost?

A 60-day trial with 3,000,000 requests and every feature, no card. Then a licence at $100 a year plus $1 per 1,000 requests, prepaid. One million requests is $1,000.

What is the Relay, and what happens when my requests run out?

The Relay is a small service you run beside Minimal Core. It reports the request count to our licence service. Minimal Core does not start without a Relay, and a Relay needs a valid licence. At zero requests, Minimal Core serves for 72 hours at a reduced rate, then stops until you top up.

Can it run air-gapped?

Yes, on request. The air-gapped version is not a download on the licensing site. Ask us for it.

Put it in front of a database.

Start the trial on your own, or book a session and we stand Minimal Core up against your own database with you, with Volume I open in another tab.

Nothing is copied out of your database. Prefer email? Write to us.

Next on the shelf

Where to go from here.

API Bayß

A dataset in, a priced API out.

Drop a file; we code, host, back up and serve the endpoints. You set the price and keep all of it.

Chat Studioß

A specialist for every part of your site.

Hand it your pages and documents, publish, and one line of code puts it on your site.

Free to try

Free tier, no card, no expiry.

The hosted tier costs nothing to start.