MCP Server Neon

MCP数据服务

提供方 neondatabase-labs · 包名 @neondatabase/mcp-server-neon

数据服务 stdio · 本地进程 无需鉴权 社区 / 第三方
查看接入方式

MCP server for interacting with Neon Management API and databases

一句话选型结论

按资料字段整理

MCP Server Neon 属于数据服务类 MCP 服务器,stdio · 本地进程,无需鉴权,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类数据服务 传输方式stdio · 本地进程 鉴权无需鉴权 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

数据服务
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

databases

安装与配置

stdio · 本地进程 无需鉴权
客户端在本机拉起子进程,数据不出本机
npx -y @neondatabase/mcp-server-neon start {NEON_API_KEY} {\ \ "NEON_API_KEY": "YOUR_NEON_API_KEY"\ \ }

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
数据库查询

用自然语言查库、取数,不用手写 SQL。

数据同步与清洗

把多来源数据拉到一处做整理。

报表取数

按口径快速拉出统计结果。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在数据服务场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Server Neon当前 未标注 stdio · 本地进程 本地部署 有 2026-05-18
Memory 9d25f64e 9 未标注 未标注 无 2026-05-17
Getzep MCP 9 stdio · 本地进程 本地部署 有 2026-05-17
anything-llm 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Prisma MCP Server 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Astr Bot 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

数据服务
字段来自项目仓库与公开索引,中文说明由本站标注
提供方neondatabase-labs上游标注的维护方 neondatabase-labs
分类数据服务本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时@neondatabase/mcp-server-neon · Node.js本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-18上游最后核验时间

详细介绍

31.5 KB
来自项目仓库与上游目录的原文,未做删改

Neon MCP Server

Neon MCP Server is an open-source tool that lets you interact with your Lakebase Postgres databases on Neon in natural language.

The Model Context Protocol (MCP) is a standardized protocol designed to manage context between large language models (LLMs) and external systems. This repository provides a remote MCP Server for Neon.

Neon's MCP server acts as a bridge between natural language requests and the Neon API. Built upon MCP, it translates your requests into the necessary API calls, enabling you to manage tasks such as creating projects and branches, running queries, and performing database migrations seamlessly.

Some of the key features of the Neon MCP server include:

  • Natural language interaction: Manage Neon databases using intuitive, conversational commands.
  • Simplified database management: Perform complex actions without writing SQL or directly using the Neon API.
  • Accessibility for non-developers: Empower users with varying technical backgrounds to interact with Neon databases.
  • Database migration support: Leverage Neon's branching capabilities for database schema changes initiated via natural language.

For example, in Claude Code, or any MCP Client, you can use natural language to accomplish things with Neon, such as:

  • Let's create a new Postgres database, and call it "my-database". Let's then create a table called users with the following columns: id, name, email, and password.
  • I want to run a migration on my project called "my-project" that alters the users table to add a new column called "created_at".
  • Can you give me a summary of all of my Neon projects and what data is in each one?

> [!WARNING]
> Neon MCP Server Security Considerations
> The Neon MCP Server grants powerful database management capabilities through natural language requests. Always review and authorize actions requested by the LLM before execution. Ensure that only authorized users and applications have access to the Neon MCP Server.
>
> The Neon MCP Server is intended for local development and IDE integrations only. We do not recommend using the Neon MCP Server in production environments. It can execute powerful operations that may lead to accidental or unauthorized changes.
>
> For more information, see MCP security guidance →.

Setting up Neon MCP Server

There are a few options for setting up the Neon MCP Server:

  1. Quick Setup with API Key (Cursor, VS Code, and Claude Code): Run neon@latest init to automatically configure Neon's MCP Server, agent skills, and VS Code extension with one command.
  2. Remote MCP Server (OAuth Based Authentication): Connect to Neon's managed MCP server using OAuth for authentication. This method is more convenient as it eliminates the need to manage API keys. Additionally, you will automatically receive the latest features and improvements as soon as they are released.
  3. Remote MCP Server (API Key Based Authentication): Connect to Neon's managed MCP server using API key for authentication. This method is useful if you want to connect a remote agent to Neon where OAuth is not available. Additionally, you will automatically receive the latest features and improvements as soon as they are released.

