MCP Grafana logo

MCP Grafana

by grafana

Connects AI agents to Grafana for dashboard inspection, alerting, incident response, and datasource queries.

Install MCP Grafana

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "grafana-mcp-grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana"
      ],
      "env": {
        "GRAFANA_URL": "YOUR_VALUE_HERE",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

grafana/mcp-grafana exposes Grafana operations through MCP, covering dashboards, datasources, alerting, incidents, annotations, snapshots, OnCall, Loki, and Tempo. It can retrieve compact dashboard summaries or targeted JSONPath properties, inspect panel queries, query supported backends, and manage alert rules, routing, and silences. Use it when an agent needs to investigate monitoring data or make confirmed changes in a Grafana instance. Grafana 9.0 or later is required for full functionality, and several query groups are opt-in.

Use cases

  • Inspect a dashboard without loading its full JSON
  • Investigate slow Tempo requests and Loki error patterns
  • Audit alert rules and notification routing
  • Mute alerts during a maintenance window
  • Query Grafana-managed observability datasources

Key features

  • Dashboard search, summaries, JSONPath extraction, and patching
  • Alert rule, routing, contact point, and silence management
  • Datasource discovery, health checks, and optional querying
  • Incident and Grafana OnCall investigation
  • Loki, Prometheus, Tempo, SQL, InfluxDB, and CloudWatch workflows
  • Dashboard, panel, and Explore deeplink generation

Tools81

What MCP Grafana lets your agent do. Expand a tool for its parameters.

Verified live~21.7k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

49/49 checks healthy over the last 89d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 2d ago via OSV.dev · mcp-grafana (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3.6kStargazers on the source repository.
Last commitTodayMost recent push to the default branch.
Tools exposed81Callable tools this server registers over MCP.
Directory activity13 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Grafana works

What grafana/mcp-grafana does

grafana/mcp-grafana connects an MCP-compatible client to a Grafana instance and exposes operational workflows for observability. Dashboard capabilities include searching, retrieving complete dashboards or saved versions, listing versions, reading compact summaries, extracting selected properties with JSONPath, inspecting panel queries, and creating or modifying dashboards. Patch-style dashboard changes avoid sending the entire dashboard when only a targeted edit is needed.

The server also covers datasource discovery and health checks, annotations, folders, snapshots, alerting, incidents, and Grafana OnCall. Alerting tools distinguish between rule configuration, routing policy, contact points, time intervals, and silences. Incident tools can create incidents, retrieve them, and add timeline notes, while OnCall tools retrieve alert groups, shifts, and currently assigned users.

How it works

The server communicates with Grafana through MCP tools and uses the Grafana instance's configured datasource plugins for supported queries. Prometheus, Loki, InfluxDB, SQL-compatible sources, and CloudWatch each have query or discovery capabilities, with some groups enabled only when explicitly selected. SQL queries are sent through Grafana plugins, so datasource authentication remains in Grafana rather than being exposed to the MCP server.

Dashboard retrieval can consume substantial context for large JSON documents. The summary and property tools provide smaller responses, and panel-query retrieval can substitute template variables before returning processed queries. Tools for slow Tempo requests, Loki error patterns, trace comparison, and Loki label analysis support targeted investigations.

Setup and configuration

A basic stdio configuration uses uvx to launch the package:

config.json
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": ["mcp-grafana"],
      "env": {
        "GRAFANA_URL": "https://your-grafana.example.com",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "your-token"
      }
    }
  }
}

Set GRAFANA_URL to the Grafana instance, including a Grafana Cloud URL when applicable, and provide a service-account token. Grafana 9.0 or newer is required for full functionality; earlier versions may lack datasource API endpoints.

Run-panel-query, query-example, InfluxDB, CloudWatch, and SQL tool groups are disabled by default and can be enabled with the corresponding --enabled-tools values. Datasource resources are also disabled along with datasource tools.

Tools and capabilities

  • Inspect dashboards with summaries, full JSON, saved versions, JSONPath properties, panel queries, and search filters.
  • Create, update, patch, and annotate dashboards, folders, snapshots, and annotations.
  • Inspect datasource configuration and health, then query Prometheus, Loki, InfluxDB, SQL sources, or CloudWatch when enabled.
  • Manage alert rules, notification routing, contact points, time intervals, and silences.
  • Investigate incidents, OnCall schedules, alert groups, slow requests, error patterns, and Tempo traces.
  • Generate dashboard, panel, and Explore deeplinks, including optional shortened URLs.

Limitations and notes

Complete dashboard retrieval and full dashboard updates may use significant context. Prefer summaries, JSONPath extraction, or patch operations for focused tasks. Creating datasources requires a two-step confirmation flow: first retrieve the schema, then collect required values from the user before submitting the creation request. Credentials should not be handled through that workflow, and any detected credentials should be rotated.

Creating an incident can notify or alert many people, so it should be performed only after user confirmation. Deleting annotations is permanent. Updating a silence requires care with its original start time and matchers because Alertmanager may assign a new ID when those values change. Panel-query execution is opt-in and has datasource-specific parser behavior.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Grafana

grafana/mcp-grafana is an MCP server that connects AI clients to Grafana instances. Its main tools inspect and modify dashboards, query and check datasources, manage alert rules and routing, investigate incidents and OnCall data, create annotations and snapshots, and analyze Loki and Tempo observability data.

Install it through an MCP client using `uvx mcp-grafana`, then set `GRAFANA_URL` and `GRAFANA_SERVICE_ACCOUNT_TOKEN` in the client configuration. Docker, binary, and Helm installation paths are also available. Grafana 9.0 or later is required for full functionality.

Set `GRAFANA_URL` and `GRAFANA_SERVICE_ACCOUNT_TOKEN`. The first identifies the Grafana instance, including a Grafana Cloud URL, and the second authenticates the MCP server with a Grafana service-account token.

Yes. Cursor is shown as an example MCP client for the standard stdio configuration. The same configuration runs `uvx mcp-grafana` and supplies the Grafana URL and service-account token through environment variables.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Grafana AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/grafana-mcp-grafana?style=directory)](https://allmcps.com/mcp/grafana-mcp-grafana)
HTML Embed
<a href="https://allmcps.com/mcp/grafana-mcp-grafana"><img src="https://allmcps.com/api/badge/grafana-mcp-grafana?style=directory" alt="MCP Grafana on AllMCPs" /></a>