Grafana MCP
Query dashboards, Prometheus, Loki, alerts, incidents and OnCall in Grafana.
Labels are provisional (from the project README/docs, checked Nov 3, 2026). Not yet tested in our sandbox.
Read-only switch
--disable-write turns off write tools, including the raw-SQL query tools. --enable-write-tools and --enable-query opt tools back in, so remove them.
Preset
- Added
--disable-write
Claude Code
{
"mcpServers": {
"grafana": {
"command": "docker",
"args": [
"run", "--rm", "-i", "-e", "GRAFANA_URL", "-e",
Removed: "GRAFANA_SERVICE_ACCOUNT_TOKEN", "grafana/mcp-grafana", "-t", "stdio"
"GRAFANA_SERVICE_ACCOUNT_TOKEN", "grafana/mcp-grafana",
"--disable-write", "-t", "stdio"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<token>"
}
}
}
}Optional third layer: add "deny": ["mcp__grafana__<write tool>"] under permissions in .claude/settings.json.
Codex
# Generated by redpresets.dev on 2026-11-03. Unverified preset. Also use a read-only credential. Not a security guarantee.
[mcp_servers.grafana]
command = "docker"
Removed: args = ["run", "--rm", "-i", "-e", "GRAFANA_URL", "-e", "GRAFANA_SERVICE_ACCOUNT_TOKEN", "grafana/mcp-grafana", "-t", "stdio"]
args = ["run", "--rm", "-i", "-e", "GRAFANA_URL", "-e", "GRAFANA_SERVICE_ACCOUNT_TOKEN", "grafana/mcp-grafana", "--disable-write", "-t", "stdio"]
default_tools_approval_mode = "writes"
[mcp_servers.grafana.env]
GRAFANA_URL = "http://localhost:3000"
GRAFANA_SERVICE_ACCOUNT_TOKEN = "<token>"default_tools_approval_mode = "writes" asks before any tool the server does not mark read-only.
Cursor
{
"mcpServers": {
"grafana": {
"type": "stdio",
"command": "docker",
"args": [
"run", "--rm", "-i", "-e", "GRAFANA_URL", "-e",
Removed: "GRAFANA_SERVICE_ACCOUNT_TOKEN", "grafana/mcp-grafana", "-t", "stdio"
"GRAFANA_SERVICE_ACCOUNT_TOKEN", "grafana/mcp-grafana",
"--disable-write", "-t", "stdio"
],
"env": {
"GRAFANA_URL": "http://localhost:3000",
"GRAFANA_SERVICE_ACCOUNT_TOKEN": "<token>"
}
}
}
}Don't add write tools to mcpAllowlist in .cursor/permissions.json. Leave them on approval. Cursor's docs say the allowlist is not a security boundary.
Lines marked + are what we added to the vendor's install command. Struck-through lines marked − are what they replaced; Copy leaves those out.
Credential layer
Use a Grafana service account with the Viewer role.
Gotchas
- Raw query tools (
query_sql,query_influxdb) run whatever query they get,DROP TABLEincluded, if the datasource credentials allow it.--disable-writeremoves them;--enable-querybrings them back. - The service account token still decides what Grafana allows. Use a Viewer token.
Facts
- Vendor
- Grafana Labs official
- Source
- grafana/mcp-grafana
- License
- Apache-2.0
- GitHub stars
- 3.6k
- Latest release
- v2.1.1 (Oct 20, 2026)
- Last push
- Oct 27, 2026
- Status
- Active
- Last checked
- Nov 3, 2026
Sources
- README: --disable-write, --enable-write-tools, -t stdio · checked Oct 27, 2026
- Docker Hub image mcp/grafana (Docker MCP catalog), same server · checked Nov 2, 2026
Spotted something wrong? Labels change when vendors change. Suggest a correction
Read-only alternatives in Observability
PromQL queries, metric and target discovery against a Prometheus server.
Query VictoriaMetrics: MetricsQL, series, alerts, and docs search.
Query OpenTelemetry traces from Jaeger, Tempo or Traceloop backends.