Grafana MCP Server
Grafana Labs' open-source server for querying metrics, logs and traces and managing dashboards and alerts
What it does
This is the open-source MCP server Grafana Labs publishes as grafana/mcp-grafana. It connects an assistant to one Grafana instance, self-hosted or Grafana Cloud, through a service account token. The assistant can search and read dashboards, run Prometheus, Loki, Tempo and Pyroscope queries, look at alert rules, incidents and OnCall schedules, and render panels as images. Grafana Cloud also offers a separate hosted MCP server that signs in with OAuth; this page covers the one you run yourself.
It has a lot of tools. Version 2.5.0 listed 81 with the default categories in our run, about 29,810 tokens of definitions, and 19 of them change things in Grafana: dashboards, datasources, alert rules, silences, annotations, snapshots, incidents and plugins, plus a general grafana_api_request tool. Starting it with --disable-write left 64 read-only tools (about 21,706 tokens), and --disable-<category> flags cut the list further. More categories, such as CloudWatch, SQL datasources and admin, are off until you enable them.
Watch the version you install. The README's quick start uses uvx mcp-grafana, which on Dec 2, 2026 installed 2.2.0 from PyPI, while the Docker image and the GitHub release binaries were at 2.5.0. The server also sends anonymous usage statistics to Grafana Labs by default; set GRAFANA_USAGE_STATS=disabled to stop it.
Tools
Listed by starting the server ourselves on Dec 2, 2026. The grouping uses the server's own annotations.
Read-only · 62
alerting_manage_routingalerting_rules_readalerting_silences_readanalyze_loki_labelscheck_datasources_healthdiff_tempo_tracesget_alert_groupget_annotation_tagsget_annotationsget_assertionsget_current_oncall_usersget_dashboard_by_uidget_dashboard_panel_queriesget_dashboard_propertyget_dashboard_summaryget_datasourceget_docget_incidentget_oncall_shiftget_panel_imageget_pluginget_snapshotget_tempo_traceget_tempo_traceql_docslist_alert_groupslist_dashboard_versionslist_datasourceslist_incident_custom_fieldslist_incidentslist_loki_label_nameslist_loki_label_valueslist_oncall_scheduleslist_oncall_teamslist_oncall_userslist_prometheus_label_nameslist_prometheus_label_valueslist_prometheus_metric_metadatalist_prometheus_metric_nameslist_provisioning_repositorieslist_pyroscope_label_nameslist_pyroscope_label_valueslist_pyroscope_profile_typeslist_snapshotslist_tempo_attribute_nameslist_tempo_attribute_valuesquery_loki_logsquery_loki_patternsquery_loki_statsquery_prometheusquery_prometheus_histogramquery_pyroscopequery_tempo_exceptionsquery_tempo_metricsrender_grafana_appsearch_dashboardssearch_docssearch_folderssearch_plugin_informationsearch_tempo_tracessuggest_loki_alloy_label_configuser_infovalidate_provisioning_file
Writes or acts · 9
add_activity_to_incidentalerting_routing_writecreate_annotationcreate_datasourcecreate_foldercreate_incidentcreate_snapshotgenerate_deeplinkinstall_plugin
Marked destructive · 10
alerting_rules_writealerting_silences_writedelete_annotationdelete_snapshotgrafana_api_requestupdate_alert_groupupdate_annotationupdate_dashboardupdate_datasourceupdate_incident
Install
Claude Code
Tested Dec 2, 2026 on Claude Code 2.1.334 with the mcp-grafana 2.5.0 release binary, Linux container (node:24-bookworm-slim, Node 24.23.0, arm64)From Grafana's Claude Code page. It needs the mcp-grafana binary on your PATH (download it from the GitHub releases page and check it against the checksums file).
claude mcp add-json "grafana" '{"command":"mcp-grafana","args":[],"env":{"GRAFANA_URL":"http://localhost:3000","GRAFANA_SERVICE_ACCOUNT_TOKEN":"<your-token>"}}'
In our test, with the 2.5.0 release binary and a placeholder token, claude mcp list reported grafana: mcp-grafana - ✔ Connected. That confirms the server starts and answers, not that the token works: a wrong token or URL only fails when a tool is called. Add "GRAFANA_USAGE_STATS":"disabled" to env to turn off the anonymous usage report.
Launch command (any stdio client)
Tested Dec 2, 2026 on grafana/mcp-grafana:2.5.0 Docker image (linux/arm64), stdio test client; also uvx mcp-grafana 2.2.0 with uv 0.13.12We started the server with this command in a clean Linux setup and confirmed it completes the MCP handshake and answers tools/list with 81 tools:
docker run --rm -i \
-e GRAFANA_URL=http://localhost:3000 \
-e GRAFANA_SERVICE_ACCOUNT_TOKEN=glsa_YOUR_TOKEN \
-e GRAFANA_USAGE_STATS=disabled \
grafana/mcp-grafana:2.5.0 -t stdio
-t stdio is needed because the image starts in SSE mode otherwise. GRAFANA_USAGE_STATS=disabled is our addition and turns off the anonymous usage report. Inside the container localhost is the container itself: for a Grafana running on your own machine use http://host.docker.internal:3000, and for Grafana Cloud your instance URL. Add --disable-write after -t stdio for read-only use (64 tools in our run). We also ran the README's uvx mcp-grafana with the same variables; it worked but installed the older 2.2.0 from PyPI. We used a placeholder token, so no tool was called.
{
"mcpServers": {
"grafana": {
"env": {
"GRAFANA_URL": "http://host.docker.internal:3000",
"GRAFANA_USAGE_STATS": "disabled",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "glsa_YOUR_TOKEN"
},
"args": [
"run",
"--rm",
"-i",
"-e",
"GRAFANA_URL",
"-e",
"GRAFANA_SERVICE_ACCOUNT_TOKEN",
"-e",
"GRAFANA_USAGE_STATS",
"grafana/mcp-grafana:2.5.0",
"-t",
"stdio"
],
"command": "docker"
}
}
}Cursor
From the maker's docs · not run by usFrom Grafana's documentation; not run by us.
With the mcp-grafana binary on your PATH, add this to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):
{
"mcpServers": {
"grafana": {
"command": "mcp-grafana",
"args": [],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your-token>"
}
}
}
}
Grafana's page also gives a Docker form of the same entry.
Before you adopt it
6 of 6 key facts checked- Tools and what they can changeExactly what an agent can read, write or delete
- 81 tools in version 2.5.0 with the default categories: 62 marked read-only by the server, 9 that write or act, 10 marked destructive. Destructive: alerting_rules_write, alerting_silences_write, delete_annotation, delete_snapshot, grafana_api_request, update_alert_group, update_annotation, update_dashboard, update_datasource, update_incident. Writing but not marked destructive: add_activity_to_incident, alerting_routing_write, create_annotation, create_datasource, create_folder, create_incident, create_snapshot, generate_deeplink (shortens URLs), install_plugin. With --disable-write it listed 64, all read-only. The PyPI build 2.2.0 that uvx installs listed 80 (no query_tempo_exceptions). Categories off by default, such as admin, cloudwatch, elasticsearch and the SQL datasources, add more tools when enabled. We used a placeholder token and called no tool.Checked Dec 2, 2026 · source
- Required credentials and scopesLeast-privilege setup with no first-run failure
- GRAFANA_URL plus a Grafana service account token in GRAFANA_SERVICE_ACCOUNT_TOKEN, or a file path in GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE (re-read on every request), or GRAFANA_USERNAME and GRAFANA_PASSWORD. GRAFANA_API_KEY still works but is deprecated. The README lists the RBAC permissions each tool needs, for example datasources:query for queries and dashboards:write for update_dashboard; it offers the built-in Editor role as a shortcut but warns that it grants broad read and write access. In our runs a placeholder token and an unreachable URL were enough to start the server and list tools, so a wrong token only fails when a tool is called.Checked Dec 2, 2026 · source
- Tool-definition token costContext used on every request
- About 29,810 tokens for the 81 default tool definitions of 2.5.0, about 21,706 for the 64 tools left by --disable-write, and about 29,404 for the 80 tools of 2.2.0 from PyPI (size of the tools/list reply divided by four; an estimate, not a tokeniser count). --disable-<category> flags or --enabled-tools shrink it.Checked Dec 2, 2026 · source
- Package and versionThe exact package or image you will run, and who publishes it
- Docker image grafana/mcp-grafana:2.5.0 on Docker Hub (an alpine variant is also tagged), which reported itself as mcp-grafana 2.5.0; release binaries for Linux, macOS and Windows on GitHub with a checksums file; go install github.com/grafana/mcp-grafana/v2/cmd/mcp-grafana. The README's quick start uses uvx mcp-grafana, which installed 2.2.0 from PyPI (published Nov 2, 2026), three releases behind.Checked Dec 2, 2026 · source
- Where your data goesLocal only, or through the vendor's cloud; any telemetry
- The server runs where you start it and calls your Grafana instance's API with your token; dashboards, query results and logs pass through it to your AI client and that client's model provider. By default it also sends anonymous usage statistics to Grafana Labs every 4 hours and at shutdown: tools called, failure counts, flag names, and whether the instance is cloud or self-hosted. The README says arguments, queries, log lines, URLs and credentials are never sent. Turn it off with GRAFANA_USAGE_STATS=disabled, --usage-stats=disabled or DO_NOT_TRACK=1.Checked Dec 2, 2026 · source
- Last releaseThe spec and upstream APIs change fast
- v2.5.0 · Dec 2, 2026 on GitHub and Docker Hub. PyPI, which uvx uses, was at 2.2.0 (Nov 2, 2026).Checked Dec 2, 2026 · source
- Runtime requirementsNode, Python, Docker, operating system
- A single Go binary with no runtime needed; Grafana 9.0 or later. The Docker image starts in SSE mode on 0.0.0.0:8000 by default, so pass -t stdio for local clients. The uvx route needs uv and Python 3.10 or later.Checked Dec 2, 2026 · source
- Read-only modeSafe use against production data
- --disable-write removes the write tools (17 fewer in our run, leaving 64 read-only); --enable-write-tools=<name> keeps individual ones. --disable-query removes every tool that runs a datasource query and keeps discovery tools. The raw-SQL tools query_sql and query_influxdb can write through the datasource, so --disable-write removes them unless you pass --enable-query.Checked Dec 2, 2026 · source
- Security recordProvenance and published advisories
- In SSE and streamable-http modes, set MCP_GRAFANA_SERVER_TOKEN so callers must send a bearer token; without it the server accepts any caller and only logs a security error when bound to a non-loopback address, as the Docker image is by default. Host and Origin checks are on by default. Per-request Grafana URL overrides are off by default; when enabled without an allowlist, a caller can make the server reach any HTTP(S) address it can see, including internal services.Checked Dec 2, 2026 · source
