Connector guide6-minute read16 MCP tools7 languages

Grafana to MCP: Dashboards, Queries and Alerts in any AI Agent

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.

HCBy HelpCode teamUpdated 6 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Grafana

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.

tools

16

Region

INTL

Category

Monitoring

Authentication

Bearer Token

Required env vars

GRAFANA_URLGRAFANA_SERVICE_ACCOUNT_TOKEN
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the Grafana in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

Summary

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.

Try asking

Example prompts for Grafana

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Grafana · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Grafana, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

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.

Setup

  1. Set GRAFANA_URL to the address you open Grafana at, without a trailing slash: https://your-stack.grafana.net on Grafana Cloud, or your own address such as https://grafana.example.com (or https://example.com/grafana when Grafana runs under a path). On AnythingMCP Cloud the instance must be reachable from the internet.
  2. In Grafana open Administration → Users and access → Service accounts, click Add service account, give it a name (for example AnythingMCP) and the role Viewer.
  3. Open the service account, click Add service account token, pick an expiry and copy the token. It starts with glsa_ and Grafana shows it only once.
  4. Paste it into GRAFANA_SERVICE_ACCOUNT_TOKEN without the word Bearer and install the connector. The token only reaches the organization the service account belongs to.
  5. Check the setup with grafana_get_current_org: it shows the organization behind the token. grafana_get_health answers even without a token, so it shows the Grafana version but does not prove the token works.

Which role: Viewer covers dashboards, folders, data sources, queries, alert rules, firing alerts, annotations and contact points. Listing users and teams needs Admin, adding annotations needs Editor. On Grafana Cloud and Grafana Enterprise the service account also needs query permission on each data source it should read.

What it does: search dashboards and folders and read a dashboard's panels with their PromQL, LogQL or SQL queries; run queries against Prometheus (or Mimir), Loki and SQL data sources through Grafana; see which alerts fire right now, how their rules are defined and which contact points get the notifications; read the annotations that mark deployments and incidents on your graphs; list the organization's users and teams.

One change, and the AI asks first: the only thing the connector can change is adding an annotation with grafana_create_annotation, which everyone sees on the dashboards. Before that, the AI shows you the text, time and tags and waits for your yes. Nothing here changes dashboards, data sources or alert rules, and nothing is deleted.

Secrets stay in Grafana: data source passwords and keys are never returned, and contact points come without their settings, which hold webhook URLs and keys.

Limits: query answers are cut at about 60 KB, so the AI aggregates in the query (sum, topk, rate) and keeps time 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 that names the new API.

Common errors: 401 Invalid API key: the token is wrong, expired or deleted, or GRAFANA_URL points at another stack. 403: the service account's role is too low (Admin for users and teams, Editor for annotations), or it lacks query permission on that data source. 404: no dashboard, data source or rule with that uid in this organization, or a wrong path in GRAFANA_URL. 400 on a query: the expression is not valid for that data source, and the message says why.

The connector does not create or change dashboards, data sources, alert rules, contact points, silences or users, does not delete anything, and does not cover Grafana OnCall, Grafana Incident or the Grafana Cloud stack API.

Prerequisites: GRAFANA_URL, GRAFANA_SERVICE_ACCOUNT_TOKEN

Install the connector locally

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Open http://localhost:3000/connectors/store, pick Grafana and paste in the env vars listed under Prerequisites.

Available tools

ToolWhat it does
grafana_get_healthCheck that the Grafana instance is up: database state, Grafana version and commit
grafana_get_current_orgRead the Grafana organization the service account token belongs to: id and name
grafana_searchSearch dashboards and folders by title, tag or folder: uid, title, type (dash-db for dashboards, dash-folder for folders), tags, folder and…
grafana_list_foldersList folders: uid and title, top level by default or the subfolders of a parent
grafana_get_dashboardRead a dashboard by uid in a compact form: title, tags, folder, time range, variables (name, type, current value) and panels with id…
grafana_list_datasourcesList the data sources: uid, name, type (prometheus, loki, postgres...), URL, access mode and which one is the default
grafana_get_datasourceRead one data source by uid: name, type, URL, access mode, default flag and its non-secret settings (jsonData)
grafana_query_datasourceRun a query against a data source through Grafana and return the result frames: a PromQL query for Prometheus or Mimir, a LogQL query for…
grafana_list_alert_rulesList the Grafana-managed alert rules: uid, title, folder, rule group, paused or not, pending period (for), labels, summary, what happens on…
grafana_get_alert_ruleRead one alert rule by uid: title, folder, group, condition, the queries and expressions it evaluates (data source uid, expression, time…
grafana_list_firing_alertsList the alert instances in Grafana's Alertmanager, by default the active ones (firing): alert name and labels, summary and description…
grafana_list_annotationsList annotations (event markers on graphs such as deployments or incidents, and alert state changes): id, time and end time (epoch…
grafana_create_annotationAdd an annotation (an event marker such as a deployment, incident or maintenance window) that shows on graphs for everyone who opens the…
grafana_list_org_usersList the users of the organization: user id, login, email, name, role (Viewer, Editor, Admin), last seen and disabled flag
grafana_search_teamsSearch the teams of the organization: id, uid, name, email and member count
grafana_list_contact_pointsList the alerting contact points (where notifications go): uid, name, integration type (email, slack, pagerduty, webhook...) and whether…

Example prompts

  • "Which alerts are firing in Grafana right now? For each one, show the rule behind it and the contact point that gets the notification."
  • "Find our API latency dashboard and explain what each panel shows and which query it runs."
  • "Query Prometheus for the rate of 5xx responses per service over the last hour and tell me which service is worst."
  • "Show me the error lines Loki logged for the checkout app in the last 30 minutes and group them by message."
  • "Add an annotation "Deployed v2.4.1" with the tag deploy at 14:05 today. Show me the text, time and tags before you add it."

Next steps

Was this guide helpful?

Your Grafana agent is one click away.

Install the connector, paste the key, prompt your AI client. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Grafana to ChatGPT via MCP

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.

Connectors

How to Connect Grafana to Claude via MCP

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.

Connectors

How to Connect Grafana to Cursor via MCP

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.

Connectors

How to Connect Grafana to Gemini via MCP

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.

Connectors

How to Connect Grafana to Meta Muse via MCP

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.

Connectors

Avito to MCP: Manage Avito Ads, Prices and Statistics from any AI Agent

Let your AI work with your Avito business account: list your ads and change their prices, read views, contacts and calls statistics, check autoload uploads and their errors, the feed format and your wallet, and read Avito Messenger chats. Sending messages and changing autoload settings are optional and off by default.