← back to blog
    Berner SetterwallOctober 14, 20267 min read

    Metabase Is Live in Cogny: Join Your Own CRM Data With Your Ad Leads

    Plenty of companies don't run their customer data in a SaaS CRM. Contacts, signup dates, lead sources and purchases sit in their own PostgreSQL or MySQL database, and the team asks questions of it through Metabase. That works well inside the company. It leaves one gap: the agent that reads your Meta Ads account has no idea what happened to the leads after they arrived.

    Metabase is now a live MCP integration in Cogny, on every plan. Paste your Metabase address and an API key, and the agent can see the databases Metabase is connected to, read their tables and columns, find and run your saved questions, and run read-only SQL. It joins the rows with the data it reads from your ad platforms, in the same conversation.


    TL;DR

    • Metabase is live now, on every Cogny plan, including Free. Connect it from Settings → Cogny Managed MCPs.
    • 10 tools, all read-only: list_databases, list_tables, get_table_metadata, list_collections, list_collection_items, search, get_card, run_card, run_native_query, get_dashboard.
    • Two ways to get rows: run a saved question or model as your team already defined it (run_card), or run one SQL SELECT against a database (run_native_query).
    • Metabase's own permissions apply. The API key belongs to a Metabase group, and that group decides what every tool can see and run.
    • Results return 500 rows by default and at most 2,000 per call, and say when they were cut.
    • Needs Metabase 0.49 or later (the first version with API keys), reachable from the internet over https.

    The question it was built for

    A common setup: Meta lead ads and Google ads bring people to a signup form, the signup lands in the CRM database with a lead source, some of those people join the email list, and some of them buy. Each system knows one part. Meta knows it delivered 400 leads at a cost per lead. The CRM knows which of those emails were already customers, who signed up to the newsletter, and who placed an order three weeks later.

    With Metabase and Meta Ads both connected, you can ask:

    • "Of last month's Meta leads, how many were new to our CRM and how many were contacts we already had?"
    • "How many of the new leads signed up to the email list, and how many of those bought within 30 days of signing up?"
    • "What did each paying customer cost per campaign, compared with Meta's cost per lead?"
    • "Which campaigns mostly bring back people we already have?"

    The agent looks for a saved question that already defines a lead or a customer, because that is the definition your team trusts. If there isn't one, it reads the table and column metadata and writes the SQL itself: leads per week and lead source, new against already known, signup to first purchase. It aggregates in the database and only brings back the grouped rows, then matches them to the ad platform's spend and leads by campaign and UTM source.

    The join works on what your CRM records. If the lead source or UTM campaign is stored on each contact, leads can be traced to campaigns. If it isn't, the agent can still compare totals per week and tells you which leads it could not attribute.

    On Cloud there is also a ready-made scheduled report for this, Ad Leads → CRM Outcomes, which turns the same analysis into a recurring check: new-to-CRM leads per platform, signup-to-purchase rates at 7, 30 and 90 days, and cost per paying customer per campaign.


    What you can do with it

    ToolWhat your agent can do
    list_databasesList the databases connected to your Metabase, and whether the key may run SQL on each
    list_tables, get_table_metadataList a database's tables, then read one table's columns, types, descriptions and foreign keys
    list_collections, list_collection_itemsBrowse the collections that hold your saved questions, models and dashboards
    searchFind saved questions, models, metrics and dashboards by name or description
    get_cardRead a saved question's or model's definition: its SQL or query, parameters and result columns
    run_cardRun a saved question or model, with filter values if it has them, and get the rows back
    run_native_queryRun one read-only SQL query in the database's own dialect and get the rows back
    get_dashboardRead a dashboard's cards, text and filters, with the ids of the questions behind each card

    Rows come back as column names plus rows, compact enough for an agent to reason over and for a report table or chart.


    How to connect it

    You need a Metabase admin for the first three steps.

    1. In Metabase, open Admin → People and create a group, for example Cogny (read-only).
    2. In Admin → Permissions, give that group view access to the collections and databases Cogny should use, and Query builder and native query access on the databases it should run SQL on. Without SQL access, saved questions still run.
    3. Open Admin → Settings → Authentication → API keys, click Create API key, name it "Cogny", choose the group from step 1 and click Create. Copy the key; Metabase shows it only once.
    4. In your Cogny workspace, go to Settings → Cogny Managed MCPs, click Connect on the Metabase card and paste:
      • your Metabase address, for example https://metabase.yourcompany.com (a Metabase Cloud address works too);
      • the API key.

    The key is stored encrypted and only sent to your own Metabase. If your Metabase only accepts known addresses, allow 207.175.17.47: every Cogny connection comes from that address. Delete the key in Metabase, or disconnect in Cogny, at any time.


    Read-only, and how that is enforced

    Every Metabase tool in Cogny reads. None of them creates, changes or deletes anything in Metabase or in your databases.

    • Metabase's permissions come first. The key can only see and query what its group can. Don't put the key in the Administrators group.
    • SQL must be a single SELECT. run_native_query refuses anything that writes, creates tables or locks rows before the query reaches Metabase.
    • For a hard guarantee, use a read-only database user. Metabase connects to your database with the credentials an admin gave it. If that user can only read, nothing sent through Metabase can change data.

    Saved questions run exactly as saved, with the key's permissions.


    What it does not cover yet

    • No tools that create or edit questions, models, dashboards, collections, alerts or subscriptions.
    • No exports, and no more than 2,000 rows per call. Ask for aggregates rather than raw rows.
    • Dashboard filters are not applied to the cards on a dashboard; the agent passes the values to the underlying question instead.
    • Metabase versions before 0.49 have no API keys and can't be connected. A Metabase that is only reachable inside a private network can't be connected either.
    • MongoDB databases can be read through their saved questions, not through SQL.

    The full tool list, with what each tool reads, is on the Metabase tools page. If you need something that isn't there, ask your agent to request it: it can file the request itself from inside Cogny.

    On the Free plan, your own AI client gets 15 MCP calls a month, and the in-app chat runs on the 50 credits every new workspace starts with. Finding the right tables, running the queries and reading the ad account each take a call, so heavier use fits Solo, where MCP calls from your own AI are unmetered.


    Your CRM already knows which leads turned into customers. Connect Metabase from your Cogny dashboard, connect the ad account next to it, and ask which campaigns actually brought you buyers.