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
cd ~/work/company-app
supa-mcp link --account company --project-ref abcd1234
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-add, /supa-link, /supa-status, /supa-list, and /supa-unlink.

Reference

Commands

The CLI is supa-mcp. Run supa-mcp doctor anytime to check dependencies, PATH, and the current directory.

CommandPurpose
account add <name>Store a Personal Access Token in the Keychain (hidden prompt).
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).
link --account <n> --project-ref <ref>Write ./.mcp.json for this directory. --write to allow writes.
statusShow and live-verify this directory's binding.
unlinkRemove the server from ./.mcp.json.
doctorCheck dependencies and current-directory status.
Security

Built so a token never leaks

🔐
Keychain onlyTokens live in the macOS login Keychain (service supa-mcp), encrypted at rest and viewable in Keychain Access.app.
📄
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.
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.