PostgreSQL MCP Server
by Anthropic ยท โญ 4.9k stars ยท updated 2 months ago
Read-only access to PostgreSQL databases. Run SQL queries, inspect schemas, and explore data โ all through your AI assistant. Official Anthropic reference implementation.
96
Excellent
Quality Score Breakdown
maintenance98/100
community95/100
documentation96/100
compatibility95/100
Use Cases
- โquery databases
- โinspect schemas
- โrun SQL queries
- โexplore data
โก One-Click Install Configs
Copy the config below and paste it into your AI client's config file.
๐ค Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}โก Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}๐ VS Code
.vscode/mcp.json
{
"mcp": {
"servers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost/mydb"
]
}
}
}
}