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 | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/surajmandalcell/pgsql-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server