For the complete documentation index, see llms.txt. This page is also available as Markdown.

7. PostgreSQL MCP Server

The PostgreSQL MCP Server lets your Agent connect to PostgreSQL databases and perform read and write operations.

What does it do?

This MCP acts as a bridge between an Agent and your MySQL database. It allows the Agent to:

  • Read data - Ask questions like "How many customers do we have?" and get a real answer pulled directly from the user’s database

  • Write or update data - Add new records, update existing ones, or make changes. All through a simple conversation

  • Search and filter - Find specific information quickly without needing to dig through spreadsheets or reports manually

  • Analyze information - Get summaries, counts, or insights from your data in plain language

Configuration parameters

Parameter
Required
Description
Default
Possible values

connection_string

Yes

PostgreSQL connection URI (f.i., postgresql://user:password@host:port/database)

-

Any postgresql URI

Access Mode

No

Database access mode

read-write

read-write, read-only

SSL Mode

No

SSL mode for the connection

prefer

disable, allow, prefer, require, verify-ca, verify-full

SSL Cert Path

No

Path to the SSL client certificate (f.i., /path/to/client-cert.pem)

-

Any path

SSL Key Path

No

Path to the SSL private key (f.i., /path/to/client-key.pem)

-

Any path

SSL Ca Path

No

Path to the CA certificate (f.i., /path/to/ca-cert.pem)

-

Any path

SSL Reject Unauthorized

No

Reject connections with invalid certificates

true

true, false

Custom parameters

  • poolSize: total number of connections in the pool

  • connectionTimeout: maximum time to establish a connection (seconds)

  • idleTimeout: maximum idle time for connections (seconds)

  • queryTimeout: maximum time to execute a query (seconds)

  • statementTimeout: maximum time for an SQL statement (ms)

  • applicationName: identifying name of the application

How to get the parameters

  1. After registering, create a new project

  2. Go to Settings (gear icon) → Database

  3. Copy the Connection string in URI format:

  4. Ssl Mode: use require (Supabase requires SSL)

Note on Supabase Connection Pooler:

  • Port 5432: Direct connection (for transactions and complex operations)

  • Port 6543: Connection pooler (for applications with many simultaneous connections)

Last updated