---
title: "Grafana MCP Server: Dashboards, Prometheus, Loki and Alerts"
url: "https://mcpshelf.co/servers/grafana"
description: "Grafana's official MCP server lets an assistant search dashboards, run PromQL and LogQL, read alerts and incidents. Service account setup and read-only mode."
updated: "2026-10-27"
site: "MCP Shelf"
---

# Grafana MCP

> Dashboards, metrics, logs, alerts and incidents from your Grafana, in one server.

## At a glance

Grafana Labs' own server works with a self-hosted Grafana or Grafana Cloud. The model can search and summarise dashboards, read panel queries, run PromQL against Prometheus and LogQL against Loki, search traces in Tempo, and read alert rules, incidents, OnCall schedules and annotations. Tools for ClickHouse, CloudWatch, Elasticsearch and other datasources are there too, switched off until you ask for them.

It can also change things: edit dashboards, create folders and alert rules, open incidents. Start it with --disable-write and a service account that only has viewer rights unless you want that. It sends anonymous usage counts to Grafana Labs unless you turn them off.

|  |  |
| --- | --- |
| Made by | Grafana Labs |
| GitHub | https://github.com/grafana/mcp-grafana |
| Licence | Apache-2.0 |
| PyPI package | [mcp-grafana](https://pypi.org/project/mcp-grafana/) 2.1.1 (20 Oct 2026) |
| GitHub stars | 3.6K |
| Downloads | 125.1K a week |
| Last commit | 26 Oct 2026 |
| Tools | 62 |
| Runs on | Your computer |
| Install check | Started in our test |
| Category | [Cloud and operations](https://mcpshelf.co/categories/cloud-and-ops) |

**Our check:** We ran this exact config on 27 Oct 2026: it started and answered with 62 tools.

## Tools

We listed 62 tools on 27 Oct 2026. Every one of them only reads.

| Tool | Kind | What it is for |
| --- | --- | --- |
| `alerting_manage_routing` | reads | Reads notification policies, contact points and timings. |
| `alerting_rules_read` | reads | Lists and inspects alert rules, with filters. |
| `alerting_silences_read` | reads | Lists active and expired silences. |
| `analyze_loki_labels` | reads | Audits a Loki label setup and points out labels that hurt query speed. |
| `check_datasources_health` | reads | Checks whether datasources are answering. |
| `diff_tempo_traces` | reads | Compares two traces span by span. |
| `generate_deeplink` | reads | Builds a link to a dashboard, panel or Explore view for you to open. |
| `get_alert_group` | reads | Details of one OnCall alert group. |
| `get_annotation_tags` | reads | Lists annotation tags. |
| `get_annotations` | reads | Annotations by dashboard, time range or tag. |
| `get_assertions` | reads | Assertion summaries for an entity from Grafana's knowledge graph. |
| `get_current_oncall_users` | reads | Who is on call now for a schedule. |
| `get_dashboard_by_uid` | reads | The complete dashboard JSON. Large dashboards can fill the context window. |
| `get_dashboard_panel_queries` | reads | Every panel's title, query and datasource on a dashboard. |
| `get_dashboard_property` | reads | Pulls out just part of a dashboard with a JSONPath expression. |
| `get_dashboard_summary` | reads | A compact overview of a dashboard: panels, variables and metadata, without the full JSON. |
| `get_datasource` | reads | Details of one datasource. |
| `get_doc` | reads | Reads one Grafana documentation page. |
| `get_incident` | reads | Full details of one incident. |
| `get_oncall_shift` | reads | Details of one OnCall shift. |
| `get_panel_image` | reads | Renders a panel, a dashboard or an Explore view as a PNG. |
| `get_plugin` | reads | Whether a plugin is installed, and its version. |
| `get_snapshot` | reads | Reads one snapshot and its dashboard. |
| `get_tempo_trace` | reads | Fetches one trace by ID. |
| `get_tempo_traceql_docs` | reads | Returns TraceQL reference notes with examples. |
| `grafana_api_request` | reads | Calls any Grafana API path with the server's credentials, for anything the other tools miss. |
| `list_alert_groups` | reads | Lists OnCall alert groups with filters. |
| `list_dashboard_versions` | reads | Saved versions of a dashboard with author, time and message. |
| `list_datasources` | reads | Lists the datasources Grafana is connected to. |
| `list_incident_custom_fields` | reads | The custom fields set up for incidents. |
| `list_incidents` | reads | Lists Grafana Incident incidents, active or resolved. |
| `list_loki_label_names` | reads | Lists log label names. |
| `list_loki_label_values` | reads | Lists the values of one log label. |
| `list_oncall_schedules` | reads | Lists OnCall schedules. |
| `list_oncall_teams` | reads | Lists OnCall teams. |
| `list_oncall_users` | reads | Lists OnCall users. |
| `list_prometheus_label_names` | reads | Lists label names for matching series. |
| `list_prometheus_label_values` | reads | Lists the values one label takes. |
| `list_prometheus_metric_metadata` | reads | Type, help text and unit for metrics. |
| `list_prometheus_metric_names` | reads | Lists metric names, filtered by a pattern. |
| `list_provisioning_repositories` | reads | Lists Git Sync and other provisioning sources. |
| `list_pyroscope_label_names` | reads | Lists profile label names. |
| `list_pyroscope_label_values` | reads | Lists the values of one profile label. |
| `list_pyroscope_profile_types` | reads | Lists the profile types a Pyroscope datasource holds. |
| `list_snapshots` | reads | Lists dashboard snapshots. |
| `list_tempo_attribute_names` | reads | Lists attribute names you can use in TraceQL. |
| `list_tempo_attribute_values` | reads | Lists the values of one trace attribute. |
| `query_loki_logs` | reads | Runs a LogQL query against Loki or VictoriaLogs and returns log lines or metrics. |
| `query_loki_patterns` | reads | Common log line patterns Loki has detected for a stream. |
| `query_loki_stats` | reads | Counts of streams, chunks and bytes for a selector, to size a query before running it. |
| `query_prometheus` | reads | Runs a PromQL query, instant or over a range, against Prometheus, Mimir, Thanos and similar. |
| `query_prometheus_histogram` | reads | Works out p50, p90, p95 or p99 from a histogram metric. |
| `query_pyroscope` | reads | Fetches profiles or profile metrics from Pyroscope. |
| `query_tempo_metrics` | reads | Computes metrics from traces with a TraceQL metrics query. |
| `search_dashboards` | reads | Finds dashboards by title, folder, tag or starred status. |
| `search_docs` | reads | Searches the Grafana documentation. |
| `search_folders` | reads | Finds folders by name. |
| `search_plugin_information` | reads | Searches the Grafana plugin catalogue. |
| `search_tempo_traces` | reads | Searches traces with TraceQL. |
| `suggest_loki_alloy_label_config` | reads | Writes an Alloy snippet that keeps only an approved set of labels. |
| `user_info` | reads | Who the server is signed in as. |
| `validate_provisioning_file` | reads | Dry-runs a provisioning file from a repository to catch errors. |

### How clearly it describes its tools

62 of 62 tools have a description and 62 of 62 say whether they change things. The tool list takes at least ~6,800 tokens of context. Every tool says whether it only reads or can change things, so a client can ask before the risky ones. The tool list is large: switch off the tools you do not use if your client allows it.

### Tool groups

| Group | Covers |
| --- | --- |
| `Default` | Dashboards, datasources, Prometheus, Loki, Tempo, Pyroscope, alerting, incidents, OnCall, annotations and docs, as listed here in read-only mode. |
| `Write tools` | Updating and patching dashboards, creating folders, alert rules, incidents and annotations. Hidden by --disable-write, which our config uses. |
| `--enabled-tools extras` | Off by default and switched on by name: sql (ClickHouse, Snowflake, Athena), cloudwatch, elasticsearch, influxdb, graphite, cloudlogging, runpanelquery and examples, among others. |

## Set it up

### Claude Desktop

Where: claude_desktop_config.json (Settings → Developer → Edit Config)

```json
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana",
        "--disable-write"
      ],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "YOUR_SERVICE_ACCOUNT_TOKEN"
      }
    }
  }
}
```

### Claude Code

Where: Your terminal, in the project folder

```bash
claude mcp add-json grafana '{"command":"uvx","args":["mcp-grafana","--disable-write"],"env":{"GRAFANA_URL":"http://localhost:3000","GRAFANA_SERVICE_ACCOUNT_TOKEN":"YOUR_SERVICE_ACCOUNT_TOKEN"}}'
```

### Cursor

Where: ~/.cursor/mcp.json, or .cursor/mcp.json in a project

```json
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana",
        "--disable-write"
      ],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "YOUR_SERVICE_ACCOUNT_TOKEN"
      }
    }
  }
}
```

### VS Code

Where: .vscode/mcp.json in your project

```json
{
  "servers": {
    "grafana": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mcp-grafana",
        "--disable-write"
      ],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "YOUR_SERVICE_ACCOUNT_TOKEN"
      }
    }
  }
}
```

### Windsurf

Where: ~/.codeium/windsurf/mcp_config.json

```json
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana",
        "--disable-write"
      ],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "YOUR_SERVICE_ACCOUNT_TOKEN"
      }
    }
  }
}
```

### ChatGPT

Where: Not supported

ChatGPT only connects to remote servers by URL. This one runs on your computer, so use Claude, Cursor or VS Code.

We publish it in read-only mode; drop "--disable-write" to allow edits. Add "GRAFANA_USAGE_STATS": "disabled" in env to stop usage reporting. For Grafana Cloud, set GRAFANA_URL to your stack, such as https://you.grafana.net.

## Settings

| Setting | Kind | Required | What it does |
| --- | --- | --- | --- |
| `GRAFANA_URL` | env | yes | Your Grafana address, such as http://localhost:3000 or https://you.grafana.net. |
| `GRAFANA_SERVICE_ACCOUNT_TOKEN` | env | yes | A service account token. Its role decides what the server can see and change, so give it Viewer unless you want edits. |
| `--disable-write` | flag | no | Removes every tool that changes Grafana. Our config uses it. |
| `--enabled-tools` | flag | no | Picks which tool groups load, including ones that are off by default. Example: `--enabled-tools search,datasource,prometheus,loki` |
| `GRAFANA_USAGE_STATS` | env | no | Set to disabled to stop anonymous usage reports to Grafana Labs, which are on by default. DO_NOT_TRACK=1 does the same. Example: `disabled` |
| `--transport` | flag | no | stdio by default; sse or streamable-http to serve it over HTTP, with --address for the host and port. Example: `--transport streamable-http --address localhost:8000` |

## What it can touch

**It can read**

- Dashboards, folders and datasources
- Metrics, logs, traces and profiles through those datasources
- Alerts, incidents and on-call schedules

**It can change**

- Without --disable-write: dashboards, folders, alert rules, incidents and annotations
- Anything the token allows, through grafana_api_request

**Safer setup:** Use --disable-write with a Viewer service account. That way even grafana_api_request cannot change anything the token is not allowed to.

## Before you start

- Grafana 9.0 or newer, self-hosted or Grafana Cloud
- A service account token
- uv (or the Docker image or Go binary)

## Good for

- Asking why a service is slow and letting the model check metrics and logs
- Finding the right dashboard in a large Grafana
- Summarising firing alerts and recent incidents

## If it does not work

**Every call returns 401 or 403**
Check that the token belongs to a service account in the same organisation and has a role with the access you need.

**Answers stop half way on big dashboards**
Ask for get_dashboard_summary or get_dashboard_property instead of the full dashboard JSON.

**Datasource tools fail on an old Grafana**
Grafana 9.0 or newer is needed for full support.

**A tool from the README is missing**
Some groups are off by default. Add them with --enabled-tools, and drop --disable-write if it is a write tool.

## Similar servers

| Server | Tools | Runs on | Stars |
| --- | --- | --- | --- |
| [Azure DevOps MCP](https://mcpshelf.co/servers/azure-devops) | 44 | Your computer or hosted | 2.1K |
| [Terraform MCP Server](https://mcpshelf.co/servers/terraform) | 61 | Your computer | 1.6K |
| [AWS Knowledge MCP Server](https://mcpshelf.co/servers/aws-knowledge) | 5 | Hosted | 9.8K |
| [Cloudflare MCP Servers](https://mcpshelf.co/servers/cloudflare) | 2 | Hosted | 4.4K |

## Questions

### Is it official?

Yes. Grafana Labs builds and maintains it under the Apache-2.0 licence.

### Does it work with Grafana Cloud?

Yes. Set GRAFANA_URL to your stack, such as https://you.grafana.net, and use a service account token from that stack.

### Can I run it without Python?

Yes. It is a Go program; uvx just fetches a build. There is also a Docker image, release binaries and a Helm chart.

### What does it send to Grafana Labs?

Anonymous counts of which tools ran and how it is configured, every four hours. Never queries, results, URLs or credentials. You can turn it off.

Full docs on GitHub: https://github.com/grafana/mcp-grafana

---

From [MCP Shelf](https://mcpshelf.co/): A short shelf of MCP servers that are worth installing. Index for agents: https://mcpshelf.co/llms.txt

