Guide
Database MCP Servers Compared (2026): Supabase, Neon, PlanetScale, Prisma Postgres, MongoDB, Redis, MotherDuck and ClickHouse
Which database MCP server should my AI coding agent use, and how do I keep it from breaking my data?
For Postgres with safe schema changes, Neon is the strongest pick: its MCP server tests migrations on a temporary branch first, has a readonly=true switch, and Neon's free plan includes 10 branches per project. Supabase is the pick if you already use it, with read_only=true and project scoping on its hosted endpoint, but its branching tools need a paid plan. For MongoDB, run the official server with --readOnly; for analytics, ClickHouse and MotherDuck both default to read-only queries. Whatever you pick, point it at a dev database or branch, not production.
Compare: the best MCP servers for scraping, search, browser automation and databases →
Coding agent settings change often
Get one email a week when a setting, flag or permission rule changes, checked against the vendor docs.
Quick comparison
- Supabase (Postgres): hosted at https://mcp.supabase.com/mcp. Read-only: read_only=true. Branching: yes, experimental, needs a paid plan. Free database: 2 active projects, 500 MB database, paused after 1 week of inactivity.
- Neon (Postgres): hosted at https://mcp.neon.tech/mcp. Read-only: readonly=true or an OAuth scope. Branching: yes, plus migrations tested on a temporary branch. Free database: 100 projects, 1 GB per project, 10 branches per project, no card.
- PlanetScale (Postgres and MySQL/Vitess): hosted at https://mcp.pscale.dev/mcp/planetscale. Read-only: an Insights-only endpoint with no query tools; separate read and write query tools. Branching: the MCP's tool list can list and read branches (planetscale_list_branches, planetscale_get_branch), with no tool listed for creating them. Free database: none listed; Postgres single node starts at $5/month.
- Prisma Postgres: hosted at https://mcp.prisma.io/mcp. Read-only: no read-only mode documented. Branching: not in the MCP tools; backups and recovery instead. Free database: 50 databases, 2 GB storage, 200k operations/month, no card.
- MongoDB: local npx package (an Atlas remote option uses the mongodb-atlas-mcp-remote package). Read-only: --readOnly or MDB_MCP_READ_ONLY=true. Branching: none. Free database: Atlas M0, 512 MB, free forever.
- Redis: local uvx package. Read-only: no flag; use a Redis ACL read-only user. Branching: none. Free database: Redis Cloud, 30 MB, one free database per account.
- MotherDuck (DuckDB): hosted at https://api.motherduck.com/mcp. Read-only: a read scaling token, or block the query_rw tool. Branching: none. Free database: Lite plan, 10 GB storage, 10 hours of Pulse compute a month, no card.
- ClickHouse Cloud: hosted at https://mcp.clickhouse.cloud/mcp, plus a local server. Read-only: run_select_query only allows SELECT; the local server is read-only by default. Branching: none. Free database: a trial with $300 in credits for 30 days, not a permanent free tier.
- Prices and free tiers were checked on each vendor's pricing page on 2026-10-23 and change often.
Supabase MCP
Supabase runs a hosted MCP server. Add read_only=true to run every query as a read-only Postgres user, and project_ref to limit the agent to one project. Use features to load only the tool groups you need.
Claude Code, hosted endpoint, one project, read-only
claude mcp add --scope project --transport http supabase "https://mcp.supabase.com/mcp?project_ref=<project-ref>&read_only=true&features=database,docs"
Any agent (mcpServers JSON)
{
"mcpServers": {
"supabase": {
"type": "http",
"url": "https://mcp.supabase.com/mcp?project_ref=<project-ref>&read_only=true"
}
}
}- Main tools: list_tables, list_migrations, apply_migration, execute_sql, get_advisors, query_logs, generate_typescript_types, search_docs.
- Branching tools (experimental, paid plan): create_branch, list_branches, delete_branch, merge_branch, reset_branch, rebase_branch.
- project_ref turns off account tools such as create_project and pause_project.
- CI and headless use: pass a scoped personal access token as a header (the docs' example uses SUPABASE_ACCESS_TOKEN and SUPABASE_PROJECT_REF).
- Local Supabase CLI: the server is at http://localhost:54321/mcp.
- Supabase's advice: connect to a production project only when the task needs production evidence, and keep manual approval of tool calls on.
Neon MCP
Neon's hosted server signs in with OAuth by default, or takes an API key as a Bearer header. Its migration tools are the main safety feature: prepare_database_migration runs the change on a temporary branch, and complete_database_migration applies it after you check it.
Claude Code, hosted endpoint with API key
claude mcp add --transport http neon https://mcp.neon.tech/mcp \ --header "Authorization: Bearer <YOUR_NEON_API_KEY>"
Any agent, read-only and one project (mcpServers JSON)
{
"mcpServers": {
"neon": {
"url": "https://mcp.neon.tech/mcp?readonly=true&projectId=my-project-id"
}
}
}- One-command setup: npx neon@latest init.
- Read-only: add ?readonly=true, or uncheck Full access on the OAuth screen. The older x-read-only header still works. run_sql stays available in read-only mode; get_connection_string is withheld.
- Main tools: list_projects, create_branch, reset_from_parent, delete_branch, run_sql, run_sql_transaction, describe_table_schema, compare_database_schema, explain_sql_statement, list_slow_queries.
- Migrations: prepare_database_migration, complete_database_migration.
- Neon says the server is for local development and IDE use, and does not recommend it in production environments.
PlanetScale MCP
PlanetScale's hosted server uses OAuth, with service tokens for CI. Reads and writes are separate tools, and it blocks some dangerous SQL. Each query uses short-lived credentials that are deleted after it runs.
Claude Code, hosted endpoint with OAuth
claude mcp add --transport http "planetscale" https://mcp.pscale.dev/mcp/planetscale
- Main tools: planetscale_list_databases, planetscale_list_branches, planetscale_get_branch_schema, planetscale_execute_read_query, planetscale_execute_write_query, planetscale_get_insights, planetscale_list_schema_recommendations.
- Blocked: UPDATE or DELETE without a WHERE clause, and TRUNCATE. DDL such as CREATE, DROP and ALTER asks the agent to get human confirmation first.
- No query access at all: use https://mcp.pscale.dev/mcp/planetscale-insights-only, which drops both execute query tools.
- Read queries go to a replica when the branch has one.
- Gotcha: the tool list includes billing tools such as planetscale_update_payment_method. The local pscale mcp server was removed.
Prisma Postgres MCP
Prisma's hosted server manages Prisma Postgres databases, runs SQL, and restores backups. You sign in with your Prisma account and pick a workspace. There is no documented read-only mode, so rely on your agent's tool approvals.
Claude Code, hosted endpoint
claude mcp add --transport http prisma https://mcp.prisma.io/mcp
Any agent (mcpServers JSON)
{
"mcpServers": {
"Prisma": {
"url": "https://mcp.prisma.io/mcp"
}
}
}- Main tools: list_prisma_postgres_databases, create_prisma_postgres_database, delete_prisma_postgres_database, introspect_database_schema, execute_sql_query, execute_prisma_postgres_schema_update, list_prisma_postgres_backups, create_prisma_postgres_recovery.
- execute_sql_query does not change the schema; schema changes go through execute_prisma_postgres_schema_update.
- Prisma's AI guardrail (PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION) covers Prisma CLI commands such as prisma migrate reset --force, not MCP tool calls.
- Prisma warns that tools that change or delete resources can cause data loss.
MongoDB MCP
MongoDB's official server runs locally with npx. It connects to any MongoDB with a connection string, and to the Atlas API with a service account. Its README says its examples include --readOnly by default.
Any agent, read-only (mcpServers JSON)
{
"mcpServers": {
"MongoDB": {
"command": "npx",
"args": ["-y", "mongodb-mcp-server@latest", "--readOnly"],
"env": {
"MDB_MCP_CONNECTION_STRING": "mongodb://localhost:27017/myDatabase"
}
}
}
}- Read-only: --readOnly or MDB_MCP_READ_ONLY=true allows only read, connect and metadata operations.
- Atlas tools need MDB_MCP_API_CLIENT_ID and MDB_MCP_API_CLIENT_SECRET. Give the service account the minimum permissions; MongoDB says Organization Owner is rarely needed.
- Main tools: find, aggregate, count, collection-schema, explain, insert-many, update-many, delete-many, atlas-list-clusters, atlas-create-free-cluster.
- Turn tools off with MDB_MCP_DISABLED_TOOLS. drop-database, drop-collection and delete-many ask for confirmation by default (MDB_MCP_CONFIRMATION_REQUIRED_TOOLS).
- Atlas remote server: use the mongodb-atlas-mcp-remote package with npx.
Redis MCP
Redis's official server is a Python package you run with uvx. It has no read-only flag. To limit it, connect as a Redis ACL user that can only read.
Any agent (mcpServers JSON)
{
"mcpServers": {
"redis-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"--from", "redis-mcp-server@latest",
"redis-mcp-server",
"--url", "redis://localhost:6379/0"
]
}
}
}Read-only ACL user (run in redis-cli)
ACL SETUSER readonlyuser on >mypassword ~* +@read -@write
- Env vars instead of --url: REDIS_HOST, REDIS_PORT, REDIS_USERNAME, REDIS_PWD, REDIS_SSL, REDIS_CLUSTER_MODE.
- Main tools: get, set, hget, hset, hgetall, scan_keys, scan_all_keys, type, expire, rename, delete, dbsize, info, client_list.
- Gotcha: delete, rename and expire change data. Without an ACL user, nothing stops the agent from using them.
MotherDuck and ClickHouse
Both are analytics databases, and both make read-only access easy.
Claude Code, MotherDuck hosted endpoint with OAuth
claude mcp add --transport http MotherDuck https://api.motherduck.com/mcp
Claude Code, ClickHouse Cloud hosted endpoint with OAuth
claude mcp add --transport http clickhouse-cloud https://mcp.clickhouse.cloud/mcp
- MotherDuck: the remote server has read-only and read-write tools: query for read-only SQL, query_rw for SQL that changes data or schema. For read-only enforced on the server, authenticate with a read scaling token as a Bearer header; those tokens use read replicas that reject writes. Read scaling tokens do not work with OAuth connectors.
- MotherDuck local server (mcp-server-motherduck, run with uvx): read-only by default; --read-write turns on writes. Token: motherduck_token or MOTHERDUCK_TOKEN. Tools: execute_query, list_databases, list_tables, list_columns.
- ClickHouse Cloud remote: turn on MCP per service in the console (needs the control-plane:service:manage-mcp permission). Tools include list_databases, list_tables, run_select_query, get_services_list, get_organization_cost. run_select_query only permits SELECT.
- ClickHouse local server (mcp-clickhouse): set CLICKHOUSE_HOST, CLICKHOUSE_USER and CLICKHOUSE_PASSWORD. Queries are read-only by default; CLICKHOUSE_ALLOW_WRITE_ACCESS allows writes and CLICKHOUSE_ALLOW_DROP allows destructive operations. Tools: run_query, list_databases, list_tables, run_chdb_select_query.
Safety checklist
- Start read-only: Supabase read_only=true, Neon readonly=true, MongoDB --readOnly, MotherDuck read scaling token, ClickHouse local server default, PlanetScale Insights-only endpoint, Redis ACL read-only user.
- Work on a dev branch or dev database: Neon branches (free plan includes 10 per project), Supabase branches (paid), or a separate free project.
- Scope tokens: Supabase project_ref, Neon projectId, a least-privilege MongoDB Atlas service account, a ClickHouse API key with only the access it needs.
- Never point a write-enabled server at production. Neon and PlanetScale both warn about this in their docs.
- Keep tool approval on in your agent, and review every write or schema change before it runs.
- Keep tokens and connection strings in environment variables, not in committed config files.
Which one to pick
- Postgres with safe migrations and free branches: Neon.
- Already on Supabase: Supabase, with read_only=true and project_ref.
- PlanetScale users who want guarded writes: PlanetScale, or the Insights-only endpoint for no query access.
- TypeScript app on Prisma Postgres with a generous free plan: Prisma, with tool approvals on.
- Document data: MongoDB with --readOnly.
- Cache or key-value data: Redis, behind a read-only ACL user.
- Analytics: MotherDuck for DuckDB, ClickHouse for large event data.
- Details on this page were checked against vendor docs, pricing pages and official GitHub READMEs on 2026-10-23.
Get coding agent settings changes by email
When a setting, flag or permission rule in this guide changes, it goes in the weekly AgentAtlas update, checked against the vendor docs. One email a week.
Sources
More guides
- Add an MCP server to any AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, VS Code and 8 more (2026)
- Web Scraping MCP Servers Compared (2026): Bright Data, Firecrawl, Apify, Tavily and Browserbase
- Web Search MCP Servers Compared (2026): Tavily, Exa, Brave Search, Perplexity, Parallel, SerpApi and Firecrawl
- Browser Automation MCP Servers Compared (2026): Playwright, Browserbase, Browserless, Browser Use, Bright Data and Chrome DevTools
- Best MCP Servers in 2026 by Job: Scraping, Search, Browser Automation and Databases
Other guides
Reviewed Oct 23, 2026. Settings change often; the linked vendor docs are the source of truth.