# PostgreSQL Read-only MCP server

> Allows an AI client to discover PostgreSQL 17+ instances and execute a restricted subset of read-only SELECT queries.

- Repository: https://github.com/futuretea/postgres-mcp-server
- Page: https://hostedmcp.org/servers/futuretea/postgres-mcp-server
- Transport: —
- Stars: 1
- License: MIT

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DATABASE_URL` | no | no |  |
| `MCP_POSTGRES_DATABASE` | no | no |  |
| `MCP_POSTGRES_HOST` | no | no |  |
| `MCP_POSTGRES_PASSWORD` | no | no |  |
| `MCP_POSTGRES_PORT` | no | no |  |
| `MCP_POSTGRES_SSLMODE` | no | no |  |
| `MCP_POSTGRES_USERNAME` | no | no |  |

## Tools (7)

- `postgres_get_server_info`
- `postgres_list_databases`
- `postgres_list_schemas`
- `postgres_list_tables`
- `postgres_describe_table`
- `postgres_list_indexes`
- `postgres_query`

## FAQ

### What version of PostgreSQL is required?

The server requires PostgreSQL 17 or newer.

### Can I run arbitrary SQL queries?

No, the server only allows a strict subset of read-only SELECT queries and rejects DML, DDL, and row locks.

### How can I connect via HTTP?

You can start the server in HTTP mode by passing the --port flag to the release command.
