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

Other guides

How to allow Cursor to run all commands: Run Everything, allowlist and sandboxHow to allow Claude Code to run all commands: permission modes, allow rules and skip permissionsClaude Code permissions: allow, ask and deny rules, rule syntax and allowed toolsCodex CLI: approval and sandbox modesGemini CLI: YOLO mode, auto_edit and allowing specific shell commandsCursor Privacy Mode: telemetry, training and data retentionClaude Code telemetry and data retention: what is sent and how to turn it offGemini CLI: turn off usage statistics and telemetryCLAUDE.md: where it goes, how it loads, and how it works with AGENTS.mdClaude Code hooks: all events, exit codes, PreToolUse and PermissionRequest JSON, examplesClaude Code subagents: create one, limit its tools, and call itAdd MCP servers to Cursor with mcp.json: Keep files out of Cursor with .cursorignore: Configure Codex with config.toml: Configure Gemini CLI with settings.json: Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes): Claude Code custom slash commands and skills (SKILL.md): GitHub Copilot custom instructions: Adding MCP servers to GitHub Copilot: Claude Code settings.json: file locations, precedence, and key settingsClaude Code plugins and marketplaces: install, create, and shareGemini CLI extensions and custom commands: Configuring OpenCode with opencode.json: Cline Rules: workspace, global, and conditional rulesKiro steering files: .kiro/steering, inclusion modes, and AGENTS.mdZed agent: instruction files, MCP servers, tool permissions, and ACP agentsCursor CLI: install, headless mode, permissions and CIAider: CONVENTIONS.md, .aider.conf.yml and API keysJunie guidelines, MCP and the Action Allowlist: Amp AGENTS.md, settings.json and MCP: Configure Goose extensions, hints, recipes and permissions: Customize OpenHands with skills, AGENTS.md, setup.sh and MCP: Configure Factory Droid CLI: AGENTS.md, settings.json, autonomy, custom droids and MCPConfigure Qwen Code: settings.json, providers, QWEN.md, MCP and approval modesCursor hooks: hooks.json, beforeShellExecution, afterFileEdit and exit codesCursor sandbox: sandbox.json, network allowlist and run modesCursor settings: settings.json, Cursor Settings and the ~/.cursor config filesCursor browser agent: @browser, browser automation and approval modesCursor subagents: .cursor/agents, frontmatter, built-in Explore and BrowserCursor telemetry and OpenTelemetry export (Privacy Mode, OTLP, Analytics API): Cursor rules setup: project, user and Team Rules, .mdc frontmatter, globs and AGENTS.mdClaude Code headless mode: claude -p, --output-format json, --bare and CI flagsClaude Code statusline: custom status bar in settings.json with context %, cost and git branchClaude Code /model: switch models, aliasesClaude Code /cost and /usage: check token spend, usage limits and reduce costsClaude Code VS Code extension: install, shortcuts, settings and /ideCodex AGENTS.md: global, project and override instruction files explainedCodex MCP servers: codex mcp add and [mcp_servers] in config.tomlCodex sandbox modes: read-only, workspace-write, danger-full-access and network accesscodex exec: run Codex non-interactively in scripts and CI with JSON outputCodex skills: create SKILL.md, skill folder locations and $skill invocationGEMINI.md in Gemini CLI: context file locations, imports and /memoryGemini CLI MCP servers: gemini mcp add and mcpServers in settings.jsonGemini CLI custom slash commands: TOML files, {{args}}, !{shell} and @{file}Gemini CLI headless mode: gemini -p, JSON output and exit codes for scripts and CIGemini CLI sandbox: enable Docker, Podman, macOS Seatbelt or gVisorcopilot-setup-steps.yml: set up the GitHub Copilot cloudGitHub Copilot CLI permissions: --allow-tool, --deny-tool, --allow-all-tools and trusted directoriesGitHub Copilot custom agents: .github/agents/*.agent.md profiles, tools and frontmatterGitHub Copilot code review settings: automatic PR reviews, rulesets, effort level and approvalsOpenCode MCP Server Setup: Local and Remote Servers in opencode.jsonOpenCode Permissions: Allow, Ask or Deny Bash, Edit and WebfetchOpenCode Custom Agents and Subagents: Markdown Files, Modes and @ MentionsCline MCP Setup: cline_mcp_settings.json for Local and Remote ServersCline Auto Approve and YOLO Mode: Run Commands and Edits Without PromptsCline Skills: SKILL.md Location, Format and Slash Command UseAmp MCP Setup: amp mcp add, amp.mcpServers and Workspace ApprovalAmp AGENTS.md: File Locations, @ Mentions and Glob-Scoped GuidanceAmp Skills: SKILL.md Folders, amp skill add and Search OrderKiro MCP Setup: .kiro/settings/mcp.json, autoApprove and OAuthKiro Hooks: .kiro/hooks JSON, PreToolUse, PostFileSave and StopKiro Permissions: permissions.yaml Allow, Ask and Deny RulesFactory Droid MCP Setup: droid mcp add, mcp.json Locations and /mcpFactory Droid Hooks: hooks.json, PreToolUse Matchers and Exit CodesFactory Droid Custom Droids (Subagents): .factory/droids Markdown FilesJunie MCP Setup: .junie/mcp/mcp.json for CLI and /mcp CommandJunie Brave Mode and Action Allowlist: Auto-Approve Commands in Junie CLIJunie Custom Slash Commands: .junie/commands Markdown Files and Argumentsgoose .goosehints and AGENTS.md: Global and Project Instructionsgoose Permission Modes: GOOSE_MODE auto, approve, smart_approve and chatgoose Recipes: recipe.yaml Format, Parameters and goose run --recipeZed Agent Tool Permissions: Auto-Approve Terminal Commands with tool_permissionsUse Claude, Codex and Gemini CLI in Zed: External Agents and agent_serversZed with Ollama, LM Studio and llama.cpp: Local Model Setup and Context LengthMCP 2026-07-28 Migration Guide: Stateless Protocol, No Sessions, server/discover, MRTR, and SDK v2 UpgradeSubagents and Custom Agents Compared: Claude Code vs Codex vs Cursor vs Gemini CLI vs GitHub CopilotAllow all commands in any AI coding agent: Cursor, Claude Code, Codex, Gemini CLI, Copilot CLI and 7 moreSettings file locations for every AI coding agent: Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Qwen Code, Amp and Factory DroidRules and instruction files in every AI coding agent: .cursor/rules, CLAUDE.md, AGENTS.md, GEMINI.md, Copilot instructions and moreGemini CLI hooks: settings.json, BeforeTool, AfterTool, exit codes and /hooksGitHub Copilot hooks: .github/hooks/*.json for Copilot CLI and the cloud agentHooks in every AI coding agent: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Kiro and Factory DroidAgent Skills (SKILL.md) in every AI coding agent: Claude Code, Codex, Cline, Amp and OpenHandsHow to deploy a remote MCP server (Streamable HTTP): Cloudflare Workers, Vercel, Railway and moreHeadless mode in every AI coding agent: claude -p, codex exec, gemini -p, Cursor agent -p and copilot -p for scripts and CIClaude Code sandbox: /sandbox, sandbox.enabled, allowedDomains, excludedCommands and strict modeSandbox modes in every AI coding agent: Claude Code, Cursor, Codex and Gemini CLI comparedCustom slash commands in every AI coding agent: file locations, arguments and examplesMigrate from Gemini CLI to Antigravity CLI (2026): Config, MCP, Skills, FlagsRun GitHub Copilot CLI with copilot -p in scripts and CI (2026): Agent Loops 2026: Ralph Loop, /loop, /goal and Headless Loops for AI Coding AgentsCursor skills and custom slash commands: .cursor/skills SKILL.md, .cursor/commands and /migrate-to-skillsCodex hooks: hooks.json, PreToolUse allow/deny, exit code 2 and config.toml [hooks]GitHub Copilot prompt files in VS Code: .github/prompts/*.prompt.md slash commandsOpenCode custom commands: .opencode/commands, $ARGUMENTS, shell output and subtasksQwen Code custom commands: .qwen/commands Markdown files, {{args}}, !{shell} and @{file}

Reviewed Oct 23, 2026. Settings change often; the linked vendor docs are the source of truth.