Back to Blog
GuideFeb 8, 202616 min read

Postgres MCP vs Supabase MCP: Which Should You Use? (Setup + Comparison)

NT

Nikhil Tiwari

MCP Playground

📖 TL;DR

  • Postgres MCP — local STDIO server, read-only SQL, works with any Postgres (local, Neon, RDS, Supabase). Minimal: one query tool + schema resources.
  • Supabase MCP — remote hosted server (https://mcp.supabase.com/mcp), OAuth login, 20+ tools including execute_sql, migrations, logs, extensions, and project management.
  • Use Postgres MCP when you want lightweight read-only access to any Postgres database.
  • Use Supabase MCP when you're on Supabase and want the full management experience (migrations, logs, security advisor).

Two MCP servers let your AI talk to PostgreSQL—but they serve different purposes. This guide compares them side-by-side, shows you how to set up each, and helps you decide which one fits your workflow.

Side-by-Side Comparison

Feature Postgres MCP Supabase MCP
Package @modelcontextprotocol/server-postgres Hosted at https://mcp.supabase.com/mcp
Source servers-archived/src/postgres supabase-community/supabase-mcp
Transport STDIO (local only) HTTP (remote hosted)
Auth Connection string as CLI argument OAuth 2.1 (auto-prompted by client)
Database support Any PostgreSQL (local, Neon, RDS, Supabase, etc.) Supabase projects only
SQL execution query — read-only (READ ONLY transaction) execute_sql — read and write
Schema discovery Auto-discovered table schemas (column names, types) as resources list_tables with full column definitions, primary keys, foreign keys, row estimates
Migrations None list_migrations, apply_migration
Debugging None get_logs, security advisor, performance advisor
Extensions None list_extensions
Testable in MCP Playground No (STDIO only) Yes — enter https://mcp.supabase.com/mcp in MCP Playground

When to Use Postgres MCP

  • You have a standalone Postgres (local dev, Neon, RDS, DigitalOcean, self-hosted) — not tied to Supabase.
  • You want read-only access only (the AI cannot modify data by design).
  • You need a minimal setup: one tool (query) and schema resources. No extra features.
  • You're building an analytics agent or ad-hoc reporting tool where safety matters and you don't need migrations or logs.

When to Use Supabase MCP

  • Your database is a Supabase project.
  • You want full management: SQL execution (read + write), migrations, logs, extensions, security advisor.
  • You want OAuth login (no connection string in config files).
  • You need to apply migrations, debug with logs, or manage multiple Supabase projects from your AI client.
  • You want a remote server (no local process to run).

Setup: Postgres MCP

The server runs locally via npx. Pass the connection string as the last argument.

Claude Desktop

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:password@localhost:5432/mydb"]
    }
  }
}

Cursor

Settings → Tools & MCP → Add MCP server:

Field Value
Name postgres
Type stdio
Command npx
Args -y @modelcontextprotocol/server-postgres postgresql://user:password@localhost:5432/mydb

Replace the connection string with your own. Use a read-only database user when possible.

Verify

  • "What Postgres tools do you have?" — should show query.
  • "List all tables in the database." — uses schema resources.
  • "How many users signed up this week?" — generates and runs a SELECT query.

Setup: Supabase MCP

Supabase MCP is a hosted remote server. No local installation needed. Your AI client connects over HTTP and authenticates via OAuth.

Claude Desktop

{
  "mcpServers": {
    "supabase": {
      "url": "https://mcp.supabase.com/mcp"
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project root (or global config):

{
  "mcpServers": {
    "supabase": {
      "url": "https://mcp.supabase.com/mcp"
    }
  }
}

When you first use it, your client will prompt you to log in to your Supabase account via OAuth. No personal access token needed.

Verify

  • "What Supabase tools do you have?" — should show execute_sql, list_tables, list_migrations, list_extensions, get_logs, apply_migration, etc.
  • "List the tables in my Supabase project." — uses list_tables with full column definitions.
  • "Show me the last 50 log entries." — uses get_logs.

Using Both Together

You can configure both servers in the same client. This is useful if you have some databases on Supabase and others on standalone Postgres (e.g. a legacy system on RDS plus a new project on Supabase).

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://user:pass@rds-host:5432/legacy_db"]
    },
    "supabase": {
      "url": "https://mcp.supabase.com/mcp"
    }
  }
}

The AI will route questions to the right server based on context. You can also be explicit: "Using the Postgres server, show me the users table" or "Using Supabase, apply the latest migration."

Example Prompts

Postgres MCP (read-only analytics)

  • "Top 10 products by revenue this month"
  • "Daily active users for the last 14 days"
  • "Describe the orders table schema"

Supabase MCP (full management)

  • "Create a profiles table with id, email, name, and created_at"
  • "Apply a migration to add an avatar_url column to profiles"
  • "Show me the last 100 error logs"
  • "What extensions are installed?"

Important Notes

  • Postgres MCP is read-only by design. All queries run in a READ ONLY transaction. It cannot INSERT, UPDATE, or DELETE. This is a safety feature for analytics and exploration.
  • Supabase MCP can write. execute_sql supports full SQL including writes. apply_migration can alter your schema. Use with care in production.
  • Supabase MCP works only with Supabase projects. It authenticates via your Supabase account. For non-Supabase Postgres, use the Postgres MCP server.
  • You can use Supabase MCP for Supabase's Postgres. Since Supabase is Postgres under the hood, the Supabase MCP gives you everything the Postgres MCP does—plus migrations, logs, and management tools.

References

Test Supabase MCP in the Browser

Enter https://mcp.supabase.com/mcp in MCP Playground to explore tools

Open MCP Playground →

Related Content

Frequently Asked Questions

Can I use Postgres MCP to connect to my Supabase database?
Yes. Supabase is Postgres, so you can use the Postgres MCP server with your Supabase connection string (found in Supabase Dashboard → Settings → Database → Connection string). However, you'll only get the read-only query tool—not migrations, logs, or management features. If you're on Supabase, the Supabase MCP gives you more.
Is Supabase MCP free?
The MCP server itself is free to use. You need a Supabase account (free tier available). Your Supabase project's usage limits and pricing still apply to the underlying database and API calls.
Can Supabase MCP accidentally break my production database?
Yes—execute_sql can run writes and apply_migration can alter schema. Be cautious with production projects. Consider using a staging project for AI-assisted development, and always review SQL before executing on production.
Can I test both in MCP Playground?
Supabase MCP (https://mcp.supabase.com/mcp) is a remote HTTP server and can be tested in MCP Playground. Postgres MCP is STDIO-only (local) and cannot be tested in MCP Playground—use Claude Desktop or Cursor instead.
NT

Written by Nikhil Tiwari

15+ years in product development. AI enthusiast building developer tools that make complex technologies accessible to everyone.