Google's open-source MCP server for enterprise databases — one binary that fronts AlloyDB, BigQuery, Spanner, Postgres, MySQL, Oracle, MongoDB, Snowflake and more.
PostgreSQLMCP Server
Summary
Read-only PostgreSQL access with automatic schema inspection — the reference MCP server for Postgres.
Features
- Read-only SQL access to any PostgreSQL database
- Automatic schema inspection for every table
- Single-argument setup with a connection string
Installation
Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.
Description
The reference PostgreSQL MCP server gives an assistant read-only access to a database, along with the schema information it needs to write correct queries.
What it does
- Read-only query execution. Every statement runs inside a read-only transaction, so an assistant cannot modify data even if it decides to try.
- Schema resources. Each table is exposed as a resource with its column names and types, so the model works from the actual schema rather than inferring one from table names.
Why the read-only constraint is the point
Giving a language model write access to a production database is a decision that deserves more thought than a config file entry. This server removes the question entirely, which makes it a sensible default for analysis, debugging, and answering questions about data.
Setup
One argument — the connection string — and you are running: npx -y @modelcontextprotocol/server-postgres postgresql://host/db. For write access or broader database support, DBHub and vendor-specific servers are better choices.
Part of the MCP reference server collection, now maintained in the archived servers repository.
Related MCP Servers
A universal database MCP server — one integration for PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB.
MCP: PlanetScale
by PlanetScale
PlanetScale's official hosted MCP server — browse organizations, databases and branches, read schema, run guarded SQL, and pull Insights and schema recommendations.
MCP: Supabase
by Supabase
Manage your Supabase project from an agent — run SQL, inspect tables, manage branches, and generate types.
