drafty
CircleCI logo

Build a CircleCI build-health dashboard with Claude

Connect the CircleCI MCP server to Claude, ask for a pipeline dashboard from your live runs — build success rate, duration, flaky tests — and publish it to a link your team comments on directly. No BI tool, no screenshots pasted into Slack.

What you'll build
A self-contained build-health dashboard — pipeline success rate, average build duration with a trend, slowest workflows, flaky tests, and recent pipeline runs — generated by Claude from your real CircleCI data, then published to a drafty.im/canvas/… link. Your team clicks the exact tile or number they want changed and leaves a note. Claude reads the comments and ships a revised version to the same URL.

This is an end-to-end example: connect a data source over MCP, generate a dashboard from live numbers, and close the review loop on one link. Total time, start to shared link, is under fifteen minutes. The same shape works for any of the other examples — only the connection step changes.

Here's the finished dashboard, published to a canvas — click any tile or number to leave a comment, exactly as your team would:

Live canvas — comment on any elementOpen ↗

The three moving parts

  1. The CircleCI MCP server gives Claude read access to your CircleCI org — pipeline status, job test results, build failure logs, flaky tests, usage metrics — through a controlled set of tools. You authorize it with a personal API token.
  2. Claude pulls the numbers and writes a single self-contained HTML dashboard. You iterate on it in the artifact panel until it's right.
  3. Drafty turns that HTML into a stable link your team reviews. Comments pin to the exact element; Claude ships the fix to the same URL.

The generation step is fast now. The part this example is really about is the third one — getting the dashboard in front of people without losing their feedback to a screenshot circled in Preview.

Step 1 — Connect the CircleCI MCP server

CircleCI ships an official MCP server you run locally over npx. It authenticates with a personal API token, which you create once in your CircleCI account.

First, create a read-scoped personal API token at app.circleci.com/settings/user/tokens.

In Claude Code:

claude
claude mcp add circleci-mcp-server -e CIRCLECI_TOKEN=your-circleci-token -- npx -y @circleci/mcp-server-circleci@latest

Replace your-circleci-token with the token you just created, then run /mcp inside Claude Code to confirm the server connected.

In Claude Desktop: open Settings → Developer → Edit Config, and add circleci-mcp-server with command npx, args ["-y", "@circleci/mcp-server-circleci@latest"], and CIRCLECI_TOKEN in env.

Safety first
Use a personal API token, and treat it like a read credential — this dashboard only reads pipeline and test data. Never commit the token to a repo or paste it into a shared config; keep it in the env block of your local MCP config. The dashboard has no reason to trigger or rerun pipelines.

Step 2 — Pull the numbers

Ask Claude in plain language. It uses the MCP server's read tools (get_latest_pipeline_status, get_job_test_results, find_flaky_tests, download_usage_api_data, list_followed_projects) to fetch real data:

claude
Using the CircleCI MCP server, pull everything we need for a build-health dashboard for our main project on the default branch: pipeline success rate over the last 30 days, average build duration with the week-over-week trend, the slowest workflows by mean duration, the top flaky tests, total credits used this month, and the 10 most recent pipeline runs with their status and duration. Summarize the figures before you build anything.

Claude calls CircleCI, returns the figures, and you sanity-check them against the CircleCI dashboard before going further. This is the moment to catch a wrong assumption — the wrong branch, a project you don't own, a status filter that excludes canceled runs — while it's cheap.

Step 3 — Build the dashboard

Once the numbers look right, ask for the artifact:

claude
Build a single self-contained HTML dashboard from those figures. Pipeline success rate as the hero number with its trend, then tiles for average build duration, total runs, and flaky test count. A duration trend line, a slowest-workflows list, and a recent-pipelines table at the bottom with status and duration. Clean, no external dependencies — inline the CSS and any chart code.

Claude renders it live in the artifact panel. Iterate in place — you're not regenerating from scratch:

Step 4 — Publish to Drafty for review

A Claude artifact link is a preview, not a stable URL — iterate the artifact and the link you already sent now shows the old version. Ask Claude to publish it to a Drafty canvas instead, so the link you share always stays current:

claude
Publish this dashboard to Drafty as a canvas and give me the shareable link.

Claude pushes the dashboard and hands back a drafty.im/canvas/… link that renders on any device. Send it — your team opens it in a browser, no login and no Claude account needed.

Step 5 — The review loop

This is the part that's not obvious until you've done it once.

A reviewer clicks the specific tile, chart, or number they want changed and leaves a pinned comment — "this duration looks low, is it excluding the queued time?" The comment is anchored to that element, not floating in a Slack thread. Claude reads the comments through the CLI, reruns the relevant CircleCI query if needed, and pushes a revised dashboard to the same URL. The reviewer refreshes and sees the change; the thread stays attached to the element.

The mechanic matters because of what it removes. A Slack message about a chart produces "the number on the left looks wrong." A pinned comment on the actual tile produces "this — measure wall-clock duration including queue time, not just execution." One of those produces a correct revision; the other produces a guess.

Keeping it fresh

An MCP-generated dashboard is a snapshot — it holds the numbers Claude pulled when it built it; it doesn't re-query CircleCI when someone opens the link. For a weekly build-health review or a sprint retro snapshot, that's fine.

To make it a live canvas that always shows the latest builds, copy this prompt — Claude sets up the refresh for you and schedules it to run on its own:

claude
Turn this CircleCI dashboard into a live canvas: every morning, re-pull the latest pipeline status, durations, and flaky tests from CircleCI via the MCP server, rebuild the dashboard, and push a new version to the same canvas URL so the link always shows the latest build health. Schedule it to run daily on its own.

The link stays stable while the content updates underneath it — see keeping a canvas updated automatically.

What to watch for

CircleCI dashboard with Claude — FAQ

Do I need to paste my CircleCI token anywhere?
You create a personal API token at app.circleci.com/settings/user/tokens and pass it to the MCP server through the CIRCLECI_TOKEN environment variable in your local config — never commit it to a repo or a shared file. The token authenticates the read tools; treat it like any read credential.
Is the dashboard live or a snapshot?
A snapshot. It contains the numbers Claude pulled when it built the file; it does not re-query CircleCI when someone opens the link. To refresh it, ask Claude to repull and re-push to the same URL — or put that on a daily schedule so the stable link always shows current build health.
Can my team comment without a CircleCI or Claude account?
Yes. The dashboard is published to a Drafty canvas link that renders in any browser. Reviewers click the exact element they want changed and leave a pinned comment with no login required. Only the person connecting CircleCI needs access to the account.
Is it safe to give Claude access to my CircleCI org?
Connect with a personal API token and use the read tools only — a build-health dashboard never needs to rerun or roll back a pipeline. Every tool call is mediated by the MCP server, and in Claude you approve actions. If you want a hard guarantee against writes, use a token scoped to a user without deploy permissions.
How is this different from CircleCI Insights?
Insights is CircleCI's built-in reporting on duration, success rate, and flakiness — the right place for governed, always-on metrics inside the product. This approach is for a fast, shareable snapshot you can spin up in minutes, shape by talking to Claude, and collect feedback on inline. Different jobs: one is a standing system, the other is a quick reviewable deliverable.