mcp servers · featured

PostgreSQL MCP Server

Give your AI agent direct access to PostgreSQL databases. Run queries, inspect schemas, and analyze data without leaving your AI conversation.
★ 2.8k ↓ 12.0k installs by Community updated May 18, 2026 MIT
← back to shelf
install via your agent of choice
npx -y @modelcontextprotocol/server-postgres

## what it does

What it does

Connect your AI agent directly to PostgreSQL databases. Query data, inspect schemas, and get AI-powered analysis of your database without switching tools.

Installation

npx -y @modelcontextprotocol/server-postgres postgresql://user:pass@localhost:5432/mydb

Claude Desktop config

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost:5432/mydb"]
    }
  }
}

Safety

⚠️ Use a read-only database user for production databases. The MCP server can execute any SQL the AI generates.

## compatibility

claude-desktop
claude-code
cursor

## exposed tools

query
describe_table
list_tables
explain_query

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/postgres-mcp.svg)