Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Neon MCP connector

OAuth 2.1/DCR DatabasesDeveloper ToolsAI

Connect to Neon MCP. Manage Neon serverless Postgres databases, projects, branches, and queries from your AI workflows.

Neon MCP connector

  1. Terminal window
    npm install @scalekit-sdk/node

    Full SDK reference: Node.js | Python

  2. Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. quickstart.ts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENV_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'neonmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Neon MCP:', link)
    process.stdout.write('Press Enter after authorizing...')
    await new Promise(r => process.stdin.once('data', r))
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'neonmcp_list_branch_computes',
    toolInput: {},
    })
    console.log(result)

Connect this agent connector to let your agent:

  • Search records — Search across all organizations, projects, and branches by keyword, returning matching items with IDs and URLs
  • Run sql transaction, sql — Execute multiple SQL statements as a single transaction against a Neon database
  • Parent reset from — Reset a branch to its parent branch state, discarding all changes made on the branch
  • Api provision neon data — Provision the Neon Data API for HTTP-based access to a Postgres database with JWT authentication
  • Auth provision neon, configure neon — Provision Neon Auth for a branch, enabling managed authentication backed by Better Auth
  • Query prepare, complete — Start a query tuning session by analyzing execution plans and suggesting optimizations on a temporary branch

Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.

neonmcp_compare_database_schema # Compare the database schema between two branches to identify differences in tables, columns, and constraints. 3 params

Compare the database schema between two branches to identify differences in tables, columns, and constraints.

Name Type Required Description
branchId string required The ID of the branch. Leave blank to use the default branch.
databaseName string required The name of the database. Defaults to `neondb` if not provided.
projectId string required The ID of the Neon project.
neonmcp_complete_database_migration # Apply a database migration to the main branch and clean up the temporary migration branch. 7 params

Apply a database migration to the main branch and clean up the temporary migration branch.

Name Type Required Description
databaseName string required The name of the database. Defaults to `neondb` if not provided.
migrationId string required The migration ID returned by `prepare_database_migration`.
migrationSql string required The SQL DDL statement(s) to apply as a migration.
parentBranchId string required The ID of the parent branch to apply the migration to.
projectId string required The ID of the Neon project.
temporaryBranchId string required The ID of the temporary branch created during the prepare step.
applyChanges boolean optional Set to `true` to apply changes, `false` to discard and only clean up.
neonmcp_complete_query_tuning # Finish a query tuning session by applying or discarding changes from the temporary tuning branch. 9 params

Finish a query tuning session by applying or discarding changes from the temporary tuning branch.

Name Type Required Description
databaseName string required The name of the database. Defaults to `neondb` if not provided.
projectId string required The ID of the Neon project.
suggestedSqlStatements array required The DDL statements suggested by `prepare_query_tuning` (e.g. CREATE INDEX).
temporaryBranchId string required The ID of the temporary branch created during the prepare step.
tuningId string required The tuning ID returned by `prepare_query_tuning`. Not the branch ID.
applyChanges boolean optional Set to `true` to apply changes, `false` to discard and only clean up.
branchId string optional The ID of the branch. Leave blank to use the default branch.
roleName string optional The name of the role to connect with. If you have used a specific role in prepare_query_tuning you MUST pass the same role again to this tool. If not provided, the default role (usually "neondb_owner") will be used.
shouldDeleteTemporaryBranch boolean optional Set to `true` to delete the temporary branch after tuning. Default is `true`.
neonmcp_configure_neon_auth # Configure Neon Auth settings for a branch by specifying the desired operation. 5 params

Configure Neon Auth settings for a branch by specifying the desired operation.

Name Type Required Description
branchId string required The ID of the branch to configure Neon Auth for.
operation string required The configuration operation to perform on Neon Auth.
projectId string required The ID of the Neon project.
allowLocalhost boolean optional Whether to allow localhost as a trusted origin. Used with set_allow_localhost operation.
trusted_origin string optional The origin URL to add or remove from trusted origins. Required for add_trusted_origin and remove_trusted_origin operations.
neonmcp_create_branch # Create a new branch in a Neon project for isolated development or testing. 3 params

