Bitbucket × Metabase

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.

Heads up: Metabase connects to databases and warehouses — it does not ship a native Bitbucket connector, and a BI warehouse is the wrong home for raw logs and event streams. Sync entities and history — runs, pull requests, stories, flag changes — and leave the raw firehose in Bitbucket.

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.

1 · MCP + CLI route (AI-assisted)

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.

Best for
  • 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
Trade-offs
  • 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
2 · Pipeline route (warehouse-backed)

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.

Best for
  • 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
Trade-offs
  • 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?

For: Eng leads

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)
For: Teams

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)
For: Platform engineers

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)
For: Leadership

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 csv to 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 replace or 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 csv needs 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)
MCPExample MCP client config
{
  "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.

TerminalLoad a Bitbucket CSV with the Metabase CLI
# 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.csv

Can 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.

Prompt for creating a Bitbucket Code Review Overview dashboard
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

TableGrainKey columns
bitbucket_pull_requestsone row per pull requestid, repo_slug, author, state, created_at, first_review_at, merged_at, lines_changed
bitbucket_pr_activityone row per PR event (comment, approval, update)pr_id, event_type, actor, created_at
bitbucket_pipeline_runsone row per Pipelines runid, repo_slug, ref, result, started_at, duration_seconds, trigger

Modeling advice

  • Build a clean pull_requests model 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?

MetricDefinitionNotes
Cycle timePR opened to merged — report medians and p90.Exclude drafts and bots from the headline.
Lead time for changesCommit to running in production — a DORA throughput metric.PR cycle time is the biggest slice of it.
Deployment frequencyProduction deployments per period — a DORA throughput metric.Needs deploy data joined from CI or hosting.
Change failure rateDeployments 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.

PR cycle time by weekPostgreSQL

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;
Review load and latency by reviewerPostgreSQL

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;
Stale open pull requestsPostgreSQL

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;

What are common mistakes when analyzing Bitbucket in Metabase?

Syncing raw logs or event streams into the warehouse.→ Land runs, entities, state changes, and rollups. Raw build logs and evaluation events belong in Bitbucket; the warehouse is for trends and joins.
Counting bot PRs in cycle-time and throughput numbers.→ Dependency bots can dwarf human volume. Keep an is_bot column and exclude them from headline cards.
Using PR count as a productivity score.→ PR volume varies with batching habits, not output. Measure flow — cycle time, review latency, stale work — and trends within a team.
Building dashboards from live MCP lookups only.→ MCP is useful for exploration; durable dashboards need a database-backed model with history.

Related analytics

Related dashboards

Related integrations

FAQ

Does Metabase connect natively to Bitbucket?
No. Metabase reads databases and warehouses. Sync Bitbucket entities and history into a database first, or upload a CSV with the Metabase CLI, then build Metabase models and dashboards on top.
Should Metabase replace Bitbucket's built-in reporting?
No — they answer different questions. Bitbucket's own views are built for operating the tool day to day. Metabase is where you build governed, shareable reporting on top of the same data, and join it with the rest of your delivery stack — issues, deploys, incidents, and business outcomes.
Should bots and draft PRs count in cycle time?
Exclude them from headline numbers. Dependency-update bots can dwarf human PR volume and skew cycle time in either direction. Keep an is_bot flag and a draft flag as explicit columns so the exclusion is visible and reversible.
Can I analyze review quality, not just speed?
Partially. Comment counts, approval-after-changes rates, and reverted-merge rates are computable from synced activity data. They're proxies — pair them with the trend in escaped defects rather than treating any one number as review quality.