postgres-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | HTTP port. | 8000 |
| BIND_HOST | No | HTTP bind address (not HOST). | 0.0.0.0 |
| DATABASES | No | Alternative to DATABASE_URL: either 'alias|url,alias|url' or JSON '{"alias":"url"}'. | |
| TRANSPORT | No | Transport protocol: stdio (MCP default) or HTTP. | stdio |
| DEFAULT_DB | No | Default database alias when multiple databases are configured. | |
| ACCESS_MODE | No | Access mode: unrestricted (read/write) or restricted (read-only with 30s statement timeout, no COMMIT/ROLLBACK). | unrestricted |
| DB_PROD_URL | No | Example multi-database variable. Any DB_<NAME>_URL can be used. | |
| DATABASE_URL | No | Single database connection URI. Sets alias 'default'. | |
| DB_STAGING_URL | No | Example multi-database variable. Any DB_<NAME>_URL can be used. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_databasesA | List configured database connections. Call first when unsure which db to use. |
| list_schemasA | List schemas (user schemas only by default) |
| list_objectsB | List tables, views, sequences, or extensions in a schema |
| get_object_detailsC | Columns and indexes for a table/view |
| execute_sqlC | Execute SQL (max 50 rows returned) |
| explain_queryC | EXPLAIN a SQL query, optionally with hypothetical indexes |
| get_top_queriesC | Slow or resource-heavy queries from pg_stat_statements |
| analyze_workload_indexesB | Recommend indexes based on pg_stat_statements workload |
| analyze_query_indexesB | Recommend indexes for up to 10 specific queries |
| analyze_db_healthB | Health checks: index,connection,vacuum,sequence,replication,buffer,constraint,all |
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/Leon-Achteresch/postgres-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server