---
title: "PostgreSQL MCP server for AI agents - actionlake"
description: "Connect Claude to PostgreSQL through one MCP server. Queries run read-only, enforced by the server; every write waits for a yes. 100,000 calls a month free."
canonical: https://actionlake.com/connectors/postgresql
updated: 2026-10-10
---

Connectors · Developer & infrastructure

# PostgreSQL MCP server for AI agents.

actionlake is an MCP gateway: one remote MCP server that connects Claude and other MCP clients to your own PostgreSQL database and the rest of your systems. Reads run read-only, enforced by the database server, one statement per call; anything that changes data is destructive and waits for a confirmation. Your agent never holds the PostgreSQL password, and every call is recorded.

[Connect PostgreSQL free](https://actionlake.com/console?start=sandbox) [See pricing](https://actionlake.com/pricing)

100,000 free calls a month. No card, no email, no password: press Start a free sandbox on the next screen and keep the key it shows you.

`claude mcp add --transport http actionlake https://connect.actionlake.com/mcp`

the first call

```
do {
  action: "postgres.query",
  input: { sql: "select table_name from information_schema.tables" },
  intent: "see what the connected PostgreSQL database holds"
}
# Run a read-only PostgreSQL query · read · 1 upstream call
```

- 3 actions in one signed file
- 1 read look, never change
- 0 write create and update
- 2 wait for a yes destructive, confirmed first

Set up

## Connect PostgreSQL in three steps.

1. 01
   ### Add actionlake to Claude.
   Run the command once in Claude Code; its consent page can create a free sandbox: 100,000 calls a month, no card. In the Claude app, add a custom connector with the URL below and paste your key on the consent page. Creating a new sandbox from the Claude app is not yet tested by us.
   `https://connect.actionlake.com/mcp`
2. 02
   ### Connect PostgreSQL.
   Username and secret. No consent screen: your agent can connect it for you, but the key then passes through your chat. To keep it out of the model's context, paste it in the console instead. actionlake stores what you paste write-only, sealed under your tenant's key.
   - `username` PostgreSQL user — grant it only what actionlake should be able to do
   - `password` PostgreSQL password
   - `database` Where your PostgreSQL lives: your database
   - `host` Where your PostgreSQL lives: your host
   ```
   account { op: "connections.requirements", service: "postgres" }
   # free: exactly what to paste, and what is found for you
   ```
3. 03
   ### Make the first call. Check before a write.
   Ask in plain words; Claude picks the action. Before anything changes, `check` validates the call and prices it, for free.
   ```
   do    { action: "postgres.query", input: { sql: "select 1" } }
   # run a read-only postgresql query · read · 1 upstream call
   check { action: "postgres.execute", input: { … } }
   # free: inputs, permissions, cost and confirmations, nothing sent
   ```

PostgreSQL at a glance

**Sign-in**

Username and secret. No consent screen: your agent can connect it for you, but the key then passes through your chat. To keep it out of the model's context, paste it in the console instead.

**You provide**

`username` `password`

**Setup fields**

`database` `host`

**Limits we pace to**

600 calls a minute, per connection

**Built from**

PostgreSQL's documentation, read 21 September 2026[postgresql.org](https://www.postgresql.org/docs/)

**Service file**

Version 1.0.0, signed (Ed25519)

**Cached reads**

Not cached: every read goes to the vendor

**Data**

Processed and stored in Sydney, Australia. No US region yet

Capabilities

## What an AI agent can do in PostgreSQL.

3 actions in 1 area. Every one carries its effect, so a key can allow the reads and hold the rest.

- **1** read look, never change
- **0** write create and update
- **2** destructive wait for a confirmation

1. ### Database
   3
   1 read · 0 write · 2 destructive
   Run a read-only PostgreSQL query · Execute a PostgreSQL statement · Execute a PostgreSQL statement, with approval

Top actions

## PostgreSQL actions, shaped for agents.

The ids your agent types, what each does, and the one name it shares with other systems.

| Action | What it does | Effect | Same name in |
| --- | --- | --- | --- |
| `postgres.query` Run a read-only PostgreSQL query | Run any SELECT (or other read) against the connected PostgreSQL database. | read | this connector |
| `postgres.execute` Execute a PostgreSQL statement | Run any one statement — INSERT, UPDATE, DELETE, DDL — behind confirmation. | destructive | this connector |

Try it

## Prompts to paste into Claude.

Each one names the PostgreSQL actions it will call, so you know what it reads and what it changes before you send it.

1. Read read
   Which tables in our PostgreSQL database have the most rows? Read only, change nothing.
   calls `postgres.query`

Governance for PostgreSQL

## Destructive actions wait for a yes.

2 PostgreSQL actions are destructive. These are all of them:

- Execute a PostgreSQL statement `postgres.execute`
- Execute a PostgreSQL statement, with approval `postgres.execute.approved`

A destructive action runs only with `confirm: true`. Under the `human` policy the agent cannot confirm for itself: the run stops until a named person approves, in the console or from a signed link in an email. The cap on a key is refused before the call is sent, never after.

do postgres.execute confirm_policy: **human**

Execute a PostgreSQL statement?

**intent:** the user asked me to execute a PostgreSQL statement

run suspended · waiting for a named person · key _postgres-agent_ cannot confirm itself

In the console, or from an emailed signed link.

a key for this connector

```
account {
  op: "keys.create", name: "postgres-agent",
  allowed_actions: ["postgres.*"], cap_calls: 2000,
  confirm_policy: "human_for_writes",
  approval_rules: [
    { match: "postgres.execute", approver: "lead@example.com" },
    { match: "postgres.execute.approved", approver: "lead@example.com" }
  ]
}
```

Illustrative. Scoped to PostgreSQL only, capped at 2,000 upstream calls, every write confirmed, and the destructive ones approved by a named person.

Cost

## What PostgreSQL costs on actionlake.

Every PostgreSQL action is one upstream call, the only thing actionlake bills. Searching, `check`, `cost`, `account` are free. Paid plans start at US$49 a month for 250,000 calls, with overage from US$0.30 down to US$0.18 per 1,000.

- 1 upstream call per action all 3 PostgreSQL actions
- 0 actions page each page of a long list is one call
- 0 reads can be cached a cache hit costs nothing
- 100,000 calls a month, free paid plans from US$49 a month for 250,000

[See pricing](https://actionlake.com/pricing)

Action index

## Every PostgreSQL action.

3 actions by area: the id your agent calls, what it does, and its effect.

**Database 3**

- `postgres.execute` Execute a PostgreSQL statement destructive
- `postgres.execute.approved` Execute a PostgreSQL statement, with approval destructive
- `postgres.query` Run a read-only PostgreSQL query read

Questions

## The PostgreSQL MCP server, answered.

**Is there a PostgreSQL MCP server for Claude?**

Yes. actionlake is an MCP gateway: a remote MCP server that gives Claude, or another MCP client, 3 PostgreSQL actions, through the same eight tools it uses for every other connector. actionlake is independent; it is not made or endorsed by PostgreSQL.

**What do I need to connect PostgreSQL?**

PostgreSQL user — grant it only what actionlake should be able to do and PostgreSQL password. Plus your database and your host. The free call account { op: "connections.requirements", service: "postgres" } lists exactly what to paste.

**What does a PostgreSQL action cost?**

One upstream call, the only unit actionlake bills. Cache hits, searches, dry runs are free. The Free plan includes 100,000 calls a month with no card. Paid plans start at US$49 a month for 250,000 calls, with overage from US$0.30 down to US$0.18 per 1,000.

**Can an AI agent change my PostgreSQL database?**

Only through the destructive action, and only with a confirmation. The read action runs read-only, enforced by the database server, one statement per call. Give the PostgreSQL user only the grants actionlake should have. On Team and above a Dedicated IP gives your firewall one address to allow.

**Does actionlake keep my PostgreSQL data, and where?**

actionlake processes and stores data in Sydney, Australia; there is no US region yet. PostgreSQL responses are not cached. Each run's request and response is kept, sealed, for your plan's trace window: 1 day on Free, 3 days on Starter, 7 days on Pro, 14 days on Team, 30 days on Business and 30 days on Enterprise. Your PostgreSQL credential is sealed under your tenant's key, never logged and never returned. Your traffic is not used to train models.

**Which AI clients can use it?**

Claude Code, tested by us end to end, and the Claude app as a custom connector, tested by us with an existing key. Other MCP clients that support remote servers over Streamable HTTP (MCP revisions 2025-06-18 and 2025-11-25) and OAuth dynamic client registration, or a bearer header, should connect the same way; we have not tested them. Or plain REST, under the same action names.

## More connectors like PostgreSQL

Browse

- [All Developer & infrastructure connectors](https://actionlake.com/connectors/category/developer-and-infrastructure)
- [All connectors](https://actionlake.com/connectors)
- [How actionlake compares](https://actionlake.com/compare)

actionlake is independent. It is not made or endorsed by PostgreSQL; the name is the vendor's own. Counts are from the PostgreSQL service file, version 1.0.0.

## Give your agent PostgreSQL today.

[Connect PostgreSQL free](https://actionlake.com/console?start=sandbox) [See pricing](https://actionlake.com/pricing)

Start free - 100,000 calls/month, no card. No signup. Hard caps on every key. Cached answers are free.

---

Source: https://actionlake.com/connectors/postgresql
More: https://actionlake.com/llms.txt
