Skip to main content
Glama
rajath002

postgres-mcp-server

by rajath002

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PGHOSTNoDatabase host (used if not using DATABASE_URL)
PGPORTNoDatabase port (used if not using DATABASE_URL)
PGUSERNoDatabase user (used if not using DATABASE_URL)
PGDATABASENoDatabase name (used if not using DATABASE_URL)
PGPASSWORDNoDatabase password (used if not using DATABASE_URL)
DATABASE_URLNoPostgreSQL connection string, e.g. postgresql://postgres:password@localhost:5432/mydb
ALLOW_WRITE_QUERIESNoSet to 'true' to enable write queries via execute_query. Defaults to false.false

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_tablesA

List all tables, views, and schemas in the PostgreSQL database along with estimated row counts and table sizes.

describe_tableA

Get detailed schema breakdown for a specific table or view, including column names, data types, constraints, primary keys, foreign keys, and indexes.

read_queryA

Execute a read-only SQL query (SELECT, WITH, etc.). Strictly executed inside a DB-level READ ONLY transaction for safety.

explain_queryA

Execute EXPLAIN on a SQL query to inspect query planner cost estimates, join strategies, and index usage.

get_db_statsA

Retrieve database health & performance metrics: database size, top tables by disk usage, active connections, and cache hit ratio.

execute_queryA

Execute data modification statements (INSERT, UPDATE, DELETE, DDL). Requires ALLOW_WRITE_QUERIES=true in environment.

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

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