mcp-postgres
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
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 |
|---|---|
| pg_connectA | Connect to a PostgreSQL server target. If multiple targets are configured, specify which one. Otherwise connects to the default target. |
| pg_disconnectA | Disconnect from a PostgreSQL server target. Omit profile to disconnect all. |
| pg_connection_statusC | Check connection pool health for the active profile or a specific named profile. |
| pg_list_connectionsB | List all configured connection profiles and their status. Each profile represents a PostgreSQL server instance. |
| pg_switch_databaseA | Switch the active connection profile. All subsequent queries will use this profile unless overridden. |
| pg_queryB | Execute a parameterized SQL query. Returns rows as JSON. Use $1, $2, ... for parameters. |
| pg_query_explainA | Run EXPLAIN on a query. mode=plan (default, safe) shows the plan without executing. mode=analyze executes the statement and shows actual timing — requires confirm=true. |
| pg_query_preparedA | [DEPRECATED] Manage named prepared statements: PREPARE, EXECUTE, DEALLOCATE. Prepared statements are session-local and unreliable with connection pools. Use parameterized pg_query instead. |
| pg_schema_listB | List all schemas in the database. |
| pg_table_listB | List tables in the database. Optionally filter by schema name. |
| pg_table_describeA | Describe a table: columns, data types, defaults, nullability, and constraints. |
| pg_index_listA | List indexes for a table with type, columns, uniqueness, and size. |
| pg_constraint_listB | List constraints (primary key, foreign key, unique, check) for a table. |
| pg_view_listB | List views with their definitions. Optionally filter by schema. |
| pg_function_listC | List functions and procedures with their signatures. |
| pg_enum_listC | List all enum types and their values. |
| pg_extension_listA | List installed PostgreSQL extensions with versions. |
| pg_insertB | Insert one or more rows into a table. Returns inserted rows. |
| pg_updateB | Update rows matching a WHERE clause. Requires confirm=true. |
| pg_deleteA | Delete rows matching a WHERE clause. Requires confirm=true. |
| pg_upsertC | Insert or update on conflict. Requires confirm=true. |
| pg_versionB | Get PostgreSQL version string and numeric version. |
| pg_settingsB | Show or search server configuration parameters. |
| pg_reload_configA | Reload server configuration files (postgresql.conf). Requires confirm=true. |
| pg_uptimeB | Show server uptime and start time. |
| pg_database_sizeC | Show size of all databases. |
| pg_table_sizesA | Show table sizes with index and toast breakdown, sorted by total size descending. |
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 27 tools
All 27 tools have clearly distinct purposes. Overlap between pg_query, pg_query_explain, and pg_query_prepared is minimal and explained, and pg_connect/pg_switch_database are well-differentiated. No ambiguity for an agent.
Tools consistently use the 'pg_' prefix followed by a descriptive verb or verb_noun pattern. Although pg_connection_status is slightly irregular, the overall pattern is uniform and predictable.
27 tools is on the higher end of typical (3-15), but each tool serves a necessary PostgreSQL operation: connection, DML, introspection, admin. The scope justifies the count, but fewer tools could suffice if combined.
The toolset covers all major PostgreSQL operations: connection management, CRUD, schema introspection, indexes/constraints, querying with parameters/explain, admin (version, settings, reload, uptime, sizes). No obvious gaps for a general-purpose database client.