• AUDIT
  • INSPECT
  • COMPARE
  • HUMAN

How to manage postgresql roles and schemas with your AI

Connect your AI to Neon and start asking questions about your database structure and user access immediately.

Ask AI about this page

Short answer

How can I use AI to manage my Neon PostgreSQL roles and schemas?

Your AI uses specific inspection tools to pull lists of roles and databases directly from your Neon branches. This lets you audit permissions and verify schema layouts through natural language. You'll see the breakdown of how this works below.

The outcomes.

Where your data lands.

The AI processes your requests through these specific outcomes.

AUDIT

Permission reviews

The AI pulls role data to show you who has access to what. You get a clear view of your security posture without running manual SQL queries.

INSPECT

Schema verification

Check your table structures and database lists across different branches. The AI identifies the exact layout of your current environment.

COMPARE

Branch analysis

Compare the state of different Neon branches. You can spot differences in roles or database counts between production and staging.

HUMAN

Manual changes

The AI only reads data. You still need to use your SQL editor or Neon console to actually create or drop roles and tables.

The workflow

What your AI does when the request arrives.

The AI acts as a read-only observer of your Neon environment.

  1. Identify users

    The AI looks up the existing users and permissions within your instance.

    list_roles
  2. Map databases

    The agent scans the instance to see which databases are currently active.

    list_databases
  3. Analyze structure

    The AI correlates the roles and databases to answer your specific questions about access.

    list_roleslist_databases
  4. Report findings

    The agent presents the raw database information in a readable format for your review.

    list_databases

Try it

Copy these to start.

Use these prompts to begin your audit.

Starting points

These are basic questions. Swap out the database names or role names to match your specific Neon setup.

Neon Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_Wyz38ZBi3SeTs6Rve6ru1Zk6eusbP8f3rO1EXQtp/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Neon capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "neon-serverless-postgresql-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_Wyz38ZBi3SeTs6Rve6ru1Zk6eusbP8f3rO1EXQtp/mcp"
    }
  }
}
Copy into chat04
  • List all the roles in my current Neon database branch.

  • Which databases are available in this instance?

  • Show me all the roles that have access to the production database.

  • Compare the database list in my main branch versus my dev branch.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Neon once, then ask.

Just link your Neon account. Your credentials stay encrypted, and you can immediately start chatting with your database via your preferred AI client.

Connect Neon to your AI

FAQ

Common questions

  • 01

    Can the AI delete my database tables?

    No. The AI only has permission to list roles and databases. It cannot execute write or delete commands.

  • 02

    Can I use this to create new users?

    No. The AI can only inspect existing roles. You must create new users through the Neon console or a SQL client.

  • 03

    Does this work on Neon branches?

    Yes. The AI can inspect the roles and databases on any branch you have connected.

  • 04

    Can the AI see my actual table data?

    No. This specific setup is limited to inspecting roles and the list of databases.

  • 05

    How does the AI access my Neon instance?

    It uses the tools provided in the MCP to call the specific list functions for your instance.

  • More questions about Neon? See everything the Neon Connector can do

Connect Neon to Claude, Cursor, ChatGPT & more