macOS & Linux · Claude Code plugin · MIT open source

The right Supabase project,
in every directory.

Open Claude Code in a project folder and its Supabase MCP connects to exactly that project — on the correct account, read-only by default. No more logging out to switch. Tokens stay encrypted in your OS keychain and never touch disk.

Free & open source · An unofficial community project, not affiliated with Supabase or Anthropic

The problem

One account at a time is not enough

The default Supabase MCP uses OAuth and connects one organization at a time. With a personal account and a company account across several organizations, you end up logging out and back in to switch — and a session open in a company project can still be pointed at your personal database.

Without supa-mcp

Log out, log back in, hope the session is on the right account. One wrong window and you run a query against the wrong database.

With supa-mcp

Each directory is pinned to one project on one account. Open Claude Code there and the correct database connects automatically — verified live.

How it works

Three ideas, no manual switching

🔑

One token per account

A Personal Access Token is per account, not per organization — it reaches every org and project in that account. A personal and a company login are just two tokens.

📌

Pinned per directory

supa-mcp link writes a .mcp.json that pins one project_ref and names its account. Claude Code auto-loads it from the folder it starts in.

🔒

Tokens never on disk

At each connection Claude Code runs supa-mcp headers, which reads the token from the Keychain in memory. Nothing secret is ever written to .mcp.json.

Why supa-mcp

Versus the default Supabase MCP

Default Supabase MCPsupa-mcp
Accounts at onceOne org via OAuthEvery account & org, side by side
Switching projectsLog out, log back inAutomatic — pinned per directory
Wrong-account riskA session can point at the wrong DBLive guard flags a mislinked directory
Token storageOAuth sessionOS keychain, never on disk
Default accessRead-writeRead-only unless you opt in
Config in the repo.mcp.json holds no secret, safe to commit
Get started

Up and running in four steps

Requires jq and curl, plus the OS keychain — security on macOS (built in) or secret-tool (libsecret) on Linux. Install jq with brew install jq or apt install jq.

1

Install the plugin in Claude Code

This adds the CLI, the /supa-* slash commands, and the skill. Then put the CLI on your PATH.

/plugin marketplace add im-shubhamsharma/supabase-mcp
/plugin install supa-mcp@supa-mcp
supa-mcp install
2

Register each account

Create a token at supabase.com/dashboard/account/tokens. The prompt hides your input and stores the token straight into the Keychain — never paste it into a chat.

supa-mcp account add personal
supa-mcp account add company
3

Link a project directory

See what a token can reach, then pin this folder to the right project. Read-only by default — add --write only when you mean it.

# list the orgs & projects this account can see
supa-mcp whoami company

# in your project folder, pin it — by ref, or by name
cd ~/work/company-app
supa-mcp link --account company --project-ref abcd1234
supa-mcp link --account company --project company-app

Or skip steps 2–3 entirely with supa-mcp init — it prompts for an account (if you don't have one) and links the directory in one pass.

4

Open Claude Code there

Start a fresh session in that directory. Accept the workspace-trust prompt and the one-time Keychain prompt (choose Always Allow). The Supabase MCP is now connected to that exact project. Inside Claude Code, drive everything with /supa-init, /supa-add, /supa-link, /supa-switch, /supa-status, /supa-list, /supa-branches, /supa-open, and /supa-unlink.

Reference

Commands

The CLI is supa-mcp. Run supa-mcp doctor anytime to check dependencies, PATH, and the current directory. Project lists are cached ~5 minutes per account — pass --refresh for a live lookup.

CommandPurpose
initGuided setup: add an account (if needed) and link this directory.
account add <name>Store a Personal Access Token in the Keychain (hidden prompt, validated before storing).
account listList registered accounts and whether each token is present.
account remove <name>Delete an account and its token.
whoami <account>Show the orgs and projects a token can see.
projects <account>List an account's projects (name, ref, org).
branches <account> <ref>List a project's Supabase branches.
link --account <n> (--project-ref <ref> | --project <name>)Write ./.mcp.json for this directory. --write to allow writes.
switch (--project-ref <ref> | --project <name> | --branch <name>)Re-point this directory's binding.
statusShow and live-verify this directory's binding.
list --verifyEvery linked directory on this machine, live-checked.
openOpen this directory's project in the Supabase dashboard.
unlinkRemove the server from ./.mcp.json (deletes the file once empty).
export / importMove accounts + links between machines (no secrets).
doctorCheck dependencies, keychain backend, and token health.
Security

Built so a token never leaks

🔐
Keychain onlyTokens live in the OS keychain (macOS Keychain or Linux libsecret, service supa-mcp), encrypted at rest.
📄
Safe to commit.mcp.json holds only a project_ref and a helper command — no secret. The registry, env, and git never hold a token.
👁️
Read-only by defaultNew links pin read_only=true. Writes require an explicit --write at link time.
🛡️
Wrong-account guardsupa-mcp status checks live that the pinned project really belongs to the linked account, so you catch a mislinked directory before running anything.
Validated before it's storedaccount add checks a token against the Supabase API first — an invalid or expired token never lands in the Keychain unless you pass --force.
Open source · MIT

Give every project its own Supabase

Star it, read the source, or open an issue — contributions welcome, including Linux and Windows Keychain backends.