# Supabase Rls Check

> Supabase Rls Check is an open-source MCP server for databases. Read-only checks for Supabase row-level security, SQL exports and leaked public keys. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/tthanh2k6/supabase-rls-check
- **MCP Registry name:** io.github.Tthanh2k6/supabase-rls-check
- **Categories:** [databases](https://ai-powered.com/categories/databases), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-23

## About

The tool exists because a Supabase app ships an anon or publishable key in browser code, so everything depends on row level security, grants and function permissions. The README lists the usual slips: a public table without RLS, a leftover USING (true) policy, and SECURITY DEFINER functions that PostgreSQL leaves executable by PUBLIC.

The workflow starts with a bundled SQL query you paste into the Supabase SQL Editor. It reads catalog metadata only, never rows, and you export the result. The CLI then normalizes that export, can probe what an anonymous caller can read, and writes an offline HTML report, a Markdown summary and a commented fix.sql wrapped in BEGIN and ROLLBACK that it never runs. A scan-env command looks through local files for service_role keys in client-exposed variables, and a GitHub Action can run the same check in CI.

The MCP mode is deliberately narrower than the CLI. It exposes four local read-only tools and leaves out network probing, so an AI client never handles API keys or makes HTTP requests through it.

## Features

- **Catalog-only SQL export:** A bundled SELECT collects policy and grant metadata without touching application rows.
- **Anonymous exposure probe:** Checks what an unauthenticated caller can read using only a public anon or publishable key.
- **Public env secret scan:** Finds service_role keys, secret keys and database URLs in client-bundled variables and source files, with values masked.
- **Run-to-run diff:** Shows new and resolved findings between two result files and can fail on new ones.
- **Report and fix template:** Writes HTML and Markdown reports plus a rollback-wrapped fix.sql for review.
- **CI action:** Runs the check in a read-only psql session and fails a job at a chosen severity.

## Good for

- Audit RLS before launching a Supabase app
- Catch a service_role key left in NEXT_PUBLIC or VITE variables
- Review AI-generated migrations for missing policies
- Gate pull requests on new high-severity findings
- Understand why a rule such as rls_disabled matters

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add supabase-rls-check -- uvx supabase-rls-check
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add supabase-rls-check -- uvx supabase-rls-check
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.supabase-rls-check]
command = "uvx"
args = ["supabase-rls-check"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user supabase-rls-check uvx -- supabase-rls-check

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 4 tools read data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `analyze_sql_export` (name suggests: reads): Analyze an exported catalog-metadata result file.
- `explain_rule` (name suggests: reads): Explain a rule's rationale, caveats and remediation.
- `scan_public_env`: Scan a local project directory for secrets in public env variables.
- `diff_results`: Compare two result files to show new and resolved findings.

## FAQ

### Does Supabase Rls Check need my database password or service_role key?

No. The README says neither is required, and probe rejects service_role and authenticated tokens before sending a request.

### Does the MCP server make network calls?

No. Network probing is excluded from MCP so AI clients never handle API keys or send HTTP requests through it.

### What Python version is needed?

Python 3.11 or newer, with Supabase on PostgreSQL 15 or newer.

### Can the report be in another language?

Add --lang vi for Vietnamese report text.

### Will Supabase Rls Check apply the fixes?

No. fix.sql is a commented review template that the tool never executes.

### Is Supabase Rls Check free?

Yes. Supabase Rls Check is open source, so you can use and self-host it for free.

### How do I add Supabase Rls Check to Claude Code?

Run this command in your terminal: claude mcp add supabase-rls-check -- uvx supabase-rls-check

### What are the best alternatives to Supabase Rls Check?

The closest alternatives to Supabase Rls Check are REA, AiSOC, x64dbg-mcp-server, redamon and Treasure Map.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [AiSOC](https://ai-powered.com/mcp/aisoc): AiSOC is an open-source MCP server for ai models and llm tooling.
- [x64dbg-mcp-server](https://ai-powered.com/mcp/x64dbg-mcp-server): x64dbg-mcp-server is an open-source MCP server for ai models and llm tooling.
- [redamon](https://ai-powered.com/mcp/redamon): redamon is an open-source MCP server for ai models and llm tooling.
- [Treasure Map](https://ai-powered.com/mcp/treasure-map): Treasure Map is an open-source MCP server for security.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [NostrPulse](https://ai-powered.com/mcp/nostrpulse): NostrPulse is an open-source MCP server for finance and payments.
- [Runeward](https://ai-powered.com/mcp/runeward): Runeward is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/supabase-rls-check