Prerequisites

  • An MCP Client application.
  • A Neon account.
  • Node.js (>= v18.0.0): Download from nodejs.org.
  • If IP Allow is enabled, add 34.192.103.46 and 23.22.233.166 to your allowlist (mcp.neon.tech static IPs).

For development, you'll need Node.js 22+ (pnpm is provided via Corepack — run corepack enable to activate it).

Option 1. Quick Setup with API Key

Don't want to manually create an API key?

Run neon@latest init to automatically configure Neon's MCP Server with one command:```bash
npx neon@latest init


This works with Cursor, VS Code (GitHub Copilot), and Claude Code. It will authenticate via OAuth, create a Neon API key for you, and configure your editor automatically.

### Option 2. Remote Hosted MCP Server (OAuth Based Authentication)

Connect to Neon's managed MCP server using OAuth for authentication. This is the easiest setup, requires no local installation of this server, and doesn't need a Neon API key configured in the client.

Run the following command to add the Neon MCP Server for all detected agents and editors in your workspace:```bash
npx add-mcp "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema"

That URL publishes projects, branches, compute endpoints, querying, and schema. Preview it with /api/list-tools?category=projects&category=branches&category=endpoints&category=querying&category=schema. The unfiltered URL publishes every category:```bash
npx add-mcp https://mcp.neon.tech/mcp


Add the `-g` flag to add the Neon MCP Server to the global MCP server list instead of project-scoped.

Alternatively, you can add the following "Neon" entry to your client's MCP server configuration file (e.g., `mcp.json`, `mcp_config.json`):```json
{
  "mcpServers": {
    "Neon": {
      "type": "http",
      "url": "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema"
    }
  }
}

Kiro: Add the following to your Kiro MCP config file (~/.kiro/settings/mcp.json for global, or .kiro/settings/mcp.json for project-scoped):```json
{
"mcpServers": {
"Neon": {
"url": "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema"
}
}
}


Or use the one-click install button at the top of this README. For more information, see the Kiro MCP documentation.

- Restart or refresh your MCP client.
- An OAuth window will open in your browser. Follow the prompts to authorize your MCP client to access your Neon account.

> With OAuth-based authentication, the MCP server will, by default, operate on projects under your personal Neon account. To access or manage projects that belong to an organization, you must explicitly provide either the `org_id` or the `project_id` in your prompt to MCP client.

### Option 3. Remote Hosted MCP Server (API Key Based Authentication)

Remote MCP Server also supports authentication using an API key in the `Authorization` header if your client supports it.

Create a Neon API key in the Neon Console. Next, run the following command to add the Neon MCP Server for all detected agents and editors in your workspace:```bash
npx add-mcp "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema" --header "Authorization: Bearer <$NEON_API_KEY>"

Alternatively, you can add the following "Neon" entry to your client's MCP server configuration file (e.g., mcp.json, mcp_config.json):```json
{
"mcpServers": {
"Neon": {
"type": "http",
"url": "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema",
"headers": {
"Authorization": "Bearer <$NEON_API_KEY>"
}
}
}
}


&gt; Provide an organization&#x27;s API key to limit access to projects under the organization only.

### Scopes and Read-Only Mode

Neon MCP advertises OAuth scopes `read` and `write`. Your MCP client can request these, or you can make the selection in the OAuth permissions UI. `*` is treated as write if a client still sends it.

**Read-only mode** restricts which tools are available, disabling write operations like creating projects, branches, or running migrations. Read-only tools include listing projects, describing schemas, querying data, and viewing performance metrics.

You can set read-only mode in two ways:

