PostgreSQL MCP Server
by lastfore
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENAI_MODEL | No | Model to use | gpt-5.2-mini |
| CACHE_ENABLED | No | Enable schema caching | true |
| DATABASE_HOST | No | PostgreSQL host | localhost |
| DATABASE_NAME | Yes | Database name (required) | |
| DATABASE_PORT | No | PostgreSQL port | 5432 |
| DATABASE_USER | Yes | Database user (required) | |
| CACHE_MAX_SIZE | No | Max number of cached schemas | 100 |
| OPENAI_API_KEY | Yes | OpenAI API key (required) | |
| OPENAI_TIMEOUT | No | API timeout in seconds | 30 |
| CACHE_SCHEMA_TTL | No | Schema cache TTL in seconds | 3600 |
| DATABASE_PASSWORD | Yes | Database password (required) | |
| OPENAI_MAX_TOKENS | No | Max tokens per request | 32000 |
| SECURITY_MAX_ROWS | No | Max rows per query | 10000 |
| OPENAI_TEMPERATURE | No | Model temperature | 0.0 |
| DATABASE_MAX_POOL_SIZE | No | Maximum connections in pool | 20 |
| DATABASE_MIN_POOL_SIZE | No | Minimum connections in pool | 5 |
| RESILIENCE_MAX_RETRIES | No | Max retry attempts | 3 |
| RESILIENCE_RETRY_DELAY | No | Initial retry delay in seconds | 1.0 |
| OBSERVABILITY_LOG_LEVEL | No | Log level | INFO |
| DATABASE_COMMAND_TIMEOUT | No | Query timeout in seconds | 30 |
| OBSERVABILITY_LOG_FORMAT | No | Log format (json/text) | json |
| RESILIENCE_BACKOFF_FACTOR | No | Exponential backoff factor | 2.0 |
| OBSERVABILITY_METRICS_PORT | No | Metrics HTTP port | 9090 |
| SECURITY_BLOCKED_FUNCTIONS | No | Comma-separated blocked functions (optional) | |
| SECURITY_MAX_EXECUTION_TIME | No | Query execution timeout in seconds | 30 |
| OBSERVABILITY_METRICS_ENABLED | No | Enable Prometheus metrics | true |
| SECURITY_ALLOW_WRITE_OPERATIONS | No | Allow INSERT/UPDATE/DELETE | false |
| RESILIENCE_CIRCUIT_BREAKER_TIMEOUT | No | Circuit breaker timeout in seconds | 60 |
| RESILIENCE_CIRCUIT_BREAKER_THRESHOLD | No | Failures before circuit breaker opens | 5 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {
"tasks": {
"list": {},
"cancel": {},
"requests": {
"tools": {
"call": {}
},
"prompts": {
"get": {}
},
"resources": {
"read": {}
}
}
}
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| addB | Add two numbers |
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/lastfore/pg-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server