PostgreSQL (MCP) Claude Desktop Config
Add the PostgreSQL (MCP) MCP server to Claude Desktop with this ready-to-use configuration.
Setup Instructions
- Open Claude Desktop
- Go to Settings → Developer → Edit Config →
claude_desktop_config.json - Paste the JSON below into the file
- Set your Database Credentials in the
envsection - Restart Claude Desktop
Configuration JSON
Copy the entire block into your claude_desktop_config.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres"
],
"env": {
"DATABASE_URL": "postgresql://user:pass@host:5432/db"
}
}
}
}Environment Variables
DATABASE_URLReplace postgresql://user:pass@host:5432/db with your actual database url
Endpoints
POST
/queryExecute SQL query
GET
/schemaGet database schema