Back to MCP Servers
🐘

PostgreSQL MCP Server

by Anthropic

Reference implementation for PostgreSQL. Query databases, inspect schemas, and analyze data.

Reference Implementation
Database
Deployment Type
💻Local

Runs on your local machine

Authentication
🔒Credentials

User credentials required

Installation
Medium

Some configuration needed

Use Cases
Common ways to use this MCP server
Data analysis
Schema inspection
Query optimization
Debugging
Ideal For
This server is perfect for these roles and teams
Developers
Data Analysts
DBAs
Installation
Quick start guide for setting up this MCP server

1. Install via npx

npx -y @modelcontextprotocol/server-postgres

2. Add to Claude Desktop config

Edit claude_desktop_config.json

{
  "mcpServers": {
    "postgresql": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "AUTH_TOKEN": "your-credentials-here"
      }
    }
  }
}

3. Restart Claude Desktop

Close and reopen Claude Desktop to load the new MCP server.

Learn More About Model Context Protocol
Understand how MCP works and how to build your own servers