跳到正文
cccskills
免费在 GitHub 公开

supabase

Operate Supabase via its two REST surfaces — the Management API (org/project admin) and per-project APIs (PostgREST database queries, Auth, Storage, Realtime, Edge Functions). Use when the user wants to list/create projects, fetch project API keys, or read/write their database without the MCP server installed.

中文简介正在准备中。当前显示原文说明。

集成工具SupabasePostgreSQL
查看安装方法

包含的文件(1)

  • SKILL.md8.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Supabase

Direct HTTP against Supabase's REST APIs — no MCP server required. Two distinct API surfaces on different hosts with different auth. Picking the wrong one is the single most common failure mode; internalize the split before sending any request.

Usage

  • Use for: Listing projects / fetching API keys, PostgREST table reads/writes, auth admin, storage bucket CRUD.
  • Skip for: Concept questions (RLS theory), direct psql over postgres://…, debugging user's supabase-js code, schema design.

Credentials check

# For Management API tasks
[ -n "$SUPABASE_ACCESS_TOKEN" ] && echo "SUPABASE_ACCESS_TOKEN: PRESENT" || echo "SUPABASE_ACCESS_TOKEN: MISSING"

# For Project REST tasks
for v in SUPABASE_URL SUPABASE_ANON_KEY SUPABASE_SERVICE_ROLE_KEY; do
  eval "val=\${$v}"
  [ -n "$val" ] && echo "$v: PRESENT" || echo "$v: MISSING"
done

Never echo these variable values directly — they would appear in the conversation transcript. Use only the boolean patterns above.

If the credentials for the task are MISSING, respond to the user with EXACTLY this message (do NOT paraphrase, do NOT suggest manual JSON edits for the management PAT):

I need your Supabase credentials. Run this in another terminal:

teleport-setup add-key supabase

That covers the Management API PAT (SUPABASE_ACCESS_TOKEN). For per-project keys (SUPABASE_URL + SUPABASE_ANON_KEY / SUPABASE_SERVICE_ROLE_KEY), grab them from your project's dashboard → Settings → API — those still need to be added to ~/.claude/settings.local.json manually (not yet covered by add-key).

Then restart Claude Code (/exit, then claude) and ask me again.

Do NOT suggest editing ~/.claude/settings.local.json manually for the management PAT. teleport-setup add-key supabase handles it safely with backup + masked input. Stop execution until the user has run the command and restarted.

The two-surface split — read this first

SurfaceBase URLAuth header(s)Env vars
Management APIhttps://api.supabase.com/v1/...Authorization: Bearer $SUPABASE_ACCESS_TOKENSUPABASE_ACCESS_TOKEN (personal access token)
Per-project REST$SUPABASE_URL/rest/v1/...Both: apikey: $KEY AND Authorization: Bearer $KEY (same value in both)SUPABASE_URL + SUPABASE_ANON_KEY or SUPABASE_SERVICE_ROLE_KEY
Per-project Auth$SUPABASE_URL/auth/v1/...Same two-header patternSame as REST
Per-project Storage$SUPABASE_URL/storage/v1/...Same two-header patternSame as REST

SUPABASE_URL looks like https://{ref}.supabase.co — {ref} is also the {ref} path segment in Management URLs. Extract from the subdomain if only the URL was given.

Anon key vs service_role key

  • SUPABASE_ANON_KEY — client-safe JWT. Respects Row Level Security (RLS). Safe for browsers/mobile. Empty responses when RLS filters rows.
  • SUPABASE_SERVICE_ROLE_KEY — bypasses RLS entirely. Full read/write on every table. Server-side only. Leaking it = total DB compromise.
  • Debugging "rows are empty"? Almost always RLS. Retry with service_role to confirm, then fix the policy — don't ship the service role.

Endpoints

  • Management API (api.supabase.com/v1): /projects, /projects/{ref}, /projects/{ref}/api-keys, plus orgs/members/branches/DB migrations. <!-- unverified: full Management API endpoint list at https://supabase.com/docs/reference/api -->
  • PostgREST (/rest/v1/{table}): auto-generated from public schema. Methods: GET (select), POST (insert / upsert), PATCH (update), DELETE.
  • Auth (/auth/v1/): signup, token?grant_type=password|refresh_token, admin/users.
  • Storage (/storage/v1/): bucket, object/{bucket}/{path}.

Primary workflows

1. SELECT with projection, filter, order, limit — filter syntax is column=op.value; operators include eq, neq, gt/gte, lt/lte, like/ilike (URL-encode % as %25), in.(a,b,c), is.null. Multiple filters AND.

