P

PostgreSQL MCP Server

Verified

Read-only SQL access to PostgreSQL databases for AI agents.

open-source 82/100 Databases & Data database sql postgres postgresql read-only

A Model Context Protocol server that provides read-only access to PostgreSQL databases. Allows AI agents to inspect database schemas and execute read-only SQL queries, enabling data exploration and analysis without risk of data modification.

Supports schema inspection, table listing, and arbitrary SELECT queries with parameterized inputs.

Install

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

MCP Client Config

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

Capabilities

Tools

query

Resources

schema

Compatible With

Claude Desktop Claude Code Cursor Windsurf Continue

Metrics

18,500

GitHub Stars

45,200

Installs

3,100

Weekly

12

Open Issues