> Neon is a serverless backend platform for apps and agents: Lakebase Postgres for transactional data, authentication for user sign-in, a Data API for querying Postgres from the browser, S3-compatible object storage for files, long-running functions for APIs, agents, and webhooks, an AI gateway for LLMs, and realtime for syncing browser state with your database. Every service branches with your data for dev, test, and preview. Pricing: https://neon.com/pricing.md. Plans and limits: https://neon.com/docs/introduction/plans.md.
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

# Get started with Cline and Neon MCP Server

Make schema changes with natural language using Cline and Neon MCP Server

Last updated: 2026-11-22

This guide shows how to use [Cline](https://cline.bot) with the [Neon MCP Server](https://github.com/neondatabase/mcp-server-neon) to manage your Neon databases.

**Important: 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](https://neon.com/docs/ai/neon-mcp-server#mcp-security-guidance).

## Setting up Neon MCP Server in Cline

### Prerequisites

Make sure you have:

1. **Cline extension and setup:**
   - Download and install the Cline VS Code extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev).
   - Set up Cline by following the [Getting Started guide](https://docs.cline.bot/getting-started/getting-started-new-coders#setting-up-openrouter-api-key) which involves obtaining an [OpenRouter API key](https://openrouter.ai) to work with Cline.
2. **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](https://console.neon.tech).
3. **Neon API key (for API key authentication):** After signing up, get your Neon API key from the [Neon Console](https://console.neon.tech/app/settings/profile). Cline uses this key to authenticate with Neon. For instructions, see [Manage API keys](https://neon.com/docs/manage/api-keys).

   **Warning: Neon API key security**

   Keep your Neon API key secure, and never share it publicly. It provides access to your Neon projects.
4. **Node.js (>= v18) and npm:** Make sure Node.js (version 18 or later) and npm are installed. Download them from [nodejs.org](https://nodejs.org).

### Option 1: OAuth authentication

**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](https://neon.com/docs/ai/neon-mcp-server#config-generator).

1. Open Cline by clicking the **Cline** icon in the VS Code sidebar.

2. In the Cline navigation bar, select the **MCP Servers** icon.
   ![Cline MCP Servers Icon](https://neon.com/docs/guides/cline-mcp-servers-icon.png)

3. Click **Remote Servers** to add a new remote MCP server.

4. Fill out the form with the following details:

   - **Name:** `Neon`
   - **URL:** `https://mcp.neon.tech/mcp`
   - **Transport Type:** Streamable HTTP

   ![Cline Add Remote MCP Server](https://neon.com/docs/guides/cline-add-remote-mcp-server.png)

5. Click **Add Server** to register the Neon MCP server.

6. Cline prompts you to authenticate with Neon via OAuth. Click **Authenticate**.

7. A browser window will open asking you to sign in to your Neon account and authorize Cline to access your Neon projects.
   ![Neon OAuth window](https://neon.com/docs/guides/neon-oauth-window.png)

8. Once authentication is complete, Cline displays a confirmation message, and **Neon** appears under your list of available MCP servers.

### Option 2: API key authentication

This method uses the hosted Neon MCP Server with a Neon API key.

1. Open Cline by clicking the **Cline** icon in the VS Code sidebar.

2. In the Cline navigation bar, select the **MCP Servers** icon.
   ![Cline MCP Servers Icon](https://neon.com/docs/guides/cline-mcp-servers-icon.png)

3. Click **Configure** to open the MCP server settings.
   ![Cline MCP Server Configure](https://neon.com/docs/guides/cline-mcp-server-configure.png)

4. This opens `cline_mcp_settings.json`.

5. Paste the following JSON configuration into it. Replace `<YOUR_NEON_API_KEY>` with your Neon API key:

   ```json
   {
     "mcpServers": {
       "neon": {
         "type": "streamableHttp",
         "url": "https://mcp.neon.tech/mcp",
         "headers": {
           "Authorization": "Bearer <YOUR_NEON_API_KEY>"
         }
       }
     }
   }
   ```

6. **Save** the `cline_mcp_settings.json` file.

7. You should see a notification in VS Code that says: "MCP servers updated".
   ![Cline MCP Server Updated](https://neon.com/docs/guides/cline-mcp-config-update.png)

8. Cline is now configured to use the hosted Neon MCP Server. You should see **neon** listed under available MCP servers.

### Verify the integration

The Neon MCP Server appears in the **Installed** section of Cline's MCP Servers view.

![Cline Available MCP Tools](https://neon.com/docs/guides/cline-available-mcp-tools.png)

For a full list of available tools, see [available tools](https://neon.com/docs/ai/neon-mcp-server#available-tools) in the Neon MCP Server overview.

## Development workflow: add a column with Cline and Neon MCP

Here's an example interaction adding a `created_at` column to a table:

```text
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.

![Neon Console with added column](https://neon.com/docs/guides/neon-cursor-mcp-added-column.png)

**Note:** The Neon MCP Server exposes Neon-specific tools such as branching and migrations, but you can also use a [generic Postgres MCP server](https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres) to connect to Neon.

## Resources

- [MCP Protocol](https://modelcontextprotocol.org)
- [Cline documentation](https://docs.cline.bot)
- [Neon Docs](https://neon.com/docs)
- [Neon API keys](https://neon.com/docs/manage/api-keys#creating-api-keys)
- [Neon MCP server GitHub](https://github.com/neondatabase/mcp-server-neon)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/guides/cline-mcp-neon"}` to https://feedback.neon.tech/ (no auth required).
