How to Connect Codex to Grafana (and What It Can't Do)
Yes — Grafana maintains an official MCP server, documented in Grafana’s own developer docs, and Codex connects to it like any other MCP client. Point it at your Grafana instance with a service account token and Codex can search dashboards, query Prometheus and Loki datasources, inspect alert rules, and pull incident context into the session where it’s writing the fix. The other half of the honest answer: Codex only looks at Grafana when you tell it to. An alert firing at 3am, a dashboard trending the wrong way over a week, a morning summary for the team — none of that is what a session-scoped coding agent does.
Here’s the current state, the setup, and where the coding agent hands off.
What Codex can do with Grafana
mcp-grafana is Apache-2.0, built by Grafana Labs, and works against Grafana 9.0+. Connected to Codex, it can:
- Query metrics and logs directly — run PromQL against Prometheus datasources and LogQL against Loki, so “check p99 latency on the checkout service before and after this commit” happens inside the coding session.
- Search and inspect dashboards — find the relevant dashboard, read its panels and queries, and use them as ground truth while debugging.
- Work with alerting — list and inspect alert rules, and see what’s currently firing.
- Pull incident context — tools for Grafana Incident and Sift investigations, plus OnCall, bring the operational picture into the task.
- Run read-only if you want — the
--disable-writeflag blocks all write operations, a sensible default for a coding agent.
For debugging with real production signal instead of guesses, this is the good stuff.
How to set it up
From the Grafana MCP docs:
- Create a service account token in Grafana with the permissions you actually want to grant.
- Run the server — Docker image, released binary, or
uvx mcp-grafana— withGRAFANA_URLandGRAFANA_SERVICE_ACCOUNT_TOKENset. Grafana Cloud users also get hosted MCP options. - Register it in Codex — an entry in
~/.codex/config.toml(or project-scoped.codex/config.toml), STDIO or Streamable HTTP, per the Codex MCP docs.
Codex itself is a surface in the unified ChatGPT desktop app as of July 9, 2026 — every plan, metered against your plan’s usage allowance.
The limits that actually matter
- Dashboards exist because things change while you’re not looking. That’s precisely the case Codex doesn’t cover. It queries Grafana during your session; between sessions, nothing is watching on your behalf.
- Alert rules fire into Grafana’s notifiers, not into Codex. Connecting the MCP server doesn’t route alerts anywhere new. Turning an alert into a ticket, a page, or a Slack thread with the runbook attached is workflow plumbing Codex doesn’t have.
- It’s one engineer’s tool. Service account tokens, TOML config, transport flags. The people who consume dashboards — leads, on-call rotations, founders checking error budgets — never touch this integration.
Codex-plus-Grafana is for “query Loki and find why this endpoint 500s” — not for “when the error-rate alert fires, run the process.”
The always-on layer: Carly
Acting on what Grafana observes — around the clock, without a session — is Carly’s job. Carly is an AI executive assistant that runs trigger- and schedule-based workflows you set up by conversation:
- Tell Carly “when a Grafana alert fires, open a Jira ticket and post the dashboard link and runbook to #on-call in Slack” — plain English; Carly interviews you for specifics and builds it.
- “Every morning at 8, email me overnight Grafana alerts grouped by service” — scheduled, in the cloud, no laptop involved.
- Folds observability into the rest of the day — sends email (Gmail and Outlook), updates tasks, touches the calendar and CRM as steps in the same workflow.
Carly integrates with Grafana natively, and connects to 200+ tools overall — anything without a native connector works through your own API key. AI agents start at $35/month, and steps in a workflow that don’t use AI run free and unlimited.
Codex + Grafana vs Carly
| Codex (Grafana MCP) | Carly | |
|---|---|---|
| Purpose | Pull metrics/logs into coding sessions | Act on Grafana alerts and schedules |
| Setup | Service account token + config.toml | Describe it in plain English |
| Queries Prometheus / Loki | Yes | Yes |
| Reads dashboards & alert rules | Yes | Yes |
| Reacts when an alert fires | No (session-scoped) | Yes, 24/7 |
| Tickets, Slack posts, email | No | Yes |
| Morning digests | No | Yes |
| Built for | Developers | Teams and operators |
| Pricing | ChatGPT plan allowance | AI agents from $35/mo |
Codex-with-Grafana gives a coding agent your observability context. Carly gives your observability an assistant that acts on it.
Frequently Asked Questions
Does OpenAI Codex integrate with Grafana?
Yes, via Grafana’s official MCP server, mcp-grafana. Run it with a Grafana service account token and register it in Codex’s config.toml. Codex can then search dashboards, query Prometheus and Loki, and inspect alert rules and incidents.
Can Codex respond to Grafana alerts?
No. Alerts fire into Grafana’s own notification channels; Codex only sees Grafana during a session you’re running. For “alert fires → ticket + Slack + runbook,” use a trigger-based assistant like Carly.
Is the Grafana MCP server read-only?
By default it includes write tools, but the --disable-write flag runs it fully read-only — a good default when wiring it to a coding agent. It requires Grafana 9.0 or later.
Does this work with Grafana Cloud?
Yes. The server works against self-hosted Grafana via URL + token, and Grafana Cloud documents MCP server options for hosted setups.
More: Codex + GitHub · Codex + Slack · Codex + Datadog · ChatGPT MCP · Claude + Datadog
Ready to automate your busywork?
Carly schedules, researches, and briefs you—so you can focus on what matters.
See what people say
"Before Carly, I relied on a Calendly link, but the whole process felt impersonal and not very professional. Carly changed that by handling all the back-and-forth, so I'm no longer stuck in endless email threads trying to line up schedules.
Now Carly reaches out to candidates, shares my real-time availability, lets them pick a slot, then sends a Zoom link and drops it straight into my calendar. She sends reminders to both of us before each call, which has significantly reduced no-shows and last-minute confusion.
On top of scheduling, Carly acts like a full executive assistant, sending me my schedule the night before so I can prepare for each call. It reminds me of the old x.ai assistant, but Carly is noticeably smarter, faster, and better suited to my healthcare recruitment business."


