MCP Grafana logo

MCP Grafana

by grafana

Connects AI agents to Grafana for dashboards, alerting, incidents, datasource queries, logs, metrics, and traces.

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 connects MCP-compatible clients to a Grafana instance and its configured datasources. It supports dashboard discovery and editing, Prometheus and Loki queries, SQL and cloud observability queries, alerting administration, incident workflows, annotations, and trace analysis. Use it when an agent needs to investigate monitoring data or make controlled changes through Grafana APIs. Grafana 9.0 or later is required for full functionality, and several query tool groups are opt-in.

Use cases

  • Investigate alert rules, routing, and silences
  • Inspect dashboards and extract panel queries
  • Query metrics, logs, traces, and SQL datasources
  • Create incident timelines and review on-call coverage
  • Modify dashboards, annotations, folders, and alert configuration

Key features

  • Dashboard search, inspection, creation, updates, and patching
  • Prometheus, Loki, SQL, cloud, InfluxDB, and Graphite queries
  • Alert rule, routing, and silence management
  • Incident and Grafana OnCall operations
  • Trace comparison and slow-request analysis
  • Context-aware dashboard retrieval with summaries and JSONPath

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.

31/31 checks healthy over the last 79d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d 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 activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Grafana works

What grafana/mcp-grafana does

grafana/mcp-grafana gives AI agents access to Grafana dashboards, alerting, incidents, annotations, datasources, and observability data through MCP. It can inspect dashboards at different levels of detail, from compact metadata to complete JSON, and can extract panel queries or selected properties with JSONPath. Dashboard creation, updates, patching, folders, snapshots, annotations, and deeplink generation are also supported.

The server covers operational investigation as well as configuration work. Agents can inspect or modify alert rules, routing policies, contact points, time intervals, and silences. Incident tools support creation, retrieval, and timeline notes, while OnCall tools expose alert groups, current on-call users, and shift details.

How it works

The server connects to a Grafana URL using a service account token and exposes Grafana operations as MCP tools. Datasource authentication remains configured in Grafana; SQL queries, for example, are sent through Grafana datasource plugins rather than handling database credentials in the MCP server.

Dashboard retrieval includes context-management options. Use summaries for planning, JSONPath properties for targeted inspection, and full dashboard retrieval only when the complete model is needed. Panel queries can include template-variable substitutions, and panel query execution supports custom time ranges and variable overrides when enabled.

Several tool families are disabled by default and must be enabled with the corresponding --enabled-tools value: runpanelquery, examples, influxdb, sql, cloudwatch, cloudlogging, and graphite.

Setup and configuration

A standard setup uses uvx to launch mcp-grafana from an MCP client's server configuration:

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

The same configuration pattern can point to a local Grafana installation. The project also supports Docker, a binary, and Helm deployment. Full functionality requires Grafana 9.0 or newer; some datasource operations depend on API endpoints unavailable in earlier versions.

Tools and capabilities

  • Search, summarize, inspect, create, update, patch, and version dashboards.
  • Retrieve panel queries, datasource details, annotations, snapshots, folders, and documentation pages.
  • Query Prometheus, Loki, InfluxDB, SQL datasources, CloudWatch, Google Cloud Logging, and Graphite when their tool groups are enabled.
  • Analyze Loki label strategies, error patterns, slow Tempo requests, and differences between traces.
  • Manage alert rules, routing, silences, incidents, annotations, and OnCall information.
  • Generate dashboard, panel, and Explore deeplinks.

Supported datasource examples include Prometheus, Loki, ClickHouse, CloudWatch, Elasticsearch, OpenSearch, Snowflake, Athena, MySQL, PostgreSQL, and MSSQL. The Google Cloud Logging tools require the Google Cloud Logging datasource plugin version 1.8.0 or later and Grafana 11.2 or newer.

Limitations and notes

Large dashboards can use substantial context-window space, so targeted summary and property tools are preferable when full JSON is unnecessary. Running panel queries and several datasource query families are opt-in rather than enabled by default. Creating incidents can notify many people and should be confirmed before execution. Deleting annotations is permanent, and updating a silence requires care with its original start time to preserve its identifier.

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 and its configured datasources. Its main tools search and modify dashboards, query metrics and logs, manage alerting and incidents, inspect OnCall data, retrieve datasource details, and analyze Tempo traces and Loki patterns.

Install it by adding `uvx mcp-grafana` to your MCP client's server configuration. Set `GRAFANA_URL` to the Grafana instance and `GRAFANA_SERVICE_ACCOUNT_TOKEN` to a service account token. Docker, binary, and Helm deployment options are also supported.

Yes, Cursor is named as a supported MCP client configuration target. Add the server with the `uvx` command, pass `mcp-grafana` as its argument, and provide the Grafana URL and service account token as environment variables.

Enable optional tool groups with the matching `--enabled-tools` value. Examples include `runpanelquery`, `sql`, `influxdb`, `cloudwatch`, `cloudlogging`, `graphite`, and `examples`; these groups are disabled by default.

Grafana 9.0 or later is required for full functionality. Earlier versions may lack API endpoints needed by datasource-related operations, while Google Cloud Logging support requires Grafana 11.2 or newer with the required datasource plugin.

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>