1. **Default MCP URL (editable consent):** Connect with `https://mcp.neon.tech/mcp` and uncheck **Allow writes** on the authorization page. You can also choose one project, a Postgres role for SQL, and a subset of tool categories there.
2. **Parameterized MCP URL (fixed consent):** Put `readonly`, `projectId`, `category`, and/or `roleName` on the MCP server URL. The authorization page confirms that grant and does not offer editors. Change the URL and authorize again to change the grant.```json
{
  &quot;mcpServers&quot;: {
    &quot;Neon&quot;: {
      &quot;url&quot;: &quot;https://mcp.neon.tech/mcp?readonly=true&quot;
    }
  }
}

How the query param behaves:

  • API key flow: readonly=true is the way to enable read-only mode (there is no OAuth scope exchange in this flow). URL changes apply on the next request.
  • OAuth flow: projectId, category, readonly, and roleName on the MCP URL are a fixed grant confirmed at authorization. readonly=true cannot be widened to writes on that page. After a token is issued, changing the URL does not widen that token; authorize again.

For OAuth registration, x-read-only is an initial Allow-writes default on editable consent. It does not lock confirmation, and it does not reduce a parameterized URL that includes readonly=false. API-key requests still honor x-read-only per request, below the readonly query param.

> Note: Read-only mode restricts which tools are available. run_sql stays available and runs each query in a READ ONLY transaction. run_sql_transaction is not available; run each statement with run_sql. Those calls run separately and do not share a transaction. For transaction semantics, use a connection with writes allowed.

URL Query Params for Access Control

Grant context (scope categories, project scoping, read-only mode, pinned Postgres role) is configured via URL query params on the MCP server URL. API-key requests apply those params on each request. OAuth tokens store the grant confirmed or edited at authorization.

Param Description Example
readonly Enable read-only mode (true/false) ?readonly=true
category Restrict to specific tool categories (repeated or CSV) ?category=querying&amp;category=schema
projectId Scope all operations to a single project ?projectId=proj-123
roleName Run all SQL as this Postgres role instead of the owner ?roleName=app_reader

Read-only + project-scoped example:```json
{
"mcpServers": {
"Neon": {
"url": "https://mcp.neon.tech/mcp?readonly=true&projectId=my-project-id"
}
}
}


**Category-filtered example (only querying and schema tools):**```json
{
  &quot;mcpServers&quot;: {
    &quot;Neon&quot;: {
      &quot;url&quot;: &quot;https://mcp.neon.tech/mcp?category=querying&amp;category=schema&quot;
    }
  }
}

Pinned Postgres role example (read-only, one project, SQL as app_reader):```json
{
"mcpServers": {
"Neon": {
"url": "https://mcp.neon.tech/mcp?readonly=true&projectId=my-project-id&roleName=app_reader"
}
}
}


`roleName` pins the Postgres login role for the whole connection. Every SQL the server runs for you (`run_sql`, `run_sql_transaction`, `explain_sql_statement`, `get_database_tables`, `describe_table_schema`, `describe_branch`, `list_slow_queries`, `inspect_database`, and the SQL inside migrations and query tuning) logs in as that role, so Postgres grants decide what the agent can read or change. Without it, SQL runs as the database owner. Read-only mode still wraps queries in a `READ ONLY` transaction; the pinned role adds a limit that Postgres enforces on the login itself, so SQL that gets out of the transaction still has only the role&#x27;s privileges.

- The server resolves the role&#x27;s credentials internally and never returns them. `get_connection_string` is not available on a pinned connection.
- A `role_name` tool argument that differs from the pinned role is rejected. Omitting it uses the pinned role, never the owner.
- If the role does not exist or cannot log in (for example `ALTER ROLE … NOLOGIN`), the call fails before any SQL runs. It does not retry as another role.
- The value must be one exact Postgres role name: letters, digits, `_` or `$`, starting with a letter or `_`, at most 63 characters. Anything else (empty, repeated, quoted, hyphenated) is rejected with `400`, not ignored.
- The role must be able to log in (`LOGIN`) and must exist on each branch you query. Roles created in SQL (`CREATE ROLE app_reader LOGIN PASSWORD &#x27;…&#x27;`) work, as do roles created in the Neon Console or API. A role with the privileges it needs, and no more, is what makes the pin useful: for read-only agents, grant `SELECT` on the tables they should see and do not add it to `neon_superuser`.
- **OAuth:** `roleName` on the MCP URL makes a fixed grant. The authorization page shows the role, and the issued token keeps it through refresh. Changing the URL later does not change the token; authorize again. With the default URL (editable consent), enter the role in the optional **Postgres role** field instead; leave it empty to keep the database owner. Tokens issued before this option have no pinned role and behave as before.
- **API key:** the role is read from the URL on each request. Anyone who can edit the connection URL and holds the API key can change or remove it, so keep the URL in configuration the agent does not control.
- The pin applies to SQL connections only. Management API tools still act with the API key or OAuth token&#x27;s own access; `compare_database_schema`, for example, is computed by the Neon API and is not limited by the role&#x27;s grants. Combine `roleName` with `readonly=true` and `category` to limit those tools too.

