How to build Bitbucket dashboards in Metabase
Bitbucket is Atlassian's Git code-hosting platform, with pull requests, Bitbucket Pipelines CI/CD, and deep Jira integration. Metabase is where you turn that delivery activity into shared, trustworthy dashboards. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live data with the Atlassian Remote MCP Server and loads a CSV into Metabase with the Metabase CLI, and a durable pipeline route that syncs Bitbucket history into a database so you can build dashboards anyone can read.
How do you connect Bitbucket to Metabase?
Most teams combine both routes: use MCP and CLI uploads for a fast first pass, then move recurring delivery reporting to a warehouse-backed model.
Live data in, quick analysis out
Pair the Atlassian Remote MCP Server 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 pr cycle time and review latency"
- Loading a Bitbucket export into Metabase in seconds
- Spot-checks and one-off analyses without a warehouse
- Great for exploration, not governed delivery reporting
- Use read-only or scoped credentials wherever the MCP server supports them
- CSV uploads are snapshots — refresh or move to the pipeline for history
Durable dashboards with history
Sync Bitbucket entities and history into a database or warehouse with a connector, custom pipeline, or the API, then point Metabase at it.
- Bitbucket delivery dashboards leaders depend on
- Joining Bitbucket data with issues, deploys, incidents, or support data
- Long-run trends for pr cycle time and review latency and merge frequency by repository
- You own the refresh schedule and the table grain
- Sync entities and rollups — not raw logs or event firehoses
- Metric definitions must be consistent across teams and repos
What can you analyze from Bitbucket data in Metabase?
Once pull requests and the related repositories, commits, pipeline runs data are in a database, the highest-value views are:
- PR cycle time and review latency — how long pull requests wait from opened to first review to merged.
- Merge frequency by repository — where change actually lands, and which repos have gone quiet.
- Pipelines build health — success rate and duration of Bitbucket Pipelines runs on your busiest repos.
- Review load by reviewer — whether reviews concentrate on a few people, and where the bottleneck is this month.
- Stale PR aging — open pull requests past 14 days, before they rot into abandoned work.
Which Bitbucket dashboards should you build in Metabase?
PR cycle time
How long code waits between ready and merged.
- PR cycle time, median and p90 (line)
- Time to first review (line)
- Cycle time by repository (bar)
- Longest-open PRs (table)
Review load and latency
Whether review capacity matches the inflow.
- Reviews completed per reviewer (bar)
- Median review latency by reviewer (table)
- PRs waiting on review right now (number)
- Review comments per PR (line)
CI on pull requests
Whether checks help or block the merge path.
- Pipeline success rate on PRs (line)
- Median check duration (line)
- Failed checks by pipeline (bar)
- Reruns per PR (table)
Merge throughput
The long-run shipping trend.
- PRs merged per week (bar)
- Merge frequency by repository (table)
- Stale PRs older than 14 days (number)
- Deployments per week where synced (bar)
How do you use the Atlassian Remote MCP Server with the Metabase CLI?
Pair the Atlassian Remote MCP Server 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 recent pull requests with created, first-review, and merged timestamps.
- Export the result as CSV, keeping stable IDs, projects, states, and timestamps.
- 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 the pipeline for real history. - Created, first-review, and merged timestamps are required for PR cycle-time and review-latency metrics.
mb upload csvneeds an uploads database configured under Admin → Settings → Uploads.
How do you set up Bitbucket MCP and the Metabase CLI?
Atlassian Remote MCP Serverofficial
- Transport
- Hosted remote MCP via Streamable HTTP
- Auth
- Atlassian account with an API token (scoped to Bitbucket)
- 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": {
"atlassian": {
"url": "https://mcp.atlassian.com/v1/mcp/authv2"
}
}
}Bitbucket Cloud tools shipped in Atlassian's Remote MCP Server in April 2026. Your Bitbucket workspace must be linked to an Atlassian organization, and Bitbucket tools authenticate with an API token rather than browser OAuth.
# 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 pull-requests export — creates a table AND a model
mb upload csv --file bitbucket-pull-requests.csv --collection root
# Refresh that same table later from a new export
mb upload replace <table-id> --file bitbucket-pull-requests.csvCan you generate a Bitbucket dashboard with AI?
Yes. Use the prompt below with any assistant that can run the Atlassian Remote MCP Server and the Metabase CLI. It works end to end: if Bitbucket 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 Bitbucket code review analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.
Goal: Help engineering leaders understand PR cycle time, review load and latency, CI health on PRs, and merge throughput from Bitbucket data.
Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for bitbucket tables and
models). If durable Bitbucket data is already present — synced from a warehouse
or uploaded earlier — use it and skip to Step 2.
- If nothing is there, pull a scoped, summarized export with the Atlassian Remote MCP Server:
pull requests, plus repositories, commits, pipeline runs.
Prefer entity tables and rollups over raw logs. 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 fields, projects,
branches, states, and timestamps, and whether history exists before creating
duration or trend cards.
Important:
- Build on whatever data is present; don't claim Metabase connects natively to
Bitbucket — it reads a database or CLI-uploaded tables.
- Never try to load raw build logs or event streams into Metabase; use runs,
entities, state changes, and rollups.
- Only compute durations (cycle time, build duration, time to review) when the
required timestamps exist.
- Exclude bot activity, draft work, and non-production environments from
headline numbers, and keep the segmenting column explicit.
- 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: Bitbucket Code Review Overview
Sections:
1. Executive summary: PRs merged last 30 days; Median cycle time; Median time
to first review; Open PRs; Stale PRs.
2. Cycle time: Trend by week; by repository; longest-open PRs.
3. Review: Latency and load by reviewer; PRs waiting on review.
4. CI: Check success rate on PRs; duration; reruns.
5. Throughput: Merges per week by repo; deployments where synced.
Filters: Date range, Project or Repository, Branch or Environment, Team, Status.
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 Bitbucket data into a database or warehouse?
For dashboards that need history and reliability, land Bitbucket entities and change history in a database first, then connect Metabase to that database.
Connector options
- Managed ETL — use a connector when one covers the objects you need.
- Custom pipeline — use the Bitbucket REST API 2.0 for control over fields, grain, and refresh cadence.
- MCP + CSV — use this for quick exploration and one-off slices.
Neither Airbyte nor Fivetran ships a Bitbucket Cloud connector, so the pipeline route is a scripted sync: page through the REST API 2.0 endpoints for pull requests, commits, and pipeline runs on a schedule, land them as tables, or start with CSV exports via the MCP + CLI route.
Notes
- Land raw entity tables first, then build clean Metabase models on top.
- Sync state-change or audit history from day one — duration metrics can't be reconstructed later without it.
- Normalize repository, author, reviewer, created/first-review/merged-timestamp, and change-size fields.
How should you model Bitbucket data in Metabase?
Core tables
| Table | Grain | Key columns |
|---|---|---|
bitbucket_pull_requests | one row per pull request | id, repo_slug, author, state, created_at, first_review_at, merged_at, lines_changed |
bitbucket_pr_activity | one row per PR event (comment, approval, update) | pr_id, event_type, actor, created_at |
bitbucket_pipeline_runs | one row per Pipelines run | id, repo_slug, ref, result, started_at, duration_seconds, trigger |
Modeling advice
- Build a clean
pull_requestsmodel with common columns across tools, so multi-source dashboards don't fork definitions. - Separate entity tables (projects, repos, flags, members) from run-grain and event-grain tables.
- Exclude bots, drafts, and non-production environments from headline metrics; keep the flag as an explicit column.
- Use stable IDs for project, repo, and person joins; display names change.
Which Bitbucket metrics should you track in Metabase?
| Metric | Definition | Notes |
|---|---|---|
| Cycle time | PR opened to merged — report medians and p90. | Exclude drafts and bots from the headline. |
| Lead time for changes | Commit to running in production — a DORA throughput metric. | PR cycle time is the biggest slice of it. |
| Deployment frequency | Production deployments per period — a DORA throughput metric. | Needs deploy data joined from CI or hosting. |
| Change failure rate | Deployments causing failures divided by all deployments. | Attribute failures via rollbacks and error spikes. |
What SQL powers Bitbucket dashboards in Metabase?
These assume a cleaned analytical model in a warehouse (PostgreSQL dialect). Adjust table and column names to match your pipeline.
Median and p90 hours from opened to merged.
SELECT
date_trunc('week', merged_at) AS week,
COUNT(*) AS prs_merged,
percentile_cont(0.5) WITHIN GROUP (
ORDER BY EXTRACT(EPOCH FROM (merged_at - created_at)) / 3600
) AS median_cycle_hours,
percentile_cont(0.9) WITHIN GROUP (
ORDER BY EXTRACT(EPOCH FROM (merged_at - created_at)) / 3600
) AS p90_cycle_hours
FROM pull_requests
WHERE merged_at IS NOT NULL
GROUP BY 1
ORDER BY 1;Whether review capacity matches inflow, trailing 30 days.
SELECT
reviewer,
COUNT(*) AS reviews_completed,
percentile_cont(0.5) WITHIN GROUP (
ORDER BY EXTRACT(EPOCH FROM (reviewed_at - requested_at)) / 3600
) AS median_response_hours
FROM pr_reviews
WHERE reviewed_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY reviewer
ORDER BY reviews_completed DESC;The aging work the cycle-time average hides.
SELECT
repo_slug,
id,
author,
created_at,
EXTRACT(DAY FROM (CURRENT_TIMESTAMP - created_at)) AS days_open
FROM pull_requests
WHERE state = 'open'
AND created_at < CURRENT_DATE - INTERVAL '14 days'
ORDER BY created_at
LIMIT 50;