§ MCP Server · Database

Official

Postgres.

by Anthropic

Read-only SQL access for any Postgres database.

Runs in Claude · Cursor · ChatGPT · Windsurf — any MCP-compatible client

Install

npx -y @modelcontextprotocol/server-postgres postgresql://...

Transports

stdio (local)

Tools exposed

4

§ Add to your AI client

Drop this into your client's MCP config — claude_desktop_config.json for Claude Desktop, or .cursor/mcp.json for Cursor — then restart the app. Replace placeholder paths and credentials with your own.

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

§ About

The reference MCP server for relational data. Exposes table schemas and read-only query execution to an agent — without giving it a write seat. The standard pattern for letting an LLM 'see' your data without risking writes.

§ Features

  • List schemas and tables
  • Read column types and constraints
  • Execute read-only queries
  • Connection-pooled for agent loops

§ Use cases

Analytics agents over an OLAP DBInternal Q&A bots over a customer-facing schemaSchema-aware report generators

§ Related MCP servers

Open standardSubmit a server →