What it does
Ad platforms keep your numbers in their own dashboards, and exporting them by hand goes stale the day after. With Supabase connected, MCP Ads reads daily campaign performance from every Google Ads and Meta ad account you have connected and upserts it into one table in your database. It is the same data the assistant reports on, through the same connection, so the numbers in SQL match the numbers in chat.
- One row per campaign per day per ad account, for Google Ads and Meta Ads
- Spend, impressions, clicks, conversions and conversion value, in the account currency
- Runs once a day; each run rewrites the last 3 days so late-attributed conversions are picked up
- The first sync backfills the last 14 days
- Idempotent: rows are upserted on (date, platform, account_id, campaign_id), never duplicated
- Read-only towards your ad accounts. The only thing it writes is this one table in your database
Connect your project
Open the MCP Ads dashboard, go to Connections and choose Supabase. There are two ways in; both end in the same daily sync.
- Sign in with Supabase
Click Sign in with Supabase and approve MCP Ads for your organization. If your login can reach more than one project, the tile asks which project to write to. MCP Ads uses the Supabase Management API to run its SQL, so no database password is shared.
- Or paste a connection string
In your Supabase project, click Connect and choose the Session pooler connection string (host aws-0-<region>.pooler.supabase.com, port 5432) and fill in your database password. The Direct connection string (db.<ref>.supabase.co) only accepts IPv6 unless your project has the IPv4 add-on, so MCP Ads cannot reach it. MCP Ads only accepts Supabase hosts, requires TLS, and checks the string by creating the table before saving anything. It is stored encrypted.
- Connect your ad accounts
Connect Google Ads and Meta Ads in the same Connections page if you have not already. Every account those logins can reach is synced; untick an account under its login to leave it out.
- Sync now, or wait for tonight
The tile has a Sync now button for the first run. After that, the sync runs on its own once a day and the tile shows when it last ran and how many rows it wrote.
The table
Created on the first sync if it does not exist, in its own mcp_ads schema so it never collides with your tables. Row Level Security is enabled with no policies, so the table is not readable through the Data API until you choose to expose it; the postgres and service roles read it as usual.
create table mcp_ads.campaign_daily (
"date" date not null,
platform text not null, -- 'google_ads' | 'meta_ads'
account_id text not null, -- Google customer id / Meta act_...
account_name text,
campaign_id text not null,
campaign_name text,
spend numeric not null default 0, -- account currency
impressions bigint not null default 0,
clicks bigint not null default 0,
conversions numeric not null default 0,
conversion_value numeric not null default 0,
currency text, -- ISO code, e.g. USD
synced_at timestamptz not null default current_timestamp,
primary key ("date", platform, account_id, campaign_id)
);| Column | Google Ads | Meta Ads |
|---|---|---|
| spend | cost (micros converted) | spend |
| conversions | conversions (the account's primary conversion actions) | Meta's conversions field, or purchases + leads |
| conversion_value | conversions value | purchase value |
| currency | account currency | ad account currency |
Example queries
Run these in the Supabase SQL editor, or point any Postgres-speaking BI tool at your project.
select platform, account_name, campaign_name,
sum(spend) as spend,
sum(clicks) as clicks
from mcp_ads.campaign_daily
where "date" >= current_date - 30
group by 1, 2, 3
having sum(conversions) = 0 and sum(spend) > 0
order by spend desc;Cost per conversion by platform, week over week
select date_trunc('week', "date")::date as week,
platform,
sum(spend) as spend,
sum(conversions) as conversions,
round(sum(spend) / nullif(sum(conversions), 0), 2) as cpa
from mcp_ads.campaign_daily
where "date" >= current_date - 56
group by 1, 2
order by 1 desc, 2;Join ad spend to your own signups
The reason to have ad data in your own database: put it next to the numbers only you have. This assumes a public.profiles table with a created_at column; swap in your own.
with spend as (
select "date", sum(spend) as spend
from mcp_ads.campaign_daily
where "date" >= current_date - 30
group by 1
), signups as (
select created_at::date as "date", count(*) as signups
from public.profiles
where created_at >= current_date - 30
group by 1
)
select s."date", s.spend, coalesce(u.signups, 0) as signups,
round(s.spend / nullif(u.signups, 0), 2) as cost_per_signup
from spend s left join signups u using ("date")
order by s."date" desc;Security and data handling
MCP Ads only creates the mcp_ads schema and writes to mcp_ads.campaign_daily. It never reads, changes or deletes anything else in your database. Credentials (OAuth tokens or the connection string) are encrypted at rest. Disconnecting deletes them from MCP Ads; the table and its rows stay in your database, and you can drop them whenever you like. If you connected with Sign in with Supabase, also remove MCP Ads under your Supabase organization settings, OAuth Apps, Authorized apps, to end its access on the Supabase side.
Troubleshooting
- The connection string is rejected as not a Supabase database: MCP Ads only connects to *.supabase.co and *.supabase.com hosts. Copy the string from the project's Connect panel rather than a custom domain or proxy.
- Could not connect to the database: you probably pasted the Direct connection string. It only accepts IPv6; copy the Session pooler string from Connect instead.
- The string cannot be read: if your database password contains characters like @, [ or /, percent-encode them (@ becomes %40), or reset the password to one without them.
- Permission denied for schema mcp_ads: the login in the string cannot create schemas. Use the postgres user from the Connect panel; the table is created and owned by that login.
- The tile says incomplete: there were more ad accounts than fit in one run. What was read is written, and the next hourly run reads the rest.
- The tile says partial: one ad account failed (usually a Google or Meta login that needs reconnecting); the rest were written. The tile shows which account and why.
- Numbers differ slightly from the ad platform for the last day or two: platforms keep attributing conversions to past days. Each run rewrites the last 3 days, so the table catches up.