TopGit
GitHub Repo Review

Grafana MCP Server: AI Access to Grafana

grafana/mcp-grafana
GTopGit review image for grafana/mcp-grafana
Review by Topgit.dev for grafana/mcp-grafana, with GitHub repository stats and README context.
Quick verdict

The Grafana MCP server is Grafana Labs' own bridge between an AI agent and a running Grafana instance, exposing dashboards, alerts, incidents, and datasource queries as callable tools instead of screen-scraping the UI. Reach for it if your agent already needs to read PromQL or LogQL results and act on alerts inside a Grafana you control; skip it if you don't run Grafana at all, since the server has nothing to connect to without one.

Stars
★ 3.3k
Forks
⑂ 417
Language
Go
License
Apache-2.0
Topic
Updated
Aug 2026
Homepage
GitHub

What is the Model Context Protocol (MCP) Server for Grafana?

The Grafana MCP server is an MCP server that Grafana Labs built to give AI clients like Claude Desktop or Cursor direct access to a Grafana instance, including Prometheus, Loki, and Incident. It runs as a small Go binary that translates MCP tool calls into Grafana API and datasource calls, so the model reads dashboards, queries metrics and logs, and manages alerts under a service account's permissions.

Core Features and Data Source Integrations

  • Dashboard tools for search, get-by-UID, get-summary, get-property via JSONPath, update/create, and patch, with the summary/property/patch tools built specifically to avoid pulling a full dashboard JSON into context, per GitHub issue #101.
  • Query tools spanning Prometheus (PromQL instant and range, metadata, histogram percentiles), Loki (LogQL logs and metrics, metadata, patterns), and eight more datasource types, InfluxDB, ClickHouse, CloudWatch, Graphite, Athena, Snowflake, Elasticsearch/OpenSearch, and Quickwit, each off by default and turned on per-type with --enabled-tools.
  • Alerting and incident tools: list, create, update, and delete alert rules, manage notification policies and contact points, and search, create, and update Grafana Incident records.
  • Sift investigation tools that list investigations, fetch analyses, and spot recurring error patterns or slow requests across Loki and Tempo data.
  • Grafana OnCall tools covering schedules, shift details, current on-call users, teams, and alert groups.
  • A navigation tool that generates deeplinks to dashboards, panels, and Explore views instead of leaving the model to guess a URL.
  • Snapshot and rendering tools: create, list, and delete dashboard snapshots, and render a panel or dashboard to PNG, which needs the separate Grafana Image Renderer service.
  • Agent Observability and Grafana Assistant tools, both disabled by default and Grafana Cloud only, for reading LLM conversation traces and evaluation scores, and for delegating a natural-language prompt to Grafana's own Assistant.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history

Practical Applications for AI Assistants

  • Debugging a firing alert without leaving the chat: have the agent pull the alert rule's status, find the panel query behind it, and check Sift for a matching error pattern in Loki.
  • Editing a dashboard by having the agent patch specific panels instead of round-tripping the full dashboard JSON through the model.
  • Running ad hoc PromQL or LogQL from a coding agent to check a metric or log pattern before writing an incident update.
  • Checking on-call coverage, such as who's on call right now or which alert groups are open, without opening the Grafana OnCall UI.
  • Adding the server to Claude Desktop or Cursor as one more MCP tool the agent can call mid-conversation when a question needs live Grafana data.

Installation and Quick Start

