Neon MCP Server – Postgres Database Management
Neon's official MCP server gives AI agents structured access to Neon Postgres projects, branches, databases, SQL execution, schema inspection, migrations, query tuning, and documentation. Use it for development and testing workflows that need live database context and controlled Neon management actions.
Overview
Neon's official MCP server connects compatible AI agents to Neon Postgres and
the Neon API. It translates natural-language requests into structured tools for
managing projects, branches, databases, and SQL workflows, so an agent can work
with live Neon resources instead of relying only on pasted schemas or static
model knowledge.
What the MCP server enables
The server exposes tools for project management, branch management, SQL
execution, schema inspection, database migrations, query tuning, resource
discovery, and Neon documentation. Depending on the authenticated account and
granted access, an AI agent can:
- List, describe, create, search, and delete Neon projects.
- Create, inspect, compare, reset, and delete database branches.
- Retrieve connection strings and inspect tables and table schemas.
- Run individual SQL statements or multi-statement transactions.
- Prepare and complete branch-based schema migrations.
- Analyze slow queries and execution plans, and test tuning changes safely.
- Provision supported Neon Auth or Neon Data API integrations.
- Search Neon resources and retrieve official Neon documentation.
When to use it
Use Neon MCP for development and testing tasks that benefit from live Postgres
context. Typical workflows include creating isolated branches for feature work,
inspecting a schema, running approved queries, testing migrations before they
reach a parent branch, diagnosing slow SQL, provisioning a development database,
and finding current Neon setup guidance from inside an AI coding assistant.
Connection and authentication
Neon's managed Streamable HTTP endpoint is
https://mcp.neon.tech/mcp. It supports interactive OAuth with no local API
key configuration. Remote clients can alternatively send a Neon API key in the
Authorization header as a Bearer token.
Neon also publishes the official @neondatabase/mcp-server-neon npm package
for local stdio use. The documented local command passes the Neon API key as a
command-line argument. Clients that cannot use Streamable HTTP may connect to
the legacy SSE endpoint at https://mcp.neon.tech/sse, but SSE does not support
API key authentication.
Key considerations
Neon recommends using the MCP server only for development and testing, not for
production databases. Do not expose production or personally identifiable data
to an agent. Always review requested actions before execution, especially SQL
writes, project deletion, branch deletion, resets, and migration completion.
Restrict access to trusted users, revoke unused API keys, and prefer isolated
branches for risky schema or tuning work.
Supported Transports
streamable_http
URL: https://mcp.neon.tech/mcp
sse
URL: https://mcp.neon.tech/sse
stdio
Command: npx
Args:
-y@neondatabase/mcp-server-neonstart${NEON_API_KEY}
Frequently Asked Questions
- When should an AI agent use the Neon MCP server?
- Use it for development and testing workflows that require live Neon Postgres context, such as creating branches, inspecting schemas, running approved SQL, testing migrations, diagnosing query performance, or retrieving current Neon documentation.
- What does the Neon MCP server add to an AI agent's capabilities?
- It gives the agent structured access to current Neon projects, branches, databases, SQL tools, migration workflows, performance diagnostics, resource search, and official documentation instead of relying only on static model knowledge or manually pasted database details.
- What can an AI agent access or manage through Neon MCP?
- Depending on account permissions, the agent can manage projects and branches, retrieve connection information, inspect tables and schemas, run SQL and transactions, prepare branch-based migrations, analyze slow queries, test tuning changes, provision selected Neon integrations, and search Neon resources and documentation.
- How is authentication configured for the Neon MCP server?
- The managed remote server supports interactive OAuth and also accepts a Neon API key as a Bearer token. The local stdio package requires a Neon API key supplied to the start command. Store keys securely, revoke unused keys, and never commit them to source control.
- Which transport should be used for the Neon MCP server?
- Use Streamable HTTP at https://mcp.neon.tech/mcp for modern remote clients. Use the official local stdio package when a locally launched server is required. Use the SSE endpoint only for older clients that cannot support Streamable HTTP, noting that SSE does not support API key authentication.