postgres-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DATABASE_URI | Yes | Postgres database connection URI | |
| OPENAI_API_KEY | No | OpenAI API key for experimental index tuning by LLM |
Capabilities
Features and capabilities supported by this server
| 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 |
|---|---|
| list_schemasA | List all schemas in the database |
| list_objectsB | List objects in a schema |
| get_object_detailsC | Show detailed information about a database object |
| explain_queryA | Explains the execution plan for a SQL query, showing how the database will execute it and provides detailed cost estimates. |
| analyze_workload_indexesA | Analyze frequently executed queries in the database and recommend optimal indexes |
| analyze_query_indexesA | Analyze a list of (up to 10) SQL queries and recommend optimal indexes |
| analyze_db_healthA | Analyzes database health. Here are the available health checks:
|
| get_top_queriesA | Reports the slowest or most resource-intensive queries using data from the 'pg_stat_statements' extension. |
| execute_sqlC | Execute any SQL query |
| execute_sql_fileA | Execute a SQL file containing migration scripts or DDL statements. The entire file is executed as a single transaction - all changes are rolled back if any statement fails. Only available in unrestricted access mode. |
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
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/mirenqinggege/postgres-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server