Grafana
Let your AI read your Grafana: search dashboards and see their panels and queries, query Prometheus, Loki and SQL data sources, see which alerts are firing and how the rules are defined, read and add annotations, and list contact points, users and teams. Works with Grafana Cloud and self-hosted Grafana.
7-day free trial · No credit card · EU-hosted
Ask Grafana anything
Try a real prompt against Grafana via AnythingMCP — Claude calls the tools, returns the answer. Press Enter on your own message to install on Cloud.
Install Grafana on CloudClaude is AI and can make mistakes. Please double-check responses.
Setup in 2 minutes
- 1Start a free trial on cloud.anythingmcp.com.
- 2Click Grafana in the connector store. Paste credentials when prompted.
- 3Mint an MCP API key and point your AI client at the generated MCP URL.
Guides for Grafana
Step-by-step setup for the most popular AI clients.
Setting up Grafana
From the connector definition itself: where to find the credentials, what they need to be allowed to do, and which API this adapter talks to.
Grafana
This connector works with one Grafana organization, on Grafana Cloud or a self-hosted Grafana, through the Grafana HTTP API with a service account token: dashboards and folders, data sources and queries against them (Prometheus, Loki, SQL...), alert rules and the alerts firing now, annotations, contact points, and the organization's users and teams. The only change it can make is adding an annotation.
Setup (about 3 minutes)
- Set
GRAFANA_URLto the address you open Grafana at, without a trailing slash:https://<your-stack>.grafana.neton Grafana Cloud, or for examplehttps://grafana.example.com(orhttps://example.com/grafanawhen it runs under a path) when self-hosted. On AnythingMCP Cloud the instance must be reachable from the internet. - In Grafana open Administration, Users and access, Service accounts, click Add service account, give it a name (for example AnythingMCP) and the role Viewer. Viewer is enough for every read here except users and teams, which need Admin. Adding annotations needs Editor.
- Open the service account, click Add service account token, pick an expiry and copy the token (it starts with
glsa_and is shown once). Paste it intoGRAFANA_SERVICE_ACCOUNT_TOKEN. It is sent asAuthorization: Bearer <token>and only reaches the organization the service account belongs to. - Check the setup with
grafana_get_current_org.
How to work
- Find dashboards with
grafana_search(or browsegrafana_list_folders), thengrafana_get_dashboardfor its panels and their queries. - Data:
grafana_list_datasourcesfor the uid and type (grafana_get_datasourcefor one data source's settings), thengrafana_query_datasource. Prometheus:expr=sum by (job) (rate(http_requests_total[5m])),from=now-1h,instant= true for the current value only. Loki:expr={app="api"} |= "error"withmax_lines, or a metric query such assum(count_over_time({app="api"} |= "error" [5m])). SQL data sources:raw_sqlinstead of expr. A panel's own query fromgrafana_get_dashboardcan be run the same way; replace dashboard variables such as$jobor$__rate_intervalwith real values first. - Alerting:
grafana_list_firing_alertsfor what fires now,grafana_list_alert_rulesandgrafana_get_alert_rulefor the rule definitions,grafana_list_contact_pointsfor where notifications go. - Annotations:
grafana_list_annotationsfor deployments and incidents marked on graphs;grafana_create_annotationto add one. - People:
grafana_list_org_usersandgrafana_search_teams(Admin role). grafana_get_healthshows the version (no token needed).
Adding an annotation is visible to everyone: confirm first. Before grafana_create_annotation, show the user the text, time and tags and wait for their yes. Nothing here changes dashboards, data sources or alert rules, or deletes anything.
Times: annotations take and return epoch milliseconds; queries take relative times such as now-6h or epoch milliseconds. Query results give times as epoch milliseconds.
Limits: query answers are cut at about 60 KB; aggregate in the query (sum, topk, rate) and keep ranges short. Dashboards saved in the newer v2 schema (Grafana 12 dashboards with tabs or auto grid layouts) may not be readable through this API; Grafana then answers with an error naming the new API.
Common errors
- 401
Invalid API key: the token is wrong, expired or deleted, orGRAFANA_URLpoints at another stack. - 403
You'll need additional permissions: the service account's role is too low (Admin for users and teams, Editor for annotations), or on Grafana Cloud and Enterprise it lacks query permission on that data source. - 404: no dashboard, data source or rule with that uid in this organization, or a wrong
GRAFANA_URLpath. - 400 on a query: the expression is not valid for that data source; the message says why.
Out of scope here: creating or changing dashboards, data sources, alert rules, contact points, silences and users; Grafana OnCall and Incident; the Grafana Cloud stack API; all deletes.
Your AI is two clicks away from Grafana.
Install the connector, paste your credentials, ask your AI a question. 7-day free trial, no credit card.