Skip to main content
Glama

Postgres MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
POOL_MAXNoMaximum connections in pool10
POOL_MINNoMinimum connections in pool2
CACHE_TTLNoCache TTL in milliseconds300000
LOG_LEVELNoLogging level (error|warn|info|debug)info
SQL_LOGGINGNoLog SQL queriesfalse
DATABASE_URLNoPostgreSQL connection string in format postgresql://username:password@localhost:5432/dbname
POSTGRES_SSLNoEnable SSL connectionfalse
CACHE_ENABLEDNoEnable query result cachingtrue
POSTGRES_HOSTNoPostgreSQL host
POSTGRES_PORTNoPostgreSQL port
POSTGRES_USERNoPostgreSQL username
POOL_IDLE_TIMEOUTNoIdle timeout in milliseconds30000
POSTGRES_DATABASENoPostgreSQL database name
POSTGRES_PASSWORDNoPostgreSQL password
POOL_ACQUIRE_TIMEOUTNoAcquire timeout in milliseconds60000

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
query

Execute SQL queries with transaction support, query analysis, and performance monitoring

tables

Table management: list, create, alter, drop tables and get detailed table information

schemas

Schema management: list, create, drop schemas and manage schema permissions

indexes

Index management: list, create, drop indexes and analyze index usage

data

Data operations: insert, update, delete, bulk operations with validation

transactions

Transaction management: begin, commit, rollback, savepoints

admin

Database administration: users, permissions, database info, maintenance operations

monitoring

Database monitoring: performance metrics, statistics, health checks

connections

Connection pool management: status, statistics, configuration

permissions

Database permissions management: users, roles, grants, privileges

security

Database security management: SSL, authentication, encryption, auditing

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/itsalfredakku/postgres-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server