How to build Strapi dashboards in Metabase
Strapi is an open-source headless CMS that developers self-host on PostgreSQL or MySQL, with a native MCP server since v5.47. Metabase is where you turn that site data into shared, trustworthy dashboards. This guide covers three complementary paths: a direct database connection to the PostgreSQL or MySQL instance Strapi runs on, a lightweight MCP + CLI route that pulls live data with the Strapi MCP server (native) and loads a CSV into Metabase with the Metabase CLI, and a durable pipeline route that syncs Strapi stats into a database so you can build dashboards anyone can read.
How do you connect Strapi to Metabase?
Self-hosters should start with the database route; the MCP + CLI and pipeline routes cover hosted setups and cross-source joins.
Point Metabase at PostgreSQL or MySQL
Self-hosted Strapi keeps every content type in its own table (plus drafts, locales, and relations) in Postgres or MySQL — point Metabase at the database and content operations analytics need no pipeline at all.
- Self-hosted installs where you control the database
- Full history from day one — no sync to schedule
- Content, users, and commerce tables in one place
- Query a read replica, not the production primary
- Internal schemas can change across major upgrades
- Hosted plans without database access need another route
Live data in, quick analysis out
Pair the Strapi MCP server (native) with the Metabase CLI. Use MCP for live lookups, write a scoped result to CSV, then load it into Metabase as a ready-to-query table and model.
- Quick lookups such as "show me entries created and published by content type"
- Loading a Strapi export into Metabase in seconds
- Spot-checks and one-off analyses without a warehouse
- Great for exploration, not governed recurring reporting
- Use read-only or least-privilege credentials — CMS MCP servers often include write tools
- CSV uploads are snapshots — refresh or move to a durable route for history
Durable dashboards with history
Sync Strapi stats and entities into a database or warehouse with a connector, script, or API, then point Metabase at it.
- Strapi reporting that content and commerce teams depend on
- Joining Strapi data with analytics, search, and revenue data
- Long-run trends for entries created and published by content type and draft backlog and time-to-publish
- You own the refresh schedule and the rollup grain
- Platform APIs cap what's exposed — and sometimes how much history
- Hosted-plan rate limits shape how often you can sync
How do you connect Metabase directly to the Strapi database?
Self-hosted Strapi keeps every content type in its own table (plus drafts, locales, and relations) in Postgres or MySQL — point Metabase at the database and content operations analytics need no pipeline at all.
- Add the PostgreSQL or MySQL instance under Admin → Databases in Metabase — use a read-only user, and prefer a read replica for busy production sites.
- Build Metabase models on top of the raw tables (filter out revisions, autosaves, and internal statuses once), and point every question at the models.
- Version-pin your expectations: CMS core upgrades can change internal schemas, so re-check models after major updates.
What can you analyze from Strapi data in Metabase?
- Entries created and published by content type — built from content entries by type and the related draft and published states, locales, admin users and roles data your connection exposes.
- Draft backlog and time-to-publish — built from content entries by type and the related draft and published states, locales, admin users and roles data your connection exposes.
- Localization coverage by locale — built from content entries by type and the related draft and published states, locales, admin users and roles data your connection exposes.
- Editor activity by admin user — built from content entries by type and the related draft and published states, locales, admin users and roles data your connection exposes.
- Media library growth — built from content entries by type and the related draft and published states, locales, admin users and roles data your connection exposes.
Which Strapi dashboards should you build in Metabase?
Content operations
What each content type is producing.
- Entries created by content type by week (stacked bar)
- Published vs. draft entries per type (bar)
- Draft backlog and age (table)
- Time from created to published (bar)
Locale coverage
Which content exists in which languages.
- Entries per locale per content type (table)
- Locale coverage vs. the default locale (bar)
- Entries missing a translation (table)
- Translation lag after the source publishes (bar)
Editor activity
Who maintains the content, and how much.
- Entries created per admin user (bar)
- Updates per entry — churn hotspots (table)
- Active editors per month (line)
- Entries untouched in 6+ months (table)
Media library
What the asset store is holding.
- Media assets added by week (bar)
- Storage size by mime type (bar)
- Largest assets (table)
- Assets by folder (table)
How do you use the Strapi MCP server (native) with the Metabase CLI?
Pair the Strapi MCP server (native) with the Metabase CLI for fast, hands-on analysis. MCP is useful for scoped lookups and summarized exports; the Metabase CLI's upload command loads CSV data into Metabase and creates a ready-to-query table and model.
Example workflow
- Ask the MCP server for a summary of content entries by type for the last 90 days, by status and author.
- Export the result as CSV, keeping stable IDs, statuses, and dates as columns.
- Run
mb upload csvto load it into Metabase as a table and model, then build questions and dashboards on top.
Be honest about the limits
- MCP lookups are excellent for exploration, not scheduled reporting.
- A CSV upload is a snapshot; refresh it with
mb upload replaceor move to a durable route for real history. - The database holds full history already — the CSV route is only a bridge until Metabase can reach Postgres or MySQL directly.
mb upload csvneeds an uploads database configured under Admin → Settings → Uploads.
How do you set up Strapi MCP and the Metabase CLI?
Strapi MCP server (native)native
- Transport
- Built into your Strapi server at /mcp (Streamable HTTP)
- Auth
- Strapi Admin API token as a Bearer token
- Best for
- Live scoped lookup and export
Metabase CLIofficial
- Install
npm install -g @metabase/cli- Auth
mb auth login- Load data
mb upload csv --file data.csv- Requires
- An uploads database (Admin → Settings → Uploads)
{
"mcpServers": {
"strapi": {
"url": "https://your-strapi-host.com/mcp",
"headers": {
"Authorization": "Bearer your-admin-api-token"
}
}
}
}Strapi ships MCP in the core since 5.47 — no plugin to install. Each request is scoped to the token's admin permissions, so a read-only token gives you a read-only server.
# Install the Metabase CLI
npm install -g @metabase/cli
# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com
# Load a content-entries-by-type export — creates a table AND a model
mb upload csv --file strapi-content-entries-by-type.csv --collection root
# Refresh that same table later from a new export
mb upload replace <table-id> --file strapi-content-entries-by-type.csvCan you generate a Strapi dashboard with AI?
Yes. Use the prompt below with any assistant that can run the Strapi MCP server (native) and the Metabase CLI. It works end to end: if Strapi tables already exist in Metabase it analyzes those; otherwise it pulls scoped, summarized data over MCP, loads it with mb upload csv, then builds the dashboard and caveats any metric that needs missing history.
Create a polished Metabase dashboard for Strapi content & site analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.
Goal: Help site and content owners understand content operations across content types — creation and publishing throughput, draft backlog, locale coverage, and editor activity from Strapi data.
Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for strapi tables and
models). If Metabase is already connected to the Strapi database, use those tables directly — that's the best route.
- If nothing is there, pull a scoped, summarized export with the Strapi MCP server (native):
content entries by type, plus draft and published states, locales, admin users and roles.
Write each result to a CSV, then load it with the Metabase CLI — run
"mb upload csv --file <export>.csv" so each upload creates a table and a
ready-to-query model. Use "mb upload replace <table-id> --file <export>.csv"
to refresh an existing table instead of creating duplicates.
Step 2 — Inspect before querying:
Do not assume exact table or column names. Inspect available content types,
statuses, dates, and whether daily history exists before creating trend cards.
Important:
- Build on whatever data is present; don't claim Metabase connects natively to
the Strapi API — it reads a database or CLI-uploaded tables.
- Exclude revisions, autosaves, and test entries from headline content counts.
- Only compute rates (conversion, open rate, paid share) when both numerator
and denominator exist in the data.
- A single CSV is a point-in-time snapshot: only build trend cards if there is
a usable date column or multiple periods have been uploaded.
Dashboard title: Strapi Content & Site Overview
Sections:
1. Executive summary: Entries published this month; Drafts open; Median days
to publish; Active editors.
2. Throughput: Entries created vs. published by week, per content type.
3. Backlog: Open drafts by age and content type; time-to-publish distribution.
4. Localization: Entries per locale; coverage against the largest locale.
5. Editors: Entries per admin user; entries untouched in 6+ months.
Note: Strapi is headless and has no traffic, comments, or order tables — pull
those from the front end's analytics tool if the dashboard needs them.
Filters: Date range, Content type/Collection, Status, Author/Editor.
Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data.How do you sync Strapi data into a database or warehouse?
Self-hosted installs may not need a sync at all — connect Metabase to the database. Sync when you're on a hosted plan, or when Strapi data should land next to analytics and revenue data in a shared warehouse.
Connector options
- Managed ETL — use a connector when one covers the objects you need.
- Custom pipeline — use the Strapi REST API for control over grain, fields, and refresh cadence.
- MCP + CSV — use this for quick exploration and one-off slices.
The dlt verified source for Strapi syncs any content type over the REST API with an API key — handy for Strapi Cloud. Self-hosters usually skip it: the direct database connection exposes every content type as tables immediately.
Notes
- Land raw entity tables first, then build clean Metabase models on top.
- Normalize content type, status, author, created and published dates fields.
- Keep platform stats (views, sessions) separate from measured analytics tools' numbers — definitions differ, and gaps are normal.
How should you model Strapi data in Metabase?
Core tables
| Table | Grain | Key columns |
|---|---|---|
<content_type_tables> | one row per entry per content type (e.g. articles, products) | id, document_id, created_at, updated_at, published_at, locale, created_by_id |
admin_users | one row per admin user | id, firstname, lastname, email, created_at, blocked |
files | one row per media asset | id, name, mime, size, created_at, folder_path |
Modeling advice
- Build a clean
content_activity_dailymodel with consistent columns, so dashboards survive schema changes and plugin swaps. - Filter out revisions, autosaves, drafts-of-drafts, and internal test entries once, in the model — not in every question.
- Normalize URLs (lowercase, no protocol, no trailing slash) so CMS content joins cleanly to analytics and Search Console data.
- Store dates in UTC and convert at display time; CMS installs often run in site-local timezones.
Which Strapi metrics should you track in Metabase?
| Metric | Definition | Notes |
|---|---|---|
| Publishing throughput | Entries published per week, by content type or editor. | Count entries, not draft/published row versions. |
| Time to publish | Created-to-published lag per entry, as a median. | A NULL published_at means still in draft. |
| Organic clicks & impressions | Search performance for the pages this content feeds. | Headless: join on the front end's URL, not the entry ID. |
| Conversion rate | Conversions divided by sessions on content pages. | Needs analytics from whatever front end renders Strapi. |
What SQL powers Strapi dashboards in Metabase?
These run against Strapi's own PostgreSQL or MySQL schema, shown in PostgreSQL dialect — MySQL needs minor changes such as DATE_FORMAT in place of date_trunc.
Each content type is its own table — swap `articles` for yours, or UNION several. Count distinct documents so Strapi v5 draft+published rows do not double-count.
SELECT
date_trunc('week', created_at) AS week,
COUNT(DISTINCT document_id) AS entries_created,
COUNT(DISTINCT document_id) FILTER (
WHERE published_at IS NOT NULL
) AS entries_published
FROM articles
GROUP BY 1
ORDER BY 1;In Strapi, a NULL published_at is the draft. Median beats average for the lag.
SELECT
COUNT(DISTINCT document_id) FILTER (
WHERE published_at IS NULL
) AS drafts_open,
COUNT(DISTINCT document_id) FILTER (
WHERE published_at IS NOT NULL
) AS published,
ROUND(
EXTRACT(EPOCH FROM PERCENTILE_CONT(0.5) WITHIN GROUP (
ORDER BY published_at - created_at
) FILTER (WHERE published_at IS NOT NULL)) / 86400.0, 1
) AS median_days_to_publish
FROM articles;Published documents per locale, against the largest locale.
SELECT
locale,
COUNT(DISTINCT document_id) AS entries,
COUNT(DISTINCT document_id) FILTER (
WHERE published_at IS NOT NULL
) AS published,
ROUND(100.0 * COUNT(DISTINCT document_id) / NULLIF(
MAX(COUNT(DISTINCT document_id)) OVER (), 0
), 1) AS coverage_vs_largest_locale_pct
FROM articles
GROUP BY locale
ORDER BY entries DESC;