pRESTd: a REST and MCP layer over the Postgres database you already have
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new, MCP server
At a glance
- What is it?
- pRESTd exposes an existing Postgres schema as CRUD plus custom SQL routes, with auth, ACL and a read-only MCP endpoint, and its most interesting file is the section on how it screens interpolated query values. That screen has documented false positives, and the default image ships a Go toolchain so plugins can rebuild at runtime.
- Who is it for?
- pRESTd fits a team with a Postgres database that needs an internal API this week and would rather not write a backend, and who can commit to binding parameters in custom SQL rather than interpolating them. It does not fit a public-facing API exposed without ACL, since the table URL pattern is the whole surface.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly Go, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 13, 2026, and from our analysis. They are not legal advice.
Star history
- prest/prest4,633 ★ · +16
| Repository | 2026-09-13 | 2026-11-13 |
|---|---|---|
| prest/prest | 4.6k | 4.6k |
16 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
One URL pattern is the whole surface
There is no schema file and no migration to write. You point the process at a database and the tables are the API:
GET /{database}/{schema}/{table}The connection comes from `PREST_PG_URL`, or from `pg.*` settings, or from `DATABASE_URL`, and the stated floor is PostgreSQL 9.5 or higher. The Go module is published as `github.com/prest/prest/v2`, so the major version is part of every import path, and the recent tags are v2.5.1 on 2026-10-08, v2.5.2 on 2026-10-19 and v2.5.3 on 2026-10-30.
On top of CRUD the project lists custom SQL routes, auth, ACL and a read-only MCP endpoint, and it advertises MCP over HTTP plus a page aimed at AI clients such as Cursor and Claude.
The design decision worth naming is that the database is the contract. That is what makes deployment fast and what makes the ACL load-bearing: whatever your schema exposes is reachable unless a rule says otherwise, so the configuration reference is the part to read first rather than the API reference.
Interpolated values get screened, bound values do not
This is the section of the documentation that tells you what the maintainers are worried about, and it is unusually specific. Values a `_QUERIES` script template interpolates become part of the SQL text, so pREST screens them: anything carrying quotes, `--`, `::`, or, for multi-word values, a SQL keyword is refused, and a refused value fails the request with `400`.
The alternative is binding, and the two forms are shown side by side:
-- interpolated: screened, and rejected for values like 'compra do mes'
SELECT * FROM articles WHERE slug = '{{.slug}}'
-- bound: the caller's value arrives verbatim, whatever it contains
SELECT * FROM articles WHERE slug = {{sqlVal "slug"}}The helpers are three, and on PostgreSQL each renders this shape:
| Helper | Use for | Renders | | --- | --- | --- | | `{{sqlVal "key"}}` | a single value | `$1` | | `{{sqlList "key"}}` | a repeated query parameter (`?tag=a&tag=b`) | `($1,$2)` | | `{{ident "key"}}` | a table/column name, which cannot be bound | `"public"."users"` |
The screen has a cost the documentation states plainly: a search phrase such as 'compra do mes' is exactly what it refuses. So the safe path is binding, and the screen is a backstop for scripts you have not converted yet rather than a design to lean on.
An agent-facing surface sits on the same database
The MCP endpoint is described as read-only, and it is served over HTTP alongside the REST API, with its own documentation page and a separate page for AI and MCP. That makes an LLM client a first class consumer of the same Postgres instance that CRUD traffic hits.
Read-only is the only restriction stated, and it is a meaningful one, but it is worth being clear about what it does and does not cover. It means the MCP path cannot write. The README points to Configuring pREST for auth, ACL, custom queries and MCP, and says MCP `prest.list_databases` shows only the served databases.
The practical consequence for an adopter is that exposing pRESTd to an agent client is a database access decision, not a UI decision. The same reasoning that governs whether your REST API should be public applies to the MCP endpoint, with the difference that the caller may be a model rather than a program you wrote.
Network tests skip when PREST_TEST_URL is unset
The testing section is specific about what runs where, and one line in it deserves attention:
make test-unitruns unit tests locally, while the integration suites run inside Docker with no local Postgres required. `make test-integration-postgres` covers the full Postgres stack across the default, auth, multicluster and queries suites, and `make test-integration-timescaledb` runs the Timescale-specific end to end tests only. There is also a compose path that brings up `postgres`, `postgres-b`, `db-init` and four prestd variants:
docker compose -f integration/postgres/docker-compose.yml up -d --wait \
postgres postgres-b db-init prestd prestd-multicluster prestd-auth prestd-queriesThe Postgres compose runs the suites under `./integration/suites/` and `./integration/postgres/`, while the TimescaleDB compose runs only `./integration/timescaledb/`.
Now the catch. Network tests require `PREST_TEST_URL`, plus flavor-specific URLs for the Postgres job, and outside Compose those tests skip when the URLs are unset. A green integration run on a laptop may therefore have executed no network test at all, silently. In CI that variable has to be set deliberately, and the skip is the difference between a suite that passed and a suite that did not run.
The development stack starts with JWT defaults and caches off
The compose file is the fastest way to see which knobs exist, and it sets three of them to a non-obvious value:
- `PREST_DEBUG=true`, so requests are verbose - `PREST_JWT_DEFAULT=false` - `PREST_PG_CACHE=false` and `PREST_CACHE_ENABLED=false`
The two cache flags being off means a local environment is not exercising the query cache or the general cache at all, so a performance question cannot be answered from a default compose run.
Two more blocks are present but commented out. MySQL is available as an opt-in profile with `PREST_ENGINE=mysql` and a `PREST_DB_URL`, and OpenTelemetry is opt-in with `PREST_OTEL_ENABLED`, `PREST_OTEL_ENDPOINT`, `PREST_OTEL_INSECURE` and `PREST_OTEL_SERVICE_NAME`, with instructions to bring up the SigNoz stack first and start the service on a shared network.
The `.env.example` template is where credentials live, and it is blunt about handling: copy it to `.env`, set the database URL, and never commit `.env` because it may contain credentials.
Postgres 18 in compose, Postgres 9.5 as the floor
Two database stories coexist. The README states PostgreSQL 9.5 or higher as the default engine, and the local compose profile runs `postgres:18` with a `pg_isready` health check on a thirty second interval. The gap between those two numbers is the compatibility range.
MySQL is a second engine: the README describes MySQL 8.0.19+ as a separate native dialect from v2.5.0, selected with `engine = "mysql"`, with read-only MCP on MySQL from v2.5.1. The compose file defines a `mysql` profile on `mysql:8.4` with its own health check, clearly marked as not started with the default prest service, and the MySQL driver is a direct dependency in `go.mod` alongside the Postgres driver. The documentation has a Databases page and a roadmap page, which suggests the set of supported engines is expected to grow.
So Postgres is the default engine and MySQL 8.0.19+ is a documented alternative, while MariaDB, TiDB and Aurora MySQL stay on the roadmap.
The rest of `go.mod` describes the shape of the service: `gorilla/mux` and `urfave/negroni` for routing and middleware, `cobra` with `viper` for configuration, `sqlx` with `lib/pq` for data access, `buntdb` as an embedded store, JOSE and JWK libraries for tokens, and OpenTelemetry packages for traces and logs.
The default image keeps a Go toolchain so plugins can rebuild
The Dockerfile is three stages and the last one is not a slim runtime image. A Node 24 stage builds the studio frontend with pnpm and copies the result into a `golang:1.26` builder, which vendors the modules and builds `prestd` with version metadata passed through build arguments.
The final stage is described as the full-repo build, the default for `docker build .`, and it needs Go in order to compile the plugin system. It sets `PREST_BUILD_PLUGINS=1`, copies the vendored dependencies and the plugin directory into the image, and explains why the module files are copied too: same module identity as the prestd binary, so plugin rebuilds triggered by the entrypoint actually load.
The entrypoint is a shell script copied to `/app/entrypoint.sh`, which means the runtime cost of the default image includes a Go toolchain and a vendored tree.
A `Dockerfile.noplugins` also sits at the root. A contributor running `docker build -t prest/prest:latest .` locally is building the heavy variant by default, and that is worth knowing before wondering why the image is large.
Three analysis configs and a CLA in the way
The top level tree is where the project's process shows. Static analysis is configured three separate times, in `.deepsource.toml`, `.codeclimate.yml` and `.sourcelevel.yml`, and `coverage.txt` is committed at the root alongside a `codecov` badge. There are agent configuration directories in `.claude/` and `.cursor/`, a `.kodiak.toml`, and `.devcontainer/` for a containerised development environment.
The substantive entry is the Contributor License Agreement, which the README links and asks contributors to sign. That is a legal commitment on the way in, and it differs from a plain MIT contribution flow, so it is worth reading before sending a patch rather than after.
The samples directory is more immediately useful. It holds `prest.sample.toml`, a configuration sample, and `prest_first_look.postman_collection.json`, a Postman collection for a first pass through the API, which is a faster way to see the surface than reading the API reference.
Release engineering sits in `.goreleaser.yml`, and there is a separate `docker-compose-prod.yml` next to the development one. The README links a Discord server, and the last push to the repository is dated 2026-10-30.
Editorial conclusion
pRESTd fits a team with a Postgres database that needs an internal API this week and would rather not write a backend, and who can commit to binding parameters in custom SQL rather than interpolating them. It does not fit a public-facing API exposed without ACL, since the table URL pattern is the whole surface. Verify two things first: that your custom queries use `sqlVal`, `sqlList` or `ident` instead of `{{.value}}` interpolation, because the screen refuses ordinary search phrases.
Frequently asked questions
How do I point pRESTd at my database?
Set `PREST_PG_URL`, or the `pg.*` settings, or `DATABASE_URL`. The `.env.example` template shows a remote form with `?sslmode=require` for AWS RDS or Heroku and a local compose form with `?sslmode=disable`, and warns never to commit a filled `.env` because it may contain credentials.
What does pRESTd expose over an existing database?
CRUD through `GET /{database}/{schema}/{table}`, custom SQL routes, auth, ACL, and a read-only MCP endpoint. PostgreSQL 9.5 or higher is the default engine, with MySQL 8.0.19+ as an alternative, and the database schema itself is the contract rather than a schema file.
Why does my pRESTd search query return 400?
A `_QUERIES` script that interpolates with `{{.slug}}` is screened, and anything carrying quotes, `--`, `::`, or a SQL keyword in a multi-word value is refused, which fails the request with 400. Bind the value instead with `{{sqlVal "slug"}}`.
Which helpers do pRESTd query scripts provide?
`{{sqlVal "key"}}` renders `$1` for a single value, `{{sqlList "key"}}` renders `($1,$2)` for a repeated query parameter such as `?tag=a&tag=b`, and `{{ident "key"}}` renders a quoted identifier like `"public"."users"` for table and column names, which cannot be bound.
Can I run pRESTd against MySQL?
Yes. The README describes MySQL 8.0.19+ as a separate native dialect from v2.5.0, selected with `engine = "mysql"` or `PREST_ENGINE=mysql` plus a `PREST_DB_URL`, with read-only MCP on MySQL from v2.5.1. PostgreSQL 9.5+ remains the default engine, and the compose file carries an optional `mysql` profile on mysql:8.4.
How do I run the pRESTd integration tests?
The repository carries an `integration/` directory, a `testdata/` directory and a `Makefile` at its root; the full documentation lives at docs.prestd.com.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/prest-prest)Star history chart for your README
[](https://hysenlabs.com/projects/prest-prest)Was this useful?