Create a new branch in a Neon project for isolated development or testing.

Name Type Required Description
projectId string required The ID of the Neon project.
branchName string optional An optional name for the new branch.
parentId string optional An optional branch ID (e.g. 'br-...') to branch from. If omitted, the branch is created from the project's default branch. Use this to fork an existing non-default branch — for example, to make an isolated copy of a dev/staging branch for experimentation.
neonmcp_create_project # Create a new Neon project with a default database and branch, returning the connection string. 2 params

Create a new Neon project with a default database and branch, returning the connection string.

Name Type Required Description
name string optional An optional name for the new project.
org_id string optional The organization ID to associate the project with.
neonmcp_delete_branch # Permanently delete a branch and all its data from a Neon project. 2 params

Permanently delete a branch and all its data from a Neon project.

Name Type Required Description
branchId string required The ID of the branch. Leave blank to use the default branch.
projectId string required The ID of the Neon project.
neonmcp_delete_project # Permanently delete a Neon project and all its branches and data. 1 param

Permanently delete a Neon project and all its branches and data.

Name Type Required Description
projectId string required The ID of the Neon project.
neonmcp_describe_branch # Get a tree view of all objects in a branch including databases, schemas, tables, views, and functions. 3 params

Get a tree view of all objects in a branch including databases, schemas, tables, views, and functions.

Name Type Required Description
branchId string required The ID of the branch. Leave blank to use the default branch.
projectId string required The ID of the Neon project.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_describe_project # Get details and configuration of a specific Neon project by its ID. 1 param

Get details and configuration of a specific Neon project by its ID.

Name Type Required Description
projectId string required The ID of the Neon project.
neonmcp_describe_table_schema # Get column definitions, data types, and constraints for a specific table in a Neon database. 4 params

Get column definitions, data types, and constraints for a specific table in a Neon database.

Name Type Required Description
projectId string required The ID of the Neon project.
tableName string required The name of the table
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_explain_sql_statement # Analyze the query execution plan for a SQL statement using EXPLAIN ANALYZE. 5 params

Analyze the query execution plan for a SQL statement using EXPLAIN ANALYZE.

Name Type Required Description
projectId string required The ID of the Neon project.
sql string required The SQL statement to execute.
analyze boolean optional Set to `true` to include ANALYZE in EXPLAIN. Default is `true`.
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_fetch # Fetch detailed information about a specific organization, project, or branch using its ID. 1 param

Fetch detailed information about a specific organization, project, or branch using its ID.

Name Type Required Description
id string required The entity ID returned by the `search` tool.
neonmcp_get_connection_string # Get a PostgreSQL connection string for a Neon database, resolving project, branch, and database automatically. 5 params

Get a PostgreSQL connection string for a Neon database, resolving project, branch, and database automatically.

Name Type Required Description
projectId string required The ID of the Neon project.
branchId string optional The ID of the branch. Leave blank to use the default branch.
computeId string optional The ID of the compute endpoint. Defaults to the branch's read-write compute if not provided.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
roleName string optional The database role to connect with. Defaults to `neondb_owner` if not provided.
neonmcp_get_database_tables # List all tables in a Neon database on a specific branch. 3 params

List all tables in a Neon database on a specific branch.

Name Type Required Description
projectId string required The ID of the Neon project.
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_get_doc_resource # Fetch a specific Neon documentation page as markdown content by its URL. 1 param

Fetch a specific Neon documentation page as markdown content by its URL.

Name Type Required Description
slug string required The docs page slug (path) to fetch, e.g. 'docs/guides/prisma.md'. Slugs use .md file endings matching the URLs in the documentation index. Use the list_docs_resources tool first to discover available slugs.
neonmcp_get_neon_auth_config # Read the full Neon Auth configuration for a specific branch. 2 params

Read the full Neon Auth configuration for a specific branch.

Name Type Required Description
projectId string required The ID of the Neon project.
branchId string optional The ID of the branch. Leave blank to use the default branch.
neonmcp_list_branch_computes # List all compute endpoints for a project or branch. 2 params

List all compute endpoints for a project or branch.

