by prest
Instant REST and MCP APIs for PostgreSQL and MySQL, on existing or new databases. CRUD, custom SQL routes, auth and ACL without writing a backend. Low-code, ⚡ realtime, high-performance. Native MySQL support since v2.5
# Add to your Claude Code skills
git clone https://github.com/prest/prestGuides for using mcp servers skills like prest.
prest is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by prest. Instant REST and MCP APIs for PostgreSQL and MySQL, on existing or new databases. CRUD, custom SQL routes, auth and ACL without writing a backend. Low-code, ⚡ realtime, high-performance. Native MySQL support since v2.5. It has 4,638 GitHub stars.
prest's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/prest/prest" and add it to your Claude Code skills directory (see the Installation section above).
prest is primarily written in Go. It is open-source under prest on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh prest against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
pREST (PostgreSQL REST) is a production-ready API that delivers instant REST and Model Context Protocol (MCP) APIs on your existing or new SQL database — CRUD, custom SQL routes, auth, ACL, and a read-only MCP endpoint — without hand-writing a backend.
PostgreSQL 9.5+ is the default engine. MySQL 8.0.19+ is a separate native dialect from v2.5.0. Read-only MCP on MySQL is v2.5.1. Set engine = "mysql" to select it. An unset engine stays PostgreSQL. MariaDB, TiDB, and Aurora MySQL stay on the roadmap.
PostgreSQL 9.5+ (default). MySQL 8.0.19+ with
engine = "mysql".
Contributor License Agreement:
Full documentation lives at docs.prestd.com.
| Topic | Link |
|---|---|
| Get pREST (Docker, Homebrew, Go) | Get pREST |
| Configuration | Configuring pREST |
| API reference | API Reference |
| MCP over HTTP | MCP over HTTP |
| Multi-database | Multi-database |
| Databases & roadmap | Databases · Roadmap |
| MySQL 8 | MySQL · v2.5.1 |
| AI clients (Cursor, Claude, …) | AI and MCP |
Install and run options (Docker, Homebrew, or Go) are documented in Get pREST. Point pREST at Postgres (PREST_PG_URL or pg.* / DATABASE_URL), then call:
GET /{database}/{schema}/{table}
MySQL 8.0.19+ uses the same path. {schema} is the MySQL database. Set the engine and a mysql:// URL. The port defaults to 3306 when unset. PREST_DB_* is read first, then the legacy PREST_PG_* names:
engine = "mysql"
[pg]
url = "mysql://user:pass@localhost:3306/mydb"
export PREST_ENGINE=mysql
export PREST_DB_URL='mysql://user:pass@localhost:3306/mydb'
A missing user or database fails startup. Postgres defaults (user postgres, database prest, port 5432) are not copied onto a MySQL engine. Guide: MySQL.
Set PREST_PG_TIMEZONE (IANA name, e.g. America/Sao_Paulo) to choose the PostgreSQL session TimeZone; see samples/prest.sample.toml. Postgres and TimescaleDB only; MySQL ignores it.
Set PREST_HTTP_ALLOWED_HOSTS (or http.allowed_hosts) to the host names pREST serves, e.g. api.example.com,.example.org, to answer any other Host header with 400 Bad Request; see samples/prest.sample.toml. Unset, every host is served.
Set PREST_HTTP_REQUEST_ID_HEADER (or http.request_id_header) to a header name such as X-Request-Id to give every request a correlation ID: the ID a client or proxy sent in that header is kept, otherwise one is generated, and it is returned in the same response header and logged at the end of each access log line; see samples/prest.sample.toml. Unset, no request ID is added.
See Configuring pREST for auth, ACL, custom queries, and MCP.
Containers can run without a mounted prest.toml. Put the application config (auth, JWT, ACL, queries, cache, CORS, …) in one JSON document in PREST_CONFIG_JSON, and keep the listener and database settings in their usual env vars:
prestd config export-json -f prest.toml > app-config.json
kubectl create secret generic prest-app-config --from-file=config.json=app-config.json
export PREST_PG_URL='postgres://user:pass@db:5432/prest'
export PREST_CONFIG_JSON="$(cat app-config.json)"
# or, where multi-line values get mangled:
export PREST_CONFIG_JSON_B64="$(base64 < app-config.json | tr -d '\n')"
prest.toml when there is one. An array replaces the file's array whole, and a null is skipped. PREST_* env vars still override the document.[http], [https], engine, [pg], [mysql], [[databases]] and queries.location are never read from it: they are ignored with a warning, so a stale export cannot move the port or switch the database.jwt.key. Store it as a secret.pREST can serve multiple databases in two modes:
Define a [[databases]] registry in prest.toml or use environment variables (DATABASE_ALIAS_<n> / DATABASE_URL_<n>). Aliases may differ from database names, and entries can be on the same host or different hosts:
[[databases]]
alias = "main"
url = "postgres://user:pass@localhost:5432/prest_main?sslmode=disable"
[[databases]]
alias = "tenant-1"
url = "postgres://user:pass@localhost:5432/tenant_1?sslmode=disable"
[[databases]]
alias = "reporting"
url = "mysql://user:[email protected]:3306/reports?tls=false"
Or via environment:
DATABASE_ALIAS_1=main
DATABASE_URL_1="postgres://user:pass@localhost:5432/prest_main?sslmode=disable"
DATABASE_ALIAS_2=tenant-1
DATABASE_URL_2="postgres://user:pass@localhost:5432/tenant_1?sslmode=disable"
An entry that is unreachable at start-up is logged and answers 503 ("database unavailable") until it comes up; start-up fails only when every entry is unreachable or the configuration is invalid.
Use pg.database plus pg.allowed_databases on the [pg] host with the [pg] credentials. Both Postgres and MySQL are supported. On MySQL, {schema} must equal {database}:
[pg]
database = "prest"
allowed_databases = ["secondary-db"]
Or via environment (comma-separated for allowed databases):
PREST_PG_DATABASE=prest
PREST_PG_ALLOWED_DATABASES=secondary-db,another-db
# or for MySQL:
PREST_DB_DATABASE=mydb
PREST_DB_ALLOWED_DATABASES=other-db
The /databases endpoint and MCP prest.list_databases show only the served databases. In registry mode, that is the configured aliases. Without a registry, that is pg.database plus pg.allowed_databases.
Postgres supports up to 64 open pools. MySQL creates one pool per served database.
pg.singleThe pg.single configuration key has been removed and is ignored with a warning. Behavior changes:
pg.single = true (the default) required requests to be for the main pg.database; allow-listed names were ignored. Now they are served whether the deprecated key is set or not.pg.database. Previously, with both a registry and pg.single = true, every request was restricted to the main database. Now a registry serves its configured aliases freely./databases and MCP list only served databases. Requests for unlisted databases return 400 "database not registered"./{database}/{other-schema}/… returns 404. On MySQL a schema is a database, so {schema} must equal {database}. Previously any database the MySQL user had grants on was reachable through pg.database.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 that is interpolated fails
the request with 400.
Bind free-form values instead, and the screen does not apply at all. On PostgreSQL, a bound value travels to the database out of band, where it can never be parsed as SQL:
-- 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"}}
| 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" |
That table is the PostgreSQL