supabase-schema-mcp
Provides deep schema introspection for Supabase/Postgres databases, allowing exploration of tables, columns, views, enums, RLS policies, functions/RPCs, foreign keys, indexes, and triggers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@supabase-schema-mcp list all tables with their columns"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
supabase-schema-mcp

An MCP server that provides deep schema introspection for Supabase/Postgres. I built it because the official Supabase MCP focuses on project overview, branches, and API usage; it does not expose the kind of schema detail needed for migrations, RLS audits, relationship graphs, or RPC/trigger discovery.
Why this exists (limitations of Supabase’s MCP)
The official Supabase MCP is great for project-level and API workflows. It does not, however, give tools or agents fine-grained access to your database schema: tables, columns, views, enums, RLS policies, functions/RPCs, foreign keys, indexes, and triggers. If you want an AI or tool to reason about your schema (e.g. “which tables have RLS?”, “what does this RPC look like?”, “what FKs reference this table?”), you either run custom SQL yourself or use something that introspects the DB. This server fills that gap by connecting directly to your Supabase Postgres and exposing schema-only, read-only tools.
Related MCP server: Self-Hosted Supabase MCP Server
What this one does that Supabase’s doesn’t
Schema introspection only: tables, columns, views, enums, RLS policies (and coverage), functions (including RPC candidates), foreign keys, indexes, triggers.
No project/API scope: no branches, no API calls; just database structure. Use the official MCP for project management; use this one when you need schema metadata.
Read-only: designed for introspection only; no writes or DDL. Suited to a read-only Postgres role.
Full tool list and parameters are in Tools reference.
Setup
Clone the repo. All commands below must be run from the repo root (the directory that contains
pyproject.tomlandsrc/).Create a virtual environment and install dependencies with uv:
uv sync --extra devCopy
.env.exampleto.envand set your Supabase Postgres connection:Required:
SUPABASE_DB_HOST(e.g.db.<project_ref>.supabase.co),SUPABASE_DB_USER(usuallypostgres),SUPABASE_DB_PASSWORD(from Project Settings > Database)Optional:
SUPABASE_DB_PORT,SUPABASE_DB_NAME
From the repo root, run the MCP server over stdio:
uv run python -m supabase_schema_mcp.serverOr use the script entry point:
uv run supabase-schema-mcp
Adding as an MCP in Cursor
Open Cursor Settings (e.g. Cursor > Settings or
Cmd+,).Search for MCP or open Features > MCP.
Add this server via the JSON config. Edit
~/.cursor/mcp.json(or your project's.cursor/mcp.json) and add asupabase-schema-mcpentry undermcpServers. ReplacePATH_TO_SUPABASE_SCHEMA_MCPwith the full path to the repo root (the folder that containspyproject.tomlandsrc/):{ "mcpServers": { "supabase-schema-mcp": { "command": "uv", "args": [ "--directory", "PATH_TO_SUPABASE_SCHEMA_MCP", "run", "python", "-m", "supabase_schema_mcp.server" ] } } }Example with a real path (macOS):
{ "mcpServers": { "supabase-schema-mcp": { "command": "uv", "args": [ "--directory", "/Users/you/Developer/supabase-mcp", "run", "python", "-m", "supabase_schema_mcp.server" ] } } }Restart Cursor (MCP servers load at startup). When the server starts, you should see on stderr:
supabase-schema-mcp server started (stdio). Any config warnings appear in a yellow panel above that.You do not need to run the server in a terminal yourself. Cursor starts and manages the process when it needs to call the tools.
Read-only safety model
This MCP server is designed to read schema and metadata only. It does not execute arbitrary writes or DDL. Database access should use a read-only Postgres role where possible; the connection layer enforces that only introspection-style, read-only operations are performed. Management API usage is limited to reading project/config data as needed. Never put a role with write or DDL privileges into this server's configuration unless you explicitly require it for a future feature.
Available Tools
13 toolsfunctions_get_definitionB
Return the full source code (CREATE FUNCTION) of an RPC/function by name.
Inputs: schema_name (required), function_name (required). Returns: result
functions_listA
List Postgres functions (signature, return type). schema_name='all' for all.
Inputs: schema_name. Returns: result
functions_list_rpc_candidatesC
List Supabase RPC-callable function candidates. schema_name='all' for all.
Inputs: schema_name. Returns: result
relationships_list_foreign_keysA
List foreign keys (from/to table and columns). schema_name='all' for all.
Inputs: schema_name. Returns: result
relationships_list_indexesA
List indexes (table, index, columns). schema_name='all' for all schemas.
Inputs: table_name, schema_name. Returns: result
rls_get_policyA
Return the definition (USING and WITH CHECK code) of an RLS policy by name.
Inputs: table_name (required), policy_name (required), schema_name (required). Returns: result
rls_list_coverageA
Report tables with RLS enabled and policy counts. schema_name='all' for all.
Inputs: schema_name. Returns: result
rls_list_policiesA
List RLS policies (table, policy, command). schema_name='all' for all schemas.
Inputs: schema_name. Returns: result
schema_list_columnsA
List columns for tables in the schema. Optionally restrict to one table.
Inputs: table_name, schema_name. Returns: result
schema_list_enumsA
List custom enum types. Use schema_name='all' for all user schemas.
Inputs: schema_name. Returns: result
schema_list_tablesA
List tables in the schema (default: public). Use schema_name='all' for all.
Inputs: schema_name. Returns: result
schema_list_viewsA
List views in the given schema. Use schema_name='all' for all user schemas.
Inputs: schema_name. Returns: result
triggers_listA
List triggers (table, trigger, timing, event). schema_name='all' for all.
Inputs: table_name, schema_name. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool is prefixed by a distinct resource domain (schema, rls, functions, relationships, triggers) and then an action (list/get). Even functions_list vs functions_list_rpc_candidates are clearly distinguished by the 'rpc_candidates' modifier. No two tools target the same resource+action combination.
All tools use snake_case with a consistent <domain>_<action>_<object> pattern, e.g., schema_list_tables, rls_get_policy, relationships_list_indexes. There are no mixed conventions or irregular verbs.
13 tools is well-scoped for a schema introspection server, covering major Postgres object types (tables, columns, views, enums, RLS, functions, relationships, triggers) without being excessive. Each tool earns its place.
The server provides strong coverage of listing and detail operations for the main schema objects. Minor gaps include no explicit list-schemas tool and no full table/view DDL definitions, but these can be worked around using schema_name='all' and existing list tools.
Related MCP Connectors
MCP server for interacting with the Supabase platform
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
Hosted PostgreSQL MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects to Supabase PostgreSQL databases, exposing table schemas as resources and providing tools for data analysis through SQL queries.1MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables interaction with self-hosted Supabase instances, allowing developers to query database schemas, manage migrations, inspect statistics, and interact with Supabase features directly from MCP-compatible development environments.211ISC
- AlicenseNot gradedqualityDmaintenanceAn open-source MCP server for PostgreSQL schema introspection and guarded read-only queries. It enables MCP clients to discover schemas, tables, columns, indexes, relationships, and safe queryable data from a configured PostgreSQL database.11 npmMIT
- AlicenseNot gradedqualityFmaintenanceMCP server for self-hosted Supabase with RLS-aware PostgreSQL and PostgREST layers, enabling safe database introspection, SQL queries, and PostgREST access via natural language.MIT