mcp-postgres
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PG_SSL | No | Enable SSL (true/false) | false |
| PG_HOST | No | Server hostname or IP | |
| PG_PORT | No | TCP port | 5432 |
| PG_USER | No | PostgreSQL username | |
| PG_DATABASE | No | Database name | |
| PG_PASSWORD | No | PostgreSQL password | |
| PG_SSH_HOST | No | SSH server hostname (activates tunnel when set) | |
| PG_SSH_PORT | No | SSH server port | 22 |
| PG_SSH_USER | No | SSH username | |
| PG_SSH_PASSWORD | No | SSH password | |
| PG_SSH_PRIVATE_KEY | No | Path to private key file | |
| PG_SSH_REMOTE_HOST | No | Postgres host as seen from SSH server (defaults to PG_HOST) | |
| PG_SSH_KEY_PASSPHRASE | No | Passphrase for private key | |
| PG_SSL_REJECT_UNAUTHORIZED | No | Reject self-signed certs | true |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| queryA | Execute a read-only SELECT query against PostgreSQL. Only SELECT (and CTEs starting with WITH) are permitted. Write operations, system functions, DoS constructs, and multiple statements are all blocked. |
| list_tablesA | List all user tables in the connected PostgreSQL database, including schema name, table name, row count estimate, and size. |
| describe_tableA | Describe the columns of a PostgreSQL table: name, data type, nullability, default value, and whether it is part of the primary key. |
| list_schemasA | List all user-defined schemas in the connected PostgreSQL database. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 4 tools
The three metadata tools (list_tables, describe_table, list_schemas) target clearly distinct objects, and query is obviously the general-purpose execution tool. The only mild overlap is that query could technically satisfy anything the metadata helpers do, but the read-only SELECT restriction keeps boundaries reasonably clear.
list_tables, describe_table, and list_schemas follow a clear verb_noun lowercase-snake pattern. The bare verb 'query' breaks the pattern slightly, but it remains readable and the deviation is minor.
Four tools is a reasonable, tightly scoped surface for read-only PostgreSQL access, with each tool earning its place. It sits at the thin end of the ideal range, though the small set is appropriate for a deliberately read-only server.
The surface covers the core read-only workflows: running queries, discovering schemas, listing tables, and inspecting columns. Minor gaps exist (no view/index/constraint inspection, no query-plan/EXPLAIN helper), and write operations are intentionally absent, but agents can work around most of these via query.