Name Type Required Description
branchId string optional The ID of the branch. Leave blank to use the default branch.
projectId string optional The ID of the Neon project.
neonmcp_list_docs_resources # List all available Neon documentation pages from the Neon docs index. 0 params

List all available Neon documentation pages from the Neon docs index.

neonmcp_list_organizations # List all organizations the current user belongs to, with optional name or ID filter. 1 param

List all organizations the current user belongs to, with optional name or ID filter.

Name Type Required Description
search string optional Filter results by partial name or ID.
neonmcp_list_projects # List Neon projects in your account with optional search and pagination. 4 params

List Neon projects in your account with optional search and pagination.

Name Type Required Description
cursor string optional The cursor value from the previous response for pagination.
limit number optional Maximum number of results to return (1–400). Default is 10.
org_id string optional The organization ID to associate the project with.
search string optional Filter results by partial name or ID.
neonmcp_list_shared_projects # List projects shared with the current user for collaboration. 3 params

List projects shared with the current user for collaboration.

Name Type Required Description
cursor string optional The cursor value from the previous response for pagination.
limit number optional Maximum number of results to return (1–400). Default is 10.
search string optional Filter results by partial name or ID.
neonmcp_list_slow_queries # List slow queries from a Neon database to identify performance bottlenecks. 6 params

List slow queries from a Neon database to identify performance bottlenecks.

Name Type Required Description
projectId string required The ID of the Neon project.
branchId string optional The ID of the branch. Leave blank to use the default branch.
computeId string optional The ID of the compute endpoint. Defaults to the branch's read-write compute if not provided.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
limit number optional Maximum number of results to return (1–400). Default is 10.
minExecutionTime number optional Minimum query execution time in milliseconds to flag as slow. Default is 1000 ms.
neonmcp_prepare_database_migration # Prepare a database schema migration by generating and executing DDL statements on a temporary branch. 3 params

Prepare a database schema migration by generating and executing DDL statements on a temporary branch.

Name Type Required Description
migrationSql string required The SQL DDL statement(s) to apply as a migration.
projectId string required The ID of the Neon project.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_prepare_query_tuning # Start a query tuning session by analyzing execution plans and suggesting optimizations on a temporary branch. 4 params

Start a query tuning session by analyzing execution plans and suggesting optimizations on a temporary branch.

Name Type Required Description
databaseName string required The name of the database. Defaults to `neondb` if not provided.
projectId string required The ID of the Neon project.
sql string required The SQL statement to execute.
roleName string optional The database role to connect with. Defaults to `neondb_owner` if not provided.
neonmcp_provision_neon_auth # Provision Neon Auth for a branch, enabling managed authentication backed by Better Auth. 3 params

Provision Neon Auth for a branch, enabling managed authentication backed by Better Auth.

Name Type Required Description
projectId string required The ID of the Neon project.
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_provision_neon_data_api # Provision the Neon Data API for HTTP-based access to a Postgres database with JWT authentication. 3 params

Provision the Neon Data API for HTTP-based access to a Postgres database with JWT authentication.

Name Type Required Description
projectId string required The ID of the Neon project.
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to neondb if not provided.
neonmcp_reset_from_parent # Reset a branch to its parent branch state, discarding all changes made on the branch. 3 params

Reset a branch to its parent branch state, discarding all changes made on the branch.

Name Type Required Description
branchIdOrName string required The ID or name of the branch to reset.
projectId string required The ID of the Neon project.
preserveUnderName string optional Optional name to preserve the current branch state before resetting.
neonmcp_run_sql # Execute a single SQL statement against a Neon database and return the results. 4 params

Execute a single SQL statement against a Neon database and return the results.

Name Type Required Description
projectId string required The ID of the Neon project.
sql string required The SQL statement to execute.
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.
neonmcp_run_sql_transaction # Execute multiple SQL statements as a single transaction against a Neon database. 4 params

Execute multiple SQL statements as a single transaction against a Neon database.

Name Type Required Description
projectId string required The ID of the Neon project.
sqlStatements array required The SQL statements to execute as a single transaction.
branchId string optional The ID of the branch. Leave blank to use the default branch.
databaseName string optional The name of the database. Defaults to `neondb` if not provided.