Best PostgreSQL MCP Server in 2026: 5 Picks Tested for Claude & Cursor
Five PostgreSQL MCP servers ranked: the official Postgres MCP, Supabase, PG Schema, Neon, and Prisma. Setup for Claude Desktop and Claude Code, plus read-only safety and performance tips.

A PostgreSQL MCP server lets Claude (or Cursor, Cline, Windsurf) query, explore, and reshape your Postgres database through natural language. We tested every Postgres MCP in the Skiln directory and ranked the top 5: the official Postgres MCP, Supabase MCP, PG Schema MCP, Neon Postgres MCP, and Prisma Postgres MCP. The official MCP is what most developers should install first. Hosted providers (Supabase, Neon) ship better MCPs for their own platforms, and ORM-aware servers like Prisma make sense when your data layer lives entirely behind an ORM.
Curated from 200+ Postgres-related MCP entries on Skiln
Table of Contents
- What Is a PostgreSQL MCP Server?
- Why Use a PostgreSQL MCP Server?
- The Best PostgreSQL MCP Servers
- PostgreSQL MCP Comparison
- What You Can Actually Do With a Postgres MCP
- Setup: Connecting Claude to Your Postgres Database
- Running in Read-Only Mode (Recommended)
- Performance Tips for Large Schemas
- Frequently Asked Questions
What Is a PostgreSQL MCP Server?
A PostgreSQL MCP server is a Model Context Protocol server that connects an AI assistant to a Postgres database. After install, Claude (or Cursor, Cline, Windsurf) gets a small toolkit: list tables, describe a column, run a SELECT, explain a query plan, and (if you opt in) write rows.
The MCP runs locally as a Node or Python process. When the AI client starts up, the server boots, reads a connection string, and registers its tools. When Claude needs to answer a question about your data, it calls the right tool, the MCP issues a SQL statement, and the result flows back into the chat.
By 2026 there are dozens of Postgres MCPs in the Skiln registry. They fall into three buckets:
- The official Postgres MCP from Anthropic's
modelcontextprotocol/serversrepo. Generic Postgres support. - Platform-specific MCPs for Supabase, Neon, Render, Railway, and other hosted providers. These layer their platform's auth, branching, and admin APIs on top of standard SQL.
- ORM-aware MCPs like Prisma Postgres and Drizzle Studio MCP that read your schema from migrations rather than the live database.
We start with the official MCP and only layer the others when you have a specific reason.
Why Use a PostgreSQL MCP Server?
Three reasons that come up in nearly every real workflow:
- Schema is the hardest part of writing SQL. With a Postgres MCP installed, Claude can read the live schema before drafting a query. It rarely hallucinates column names because it has just looked them up.
- Query plan inspection is a chore. Asking Claude to run
EXPLAIN ANALYZEand interpret the result is faster than reading the planner output yourself, especially for nested loops and bad index choices. - Migrations get drafted in seconds, not hours. Describe the change in plain English, let Claude write the migration, review the SQL, run it on a branch database. Pair with the Claude Code Postgres setup for end-to-end automation.
We have also seen good results using Postgres MCPs for ad-hoc analytics on staging databases and for keeping seed-data scripts in sync with the live schema.
The Best PostgreSQL MCP Servers
1. Official Postgres MCP Server
The reference implementation, shipped by Anthropic. Connects to any Postgres database via a standard postgresql:// connection string. Defaults to read-only on the latest versions. Tool surface: schema introspection, SELECT, EXPLAIN, and (opt-in) write statements. See our deep dive in Postgres on the Skiln directory.
Best for: Any developer who runs Postgres. RDS, Cloud SQL, self-hosted, Docker, local. This is the default install.
Install: npx -y @modelcontextprotocol/server-postgres "postgresql://user:pass@localhost/db"
2. Supabase MCP Server
Built and maintained by Supabase. Wraps the standard Postgres tool surface and adds Supabase-specific tools: auth user management, edge function deployment, storage buckets, branch creation. If you live in Supabase, this MCP is a meaningful upgrade over the generic Postgres one. Compared in our Supabase vs Postgres MCP guide. See the listing at Supabase MCP on Skiln.
Best for: Supabase developers, full-stack apps with auth + database needs, RLS policy debugging, edge function workflows.
Install: npx -y @supabase/mcp-server-supabase --access-token=YOUR_TOKEN
3. PG Schema MCP
A focused community MCP for schema work. Where the official MCP gives you a flat list of tables, PG Schema exposes deeper introspection: foreign-key graphs, dependent views, materialized view refresh state, partitioned-table layouts, and row-level security policies. Maintained by the team behind several Postgres ORMs. Browse the listing at PG Schema on Skiln.
Best for: Developers working on complex schemas with partitioning, RLS policies, materialized views, or heavy use of foreign keys.
Install: Search Skiln for the latest PG Schema MCP build and follow the README.
4. Neon Postgres MCP
Neon-specific MCP that adds tools for Neon's branching model: create a branch from main, run migrations against the branch, swap branches, delete stale branches. Useful even outside Neon for the branch-aware migration workflow it teaches.
Best for: Teams using Neon for development databases, anyone who has fallen in love with database branching.
Install: Available via npm. The Neon dashboard shows the exact install command for your project.
5. Prisma Postgres MCP
An ORM-aware MCP that reads your Prisma schema (rather than the live database) and exposes Prisma-style operations: findMany, create, update, delete, plus migration draft and Prisma Migrate apply. Reduces the gap between what Claude sees and what your application code does.
Best for: Teams that use Prisma exclusively, full-stack apps where the ORM is the source of truth.
Install: npx -y @prisma/mcp-postgres
PostgreSQL MCP Comparison
What You Can Actually Do With a Postgres MCP
Six patterns we run constantly:
- Ad-hoc analytics. "How many users signed up last week, broken down by referral source?" Claude reads the schema, writes the SQL, runs it, hands back the result. Faster than opening pgAdmin.
- Schema documentation. Ask Claude to walk through your schema and produce a markdown doc with table descriptions, key relationships, and example queries.
- Migration drafting. Describe a change in English. Claude writes the migration, generates the rollback, runs it against a branch database first, then applies to main.
- Query optimization. Paste a slow query, ask Claude to EXPLAIN ANALYZE it, propose an index, and benchmark before/after.
- RLS policy debugging. "Why can this user not see row X?" Claude reads the RLS policies, checks the row metadata, and pinpoints the failing predicate. The official Postgres MCP handles this well even without the specialized PG Schema MCP.
- Seed data generation. "Generate 50 realistic fake users with associated orders." Claude writes the INSERTs, the MCP runs them, your dev database is populated.
These patterns work across every client. Read our MCP clients guide for the version-by-version notes.
Setup: Connecting Claude to Your Postgres Database
The official MCP install on Claude Desktop:
{ "mcpServers": { "postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost:5432/mydb"] } } }
Restart Claude Desktop. The postgres tool appears in the sidebar.
For Claude Code:
claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres "postgresql://user:pass@localhost:5432/mydb"
Cursor and Windsurf both have settings panels for MCP servers. Paste the same command and connection string.
If you are connecting to a remote database (RDS, Supabase, Neon), make sure your IP is allowlisted, SSL is configured (?sslmode=require in the connection string), and the user has the right grants. The Claude Code setup guide walks through each step end-to-end.
Running in Read-Only Mode (Recommended)
The single safest decision you can make: start in read-only mode. The official Postgres MCP gates writes behind an explicit flag. To force read-only:
- Connect with a database user that has only
SELECTandUSAGEgrants on the schemas you want to expose. - Or run the official MCP with the
--readonlyflag if your version exposes it.
The result is that even if the AI tries to run a destructive query, the database itself refuses. This is layer-in-depth defense and it is essentially free.
When you do need write access for a one-off task (a migration, a backfill), generate a separate user with the precise grants you need, connect a second MCP server pointing at that user, and disconnect it when the task is done.
Performance Tips for Large Schemas
Schemas with 1,000+ tables stress the introspection step. Three tactics:
- Scope the connection string to a specific schema. Use a connection-level
search_pathso only the schema you care about is visible. - Pre-cache the schema. Ask Claude to introspect once at the start of the session and reuse that map for the rest of the conversation. The MCP does this automatically in most clients.
- Avoid
SELECT *on wide tables. Claude will sometimes do this by default. Add a quick instruction to your client's system prompt or aCLAUDE.mdfile telling it to always specify columns.
Combined with read-only mode and connection pooling, the official Postgres MCP handles production-scale schemas without trouble.
Browse every Postgres MCP server on Skiln. Trust scores, install commands, and active maintenance flags included.
Browse Now →Frequently Asked Questions
What is a PostgreSQL MCP server?
A PostgreSQL MCP server is a Model Context Protocol server that connects an AI client like Claude to a Postgres database. Once installed, the AI can introspect the schema, run SQL queries, draft migrations, explain query plans, and answer questions about your data without you writing SQL by hand. Most servers default to read-only mode for safety.
Is the official Postgres MCP server free?
Yes. The official Postgres MCP server, shipped by Anthropic as part of the modelcontextprotocol/servers repo, is free and open source under the MIT license. You only pay for whatever Postgres instance you connect it to (RDS, Supabase, Neon, self-hosted).
Does the Postgres MCP work with Supabase?
Yes, and there are two paths. The first is to use the official Postgres MCP with your Supabase connection string. The second is to use the dedicated Supabase MCP server, which adds tools for auth users, edge functions, storage, and branch management on top of raw Postgres access. We compare the two in our Supabase MCP vs Postgres MCP guide.
Can the Postgres MCP write to my database?
Yes, but you should explicitly opt in. Every major Postgres MCP supports a read-only flag that disables INSERT, UPDATE, DELETE, and DDL statements. The official MCP defaults to read-only on the latest versions. For workflows that need writes (migrations, seed data, fixture cleanup), generate a separate database user with write permissions and connect the MCP to that user only when needed.
How does the AI know my schema?
The MCP server introspects information_schema on connect and exposes a schema tool the AI can call. Claude will typically call it once at the start of a conversation, cache the result, and use that map to write correct SQL. If you change the schema mid-conversation, ask Claude to re-introspect and it will refresh.
Will the AI exfiltrate my data?
Only what you let it. The MCP runs locally on your machine. SQL results flow into the AI's context, which then sends them to whatever model provider you have configured (Anthropic, OpenAI, Google). If your data is sensitive, use the read-only flag, restrict the connection to a read replica with no PII, and consider running through a local model provider via Cline or Ollama.
Does this work with PostgreSQL 16 and 17?
Yes. The MCP servers we recommend support every Postgres version from 12 onward, including the latest 17.x release. They use standard SQL, information_schema, and pg_catalog queries that are stable across versions.
Where can I see all Postgres-related MCP servers indexed on Skiln?
Visit /mcps and filter by 'postgres' or 'database'. As of 2026, Skiln tracks 200+ Postgres-related MCP entries spanning the official server, hosted variants for Supabase and Neon, ORM-aware MCPs for Prisma and Drizzle, and specialized servers for schema migrations and query optimization.
Last updated: June 10, 2026 · Skiln tracks Postgres MCP and related releases daily across 13 source registries.