Grafana MCP

Query dashboards, Prometheus, Loki, alerts, incidents and OnCall in Grafana.

By defaultCan write
With our presetRead-only

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

Read-onlyRead-only switch from the vendor's docs. Not sandbox-tested yet.
What the preset changes
  • Added --disable-write

Claude Code

.mcp.json
{
  "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

~/.codex/config.toml
# 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

.cursor/mcp.json
{
  "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 TABLE included, if the datasource credentials allow it. --disable-write removes them; --enable-query brings 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

Spotted something wrong? Labels change when vendors change. Suggest a correction

Read-only alternatives in Observability