Set up Postgres MCP Pro
Postgres queries, schema inspection, index tuning and health checks, replacing the archived reference server.
- Publisher
- Crystal DBA Community
- Run locally
uvx postgres-mcp --access-mode=restricted- Transports
- stdio, sse
- Authentication
- A Postgres connection string in DATABASE_URI.
- Environment
DATABASE_URI- What it can touch
- Restricted mode is read-only; unrestricted mode reads and writes.
- Licence
- MIT
- Source
- github.com/crystaldba/postgres-mcp
- Status
- Active
Install
This server runs on your machine as a child process of the client. You need the runtime its command uses, such as Node.js for npx, uv for uvx or Docker, plus any variables listed under Environment.
Claude Code
claude mcp add --scope project --env DATABASE_URI='<DATABASE_URI>' postgres-mcp-pro -- uvx postgres-mcp --access-mode=restricted
Cursor
{
"mcpServers": {
"postgres-mcp-pro": {
"command": "uvx",
"args": [
"postgres-mcp",
"--access-mode=restricted"
],
"env": {
"DATABASE_URI": "${env:DATABASE_URI}"
}
}
}
}
Codex
[mcp_servers.postgres-mcp-pro]
command = "uvx"
args = ["postgres-mcp", "--access-mode=restricted"]
env_vars = ["DATABASE_URI"]
Keep --access-mode=restricted for any database you care about; unrestricted mode lets the agent write.
Other servers in data
Airtable
Query, create and update records in Airtable bases, limited to the bases you authorise.
BigQuery
Google-hosted endpoint to explore BigQuery datasets and run SQL. Cloud SQL and Spanner have their own.
MCP Toolbox for Databases
One server with prebuilt tool sets for Postgres, MySQL, BigQuery, AlloyDB, Spanner and other databases.
Supabase
Manage Supabase projects from an agent: run SQL, apply migrations, read logs and deploy Edge Functions.
Neon
Create Neon Postgres projects and branches, run SQL and do branch-based migrations. Meant for development use.
MongoDB
Query and administer MongoDB databases and Atlas clusters, using a connection string or an Atlas service account.