Skip to main content
Glama
lastfore

PostgreSQL MCP Server

by lastfore

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENAI_MODELNoModel to usegpt-5.2-mini
CACHE_ENABLEDNoEnable schema cachingtrue
DATABASE_HOSTNoPostgreSQL hostlocalhost
DATABASE_NAMEYesDatabase name (required)
DATABASE_PORTNoPostgreSQL port5432
DATABASE_USERYesDatabase user (required)
CACHE_MAX_SIZENoMax number of cached schemas100
OPENAI_API_KEYYesOpenAI API key (required)
OPENAI_TIMEOUTNoAPI timeout in seconds30
CACHE_SCHEMA_TTLNoSchema cache TTL in seconds3600
DATABASE_PASSWORDYesDatabase password (required)
OPENAI_MAX_TOKENSNoMax tokens per request32000
SECURITY_MAX_ROWSNoMax rows per query10000
OPENAI_TEMPERATURENoModel temperature0.0
DATABASE_MAX_POOL_SIZENoMaximum connections in pool20
DATABASE_MIN_POOL_SIZENoMinimum connections in pool5
RESILIENCE_MAX_RETRIESNoMax retry attempts3
RESILIENCE_RETRY_DELAYNoInitial retry delay in seconds1.0
OBSERVABILITY_LOG_LEVELNoLog levelINFO
DATABASE_COMMAND_TIMEOUTNoQuery timeout in seconds30
OBSERVABILITY_LOG_FORMATNoLog format (json/text)json
RESILIENCE_BACKOFF_FACTORNoExponential backoff factor2.0
OBSERVABILITY_METRICS_PORTNoMetrics HTTP port9090
SECURITY_BLOCKED_FUNCTIONSNoComma-separated blocked functions (optional)
SECURITY_MAX_EXECUTION_TIMENoQuery execution timeout in seconds30
OBSERVABILITY_METRICS_ENABLEDNoEnable Prometheus metricstrue
SECURITY_ALLOW_WRITE_OPERATIONSNoAllow INSERT/UPDATE/DELETEfalse
RESILIENCE_CIRCUIT_BREAKER_TIMEOUTNoCircuit breaker timeout in seconds60
RESILIENCE_CIRCUIT_BREAKER_THRESHOLDNoFailures before circuit breaker opens5

Capabilities

Features and capabilities supported by this server

CapabilityDetails
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

NameDescription
addB

Add two numbers

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

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