Neon MCP

Create Postgres databases and branches, run SQL and test migrations before they touch main

Neon is serverless Postgres that branches like Git. Its official MCP server lets an agent create projects and branches, run SQL, inspect schemas and test a migration on a temporary branch before it reaches main. Neon hosts the server for you.
Use it two ways. In Claude Code or claude.ai, a developer can spin up a database, try a schema change on a branch and tune slow queries without leaving the chat. In your own product, you attach the same hosted URL with a Neon API key, and an internal agent can create a database or a branch on request. Neon says the MCP server is for development and testing, so if your product gives every user their own Postgres, the way Replit Agent does, call the Neon API from your backend and keep MCP for dev and staging.
Projects and branches
createproject and createbranch give you a new Postgres database or a copy of one in seconds
Run SQL
runsql and run_sql_transaction query and change data, get_databasetables reads the schema
Safe migrations
preparedatabase_migration tests a change on a temporary branch, complete_databasemigration applies it
Query tuning
listslow_queries and explain_sql_statement find slow queries, prepare_querytuning tests an index on a branch
Prompts to try
When to use
  • Your app runs on Postgres and you want to test schema changes on a branch first
  • You want a fresh database or branch per task, preview or developer
  • You want one server that works in Claude Code and with an API key in your backend
When not to use
  • You want Postgres with auth, storage and RLS checks in one place: use Supabase
  • You need deploys, logs and preview URLs for the app itself: use Vercel
  • You provision a database for every end user in production: call the Neon API directly, not MCP

Watch out

  • Neon says the server is for development and testing only. Don't connect it to a production database or real user data, and approve every write tool call.
  • Rows the agent reads can carry instructions aimed at it. Use ?readonly=true and ?projectId= when the agent only needs to read one project.
  • The free plan gives 100 CU-hours and 10 branches per project, and 20 GB of storage in total. Agents that create a branch per task can hit these limits fast. On paid plans extra branches cost $1.50 per branch-month.

Install

In Claude Code:
Terminal

Loading editor...

claude mcp add --transport http neon https://mcp.neon.tech/mcp
Then run /mcp and sign in to Neon with OAuth. You can uncheck "Allow writes" on the sign-in page for read-only access. Or run npx neon@latest init, which signs you in, creates an API key and configures Claude Code for you. In claude.ai, add Neon from Settings > Connectors.
In your product, attach the hosted URL https://mcp.neon.tech/mcp with a Neon API key as the authorization_token in the Claude API's mcp_servers, or as an Authorization: Bearer header in the AI SDK. An organization API key limits access to that organization. Add ?projectId= to lock the agent to one project, ?readonly=true to block writes, and ?category=querying&category=schema to load only some tools.
© 2026 Paralect, Inc 651 N Broad St, Suite 206, Middletown, 19709, Delaware, United States