Neon MCP server
Neon's official MCP server lets agents create projects and branches, run SQL, and drive safe schema migrations on serverless Postgres.
The Neon MCP Server is the official server from Neon, the serverless Postgres platform, that lets an AI agent manage your databases through natural language. It exposes the full Neon control plane: list, create, describe, and delete projects; spin up and tear down database branches (Neon's instant copy-on-write clones); fetch connection strings; and run SQL queries and transactions directly. Where it really shines is safe schema change: the prepare_database_migration / complete_database_migration pair applies a migration to a temporary branch first so the agent can verify it before touching production, and the query-tuning tools do the same for performance work, testing an optimization on a branch before committing. It also surfaces slow queries, EXPLAIN plans, and can provision Neon Auth and the Data API.
The canonical deployment is the hosted remote endpoint at https://mcp.neon.tech/mcp, which uses OAuth so an interactive client opens a browser window to authorize access to your Neon account with no key handling. For remote agents or headless setups you can instead run the local @neondatabase/mcp-server-neon package, or point a client at the remote URL with a NEON_API_KEY passed as a bearer token. Branch-first migrations make it one of the safer ways to let an agent change a live database.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Add to ~/.claude.json
{
"mcpServers": {
"neon": {
"type": "http",
"url": "https://mcp.neon.tech/mcp"
}
}
}claude mcp add --transport http neon https://mcp.neon.tech/mcpHeads up
- First tool call opens a browser to authorize.
Available tools
| Tool | Description |
|---|---|
| list_projects | Lists the first 10 Neon projects for the authenticated account with summaries. |
| list_shared_projects | Lists projects that have been shared with the current user. |
| describe_project | Gets detailed information about a specific Neon project. |
| create_project | Creates a new Neon project. |
| delete_project | Deletes a Neon project and its resources. |
| list_organizations | Lists organizations the user has access to. |
| create_branch | Creates a new database branch in a project. |
| delete_branch | Deletes a branch from a project. |
| describe_branch | Fetches details about a branch, including its objects. |
| list_branch_computes | Lists the compute endpoints attached to branches. |
| compare_database_schema | Shows the schema differences between two branches. |
| reset_from_parent | Resets a branch to the current state of its parent branch. |
| get_connection_string | Retrieves a Postgres connection string for a project or branch. |
| run_sql | Executes a single SQL statement (read or write) against a database. |
| run_sql_transaction | Runs multiple SQL statements as a single transaction. |
| get_database_tables | Lists all tables in a database. |
| describe_table_schema | Describes the column structure of a table. |
| prepare_database_migration | Begins a safe schema migration by applying it to a temporary branch for verification. |
| complete_database_migration | Applies a verified migration to the main branch. |
| list_slow_queries | Identifies slow queries to surface performance problems. |
| explain_sql_statement | Returns the execution plan for a SQL statement. |
| prepare_query_tuning | Tests query optimizations safely on a temporary branch. |
| complete_query_tuning | Applies or discards changes from a query-tuning session. |
| provision_neon_auth | Provisions Neon Auth authentication infrastructure for a project. |
| provision_neon_data_api | Sets up the Neon Data API for HTTP-based database access. |
| search | Searches across organizations, projects, and branches. |
| fetch | Fetches detailed information about a specific resource. |
| list_docs_resources | Indexes the available Neon documentation resources. |
| get_doc_resource | Retrieves a specific Neon documentation page. |
Required configuration
- NEON_API_KEYOptional
Neon API key, used as a bearer token for remote agents or headless setups when OAuth is unavailable. Not required for the standard OAuth flow.
What you can do with it
Migrate a schema safely
The agent applies a schema change to a temporary Neon branch with prepare_database_migration, verifies it, then promotes it to production with complete_database_migration so a bad migration never hits the main branch.
Spin up a throwaway database
Ask the agent to create a project or branch, hand it the connection string, run experiments, then delete the branch when finished, all without leaving the editor.
FAQ
- Is it free?
- Yes. The MCP server is open source and free to run; it operates within your existing Neon account and plan limits, including the generous free tier.
- Does it support remote/OAuth?
- Yes. The canonical deployment is the hosted remote endpoint at https://mcp.neon.tech/mcp with OAuth, which opens a browser window to authorize access. For remote agents you can pass a NEON_API_KEY as a bearer token, or run the local @neondatabase/mcp-server-neon package.
- Can the agent change production data?
- It can run write SQL and migrations, but the migration and query-tuning tools apply changes to a temporary branch first so they can be verified before being promoted to the main branch.