Installation runs through uv: install the uvx command-line tool, then point your MCP client's config file at the mcp-grafana package. The README's example config runs `uvx mcp-grafana` and sets two environment variables, GRAFANA_URL (a local http://localhost:3000 by default, or your https://*.grafana.net address on Grafana Cloud) and GRAFANA_SERVICE_ACCOUNT_TOKEN. Full functionality needs Grafana 9.0 or newer; earlier versions can be missing the API endpoints the datasource tools depend on. The README also lists Docker, a standalone binary, and a Helm chart as install paths beyond uvx, though it points to a separate Usage section for those specifics rather than spelling them out inline.

Strengths

  • One MCP interface covers dashboards, alerting, incidents, OnCall, Sift, annotations, snapshots, and ten-plus datasource query types instead of a separate integration per system.
  • The dashboard tool set was rebuilt around context-window cost, tracked in issue #101: get_dashboard_summary and get_dashboard_property (JSONPath) let an agent skip loading a full dashboard JSON to answer a small question.
  • Tool exposure is opt-in per category via --disable-<category> and --enabled-tools, so a team can hand an agent read-only Prometheus and Loki access without also granting Admin, Assistant, or dashboard-write tools.
  • Snowflake and ClickHouse queries go through Grafana's own datasource configuration, so authentication for those systems stays out of the MCP process entirely.
  • Deeplink generation for dashboards, panels, and Explore views means the agent returns a real, clickable Grafana URL instead of guessing one.

Operational Considerations and Warnings

  • Most non-core tool groups ship disabled by default: Run Panel Query, ClickHouse, CloudWatch, InfluxDB, Graphite, Athena, Snowflake, Elasticsearch/OpenSearch, Quickwit, Query Examples, Agent Observability, Grafana Assistant, and Admin all need an explicit --enabled-tools flag before an agent can use them.
  • Agent Observability tools only work against Grafana Cloud, not a self-hosted instance.
  • Rendering a panel or dashboard to an image depends on the separate Grafana Image Renderer service being installed and configured; the MCP server can't do it alone.
  • Snowflake querying requires the Grafana Enterprise grafana-snowflake-datasource plugin, so it's out of reach on the open-source edition.
  • Pulling a full dashboard with get_dashboard_by_uid, or writing one back with the update/create tool, can use a large amount of context window, per the README's own warning, which is exactly why the summary/property/patch tools exist.
  • RBAC setup is granular enough that the README offers the built-in Editor role as a shortcut instead of hand-picking scopes, trading least-privilege access for convenience.

Other Ways to Automate Grafana

Grafana's HTTP API — direct REST calls for dashboards, alerts, and datasources, with no MCP layer or LLM in the loop.Terraform Grafana provider — manages dashboards, folders, and alert rules as infrastructure-as-code, suited to CI/CD pipelines rather than a conversational agent.Grafana Assistant — Grafana's own in-product AI feature; the MCP server can call it as one optional tool, but you can also use it directly inside Grafana without the MCP layer at all.toolhive — a registry and runtime for running MCP servers in an isolated, managed way instead of wiring each one into a client config by hand.

Common Questions

What Grafana versions does the MCP server require?

Grafana MCP server needs Grafana 9.0 or later for full functionality; earlier versions can be missing the API endpoints that datasource-related tools depend on, per the README.

How can I manage context window usage when interacting with dashboards?

Grafana MCP server offers get_dashboard_summary and get_dashboard_property, which uses JSONPath, as lighter alternatives to pulling a full dashboard with get_dashboard_by_uid, plus a patch tool to edit a dashboard without resending its entire JSON.

Are all MCP server tools enabled by default?

Not all of them: many tool groups in Grafana MCP server, including Run Panel Query, ClickHouse, CloudWatch, InfluxDB, Snowflake, Elasticsearch/OpenSearch, Quickwit, Admin, Agent Observability, and Grafana Assistant, are disabled until you add them with the --enabled-tools flag.

What RBAC permissions are needed for the Grafana MCP server?

Grafana MCP server's service account needs RBAC permissions and scopes matched to whichever tools are enabled, such as datasources:*, dashboards:*, or folders:* for broad access; the README also allows assigning the built-in Editor role as a simpler, less granular shortcut.

Can the MCP server create or modify Grafana dashboards?

Grafana MCP server can create, update, and patch dashboards, plus create alert rules, incidents, and annotations; these are write tools rather than read-only lookups.

Which data sources can the Grafana MCP server query?

Grafana MCP server can query Prometheus, Loki, InfluxDB, ClickHouse, CloudWatch, Graphite, Athena, Snowflake, and Elasticsearch/OpenSearch, plus Quickwit, though most of those beyond Prometheus and Loki are off until enabled via --enabled-tools.

The problem it solves

An agent trying to answer 'why did this alert fire' has to touch several different systems: the dashboard that shows the metric, the alert rule that triggered, the datasource holding the raw data, and possibly Grafana Incident or OnCall, each with its own API shape. Grafana MCP server's specific fix is a single MCP interface over all of those, plus tools built around one recorded pain point (GitHub issue #101): pulling a full dashboard JSON into an LLM's context window is expensive, so it adds summary, JSONPath-property, and patch tools that let the agent touch only the part of a dashboard it actually needs.

Who should try it — and who should skip

Try Grafana MCP server if you already run Grafana (9.0 or later) with Prometheus, Loki, or another supported datasource, and want an AI assistant that can look up dashboards, run queries, and check alerts inside your own instance rather than a generic observability chatbot. Skip it if you don't have a Grafana instance to point it at, since it's a client for an existing deployment and not a monitoring stack of its own, or if you need it to safely mutate dashboards and alerts with minimal setup, since the write tools mean getting the RBAC scopes, or the broader Editor role, right first.

Source & attribution

Facts and quotes sourced from the grafana/mcp-grafana GitHub repository and its README.

GitHub data · last synced Aug 12, 2026Reviewed by Henry
Back to TopGit

Curious whether mcp-grafana is right for you?

Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about mcp-grafana.

GitHub