Postgres database for AI agents (a Postgres MCP server)
A real Postgres database for your workspace that your agent creates tables in, queries with SQL and writes to, from Claude, ChatGPT or Codex, with no connection string to hand out. It is created on the first call once your organization has a plan, a credit package or a running trial; ours was ready 13 seconds after that call.
What it touches: only your workspace's own database. Updates and deletes need a filter, a read-only query can't write, and DROP or TRUNCATE runs only with an explicit confirm.
updated Nov 3, 2026
Copy the setup prompt.
Your agent does the rest.
Install superagnt for me. It's the superagnt plugin from the github.com/superagnt/plugins marketplace, plus the superagnt MCP server (on Claude it's a connector I add in my browser; elsewhere I sign in through my browser). The setup guide for each kind of agent is at https://www.superagnt.com/install» the agnt_db_* tools are part of every server's base tools, so a fresh connection already has them.
What can your agent do with postgres database?
list_tables returns tables, columns, types and row-level security status, so the agent reads the schema instead of guessing at it.
apply_migration runs DDL and records it, so the schema an agent built is auditable and repeatable.
select, insert, upsert, update and delete with filters, so simple work needs no hand-written SQL.
execute_sql for anything the helpers don't cover, with a read_only flag for a statement that must not write.
load_csv streams a workspace file into a table server-side, with type inference, batched upsert and dedup on conflict.
pgvector and pgcrypto are on hand, so embeddings sit next to the rows they describe; list_extensions shows what is installed.
agnt_db_readaction: status · list_tables · list_extensions · list_migrations · selectagnt_db_sqlaction: execute_sql · apply_migrationagnt_db_writeaction: insert · upsert · update · load_csvagnt_db_deletecalled by its own name
per-operation names12older servers list these
agnt_db_statusagnt_db_list_tablesagnt_db_list_extensionsagnt_db_list_migrationsagnt_db_apply_migrationagnt_db_execute_sqlagnt_db_selectagnt_db_insertagnt_db_upsertagnt_db_updateagnt_db_deleteagnt_db_load_csvWhat does a real call return?
A run we recorded on superagnt, with the result trimmed to fit. Nothing on it is invented: the date, the wall time and the cost are the run's own.
asked Make a leads table, add three rows, then try to mark every lead lost, sneak an insert into a read-only query, and drop the table.
- → call 1
agnt_db_write{ "action": "update", "table": "leads_probe", "values": { "status": "lost" } }← resulttrimmedMissing required argument(s) for agnt_db_write action "update": filters. It was not executed. - → call 2
agnt_db_sql{ "action": "execute_sql", "query": "insert into leads_probe (company) values ('Sneaky Insert')", "read_only": true }← resulttrimmedOnly read-only SELECT/CTE statements are allowed (got "insert") - → call 3
agnt_db_sql{ "action": "execute_sql", "query": "drop table leads_probe" }← resulttrimmedDestructive statement requires confirm=true
» The same run created the table and inserted the rows first, and agnt_db_delete with an empty filter list answered "delete requires at least one filter". With confirm_destructive true the DROP went through. Database calls carry no per-call charge.
Are people letting agents run SQL straight on production?
Some are, and the fear is fair: a model that writes UPDATE without a WHERE clause can wipe a table. Here the dangerous statements need a deliberate second step. In our run an update with no filter was refused before it ran, a delete with no filter was refused, an INSERT inside a read_only query was refused, and DROP ran only when the call said confirm_destructive. The database is the workspace's own, separate from your production systems.
| What the agent tried | What happened |
|---|---|
| update with no filter | Refused: filters are required. Not executed. |
| delete with no filter | Refused: "delete requires at least one filter" |
| INSERT inside a read_only query | Refused: "Only read-only SELECT/CTE statements are allowed" |
| DROP TABLE | Refused until the call sets confirm_destructive true |
sample · One run on a fresh workspace database, Nov 3, 2026
Is a vector database enough, or can Postgres do it?
Postgres can. pgvector is on the same database, so embeddings live next to the rows they describe and one query can join them. In our test we loaded 10,000 random 1,536-dimension vectors with one SQL call in 4.4 seconds, and an exact nearest-neighbour query over all of them came back in 0.64 to 0.67 seconds, the round trip included, with no index. A separate vector database earns its place only at millions of vectors or with search features Postgres lacks.
sample · 10,000 rows, vector(1536), two queries, Nov 3, 2026
Do agents need a database at all?
Any agent that works for more than one session does. Each run of a schedule or a queue starts fresh, so results, lists and state go in tables the next run reads. Keep documents in a knowledge base, small learned facts in memory and uploads and exports in files.
What do people use it for?
A lead store an agent keeps up to date
The agent writes every lead it finds to one table with an upsert on the email, marks status as it works, and reads back only the rows that still need a step, so nothing is contacted twice.
Pipeline output the team can query
A scraping or enrichment job writes rows as it goes. Analysts query the same tables directly, so nothing important lives only in a chat transcript.
CSV in, structured out
Someone uploads a list. The agent loads it with load_csv, enriches each row with the lead tools, and writes the results back with an upsert.
What does it cost?
The tools carry no per-call price: every plan includes them, and plans differ only in how much they hold. Plans are Starter $49 a month ($20 of data credit included), Growth $149 a month ($90) and Scale $399 a month ($300), and the no-card trial gives $3 of data credit with Growth limits.
- Database tables: Starter 10, Growth 50 and Scale 250.
- Database rows, across every table: Starter 25,000, Growth 250,000 and Scale 2,500,000.
- Database storage: Starter 250 MB, Growth 1 GB and Scale 10 GB.
What do people ask before they wire it up?
01What is the best database for AI agents?
For most agents, plain Postgres: tables for state, SQL the model already knows, and pgvector for embeddings, with guard rails on what the agent can change. This one adds the guard rails and needs no hosting or connection string.
02Where do AI agents get their data?
From the tools you give them: live data sources such as LinkedIn or the web, your own systems through connections, and a database they read and write between runs. The database is what lets the next run start from what the last one learned.
03Can AI agents connect to a database?
Yes. Over MCP an agent in Claude, ChatGPT, Codex or Cursor reads the schema, runs SQL, applies migrations and writes rows, as in the run above, without you handing it a connection string.
04Are people actually letting agents run SQL straight on production?
Some do, and that is where accidents happen. Here a filterless update or delete is refused, a read_only query can't write, and DROP needs an explicit confirm, on a database that belongs to the workspace rather than to your production app.
05Do agents need a database at all?
An agent that runs more than once does: each scheduled or queued run starts fresh, so its results and state have to live somewhere the next run can read.
06Is a vector database enough, or can Postgres do it?
Postgres with pgvector does it: in our test an exact nearest-neighbour query over 10,000 vectors of 1,536 dimensions returned in under 0.7 seconds, the round trip included. A vector database alone can't hold the rows, filters and joins an agent also needs.