Build a Grafana observability dashboard with Claude
Connect the official Grafana MCP server to Claude, ask for an observability rollup from your live metrics, and publish it to a link your team comments on directly — no screenshots pasted into Slack.
drafty.im/canvas/… link. Your team clicks the exact panel 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:
The three moving parts
- The Grafana MCP server gives Claude read access to your Grafana instance — dashboards, datasources, and the metrics and logs behind them (Prometheus, Loki), plus alert and incident state — through a controlled set of tools. You approve what it can touch.
- Claude pulls the numbers and writes a single self-contained HTML dashboard. You iterate on it in the artifact panel until it's right.
- 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 rollup in front of people without losing their feedback to a screenshot circled in Preview.
Step 1 — Connect the Grafana MCP server
Grafana ships an official MCP server, mcp-grafana. It runs locally and talks to your instance with a service account token, so you authorize it once with a scoped credential rather than handing over a login.
First create the token: in Grafana, go to Administration → Users and access → Service accounts, add a service account with a Viewer role, and generate a token. Viewer is read access only — exactly what a reporting dashboard needs.
Then add it to Claude Code. The --disable-write flag is the read-only switch — it strips every mutating tool (dashboard edits, alert-rule changes, incident creation) so the connection can only read:
That uses uvx to fetch and run the server — no separate install if you have uv. Point GRAFANA_URL at your own instance (http://localhost:3000 for a local Grafana, https://YOUR-INSTANCE.grafana.net for Grafana Cloud). Then run /mcp inside Claude Code to confirm the server connected.
In Claude Desktop: open Settings → Developer → Edit Config and add the same grafana entry — command: uvx, args: ["mcp-grafana", "--disable-write"], and the two env values — then restart Claude Desktop.
--disable-write — a dashboard never needs to change anything in Grafana. The service account token is a secret: keep it in the MCP config Claude manages, never paste it into a file you commit. The dashboard only reads; it has no reason to hold write permissions.Step 2 — Pull the numbers
Ask Claude in plain language. It uses the MCP server's read tools to query your datasources (Prometheus, Loki) and read your alert state:
Claude queries Grafana, returns the figures, and you sanity-check them against the Grafana dashboards you already trust before going further. This is the moment to catch a wrong assumption — the wrong PromQL window, a label filter that drops a service, a rate over the wrong interval — while it's cheap.
Step 3 — Build the dashboard
Once the numbers look right, ask for the artifact:
Claude renders it live in the artifact panel. Iterate in place — you're not regenerating from scratch:
- "Make error rate the biggest tile and color it red above 1%."
- "Add a stacked latency sparkline showing p95 vs p99."
- "Sort the alerts table by severity, criticals first."
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 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 error rate looks low, is it excluding the checkout service?" The comment is anchored to that element, not floating in a Slack thread. Claude reads the comments through the CLI, reruns the relevant Grafana 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 — exclude the staging cluster from the error rate." 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 Grafana when someone opens the link. For a weekly review or an incident postmortem snapshot, that's fine.
To make it a live canvas that always shows current figures, copy this prompt — Claude sets up the refresh for you and schedules it to run on its own:
The link stays stable while the content updates underneath it — see keeping a canvas updated automatically.
What to watch for
- Read-only, always. An observability rollup needs read access and nothing more. Scope the service account to Viewer and pass
--disable-write. - Check the figures before you share. The MCP returns exactly what you ask for — if your latency query uses the wrong percentile or your error-rate filter misses a service, the dashboard will confidently show the wrong number. Reconcile against your Grafana dashboards once.
- The link is the deliverable, not the artifact. Share the Drafty URL, not the Claude artifact preview — that's the one you can update in place.
Grafana dashboard with Claude — FAQ
- Do I need to paste a Grafana password anywhere?
- No. The Grafana MCP server authenticates with a service account token, not your login. Create a service account with a Viewer role, generate a token, and put it in the MCP config Claude manages. Never commit the token to a repo, and don't grant it more than Viewer for a reporting dashboard.
- 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 Grafana 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 numbers.
- Can my team comment without a Grafana 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 Grafana needs access to the instance.
- Is it safe to give Claude access to my Grafana instance?
- Connect with a Viewer-scoped service account token and pass the --disable-write flag, which removes every mutating tool. A rollup never needs more than read access. Every tool call is mediated by the MCP server, and in Claude you approve actions. Don't grant Editor or Admin for a read-only reporting task.
- How is this different from a Grafana dashboard I build in the UI?
- A native Grafana dashboard queries live data against panels you maintain — the right choice for the standing operational view your on-call team watches. This approach is for a fast, shareable rollup you can spin up in minutes and iterate by talking to Claude, then collect feedback on inline. Different jobs: one is your always-on system of record, the other is a quick reviewable deliverable for a meeting or a postmortem.