PostgreSQL MCP Server

Query and explore PostgreSQL databases using natural language

By Anthropic (official) ★ 4.8K stars official database sql

The PostgreSQL MCP Server lets Claude inspect your database schema and run read-only SQL queries. Perfect for data exploration, generating reports, and building dashboards — without writing a single line of SQL yourself.

Installation & Configuration

Add this block to your claude_desktop_config.json (or your agent framework's MCP config file):

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

Config file location:

Available Tools (3)

Use Cases

Source & Documentation

GitHub Repository: https://github.com/modelcontextprotocol/servers/tree/main/src/postgres

Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io

← Back to MCP Server Directory