pgsql-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DATABASE_URI | Yes | PostgreSQL database connection URI (e.g., postgresql://username:password@localhost:5432/dbname) |
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": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_server_capabilitiesA | Report the active profile, access policy, and hard execution limits |
| list_schemasA | List all schemas in the database |
| list_objectsB | List tables, views, sequences, or extensions |
| get_object_detailsB | Show columns, constraints, indexes, and comments for a database object |
| get_server_infoB | Report PostgreSQL version, database, role, recovery, locale, and installed extensions |
| get_extension_profilesA | List installed or available PostgreSQL extension capability profiles |
| get_deployment_profileB | Report conservative PostgreSQL deployment-provider capabilities without secrets |
| get_extension_objectsB | Inventory PostgreSQL objects owned by one installed extension through core catalogs |
| get_postgis_diagnosticsB | Report bounded PostGIS columns and indexes through PostgreSQL core catalogs |
| get_pgvector_diagnosticsA | Report bounded pgvector columns and indexes through PostgreSQL core catalogs |
| search_catalogB | Search relations, routines, types, collations, and extensions |
| list_relationsC | List tables, partitions, views, sequences, foreign tables, indexes, and other relations |
| get_relation_detailsA | Inspect a relation's columns, constraints, indexes, triggers, policies, partitions, and privileges |
| list_postgres_typesB | List built-in, user-defined, and extension-owned PostgreSQL types by OID |
| get_postgres_typeA | Inspect any PostgreSQL type, including enum, domain, composite, range, multirange, array, and extension types |
| select_rowsA | Select bounded rows using catalog-validated identifiers, typed filters, and keyset pagination |
| insert_rowsC | Insert bounded typed rows with exact affected-row commit guards |
| upsert_rowsA | Upsert typed rows through a verified primary or unique conflict key |
| update_rowsB | Update typed values with mandatory filters, optimistic predicates, and commit guards |
| delete_rowsB | Delete rows with mandatory filters, optimistic predicates, and commit guards |
| create_migration_planA | Create a deterministic reviewed PostgreSQL migration plan without touching the database |
| apply_migration_planB | Apply a reviewed fully transactional migration and its ledger row atomically |
| get_migration_statusC | List redacted reviewed migration ledger metadata |
| rollback_migrationA | Atomically roll back the latest reviewed migration using its stored verified plan |
| create_maintenance_planB | Create a reviewed nontransactional PostgreSQL maintenance plan |
| apply_maintenance_planC | Apply an exact reviewed nontransactional maintenance plan |
| get_maintenance_statusC | List redacted reviewed maintenance status records |
| reconcile_maintenance_operationA | Reconcile a reviewed maintenance operation after external outcome verification |
| explain_queryA | Explain a SQL query and optionally simulate hypothetical indexes |
| analyze_workload_indexesC | Analyze frequently executed queries and recommend indexes |
| analyze_query_indexesC | Analyze up to ten SQL queries and recommend indexes |
| analyze_db_healthB | Analyze database health. Valid values: index, connection, vacuum, sequence, replication, buffer, constraint, all; comma-separated values are accepted. |
| get_top_queriesC | Report slow or resource-intensive queries using pg_stat_statements |
| get_runtime_metricsA | Return privacy-preserving aggregate runtime metrics for the current process |
| execute_sqlA | Execute exactly one read-only, parameterized SQL statement with bounded results |
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 35 tools
Each tool targets a distinct operation or resource (e.g., schema listing vs. object details, migration planning vs. maintenance), with clear descriptions that prevent ambiguity. Even similar tools like 'list_objects' and 'list_relations' differentiate by scope.
All tool names follow a consistent 'verb_noun' pattern in snake_case (e.g., 'get_runtime_metrics', 'create_migration_plan'). No mixed conventions (camelCase, different verb styles) are present.
35 tools is slightly high for typical MCP servers (most have 3-15), but each tool serves a well-defined PostgreSQL operation. The count is justified by the broad domain coverage, though some tools like the three 'analyze_*' variants could potentially be consolidated.
The tool set covers CRUD, migration lifecycle, maintenance, diagnostics, and schema inspection comprehensively. Minor gaps exist (e.g., no explicit tools for role/permission management, transaction control beyond migrations), but overall it's sufficient for database interaction.