跳过安装。2 分钟内即可运行。
在 cloud.anythingmcp.com 开始免费试用,一键添加 Neon,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。
摘要
让你的 AI 管理 Neon Serverless Postgres:项目、分支、计算端点、数据库、角色、架构、操作和用量。经你确认后,它可以创建分支,启动或暂停计算实例。绝不返回密码。使用 Neon API 密钥连接。
试试这样问
Neon 的示例提示
点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。
Claude 是 AI,可能会出错。请核对回答。
💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → Neon、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无
git clone、无本地服务器。
Neon
让你的 AI 管理 Neon Serverless Postgres:项目、分支、计算端点、数据库、角色、架构、操作和用量。经你确认后,它可以创建分支,启动或暂停计算实例。绝不返回密码。使用 Neon API 密钥连接。
设置
- 在 Neon Console 中打开 Account settings → API keys 创建个人密钥(它以你的身份在你所属的所有组织中操作),或打开 Organization settings → API keys 创建只能访问该组织项目的密钥。项目级密钥只能访问一个项目。
- 创建密钥后立即复制:Neon 只显示一次。把它粘贴到
NEON_API_KEY,然后安装连接器。密钥只会发送到 console.neon.tech。 - 用
neon_list_organizations检查设置:它会列出密钥所属的组织及其org_id。
覆盖范围:通过 Neon API v2 访问组织、项目、分支、计算端点、数据库、角色、数据库架构、操作和用量。AI 从 neon_list_projects 开始,依次使用 neon_get_project、neon_list_branches、neon_list_endpoints、neon_list_databases、neon_list_roles 和 neon_get_database_schema;后者会显示数据库的表、列、索引和约束,也可以查看过去某个时间点的状态。使用个人密钥时,组织下的项目需要提供 org_id。
每次更改前都会先问你:neon_create_branch、neon_start_endpoint 和 neon_suspend_endpoint 会更改你的项目,所以 AI 会先说明将发生什么,并等你同意。
- 运行中的计算实例会消耗计算时长,计入套餐额度,付费套餐会按量计费。
neon_start_endpoint会启动计费;计算实例在空闲超时后会自动缩容到零。 neon_suspend_endpoint会立即关闭该计算实例上的所有连接。neon_create_branch会立即创建写时复制分支,也可以基于过去某个时间点创建。超出套餐额度的分支可能产生费用,加到分支上的计算实例会立刻启动。临时分支请设置过期时间。- 每次更改都作为后台操作运行;
neon_list_operations和neon_get_operation会显示它何时完成。
安装时默认关闭:neon_delete_branch 会删除分支及其计算实例。需要管理员有意识地开启。根分支和默认分支永远不能删除。
用量和费用:neon_get_consumption 按小时、天或月返回每个项目的计算时间、存储、分支数量和网络传输量。它需要 org_id,仅适用于付费套餐(Launch、Scale、Business、Enterprise),并且不会唤醒任何计算实例。项目和分支详情也会显示本周期的计算时间、活跃时间、写入数据量和数据传输量。
不返回密码,不执行 SQL:角色密码和连接字符串永远不会返回,因此数据库密码不会传给 AI。这个连接器也不执行 SQL:Neon 的 HTTP SQL 需要包含角色密码的连接字符串,而不是 API 密钥。要查询数据,请在你的 Neon 主机上创建专用的只读 Postgres 角色,并添加 PostgreSQL 连接器(端口 5432,必须使用 SSL)。neon_get_database_schema 依然可以在不需要任何密码的情况下显示结构。
常见错误:401:API 密钥错误或已被撤销;请新建一个。403:密钥无权访问该项目或组织(项目级或组织级密钥被用在别处),或者你的套餐不包含该功能,例如用量历史。404:项目、分支或端点 ID 错误。423 Locked:项目上正在运行另一个操作;请等它完成后重试。429:请求过多;请稍候重试。
该连接器不会创建或删除项目、数据库和角色,不会重置密码,也不涉及 Neon Auth、Data API、快照和组织管理。
前提条件: NEON_API_KEY
本地安装连接器
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
打开 http://localhost:3000/connectors/store,选择 Neon 并填入前提条件中列出的环境变量。
可用工具
| Tool | What it does |
|---|---|
neon_list_organizations | List the Neon organizations the API key belongs to, with org_id, name, handle and plan |
neon_list_projects | List Neon projects with id, name, region, Postgres version, organization, storage size and last compute activity |
neon_get_project | Get one Neon project: region, Postgres version, default compute settings, history retention, and this billing period's compute time, active… |
neon_list_branches | List the branches of a Neon project with id, name, parent, state, default and protected flags, logical size and this period's compute time |
neon_get_branch | Get one Neon branch: name, parent and branch point, state, default and protected flags, expiry, logical size and this period's compute and… |
neon_create_branch | Create a Neon branch (an instant copy-on-write copy of a parent branch, optionally at a point in time) |
neon_delete_branch | Delete a Neon branch and its computes, ending all their connections |
neon_list_endpoints | List the compute endpoints of a Neon project: id, branch, read-write or read-only, state (active, idle), autoscaling range in compute… |
neon_get_endpoint | Get one Neon compute endpoint: state, branch, type, autoscaling range, suspend timeout, last activity, start and suspend times and host name |
neon_start_endpoint | Start (wake) a Neon compute endpoint |
neon_suspend_endpoint | Suspend a Neon compute endpoint now, which stops compute billing but closes every open connection to it |
neon_list_databases | List the Postgres databases of a Neon branch with name and owner role |
neon_list_roles | List the Postgres roles of a Neon branch with name, protected flag and authentication method |
neon_get_database_schema | Get the schema of one database on a Neon branch (tables, columns, types, indexes, constraints, as pg_dump-style SQL), optionally as it was… |
neon_list_operations | List the operations of a Neon project (branch creation, compute start and suspend, config changes), newest first, with status, error and… |
neon_get_operation | Get one Neon operation: action, status (scheduling, running, finished, failed, cancelled), error, retries and duration |
neon_get_consumption | Get Neon consumption per project and period: compute unit seconds, root and child branch storage, instant restore storage, extra branches… |
示例提示
- “列出我们所有的 Neon 项目,包括区域、Postgres 版本和存储大小,并告诉我本月哪些项目没有计算活动。”
- “给我看生产分支上 app 数据库的架构:表、列和索引。”
- “基于 main 创建一个名为 feature-billing 的分支,7 天后过期。创建前先告诉我可能产生的费用。”
- “现在哪些计算实例在运行?把 preview 分支上的那个暂停,但先问我。”
- “上个月每个项目用了多少计算时间和存储?”
下一步
这份指南对你有帮助吗?