grafana/mcp-grafana

DevOps & Self-hosting

An MCP server that lets AI assistants read and operate a Grafana instance for observability work.

3,616
479
Go
Apache-2.0
1 year old

Worth trying if you already run Grafana and want an AI assistant to inspect dashboards and datasources without you clicking through the UI. This is tooling for an existing observability stack, not a replacement for it.

The problem

You want to answer an operational question — what a dashboard shows, which panels exist, how a query is configured — using an AI client rather than the Grafana web UI. Normally you copy panel JSON or describe settings by hand, then paste the answer back. mcp-grafana exposes the Grafana API as MCP tools, so the assistant can search dashboards, fetch a dashboard by UID, list saved versions and run panel queries within the conversation. The result is that the investigation stays in your chat client while the data still comes from Grafana.

What's different

The mechanism is a Model Context Protocol server, configured in clients such as Claude Desktop or Cursor, that translates tool calls into Grafana API requests. The quick-start path uses uvx mcp-grafana with GRAFANA_URL and a service account token; Docker, binary and Helm options are also documented. That makes it a thin bridge: the assistant is only as capable as the service account's permissions, and you have to think about scope before handing it an account.

The README recommends the built-in Editor role as a convenient fallback when fine-grained RBAC is not comfortable, but Editor grants broad read/write access covering most operations, so least privilege is the trade-off. Query execution is also deliberately gated: run-panel-query tools are disabled unless you add runpanelquery to --enabled-tools. Even then, Infinity panels only run in the backend for the backend or jq-backend parser, while the default simple, UQL and GROQ parsers work only in the browser, so some queries cannot be replayed through the server. Large dashboards carry a separate caveat: fetching full dashboard details can consume significant context window space.

Who should try it

A good fit is a platform or SRE team with Grafana 9.0 or later, an existing service account workflow and a chat-based assistant already in use, especially where asking an assistant to summarize dashboards or look up datasource configuration saves copy-paste. A poor fit is someone on an older Grafana instance, since datasource-related operations can fail with an id-is-invalid error; the documented remedy is upgrading to 9.0 or later. It is also a poor fit if you want query execution without extra configuration or if your panels rely on browser-only parsers.

Requirements and limitations

Grafana version 9.0 or later is required for full functionality, and datasource operations may break on earlier versions. The quick start requires uv; Docker, binary and Helm installations avoid that but carry their own setup. Authentication uses a service account token, and GRAFANA_API_KEY is deprecated, so existing configurations should migrate. Multi-organization use needs GRAFANA_ORG_ID or the X-Grafana-Org-Id header.

Usage statistics are on by default: one report per server process every four hours plus one at shutdown, covering tool names, failure counts and configuration, though not arguments, queries or credentials. You can opt out with --usage-stats=disabled, GRAFANA_USAGE_STATS=disabled or DO_NOT_TRACK=1, and set GRAFANA_USAGE_STATS=log to print what would be sent. Ongoing upkeep means managing the service account's permissions as your use grows.

HotRepo's take

The only dated HotRepo observation is a single daily-board appearance on 2026-10-27 at 3,611 stars (+10 that day), so there is not enough comparable history to judge whether interest persists. Before adopting, check the service-account permission model against the specific tools you intend the assistant to call. Project README · Usage and installation options · Grafana service account docs

Written by AI from the project's README, updated October 27, 2026. The project's own docs are the source of truth.