MCP Configs2026年4月9日·1 分钟阅读

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.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
step-1.md
安全暂存命令
npx -y tokrepo@latest install 439d1fdb-33ce-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

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.

常见问题

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.

引用来源 (3)
🙏

来源与感谢

Created by Neon Database. Licensed under MIT.

mcp-server-neon — ⭐ 574+

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产