Connect ChatGPT to Supabase through MCP
Managed TatNet Supabase has a protected remote MCP endpoint for reading data and running administrative SQL. No SSH tunnel, API Gateway configuration, or direct PostgreSQL connection is required. Русская версия.
Add the server
In ChatGPT on the web, open Plugins → Add → Add custom MCP server. Availability depends on your workspace permissions and ChatGPT security settings.
Use a name such as “TatNet Supabase” and this URL:
https://mcp.tatnet.cloud/supabase/mcp
Choose OAuth. ChatGPT discovers the authorization settings and registers its OAuth client automatically. Do not enter a Studio password, anon key, or service_role key.
The general platform endpoint at /mcp is a separate connection and does not grant Supabase database access.
Select databases and permissions
On the TatNet consent screen, choose your account, explicitly select databases, and allow Read or Write access. Read is selected by default. Future databases are excluded. Apps, VMs, and billing are not included.
- Read: list permitted databases and run queries in a PostgreSQL-enforced read-only transaction.
- Write: additionally run SQL as the database owner, including schema, policy, and data changes. This is not cluster-superuser access.
Read access can include sensitive rows available to the database owner, beyond the permissions of an application user. Query results are sent to your chosen AI service. Select only the databases you need. Write access can make irreversible changes or delete data.
The database detail in TatNet has the same connection instructions. In Studio, open Connect → MCP. Do not expose Studio /api/mcp, pg-meta, or a PostgreSQL port as an alternative.
Run a safe check
In a chat with the new plugin, ask:
Use TatNet Supabase to call list_databases. For the database I selected, call query_database with
SELECT 1 AS ok, current_setting('transaction_read_only') AS read_only. Do not read application tables or change data.
Expect ok = 1 and read_only = on. Only the selected databases should be listed.
| Tool | Purpose |
|---|---|
list_databases | List permitted databases without credentials |
query_database | One row-returning statement in read-only mode |
execute_sql | Run an owner SQL script; requires Write access |
Default limits are 30 seconds and 100 result rows. Clients may request up to 1000 rows and a shorter timeout. query_database rejects multi-statement scripts. Use SQL pagination for larger results.
To check execute_sql without changing tables, use:
BEGIN;
SET LOCAL application_name = 'tatnet-mcp-check';
SELECT current_setting('application_name') AS marker;
ROLLBACK;
Expect marker = tatnet-mcp-check. This changes only a transaction-local session setting; it does not test table mutations. Review administrative SQL before execution. After a timeout, inspect the database before retrying: writes are not retried automatically.
Revoke access
Go to TatNet → API keys → Connected applications, identify the ChatGPT connection by its database and access mode, and disconnect it. The next request is denied and ChatGPT asks to reconnect. Revocation does not undo completed SQL or remove previous responses from the chat.
If database tools are missing, check that the URL ends with /supabase/mcp. SQL access also requires the connection creator’s live account:manage_supabase permission. Resume paused databases in TatNet before querying them.
For scripts and CI, the public API exposes GET /v1/supabase, POST /v1/supabase/{id}/query, and POST /v1/supabase/{id}/sql with the same authorization checks. Native postgres:// access to managed Supabase is not provided.