Skip to content
Draft
159 changes: 4 additions & 155 deletions content/docs/ai/neon-mcp-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,166 +58,15 @@ The Neon MCP Server grants powerful database management capabilities through nat

## Other setup options

<Tabs labels={["Remote (OAuth)", "Remote (API Key)", "Local"]}>
### MCP Server Config Generator

<TabItem>
Use this generator to build valid Neon hosted MCP config snippets with supported auth modes, transport, and headers:

Connect to Neon's managed MCP server using OAuth. No API key configuration needed.

```bash
npx add-mcp https://mcp.neon.tech/mcp
```

Or add this to your MCP config file:

```json
{
"mcpServers": {
"neon": {
"type": "http",
"url": "https://mcp.neon.tech/mcp"
}
}
}
```

<Admonition type="tip" title="One-click install for Cursor">
<a href="cursor://anysphere.cursor-deeplink/mcp/install?name=Neon&config=eyJ1cmwiOiJodHRwczovL21jcC5uZW9uLnRlY2gvbWNwIn0%3D"><img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Add Neon MCP server to Cursor" height="32" /></a>
</Admonition>

<Admonition type="tip" title="One-click install for Kiro">
<a href="https://kiro.dev/launch/mcp/add?name=Neon&config=%7B%22url%22%3A%20%22https%3A//mcp.neon.tech/mcp%22%7D"><img src="https://kiro.dev/images/add-to-kiro.svg" alt="Add Neon MCP server to Kiro" height="32" /></a>
</Admonition>

After saving, restart your MCP client. When the OAuth window opens in your browser, review the requested permissions and click **Authorize** to complete the connection.

</TabItem>

<TabItem>

Connect using API key authentication. Useful for remote agents where OAuth isn't available.

**Requires:** [Neon API key](/docs/manage/api-keys)

```bash
npx add-mcp https://mcp.neon.tech/mcp --header "Authorization: Bearer <NEON_API_KEY>"
```

### MCP-only setup (OAuth)

If you only want the MCP server and prefer OAuth, run:

```bash
npx add-mcp https://mcp.neon.tech/mcp
```

The command adds the config to your editor; restart your editor (or enable the MCP server) for it to take effect. When you use the MCP connection, an OAuth window will open in your browser; follow the prompts to authorize. For the recommended quick setup (API key + agent skills), use `npx neonctl@latest init` instead.

<Admonition type="tip" title="Install in a single click for Cursor users">
Click the button below to install the Neon MCP server in Cursor. When prompted, click **Install** within Cursor.

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

</Admonition>

<Admonition type="note">
Use an organization API key to limit access to organization projects only.
</Admonition>

### Manual setup

1. Go to your MCP Client's settings where you configure MCP Servers (this varies by client)
2. Register a new MCP Server. When prompted for the configuration, name the server "Neon" and add the following configuration:

```json
{
"mcpServers": {
"Neon": {
"type": "http",
"url": "https://mcp.neon.tech/mcp"
}
}
}
```

> MCP supports two remote server transports: the deprecated Server-Sent Events (SSE) and the newer, recommended Streamable HTTP. If your LLM client doesn't support Streamable HTTP yet, you can switch the endpoint from `https://mcp.neon.tech/mcp` to `https://mcp.neon.tech/sse` to use SSE instead.

</TabItem>

<TabItem>

Run the MCP server locally on your machine.

**Requires:** Node.js >= v18, [Neon API key](/docs/manage/api-keys)

```bash
npx add-mcp "npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>" --name neon
```

Or add this to your MCP config file:

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

<Admonition type="note" title="Windows users">

Use `cmd` or `wsl` if you encounter issues:

<CodeTabs labels={["Windows", "Windows (WSL)"]}>

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

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

</CodeTabs>

</Admonition>

</TabItem>

</Tabs>
<McpSetupConfigurator />

<MCPTools />

## Troubleshooting
### Troubleshooting

If your client does not use JSON for configuration of MCP servers (such as older versions of Cursor), use this command when prompted:

Expand Down
4 changes: 3 additions & 1 deletion content/docs/shared-content/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The Neon MCP Server provides the following actions, which are exposed as "tools"
- `prepare_database_migration`: Initiates a database migration process. Critically, it creates a temporary branch to apply and test the migration safely before affecting the main branch.
- `complete_database_migration`: Finalizes and applies a prepared database migration to the main branch. This action merges changes from the temporary migration branch and cleans up temporary resources.

**Query performance optimization:**
**SQL querying and optimization:**

- `list_slow_queries`: Identifies performance bottlenecks by finding the slowest queries in a database. Requires the pg_stat_statements extension.
- `explain_sql_statement`: Provides detailed execution plans for SQL queries to help identify performance bottlenecks.
Expand All @@ -57,6 +57,8 @@ The Neon MCP Server provides the following actions, which are exposed as "tools"
- `search`: Searches across organizations, projects, and branches matching a query. Returns IDs, titles, and direct links to the Neon Console.
- `fetch`: Fetches detailed information about a specific organization, project, or branch using an ID (typically from the search tool).

In project-scoped mode, `search` and `fetch` are not available.

**Documentation and resources:**

- `list_docs_resources`: Lists all available Neon documentation pages by fetching the docs index. Returns page URLs and titles that can be fetched individually using the `get_doc_resource` tool.
Expand Down
3 changes: 3 additions & 0 deletions src/components/pages/doc/mcp-setup-configurator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import McpSetupConfigurator from './mcp-setup-configurator';

export default McpSetupConfigurator;
Loading