You can preview which tools are visible for any configuration using the `/api/list-tools` endpoint (no auth required):```bash
curl &quot;https://mcp.neon.tech/api/list-tools?readonly=true&amp;category=querying&quot;

Tools available in read-only mode

Host tools: list_organizations, describe_branch, run_sql, get_database_tables, describe_table_schema, list_slow_queries, explain_sql_statement, inspect_database, get_neon_auth_config, search, fetch, search_docs, get_doc, send_feedback.

Generated Management API tools that are GET and do not return secrets, plus query_logs (POST, read-only). Preview the exact set with /api/list-tools?readonly=true.

Tools requiring write access:

  • Generated Management API writes (create_project, create_branch, delete_project, …)
  • get_connection_string (the connection string carries a privileged role password, so it is withheld in read-only mode; copy it from the Neon Console instead)
  • run_sql_transaction (its statements run in one session, so a COMMIT or SET TRANSACTION READ WRITE statement would end the read-only transaction)
  • prepare_database_migration, complete_database_migration
  • prepare_query_tuning, complete_query_tuning

Server-Sent Events (SSE) Transport (Deprecated)

MCP supports two remote server transports: the deprecated Server-Sent Events (SSE) and the newer, recommended Streamable HTTP. If your LLM client doesn't support Streamable HTTP yet, you can switch the endpoint from https://mcp.neon.tech/mcp to https://mcp.neon.tech/sse to use SSE instead.

Run the following command to add the Neon MCP Server for all detected agents and editors in your workspace using the SSE transport:```bash
npx add-mcp https://mcp.neon.tech/sse --type sse


## Remote Server Architecture

The remote server runs as a Next.js App Router application on Vercel at `mcp.neon.tech`.

&gt; [!NOTE]
&gt; The root `/` path redirects to Neon MCP Server docs. There is no landing page.

Core implementation areas:

- `app/api/[transport]/route.ts`: MCP transport endpoint for Streamable HTTP (`/mcp`) and SSE (`/sse`)
- `app/api/authorize/`, `app/callback/`, `app/api/token/`, `app/api/revoke/`: OAuth flow endpoints
- `app/.well-known/`: OAuth discovery metadata endpoints
- `mcp/`: MCP server, tools, handlers, analytics, and Sentry integration
- `lib/`: Next.js-compatible helpers (OAuth, configuration, error handling)
- `mcp/utils/read-only.ts`: read-only mode and scope handling

## Guides

- Neon MCP Server Guide
- Connect MCP Clients to Neon
- Cursor with Neon MCP Server
- Claude Code with Neon MCP Server
- Claude Desktop with Neon MCP Server
- Cline with Neon MCP Server
- Windsurf with Neon MCP Server
- Zed with Neon MCP Server

## Features

### Supported Tools

The Neon MCP Server provides the following actions, which are exposed as &quot;tools&quot; to MCP Clients. You can use these tools to interact with your Neon projects and databases using natural language commands.

#### Tool Scope Metadata

Each tool definition includes a `scope` category used for grant-based tool filtering and consent UX. Current categories are:

- `projects`
- `branches`
- `endpoints`
- `snapshots`
- `schema`
- `querying`
- `neon_auth`
- `data_api`
- `observability`
- `docs`
- `functions`
- `storage`
- `realtime`
- `null` (tools without a scope category: `search`, `fetch`, `send_feedback`)

Notes:

- Management API tools come from `@neon/tools`. Selectors are SDK paths (`projects.list`); published MCP names are verb-first (`list_projects`, `delete_project`, `query_logs`). Historical names stay where they already existed (`describe_project`, `create_branch`, `reset_from_parent`, `compare_database_schema`, `provision_neon_auth`, `provision_neon_data_api`, `list_branch_computes`).
- `?category=branches` includes branch, role, and database tools (`list_postgres_roles`, `create_postgres_database`, …). A token already issued for `branches` gains those writes. Compute listing is `?category=endpoints`. Snapshot restore is `?category=snapshots`.
- Project member and permission writes are not published. `list_project_members` and `list_project_permissions` are reads.
- Schema tools (`?category=schema`) are the host tools `get_database_tables` and `describe_table_schema`, plus generated `compare_database_schema`.
- Read-only enforcement still relies on `readOnlySafe` and server-side read-only logic; `scope` is category metadata, not a standalone read/write switch.
- In project-scoped mode (`?projectId=...`), tools without a project path (`list_projects`, `create_project`, `list_organizations`, `list_regions`, `search`, `fetch`, …) are hidden. `delete_project` is also hidden.

