Server Directory
DatabaseIntermediate Official

PostgreSQL

by Anthropic

GitHub
18.5k

Connects to PostgreSQL databases with read-only access. Run SQL queries, inspect schemas, list tables, and analyze database structure safely.

CAPABILITIES

  • Execute read-only SQL queries
  • List database tables
  • Inspect table schemas
  • Describe column types and constraints

INSTALLATION

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

CLAUDE DESKTOP CONFIG

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

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json

QUICK FACTS

Category
Database
Difficulty
Intermediate
Maintained By
Anthropic
NPM Package
@modelcontextprotocol/server-postgres

RELATED SERVERS

NEW TO MCP?

Learn how to set up MCP servers with Claude Desktop step by step.

Read the tutorial →