Connect Neon to Claude Code
Manage serverless Postgres projects, branches, databases, roles and computes. Add Toolspoke to Claude Code once and it can use 17 Neon actions. Your Neon credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install Neon and connect it
Add Neon to a project in your Toolspoke workspace.
API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API key
- Neon Console → your avatar → Account settings → API keys → Create new API key for a personal key, or Organization settings → API keys for a key that reaches only that organization's projects.
Choose what Claude Code may do
All 17 actions start on. Switch off any of the 7 actions that change something in Neon, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the Neon actions that only read, so they are safe to try first.
- List the Neon projects this key can reach, with their region, Postgres version and default branch
- List the organizations the key's owner belongs to, with the org_id each project listing can be narrowed by
- List a project's branches with their parent, state, size and whether each is the default
- List the Postgres databases on a branch with the role that owns each
What Claude Code can do in Neon
10 actions read, 5 write and 2 delete or permanently change something.
Reads
List projects
List the Neon projects this key can reach, with their region, Postgres version and default branch. Takes no required arguments, which is why an install tests itself with it. A personal key that belongs to several organizations may need org_id to see an organization's projects.
Get project
Read one project's settings, region, Postgres version, compute defaults and storage and compute usage for the current period.
List organizations
List the organizations the key's owner belongs to, with the org_id each project listing can be narrowed by.
List branches
List a project's branches with their parent, state, size and whether each is the default. A branch id (br-…) is what every database, role and restore call takes.
Get branch
Read one branch, including its parent, the point it was branched from, its logical size and its protection state.
List databases
List the Postgres databases on a branch with the role that owns each.
List roles
List the Postgres roles on a branch. Passwords are not returned here.
Get connection uri
Return a ready-to-use postgresql:// connection string for a database and role. The string contains the role's password, so this response is never written to the audit log.
List endpoints
List a project's computes (endpoints) with their branch, host, state (active or idle), size limits and autosuspend setting.
List operations
List a project's recent control-plane operations (branch creation, compute starts, restores) with their status. Use it to see whether a change has finished or why it failed.
Writes
Create branch
Create a branch: an instant copy-on-write copy of its parent's data, so it is cheap and can be deleted afterwards. Forks the project's default branch unless parent_id is given. Adds a read-write compute by default so the branch can be connected to at once; set compute_type to read_only for a replica compute instead.
Create database
Create an empty Postgres database on a branch, owned by an existing role. Reversible by deleting it in the console; nothing existing is changed.
Start endpoint
Start an idle compute. Computes also wake on their own when a connection arrives, so this is for warming one up ahead of traffic.
Suspend endpoint
Suspend a compute now. Open connections are closed; the next connection starts it again.
Restart endpoint
Restart a compute, for example to apply new settings. Open connections are dropped while it restarts.
Deletes or permanently changes
Delete branch
Delete a branch with its databases, roles and computes. Destructive because the branch's data goes with it and a branch that has children cannot be deleted at all. The default branch cannot be deleted.
Restore branch
Restore a branch's data from a source branch, optionally at a point in time. Destructive because it replaces the target branch's current data: set preserve_under_name to keep the old state as a backup branch, otherwise it is gone. Restoring a branch to its own earlier state needs source_lsn or source_timestamp.
Neon in Claude Code: questions
Does Claude Code see my Neon credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in Neon?
Yes. Each of the 17 actions can be switched off for a project. Turn off the 7 that change something and Claude Code can only read.
Will 17 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Neon action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a Neon call does not run in a sandbox, so it bills nothing.
Neon in your other apps
Try Neon in Claude Code
Free to start, and tool calls cost nothing on any plan.