> For the complete documentation index, see [llms.txt](https://docs.aisuru.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aisuru.com/en/advanced-features/integrations/mcp/aisuru-mcp-which-ones-and-how-to-activate/7.-postgresql-mcp-server.md).

# 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 <a href="#f09f939d-parametri-1" id="f09f939d-parametri-1"></a>

| 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

```json
{
  "poolSize": 20,
  "connectionTimeout": 30,
  "idleTimeout": 60,
  "queryTimeout": 60,
  "statementTimeout": 60000,
  "applicationName": "aisuru_mcp"
}
```

## 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:

   ```
   postgresql://postgres:[YOUR-PASSWORD]@db.xxxxx.supabase.co:5432/postgres
   ```
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)
