---
title: "Postgres MCP Server for ToolPiper · ModelPiper"
description: "Query Postgres databases with read-only SQL. 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."
canonical: "https://modelpiper.com/mcp-tools/postgres"
---

# Postgres MCP Server for ToolPiper · ModelPiper

> Query Postgres databases with read-only SQL. 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.

P

# Postgres MCP Server

✓ verified

Query Postgres databases with read-only SQL.

Install Postgres in ToolPiper

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

[Open repository →](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres)

Publisher

[Anthropic Reference (archived)](https://github.com/modelcontextprotocol/servers-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.

Install Postgres in ToolPiper

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)

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}"
      ]
    }
  }
}
```

Copy

## Example prompts

-   "Which users signed up in the last 7 days?"
    
    Copy
-   "Show me the schema of the orders table."
    
    Copy
-   "What is the median order value for orders placed in April?"
    
    Copy

## 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

-   [
    
    S
    
    ### SQLite
    
    ✓ verified
    
    Query SQLite databases and run business-intelligence prompts.
    
    DataLocal subprocess4 tools
    
    
    
    
    
    ](/mcp-tools/sqlite)
-   [
    
    R
    
    ### Redis
    
    ✓ verified
    
    Interact with Redis key-value stores from the assistant.
    
    DataLocal subprocess4 tools
    
    
    
    
    
    ](/mcp-tools/redis)
-   [
    
    A
    
    ### AWS Knowledge Base
    
    ✓ verified
    
    Retrieve answers from an AWS Bedrock Knowledge Base.
    
    DataLocal subprocess1 tool
    
    
    
    
    
    ](/mcp-tools/aws-kb-retrieval)
-   [
    
    M
    
    ### MongoDB
    
    ✓ verified
    
    Query and manage MongoDB and Atlas clusters from the assistant.
    
    DataLocal subprocess5 tools
    
    
    
    
    
    ](/mcp-tools/mongodb)

[← Back to all MCP tools](/mcp-tools)
