- ACCESS
- AUDIT
- STRUCTURE
- HUMAN
Short answer
How can I manage database roles and permissions with my AI?
Your AI uses the Neon MCP to list roles, create new ones, and manage access across different database branches. You can control user permissions by simply telling your agent which roles to create or which branches to target. This breakdown shows how to handle those permissions.
Where every action lands.
Permission outcomes
The AI handles the heavy lifting of role creation and branch inspection.
ACCESS
New user setup
The AI uses create_role to set up specific permissions. You get a new database user ready for work.
AUDIT
Role inventory
Your agent runs list_roles to show you exactly who has what access. You get a clear view of your current security setup.
STRUCTURE
Branch management
The AI uses list_branches to find the right environment. You can then apply permissions to specific database versions.
HUMAN
Security review
The AI identifies the roles, but you decide if the permissions are correct. You maintain final control over sensitive access.
The workflow
What your AI does when the request arrives.
Your AI translates your plain English commands into direct database operations.
Identify the environment
The AI checks your existing Neon setup to find the specific branch you want to modify.
list_branchesAudit current access
It pulls a list of all existing roles to ensure there are no naming conflicts.
list_rolesProvision new roles
The agent creates the requested user or role with the specific permissions you asked for.
create_roleInitialize new databases
If you need a fresh environment for a new user, the AI can spin up a new database.
create_database
Try it
Copy these to start.
Use these prompts to kick off your first task.
Starting points
Swap out the branch names and role titles with your actual Neon identifiers.
Neon Connector
You're all set. Choose your MCP client and follow the setup instructions.
https://edge.vinkius.com/vk_preview_e3C6GSP7rcg3FCPCbSglmhApwE4Mzt5VNYrUY3zB/mcpClaude Desktop
Follow the steps below to connect in seconds.
- 1In Claude Desktop, open Settings → Connectors.
- 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
- 3Click Add and start a new chat — Neon capabilities are ready to use.
{
"mcpServers": {
"neon-mcp": {
"url": "https://edge.vinkius.com/vk_preview_e3C6GSP7rcg3FCPCbSglmhApwE4Mzt5VNYrUY3zB/mcp"
}
}
}List all the branches in my Neon project.
Create a new role named 'readonly_user' for my development branch.
Show me all the current roles in my database.
Create a new database for my testing environment.
Claude
ChatGPT
Cursor
VS Code
Windsurf
Claude Code
JetBrains
Cline
Start here
Connect Neon once, then ask.
One connection gives your AI client direct access to your Neon environment. Your credentials stay encrypted and secure on our side.
Connect Neon to your AIFAQ
How this task behaves
- 01
Can the AI delete existing database roles?
No. The current tools only allow for listing and creating roles.
- 02
Will the AI change my existing database schemas?
No. The AI can create new databases or roles, but it cannot modify existing table structures.
- 03
How does the AI know which branch to use?
It uses the list_branches tool to see your available branches and then targets the one you specify in your prompt.
- 04
Can I use this with any AI client?
Yes, as long as you are using an MCP-compatible client like Claude, Cursor, or Windsurf.
- 05
Does the AI handle the actual SQL execution?
The AI uses specific tools to perform these actions directly through the Neon API.
More questions about Neon? The Connector page answers them. See everything the Neon Connector can do
Connect Neon to Claude, Cursor, ChatGPT & more