**Project Management:**

- **`list_projects`**: Lists Neon projects. `limit` caps how many items come back.
- **`describe_project`**: Fetches a Neon project by id (`{ &quot;project_id&quot;: &quot;…&quot; }`).
- **`create_project`**: Creates a Neon project and waits for the default compute. Does not return a connection string. Arguments are `{ &quot;name&quot;: &quot;…&quot;, &quot;org_id&quot;: &quot;…&quot;, &quot;region_id&quot;: &quot;…&quot; }`. Call `get_connection_string` after it succeeds.
- **`delete_project`**: Deletes an existing Neon project. Arguments are `{ &quot;project_id&quot;: &quot;…&quot; }`.
- **`list_organizations`**: Lists all organizations that the current user has access to. Optionally filter by organization name or ID using the search parameter.

**Branch Management:**

- **`list_branches`**: Lists branches in a project. Use it to resolve a branch name to a `br-…` id.
- **`list_credentials`**, **`create_credential`**, **`revoke_credential`**, **`rotate_credential`**: Branch-scoped credentials for Object Storage and the AI Gateway. `reveal` is not a tool; rotation replaces secrets in place and is not idempotent.
- **`create_branch`**: Creates a branch with a read-write compute and waits until it is ready. Does not return a connection string. Arguments are `{ &quot;project_id&quot;: &quot;…&quot;, &quot;name&quot;: &quot;feature-x&quot; }`. Pass `no_compute: true` to skip the endpoint. Call `get_connection_string` after it succeeds.
- **`reset_from_parent`**: Resets a branch to its parent&#x27;s current HEAD (`{ &quot;project_id&quot;: &quot;…&quot;, &quot;branch_id&quot;: &quot;br-…&quot; }`). Discards writes since the branch diverged. `preserve_under_name` is required when the branch has children; those children move to the new branch. Parent HEAD only; point-in-time restore is `restore_snapshot`.
- **`delete_branch`**: Deletes a branch (`{ &quot;project_id&quot;: &quot;…&quot;, &quot;branch_id&quot;: &quot;br-…&quot; }`).
- **`describe_branch`**: Retrieves a tree of databases, schemas, tables, views, and functions on a branch.
- Generated branch tools take `branch_id` as a branch id (`br-...`), not a name.
- **`restore_snapshot`**: Restores a snapshot. Pass `target_branch_id` to restore onto an existing branch; omit it to create a new one.

**Compute endpoints** (`?category=endpoints`):

- **`list_postgres_endpoints`**, **`list_branch_computes`**, **`get_postgres_endpoint`**, **`create_postgres_endpoint`**, **`update_postgres_endpoint`**, **`delete_postgres_endpoint`**, **`start_postgres_endpoint`**, **`suspend_postgres_endpoint`**, **`restart_postgres_endpoint`**

**Snapshots** (`?category=snapshots`):

- **`list_snapshots`**, **`get_snapshot_schedule`**, **`set_snapshot_schedule`**, **`create_snapshot`**, **`update_snapshot`**, **`delete_snapshot`**, **`restore_snapshot`**

**Schema** (`?category=schema`):

- **`get_database_tables`**, **`describe_table_schema`**
- **`compare_database_schema`**: SQL schema diff of one database against another branch. `database_name` is required. Omitting `base_branch_id` compares against the parent. Optional `lsn`, `timestamp`, `base_lsn`, `base_timestamp` are point-in-time only.

**SQL Query Execution:**

