Add to Claude Code
357 addsAdd this MCP server to Claude Code.
Name: PostgreSQL MCP
Merge into: ~/.claude/mcp.json under mcpServers
---
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://user:password@localhost:5432/mydb"
}
}
}
}
// ── Setup ────────────────────────────────────────────────────────────────────
// Replace the connection string with your actual database URL.
// The server is READ-ONLY by default — safe to point at production.
//
// For Supabase, use the Session Pooler URL (port 5432):
// postgresql://postgres.PROJECT_REF:PASSWORD@aws-X-REGION.pooler.supabase.com:5432/postgres
//
// ── Available tools ──────────────────────────────────────────────────────────
// query execute a read-only SQL query
// list_tables list all tables in the database
// describe_table show columns, types, and constraints for a table
Paste into Claude Code to connect this MCP server.
How to add
Full guide →Click Add, then paste into Claude Code. Claude will connect the MCP server in your settings.
Target: .claude/mcp.json → mcpServers