This guide shows how to use Cline with the Neon MCP Server to manage your Neon databases.
Security
The Neon MCP Server grants broad database management capabilities. Always review and authorize actions requested by the LLM before execution. See MCP security guidance.
Setting up Neon MCP Server in Cline
Prerequisites
Make sure you have:
- Cline extension and Setup:
- Download and install the Cline VS Code extension from the VS Code Marketplace.
- Set up Cline by following the Getting Started guide which involves obtaining an OpenRouter API key to work with Cline.
- A Neon Account and Project: You'll need a Neon account and a project. You can create a new Neon project in the Neon Console
- Neon API Key (for Local MCP server): After signing up, get your Neon API Key from the Neon console. This API key is needed to authenticate your application with Neon. For instructions, see Manage API keys.
Neon API Key Security
Keep your Neon API key secure, and never share it publicly. It provides access to your Neon projects.
- Node.js (>= v18) and npm: Ensure Node.js (version 18 or later) and npm are installed. Download them from nodejs.org.
Option 1: Setting up the remote hosted Neon MCP Server
note
By default, the Remote MCP Server connects to your personal Neon account. To connect to an organization's account, you must authenticate with an API key. For more information, see API key-based authentication.
-
Open Cline by clicking the Cline icon in the VS Code sidebar.
-
In the Cline navigation bar, select the MCP Servers icon.

-
Click Remote Servers to add a new remote MCP server.
-
Fill out the form with the following details:
- Name:
Neon - URL:
https://mcp.neon.tech/mcp - Transport Type: Streamable HTTP

- Name:
-
Click Add Server to register the Neon MCP server.
-
Cline will prompt you to authenticate with Neon via OAuth. Click Authenticate.
-
A browser window will open asking you to sign in to your Neon account and authorize Cline to access your Neon projects.

-
Once authentication is complete, Cline will display a confirmation message, and Neon will appear under your list of available MCP servers.
Option 2: Setting up the Local Neon MCP Server
This method runs the Neon MCP server locally on your machine, using a Neon API key for authentication.
-
Open Cline by clicking the Cline icon in the VS Code sidebar.
-
In the Cline navigation bar, select the MCP Servers icon.

-
Click Configure to open the MCP server settings.

-
This opens
cline_mcp_settings.json. -
Paste the following JSON configuration into it. Replace
<YOUR_NEON_API_KEY>with your Neon API key:{ "mcpServers": { "neon": { "command": "npx", "args": ["-y", "@neondatabase/mcp-server-neon", "start", "<YOUR_NEON_API_KEY>"] } } } -
Save the
cline_mcp_settings.jsonfile. -
You should see a notification in VS Code that says: "MCP servers updated".

-
Cline is now configured to use the local Neon MCP server. You should see neon listed under available MCP servers.
Verifying the Integration
The Neon MCP server will appear in the Cline MCP Servers Installed section.

For a full list of available tools, see available tools in the Neon MCP Server overview.
Development Workflow: Adding a Column with Cline and Neon MCP
Here's an example interaction adding a created_at column to a table:
User: in my neon project id: fancy-bush-59303206, list all my tables
Cline: I need to list all tables in the specified Neon project. Since I have access to the Neon MCP server, I can use the get_database_tables tool to accomplish this task. The tool requires:
> projectId - which the user provided: "fancy-bush-59303206"
> databaseName - which I can default to "neondb" as it's the standard default database name in Neon
> Cline wants to use a tool on the neon MCP server: get_database_tables
> Your Neon project (fancy-bush-59303206) has 1 table in the public schema:
> - playing_with_neon (Base Table)
User: can you show me first 5 rows in it?
Cline: I'll use the run_sql tool to execute a SELECT statement that retrieves the first 5 rows from the playing_with_neon table. I'll use LIMIT 5 to ensure we only get the first 5 rows.
> Cline wants to use a tool on the neon MCP server: run_sql
> I have successfully retrieved the first 5 rows from the playing_with_neon table. I'll present this data in a clear, formatted way.
> | id | name | value |
> |----|------------|-----------|
> | 1 | c4ca4238a0 | 0.857180 |
> | 2 | c81e728d9d | 0.416151 |
> | 3 | eccbc87e4b | 0.440935 |
> | 4 | a87ff679a2 | 0.438505 |
> | 5 | e4da3b7fbb | 0.686455 |
User: can you add a created_at column, use a temporary branch
Cline: I'll use the prepare_database_migration tool to add a created_at column to the playing_with_neon table. This tool will automatically create a temporary branch for safety. After the migration is prepared, I'll need to verify it before completing it.
> Cline wants to use a tool on the neon MCP server: prepare_database_migration
> Let me verify the migration by checking the table structure in the temporary branch. I'll use run_sql to describe the table and ensure the created_at column was added correctly.
> Cline wants to use a tool on the neon MCP server: run_sql
> The created_at column has been successfully added to the table in the temporary branch with the correct data type and default value. Let me verify the data by selecting a few rows to ensure everything looks correct.
> Cline wants to use a tool on the neon MCP server: run_sql
> The migration looks good - the created_at column has been added successfully and is populated with timestamps. Now I can complete the migration to apply these changes to the production branch.
> Cline wants to use a tool on the neon MCP server: complete_database_migration
> The migration has been successfully completed and the temporary branch has been deleted. Let me verify the changes in the production branch and show the updated table structure.
> Cline wants to use a tool on the neon MCP server: run_sql
> The migration has been successfully completed. The created_at column has been added to the table and is populated with timestamps.You can verify the changes in your Neon Console or by querying the database directly.

note
While the Neon MCP server allows you to use all of Neon's functionalities, you can also use a generic Postgres MCP server to connect to Neon.
Resources
Need help?
Join our Discord Server to ask questions or see what others are doing with Neon. For paid plan support options, see Support.