- **`get_connection_string`**: Returns your database connection string.
- **`run_sql`**: Executes a single SQL query against a specified Neon database. Supports both read and write operations. Optional `role_name` logs in as that Postgres role instead of the database owner, and `compute_id` picks the compute; credentials stay on the server. On a connection with `?roleName=`, `role_name` must be omitted or match it.
- **`run_sql_transaction`**: Executes a series of SQL queries within a single transaction against a Neon database. Takes the same optional `role_name` and `compute_id` as `run_sql`.
- **`get_database_tables`**: Lists all tables within a specified Neon database.
- **`describe_table_schema`**: Retrieves the schema definition of a specific table, detailing columns, data types, and constraints.

**Database Migrations (Schema Changes):**

- **`prepare_database_migration`**: Initiates a database migration process. Critically, it creates a temporary branch to apply and test the migration safely before affecting the main branch.
- **`complete_database_migration`**: Finalizes and applies a prepared database migration to the main branch. This action merges changes from the temporary migration branch and cleans up temporary resources.

**SQL Querying and Optimization:**

- **`inspect_database`**: Runs one of 15 predefined read-only Postgres diagnostics against a branch — relation and index sizes, index and sequential-scan usage, active queries and locks, the heaviest and most frequent queries, cache hit rate and working-set size, autovacuum and bloat estimates, and replication state. Same checks as the `neon inspect db` CLI command. Omit `database_name` to cover every database on the branch; pass a name to inspect one. Four of them need the `pg_stat_statements` or `neon` extension.
- **`list_slow_queries`**: Identifies performance bottlenecks by finding the slowest queries in a database. Requires the pg_stat_statements extension.
- **`explain_sql_statement`**: Provides detailed execution plans for SQL queries to help identify performance bottlenecks.
- **`prepare_query_tuning`**: Analyzes query performance and suggests optimizations, like index creation. Creates a temporary branch for safely testing these optimizations.
- **`complete_query_tuning`**: Finalizes query tuning by either applying optimizations to the main branch or discarding them. Cleans up the temporary tuning branch.

**Neon Auth** (`?category=neon_auth`):

- **`provision_neon_auth`**, **`get_auth`**, **`disable_auth`**, **`update_auth_config`**
- **`get_neon_auth_config`**: host tool; secrets redacted. Use generated Auth write tools to change settings.
- **`list_auth_oauth_providers`**, **`add_auth_oauth_provider`**, **`update_auth_oauth_provider`**, **`delete_auth_oauth_provider`**
- **`get_auth_oauth_server`**, **`update_auth_oauth_server`**: Configure Neon Auth as an OAuth 2.1 authorization server (including for MCP servers). Separate from the social login providers above.
- **`list_auth_oauth_clients`**, **`get_auth_oauth_client`**, **`create_auth_oauth_client`**, **`update_auth_oauth_client`**, **`delete_auth_oauth_client`**, **`rotate_auth_oauth_client_secret`**: Manage the OAuth clients of that server. `create_auth_oauth_client` and `rotate_auth_oauth_client_secret` return the `client_secret` once.
- **`list_auth_trusted_domains`**, **`add_auth_trusted_domain`**, **`delete_auth_trusted_domain`**
- **`create_auth_user`**, **`delete_auth_user`**, **`update_auth_user_role`**

**Neon Data API** (`?category=data_api`):

- **`provision_neon_data_api`**, **`get_data_api`**, **`update_data_api`**, **`delete_data_api`**: Manage the Data API for a branch database.

**Search and Discovery:**

- **`search`**: Searches across organizations, projects, and branches matching a query. Returns IDs, titles, and direct links to the Neon Console.
- **`fetch`**: Fetches detailed information about a specific organization, project, or branch using an ID (typically from the search tool).

**Feedback** (always available, including the no-login `?category=docs` endpoint):

- **`send_feedback`**: Sends anonymous feedback to the Neon team. Only the feedback text is sent, with no account, project, or connection details. Messages are limited to 10,000 characters.

**Observability** (`?category=observability`): these tools require the Neon Platform Beta and are currently only available for projects in the `aws-us-east-2` region. A branch without logs access returns HTTP 404 with reason `telemetry_not_enabled`.

- **`query_logs`**: Queries OpenTelemetry logs for a branch. POST in the Management API; treated as read-only by this server.
- **`list_log_fields`**: Lists the log fields you can enumerate values for on a branch.
- **`list_log_field_values`**: Lists the distinct values of a log field within a branch and time window.

**Documentation and Resources** (`?category=docs`):

