MCPs/postgresql/README.md

897 B

postgresql-mcp

MCP server for PostgreSQL database operations.

Source: @modelcontextprotocol/server-postgres

Environment Variables

Variable Required Description
DATABASE_URL Yes Full PostgreSQL connection URL (e.g. postgresql://user:pass@host:5432/db?sslmode=disable)

Usage

docker run -d \
  --name postgresql-mcp \
  -p 8109:8109 \
  -e DATABASE_URL=postgresql://user:pass@host:5432/mydb \
  forgejo.corentic.eu/corentic/mcp-fleet-postgresql:latest

Tools

  • query — Execute read-only SQL queries (SELECT, EXPLAIN, etc.)
  • execute — Execute write SQL (INSERT, UPDATE, DELETE, DDL)
  • list_tables — List tables in the database
  • describe_table — Get schema info for a specific table
  • get_table_stats — Row counts and table statistics