Neon 扩展
本教程介绍如何把 Neon MCP 服务器 添加为 goose 扩展,以便操作 Neon Postgres 数据库,并管理项目、分支等资源。
Neon 提供两个版本的 MCP 服务器:
- 远程 MCP 服务器,由 Neon 托管。它会把你重定向到 neon.com,登录 Neon 账号。
- 本地 MCP 服务器,可以在自己的机器上运行,用 API 密钥连接指定组织或个人账号。
安全提示
Neon MCP 服务器提供很强的数据库管理能力,仅适用于本地开发。执行前务必检查大模型请求的操作,不要在生产环境中使用。
配置
- Neon Remote MCP
- Neon Local MCP
快速安装
- goose Desktop
- goose CLI
使用 goose configure 添加 Remote Extension (Streamable HTTP) 类型的扩展,并填写:
端点 URL
https://mcp.neon.tech/mcp
OAuth 流程
浏览器会打开一个 OAuth 窗口。按提示授权访问你的 Neon 账号。
- goose Desktop
- goose CLI
- Launch the installer
- Click
Yesto confirm the installation - Click the button in the top-left to open the sidebar
- Navigate to the chat
- Run the
configurecommand:
goose configure
- Choose to add a
Remote Extension (Streamable HTTP).
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
│ ○ Command-line Extension
│ ● Remote Extension (Streamable HTTP) (Connect to a remote extension via MCP Streamable HTTP)
└
- Give your extension a name.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◆ What would you like to call this extension?
│ neon-mcp-remote
└
- Enter the Streamable HTTP endpoint URI.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ neon-mcp-remote
│
◆ What is the Streamable HTTP endpoint URI?
│ https://mcp.neon.tech/mcp
└
- Enter the number of seconds goose should wait for actions to complete before timing out. Default is
300seconds.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ neon-mcp-remote
│
◇ What is the Streamable HTTP endpoint URI?
│ https://mcp.neon.tech/mcp
│
◆ Please set the timeout for this tool (in secs):
│ 300
└
- Enter a description for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ neon-mcp-remote
│
◇ What is the Streamable HTTP endpoint URI?
│ https://mcp.neon.tech/mcp
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ Manage Neon Postgres databases, projects, and branches
└
- Choose
Nowhen asked to add custom headers.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Remote Extension (Streamable HTTP)
│
◇ What would you like to call this extension?
│ neon-mcp-remote
│
◇ What is the Streamable HTTP endpoint URI?
│ https://mcp.neon.tech/mcp
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ Manage Neon Postgres databases, projects, and branches
│
◆ Would you like to add custom headers?
│ No
│
└ Added neon-mcp-remote extension
快速安装
- goose Desktop
- goose CLI
命令
npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>
不需要环境变量。
前置条件
- 系统已安装 Node.js(v18.0.0 或更高版本)。此命令使用
npx - 需要 Neon API 密钥,以便 Neon MCP 服务器向你的 Neon 账号认证。可以在 Neon Console 的个人资料设置里创建。详细步骤见 Neon API 密钥文档
- goose Desktop
- goose CLI
- Launch the installer
- Click
Yesto confirm the installation - Click the button in the top-left to open the sidebar
- Navigate to the chat
- Run the
configurecommand:
goose configure
- Choose to add a
Command-line Extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◆ What type of extension would you like to add?
│ ○ Built-in Extension
│ ● Command-line Extension (Run a local command or script)
│ ○ Remote Extension (Streamable HTTP)
└
- Give your extension a name.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◆ What would you like to call this extension?
│ Neon MCP
└
- Enter the command to run when this extension is used.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Neon MCP
│
◆ What command should be run?
│ npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>
└
- Enter the number of seconds goose should wait for actions to complete before timing out. Default is
300seconds.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Neon MCP
│
◇ What command should be run?
│ npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>
│
◆ Please set the timeout for this tool (in secs):
│ 300
└
- Enter a description for this extension.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Neon MCP
│
◇ What command should be run?
│ npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◆ Enter a description for this extension:
│ Manage Neon Postgres databases, projects, and branches
└
- Choose
Nowhen asked to add environment variables.
┌ goose-configure
│
◇ What would you like to configure?
│ Add Extension
│
◇ What type of extension would you like to add?
│ Command-line Extension
│
◇ What would you like to call this extension?
│ Neon MCP
│
◇ What command should be run?
│ npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>
│
◇ Please set the timeout for this tool (in secs):
│ 300
│
◇ Enter a description for this extension:
│ Manage Neon Postgres databases, projects, and branches
│
◆ Would you like to add environment variables?
│ No
│
└ Added Neon MCP extension
完整的安装和配置选项见 Neon MCP 服务器官方文档。
使用示例 1
查看所有 Neon 数据库项目及其配置概览。
goose 提示词
列出我的 Neon 项目
goose 输出
我用 neon__list_projects 工具列出你的 Neon 项目。默认显示前 10 个。
你的 Neon 项目如下:
1. laravel-test(ID:mute-mountain-08595850)
- 区域:AWS US East 2
- 创建时间:2025 年 7 月 23 日
- PostgreSQL:v17
2. rls-test(ID:noisy-hill-99207787)
- 区域:AWS US East 2
- 创建时间:2025 年 7 月 20 日
- PostgreSQL:v17
3. neon-auth-test(ID:rapid-pond-81053507)
- 区域:Azure East US 2
- 创建时间:2025 年 7 月 7 日
- PostgreSQL:v17
4. saas-starter-kit-nextjs(ID:misty-poetry-78149700)
- 区域:AWS US West 2
- 创建时间:2025 年 6 月 23 日
- PostgreSQL:v17
- 备注:已启用逻辑复制
5. neon-auth-mcp-oauth(ID:gentle-base-21700263)
- 区域:AWS US West 2
- 创建时间:2025 年 6 月 4 日
- PostgreSQL:v17
所有项目都在运行 PostgreSQL 17,并配置了 1–2 个计算单元的自动扩缩容。需要查看某个项目的更多细节吗?
使用示例 2
查看某个项目里有哪些表和 schema。
goose 提示词
我的 neon-auth-mcp-oauth 项目里有哪些表?
goose 输出
在 neon-auth-mcp-oauth 项目中有一张表:
neon_auth schema 中的 users_sync
使用示例 3
对数据库表运行查询,检索并分析数据。
goose 提示词
统计 users_sync 表的行数。
goose 输出
我用 COUNT 查询统计 neon_auth.users_sync 表的行数。
记录总数:1 行
表位置:schema neon_auth,表 users_sync
项目:neon-auth-mcp-oauth(项目 ID:gentle-base-21700263)
内容:包含一条用户记录