- **`search_docs`**: Searches neon.com (docs, API reference, PostgreSQL tutorial, guides, FAQs, changelog, and blog) with the same search as the neon.com search box. Takes `query`, optional `categories` (`docs`, `api`, `postgresql`, `guides`, `faqs`, `blog`, `changelog`), and optional `limit` (1-40, default 10). Returns ranked pages with `title`, `url`, `slug`, `category`, `breadcrumb`, `heading`, and `excerpt`; pass `slug` to `get_doc` to read the page.
- **`get_doc`**: Fetches one neon.com page as markdown. Takes `slug` from a `search_docs` hit (for example `docs/guides/prisma` or `postgresql/tutorial/inner-join`).

**Functions** (`?category=functions`):

- **`list_functions`**, **`get_function`**, **`update_function`**, **`delete_function`**, **`deploy_function`**
- **`list_functions_custom_domains`**, **`register_functions_custom_domain`**, **`delete_functions_custom_domain`**
- **`list_triggers`**, **`get_trigger`**, **`create_trigger`**, **`update_trigger`**, **`delete_trigger`**: Scheduled function triggers (`type: &quot;schedule&quot;`, five-field UTC cron).

**Storage** (`?category=storage`):

- **`list_storage_buckets`**, **`create_storage_bucket`**, **`delete_storage_bucket`**
- **`list_storage_objects`**, **`delete_storage_object`**, **`delete_storage_objects_by_prefix`**
- **`presign_storage_object`**, **`get_storage`**

**Realtime** (`?category=realtime`):

- **`get_realtime`**, **`enable_realtime`**, **`disable_realtime`**: Branch Realtime state, enable (optional `allowed_origins`), and disable. Enable and disable wait until the change is applied.
- **`get_realtime_secret`**: The shared secret the application backend issues Realtime tokens with. Not available in read-only mode.
- **`rotate_realtime_secret`**: Replaces the shared secret and waits until the change is applied. Not idempotent. Call `get_realtime_secret` afterwards for the new value.

### Migrations

Migrations are a way to manage changes to your database schema over time. With the Neon MCP server, LLMs are empowered to do migrations safely with separate &quot;Start&quot; (`prepare_database_migration`) and &quot;Commit&quot; (`complete_database_migration`) commands.

The &quot;Start&quot; command accepts a migration and runs it in a new temporary branch. Upon returning, this command hints to the LLM that it should test the migration on this branch. The LLM can then run the &quot;Commit&quot; command to apply the migration to the original branch.

## Development

This project uses pnpm as the package manager, pinned via Corepack.

### Project Structure

The MCP server code lives at the repository root, a Next.js application deployed to Vercel at `mcp.neon.tech`.```bash
corepack enable
pnpm install

See CONTRIBUTING.md for how to add tools. Tool arguments are snake_case.

Local Development```bash

Start the Next.js dev server (for the remote MCP server)

pnpm dev


### Linting and Type Checking```bash
pnpm lint
pnpm typecheck

Environment Variables

Required for remote server runtime:

Variable Description
SERVER_HOST Server URL (defaults to VERCEL_URL)
UPSTREAM_OAUTH_HOST Neon OAuth provider URL
CLIENT_ID OAuth client ID
CLIENT_SECRET OAuth client secret
KV_URL Vercel KV (Upstash Redis) URL
OAUTH_DATABASE_URL Postgres URL for token storage

Optional:

| Variable | Description |

…(正文过长,页面只展示前面部分,完整内容见仓库)

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
MCP Server Neon 怎么安装?

在客户端按下面的安装命令接入:npx -y @neondatabase/mcp-server-neon start {NEON_API_KEY} {\ \ "NEON_API_KEY": "YOUR_NEON_API_KEY"\ \ }。对应的包名是 @neondatabase/mcp-server-neon。装完在客户端配置里引用同一个包或端点。

MCP Server Neon 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

MCP Server Neon 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Server Neon 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

MCP Server Neon 能提供哪些能力?

资料显示能力标签包括 数据分析、自然语言交互、JavaScript、OAuth认证。具体工具清单以官方文档为准。

MCP Server Neon 需要什么运行环境?

运行时为 Node.js;属于本地进程,需要在本机装好运行环境。

MCP Server Neon 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-18。