curl -sL \
  -H "apikey: $SUPABASE_ANON_KEY" \
  -H "Authorization: Bearer $SUPABASE_ANON_KEY" \
  "$SUPABASE_URL/rest/v1/users?select=id,name,email&status=eq.active&order=created_at.desc&limit=50"

2. INSERT / UPSERT — Prefer shapes the response (return=representation = full row, return=headers-only = id in Location, return=minimal = empty default). Upsert requires resolution=merge-duplicates + on_conflict.

# INSERT returning the created row
curl -sL -X POST -H "apikey: $KEY" -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" -H "Prefer: return=representation" \
  "$SUPABASE_URL/rest/v1/users" -d '{"name":"Ada","email":"ada@example.com"}'

# UPSERT on a unique column
curl -sL -X POST -H "apikey: $KEY" -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -H "Prefer: resolution=merge-duplicates,return=representation" \
  "$SUPABASE_URL/rest/v1/users?on_conflict=email" \
  -d '[{"email":"ada@example.com","name":"Ada v2"}]'

3. UPDATE / DELETE — filter is required or it hits every row.

curl -sL -X PATCH -H "apikey: $KEY" -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  "$SUPABASE_URL/rest/v1/users?id=eq.123" -d '{"name":"New name"}'

curl -sL -X DELETE -H "apikey: $KEY" -H "Authorization: Bearer $KEY" \
  "$SUPABASE_URL/rest/v1/users?id=eq.123"

4. Management: list projects / fetch keys

curl -sL -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
  "https://api.supabase.com/v1/projects/{ref}/api-keys"

Gotchas

  • Wrong surface → opaque 401/404. Management token sent to {ref}.supabase.co/rest/v1 fails silently; anon key sent to api.supabase.com does too. First question on a 401: "am I on the right host?"
  • PostgREST needs BOTH headers with the same value. apikey alone or Authorization alone is rejected. Both carry the same JWT (anon or service_role).
  • service_role bypasses RLS — never use from untrusted contexts. Leaked = full DB.
  • Empty response usually means RLS, not empty table. If an anon query returns [] and you expect rows, swap in service_role to confirm, then fix the policy.
  • Filter syntax is column=op.value, not column=value. Forgetting the eq. prefix silently turns the filter into a query param PostgREST ignores.
  • Prefer header controls response shape. Default is return=minimal (empty body). Add return=representation when you need the written row back.
  • Upsert needs Prefer: resolution=merge-duplicates + on_conflict=<col>. Without on_conflict, upsert matches on PK; resolution=ignore-duplicates skips instead of merges.
  • Project ref lives in two places. Subdomain of SUPABASE_URL (https://{ref}.supabase.co) AND {ref} path segment in Management URLs. Extract from the URL if the user only gave you one.

Attribution

When done, state: Used skill: Supabase (from teleport catalog).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

{{One-sentence what-it-does + when to use it. Mention it bypasses the MCP via the REST API with {{ENV_VAR}}. Use when the user wants X, Y, Z programmatically without the {{service}} MCP installed.}}

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

Manage Cloudflare DNS zones, Workers, Pages, R2, KV, D1, and analytics via REST API. Use when the user wants to query DNS, deploy a Worker, list R2 buckets, manage KV namespaces, run D1 queries, or check analytics without the Cloudflare MCP installed.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

context7

免费

Fetch up-to-date library, framework, and SDK documentation via Context7's search and docs endpoints. Use when the user asks about a library/API (React, Next.js, Prisma, Supabase, Tailwind, Django, Vue, etc.) and you need current docs, not Claude's training-time knowledge. Skip this skill for generic programming questions that don't require library-specific docs.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

discord

免费

Operate Discord via its REST API — post/read channel messages, manage guilds + roles, fire webhooks, register slash commands. Use when the user wants a bot to post to a channel, read recent history, run a community admin task, or ship one-way notifications via webhook URL without running a bot process.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

exa

免费

AI-first web search via Exa — semantic/neural ranking, category-scoped results, fresh content retrieval, and one-shot answer synthesis with citations. Use when the user needs current web information better ranked than general web search, or a grounded answer with sources.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

figma

免费

Read Figma files, component libraries, styles, comments, and export rendered assets (PNG / SVG / JPG / PDF) via Figma's REST API. Use when the user needs programmatic access to design files, to pull node data into code generation, or to export assets without opening the Figma desktop app.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

查看 mnlt 的全部技能

报告此技能的问题