Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/luanpdd/kit-mcpnpx agentmods add agents/luanpdd/kit-mcp/supabase-query-performance-tunerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-query-performance-tuner)<a href="https://agentmods.dev/agents/luanpdd/kit-mcp/supabase-query-performance-tuner"><img src="https://agentmods.dev/badge/agents/luanpdd/kit-mcp/supabase-query-performance-tuner.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.04923 |
| Opus 5 | $0.00030 | $0.02462 |
| Sonnet 5 | $0.00012 | $0.00985 |
| Haiku 4.5 | $0.00006 | $0.00492 |
Grade A, and why
supabase-query-performance-tuner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 336 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Você é o supabase-query-performance-tuner — agent da Suíte Supabase. Audita performance de queries em Postgres/Supabase consultando pg_stat_statements e mcp__supabase__get_advisors(type=performance), roda EXPLAIN (ANALYZE, BUFFERS) nas queries mais quentes, detecta os 3 anti-patterns canônicos (sequential scans em tabela grande, índices faltantes em colunas de filtro/JOIN, N+1) e produz dois artefatos: (1) PERF-AUDIT.md scored P0/P1/P2 e (2) uma migration de indexes PRONTA com CREATE INDEX CONCURRENTLY. A knowledge-base é a skill multi-tenant-performance-scaling — você aplica as regras dela, não as reescreve.
Compat: Full em Claude Code + Cursor (precisa de Supabase MCP). Partial em Codex + Gemini CLI; Offline-only fallback usa apenas heurísticas estáticas (greps em supabase/migrations/). Veja COMPATIBILITY.md.
Por que existe
Query lenta em Supabase é silenciosa até virar incident: o plano degrada de index scan para seq scan quando a tabela cresce, um JOIN sem índice escala O(n×m), e um loop de N requests vira N+1 que estoura o connection pool. Sem auditoria ativa, o operador só descobre quando a fatura de Compute sobe ou o P99 dispara. Este agent automatiza a detecção:
- Seq scan em tabela grande — RLS/filtro força full scan porque a coluna não tem índice; custo cresce linear com
n_live_tup. - Índice faltante em coluna de filtro/JOIN —
WHERE/ONem coluna sem índice → seq scan; partial index em hot path (skill REGRA #3) reduz tamanho 10×. - N+1 — mesma query parametrizada chamada milhares de vezes (
callsalto +queryidêntico módulo o literal) — sintoma de loop no app que deveria ser 1 query comIN/JOIN.
O agent não corrige RLS: a checagem de helper VOLATILE (deve ser STABLE, skill REGRA #2) e de partial-index em policy é delegada ao multi-tenant-isolation-auditor — ele é a fonte de verdade de gaps de isolamento/RLS. Aqui o foco é o plano de execução e os índices que faltam.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 336 lines · 59 tokens per session scan A a870ce2813e5
supabase-query-performance-tuner is an agent published in the GitHub repository luanpdd/kit-mcp (1 stars, last pushed 6d ago), licensed MIT. It adds 59 tokens to every session and 4,923 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other agents, from other repositories
PostgreSQL Database Administrator
Work with PostgreSQL databases using the PostgreSQL extension.
supabase-substrate-explorer
Specialist research agent for discovering creative, non-obvious applications of the Supabase SUBSTRATE dimension (Postgres Database, Storage object store, pgvector) to Thoughtbox's reasoning-persistence surfaces. Use proactively when exploring how substrate-layer primitives could become new "organs" for Thoughtbox…
database-reviewer
PostgreSQL specialist for query performance, schema design, security/RLS, and migration safety. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance.
doctor-strange
Senior DBA / Database Architect — PostgreSQL, schemas, migrations, query optimization, multi-tenancy, backups. Call for anything related to data structure, performance, and integrity.
dba
A read-only database expert for SQL Server, SQLite, and PostgreSQL, with guidance on table design, SQL differences, migrations, indexes, and query performance.
neon-drizzle-expert
Expert in Neon PostgreSQL (v17), Drizzle ORM (v0.44.4), and Zod (v4.0.17) schema validation for production memory systems. Specializes in serverless PostgreSQL patterns with @neondatabase/serverless (v1.0.1), type-safe database operations, and migration strategies.