Skip to main content
Glama

PostgreSQL MCP Server

by melihbirim

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PG_HOSTNoPostgreSQL hostlocalhost
PG_PORTNoPostgreSQL port5432
PG_USERNoDefault username
PG_DATABASENoDefault database name
PG_PASSWORDNoDefault password

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
connect_database

Connect to a PostgreSQL database

list_tables

List all tables in the current database

describe_table

Get detailed information about a table's structure, columns, and constraints

execute_query

Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN, WITH statements only)

get_schema

Get an overview of the database schema including tables and their relationships

disconnect_database

Disconnect from the current PostgreSQL database

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/melihbirim/pg-mcp'

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