Learn how Neon simplifies HIPAA compliance and scaling for multi-tenant SaaS

Connect MCP Clients to Neon

Learn how to connect MCP clients such as Cursor, Claude Desktop, Cline, and Windsurf to your Neon Postgres database.

The Neon MCP Server allows you to connect various Model Context Protocol (MCP) compatible AI tools to your Neon Postgres databases. This guide provides instructions for connecting popular MCP clients to the Neon MCP Server, enabling natural language interaction with your Neon projects.

This guide covers the setup for the following MCP Clients:

By connecting these tools to the Neon MCP Server, you can manage your Neon projects, databases, and schemas using natural language commands within the MCP client interface.

Prerequisites

Before you begin, ensure you have:

  • Neon Account and API Key: You need a Neon account and a Neon API key. Create an API key in your Neon Console. See Neon API Keys documentation for details.
  • Node.js (>= v18.0.0) and npm: Ensure Node.js version 18 or later and npm are installed. Download them from nodejs.org.

Claude Desktop

  1. Open your terminal.

  2. Run the following command:

    npx -y @smithery/cli install neon --client claude

    Enter your Neon API key when prompted.

  3. Restart Claude Desktop.

For more, see Get started with Neon MCP server with Claude Desktop.

Cursor

  1. Open Cursor and go to Cursor Settings. (Navbar -> Cursor Settings)
  2. Navigate to MCP Servers.
  3. Click "+ Add new MCP server".
  4. In the "Add MCP Server" modal:
    • Name: Neon (or any descriptive name)
    • Choose command for type
    • Command:
      npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>`
      (Replace <YOUR_NEON_API_KEY> with your Neon API key)
    • Click Add.

For more, see Get started with Cursor and Neon Postgres MCP Server.

Windsurf (Codeium)

  1. Open your terminal.

  2. Run the following command:

    npx -y @smithery/cli install neon --client windsurf

    Enter your Neon API key when prompted.

  3. You can also manually configure Windsurf by editing the mcp_config.json file by adding the following within the mcpServers section at ~/.codeium/windsurf/mcp_config.json:

    "neon": {
      "command": "npx",
      "args": ["-y", "@neondatabase/mcp-server-neon", "start", "<YOUR_NEON_API_KEY>"]
    }

    Replace <YOUR_NEON_API_KEY> with your Neon API key.

  4. Click the Refresh button in Cascade to load the new MCP server.

For more, see Get started with Windsurf and Neon Postgres MCP Server.

Cline (VS Code Extension)

  1. Open Cline in VS Code (Sidebar -> Cline icon).

  2. Click "Configure MCP Servers" in the Cline panel. This opens cline_mcp_settings.json.

  3. Edit cline_mcp_settings.json, adding the following within the mcpServers section and replacing <YOUR_NEON_API_KEY> with your Neon API Key:

    "neon": {
      "command": "npx",
      "args": ["-y", "@neondatabase/mcp-server-neon", "start", "<YOUR_NEON_API_KEY>"]
    }
  4. Save cline_mcp_settings.json.

For more, see Get started with Cline and Neon Postgres MCP Server.

Any other MCP client

You can connect other MCP clients to the Neon MCP Server by running the following command in your terminal:

npx -y @smithery/cli install neon --client <client_name>

Replace <client_name> with the name of your MCP client application. Supported client names include:

For MCP clients not listed here, you can manually configure them by adding the following Neon MCP Server configuration to their respective mcp_config file within the mcpServers section:

"neon": {
  "command": "npx",
  "args": ["-y", "@neondatabase/mcp-server-neon", "start", "<YOUR_NEON_API_KEY>"]
}

Replace <YOUR_NEON_API_KEY> with your Neon API key.

note

After successful configuration, you should see the Neon MCP Server listed as active in your MCP client's settings or tool list. You can enter "List my Neon projects" in the MCP client to see your Neon projects and verify the connection.

Next Steps

Once connected, you can start interacting with your Neon Postgres databases using natural language commands within your chosen MCP client. Explore the Supported Actions (Tools) of the Neon MCP Server to understand the available functionalities.

Resources

Need help?

Join our Discord Server to ask questions or see what others are doing with Neon. Users on paid plans can open a support ticket from the console. For more details, see Getting Support.

Last updated on

Was this page helpful?