Grafana MCP server
Last verified: 2026-09
Dashboards and datasources.
Community Cloud & infra Needs a secret Claude Desktop, Cursor, Windsurf, Claude Code
What it does
Official Grafana MCP. Dashboards, datasources, and panel queries (including runPanelQuery). Needs GRAFANA_URL and a service-account token.
It sits in Cloud & infra: Most of these are admin APIs.
Good for
- Open a dashboard by uid and read the summary.
- runPanelQuery on a panel you already know, with a query-only token.
- Ask 'what does this dashboard measure' without a Viewer seat in the browser.
- Leave dashboard-write and alerting-write off.
Tools
- get_dashboard_by_uid / get_dashboard_summary / get_dashboard_property — Read dashboards.
- runPanelQuery — Execute a panel's query against the datasource.
- datasource / alerting extras — When enabled in that version.
Config (Claude Desktop / Cursor / Windsurf)
Paste the JSON below. Same mcpServers shape. Replace placeholder paths and secrets.
Windows paths look like C:\\Users\\you\\project, not /path/to.
Host-side steps →
Claude Desktop
| OS | Config file |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json
(usually C:\Users\<you>\AppData\Roaming\Claude\) |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Cursor
| Scope | macOS / Linux | Windows |
|---|---|---|
| This project | .cursor/mcp.json in the repo root | |
| This user | ~/.cursor/mcp.json |
%USERPROFILE%\.cursor\mcp.json |
Windsurf
| OS | Config file |
|---|---|
| macOS / Linux | ~/.codeium/windsurf/mcp_config.json |
| Windows | %USERPROFILE%\.codeium\windsurf\mcp_config.json |
{
"mcpServers": {
"grafana": {
"command": "npx",
"args": [
"-y",
"@grafana/mcp-grafana"
],
"env": {
"GRAFANA_URL": "https://grafana.example.com",
"GRAFANA_API_KEY": "glsa_..."
}
}
}
}
Windsurf remote MCP: use serverUrl instead of url if the block below is HTTP.
One-liner: npx -y @grafana/mcp-grafana
Secrets it wants: GRAFANA_URL, GRAFANA_API_KEY
How to get started
- Create a Grafana service account with dashboards:read. Add datasource query only if you want runPanelQuery.
- Set GRAFANA_URL and GRAFANA_API_KEY.
- Open one dashboard uid you know.
Access risk
Query tools can pull production metrics and customer-shaped labels. A write token can change dashboards and alerts.
When to skip it
Skip it for Prometheus-only PromQL (Prometheus MCP) or for Datadog.
Instead: Prometheus, Datadog, Elasticsearch.
Vs alternatives
| Server | Official? | Needs a secret? | Best for |
|---|---|---|---|
| Grafana | No | Yes | Dashboards and datasources. |
| Prometheus | No | Yes | Instant queries against Prometheus. |
| Datadog | No | Yes | Metrics, logs, and monitors. |
| Elasticsearch | No | Yes | Search an Elasticsearch cluster. |
More in Cloud & infra
FAQ
Which token?
GRAFANA_URL plus a service-account token. dashboards:read first. Datasource query only if you want runPanelQuery.
Grafana or Prometheus?
Grafana if the question is dashboards/datasources. Prometheus MCP if you only have PromQL and a Prometheus URL.
Can queries leak customer labels?
Yes. Metrics often have tenant ids. A write token can change dashboards and alerts.
Official Grafana?
Yes — @grafana/mcp-grafana.