Postgres MCP Server

✓ verified

Query Postgres databases with read-only SQL.

Don't have ToolPiper? We'll take you to the download.

Open repository →

Publisher

Anthropic Reference (archived)

License

MIT

Transport

Local subprocess

Tools

1

What this server does

Point the Postgres MCP server at any Postgres database and let your AI assistant write the SELECTs for you. The server is read-only by construction; DDL and DML are refused.

Tools included

  • query

    Run a read-only SQL query against the configured database.

The authoritative list comes from the server's tools/list at runtime. This catalog entry may lag the upstream until the next ToolPiper release.

Install in ToolPiper

ToolPiper handles the JSON configuration. Click Install, fill in any required tokens, and the server is ready in your chat.

Don't have ToolPiper? We'll take you to the download.

Install in another client

Install in another MCP client (Claude Desktop, Cursor, Continue, Cline)

Add this to ~/Library/Application Support/Claude/claude_desktop_config.json.

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "${POSTGRES_URL}"
      ]
    }
  }
}

Example prompts

  • "Which users signed up in the last 7 days?"

  • "Show me the schema of the orders table."

  • "What is the median order value for orders placed in April?"

Security notes

The connection URL contains your database password. Treat it like a password; do not commit the JSON config to a public repository. The server refuses writes, but a leaked URL still grants read access to the database.

Related tools