MCP ConfigsApr 9, 2026·3 min read

Neon MCP — Serverless Postgres via AI Agents

MCP server for Neon serverless Postgres. Create projects, branch databases, run SQL, optimize queries via natural language. Safe migration workflow with branching. MIT, 574+ stars.

TL;DR
Neon MCP lets AI agents create Neon projects, branch databases, run SQL, and optimize queries via natural language.
§01

What it is

Neon MCP is a Model Context Protocol server that connects AI agents like Claude Code to Neon's serverless PostgreSQL platform. Through natural language, you can create database projects, branch databases for safe migrations, run SQL queries, and get query optimization suggestions. The MCP server handles authentication and API calls to Neon behind the scenes.

Neon MCP is designed for developers using AI coding agents who want database operations integrated into their AI workflow without switching to a database GUI.

§02

How it saves time or tokens

Database operations typically require switching between your code editor, a database client, and the Neon console. Neon MCP brings all of that into your AI agent's context. Ask Claude Code to 'create a branch, apply the migration, and verify the schema' and it executes the entire workflow through the MCP server. Database branching is particularly powerful: you can test migrations on a branch without risking your production data, all from natural language commands.

§03

How to use

  1. Add the Neon MCP server to your .mcp.json (Claude Code) or MCP client config:
{
  "mcpServers": {
    "Neon": {
      "type": "http",
      "url": "https://mcp.neon.tech/mcp"
    }
  }
}
  1. Restart Claude Code. Authenticate when prompted.
  1. Ask natural language database questions:
'Create a new Neon database called analytics'
'Branch the production database for testing my migration'
'Run SELECT count(*) FROM users WHERE created_at > now() - interval 7 days'
§04

Example

A typical database migration workflow using Neon MCP:

You: Create a branch from production called 'add-orders-table'
Agent: Created branch 'add-orders-table' from production.

You: On the branch, create a table:
  CREATE TABLE orders (
    id SERIAL PRIMARY KEY,
    user_id INT REFERENCES users(id),
    total DECIMAL(10,2),
    created_at TIMESTAMPTZ DEFAULT now()
  );
Agent: Table 'orders' created on branch 'add-orders-table'.

You: Verify the schema looks correct
Agent: Schema verified. The orders table has 4 columns...

You: Merge the branch to production
Agent: Branch merged. The orders table is now in production.
§05

Related on TokRepo

§06

Common pitfalls

  • Running destructive queries on the main branch instead of a test branch. Always create a branch before running DDL changes or data modifications. Branches are cheap and instant in Neon.
  • Not setting up proper authentication. The Neon MCP server requires an API key. Follow the authentication flow on first use.
  • Expecting the MCP server to handle complex multi-statement transactions. For complex migrations, write a SQL file and ask the agent to execute it, rather than sending individual statements.

Frequently Asked Questions

What is Neon database branching?+

Neon branching creates an instant copy-on-write clone of your database. The branch shares storage with the parent until data diverges, making it free to create. This lets you test migrations, run analytics, or create dev environments without copying data.

Does Neon MCP work with Claude Code?+

Yes. Neon MCP uses the Model Context Protocol, which Claude Code supports natively. Add the MCP server configuration to your .mcp.json file and restart Claude Code to connect.

Is Neon MCP free to use?+

The MCP server itself is open source and free. Neon's serverless Postgres has a free tier that includes one project with branching. Paid tiers offer more compute, storage, and projects.

Can I use Neon MCP for production database management?+

You can, but exercise caution. Always use branches for testing changes before applying them to production. The MCP server gives your AI agent direct database access, so review any destructive operations before confirming.

What SQL operations does Neon MCP support?+

Neon MCP supports all standard PostgreSQL operations: DDL (CREATE, ALTER, DROP), DML (SELECT, INSERT, UPDATE, DELETE), and Neon-specific operations like branching, project management, and query optimization suggestions.

Citations (3)
🙏

Source & Thanks

Created by Neon Database. Licensed under MIT.

mcp-server-neon — ⭐ 574+

Thanks to the Neon team for making serverless Postgres accessible to AI agents.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.