
Neon MCP Server
OfficialManage serverless Postgres on Neon with natural language: projects, branches, migrations, and SQL.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx -y mcp-remote https://mcp.neon.tech/mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"neon-mcp-server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.neon.tech/mcp"
]
}
}
}Claude Desktop connects to remote servers through the `mcp-remote` proxy (installed on first run via npx). Restart Claude Desktop after saving.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- A Neon account (sign up at console.neon.tech)
- An MCP-capable client (Cursor, VS Code, Claude Code, Claude Desktop, etc.)
- For the remote server: just a browser for the OAuth flow — no API key needed
- For API-key auth or local use: a Neon API key from the Neon Console (passed as Authorization: Bearer <key>), and Node.js 18+ (the mcp-remote bridge / local server run via npx)
About Neon MCP Server
The official Neon MCP server lets an AI client manage Neon serverless Postgres with natural language: create and delete projects, branch databases instantly, run SQL and transactions, inspect schemas, and perform safe two-step migrations. It is maintained by Neon.
The recommended path is the hosted remote server at https://mcp.neon.tech/mcp (Streamable HTTP; a legacy SSE endpoint also exists), authenticated by an OAuth browser flow so no API key handling is required. For stdio-only clients you connect through the mcp-remote bridge, or run the local server package; npx neonctl@latest init can auto-configure a client with OAuth and a generated API key.
A defining feature is migration safety: prepare_database_migration applies your change on a temporary branch first, and complete_database_migration promotes it once verified — so the agent can test schema changes against real data before touching your main branch. The server also includes query-tuning tools (slow query listing, EXPLAIN, prepare/complete query tuning) and one-click provisioning of Neon Auth and the Data API.
Tools & capabilities (11)
list_projects / describe_project / create_project / delete_projectManage Neon projects
create_branch / delete_branch / describe_branch / reset_from_parentCreate and manage database branches
run_sql / run_sql_transactionExecute a single SQL statement or a transaction
get_connection_stringRetrieve a connection string for a project/branch
get_database_tables / describe_table_schemaInspect tables and their schemas
compare_database_schemaDiff schemas between branches
prepare_database_migration / complete_database_migrationTwo-step safe migration: test on a temp branch, then promote
list_slow_queries / explain_sql_statementFind slow queries and inspect execution plans
prepare_query_tuning / complete_query_tuningTwo-step query optimization workflow
provision_neon_auth / provision_neon_data_apiProvision Neon Auth and the Data API for a project
search / fetch / list_docs_resourcesSearch and fetch Neon documentation
When to use it
- Use it when you want an AI agent to spin up Neon projects and branches on demand without the console
- Use it when you need to apply a schema migration safely — tested on a throwaway branch before it hits main
- Use it when you want instant database branches for previews, CI, or experimentation
- Use it when you want to run SQL or transactions against serverless Postgres from your editor
- Use it when a query is slow and you want the agent to surface it, EXPLAIN it, and propose a tuning
- Use it when you want to provision Neon Auth or the Data API for a project conversationally
Quick setup
- 1Add a remote MCP server in your client pointing at https://mcp.neon.tech/mcp (or use npx neonctl@latest init for auto-config)
- 2For stdio-only clients, configure the mcp-remote bridge to that URL
- 3Complete the OAuth browser flow when prompted, or supply an API key via an Authorization: Bearer header
- 4Restart/refresh your MCP client
- 5Verify by asking the agent to list your Neon projects
Security notes
The server can create, modify, and delete Neon projects and run arbitrary SQL, so the OAuth grant is powerful; review the authorization scope. The standalone @neondatabase/mcp-server-neon npm package is deprecated, so prefer the remote OAuth endpoint.
Neon MCP Server FAQ
OAuth or API key — which should I use?
OAuth is recommended for the hosted server and needs no key handling. Use an API key (from the Neon Console, sent as Authorization: Bearer <key>) for headless/CI setups or clients that can't do the browser flow.
What is mcp-remote for?
It is a bridge that lets stdio-only MCP clients connect to Neon's hosted HTTP endpoint at mcp.neon.tech. Clients that support remote HTTP servers can connect directly without it.
Why does migration use two steps?
prepare_database_migration applies your change on a temporary branch so it can be verified against real data; complete_database_migration then promotes it. This prevents an agent from breaking your main branch.
Can I run it locally instead of the hosted server?
Yes — you can run the Neon MCP server locally with Node.js 18+ and a Neon API key, though the hosted OAuth server is the simplest setup.
Does branching cost extra or eat storage?
Neon branches are copy-on-write and cheap to create; consult Neon's pricing for your plan's branch and compute limits. The MCP server itself is free and open source.
Alternatives to Neon MCP Server
Compare all alternatives →Google's official MCP server with prebuilt BigQuery tools, querying datasets via Application Default Credentials.
Read/write Postgres access plus index tuning, EXPLAIN plans, and database health analysis for AI agents.
Official Supabase server: manage tables, run SQL, branches, configs and edge functions from your AI client.
Compare Neon MCP Server with: