Grafana MCP Server
$ mcp-grafana Official Med RiskOfficial Grafana Labs MCP server in Go that gives AI agents access to dashboards, Prometheus metrics, Loki logs, Tempo traces, incidents, and alert rules. Supports -t/--transport (stdio, sse, streamable-http), --address, --endpoint-path, --enabled-tools, and --disable-write safety scoping.
brew install mcp-grafana mcp-grafana is purpose-built as an MCP server bridging Grafana, Prometheus, Loki, and alerting APIs into agent tool schemas.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Exposes structured MCP JSON-RPC tools over stdio, sse, and streamable-http, with --enabled-tools filtering and non-interactive startup.
- Supports
-t/--transport(stdio|sse|streamable-http),--address, and--endpoint-path
Supports Grafana Service Account tokens and --disable-write / --enabled-tools flags to enforce least-privilege read-only operation.
--disable-writeand--enabled-toolsrestrict mutating and unwanted tool categories
Single static Go binary available via brew install mcp-grafana, go install, Docker, and GitHub releases across macOS, Linux, and Windows.
- Distributed via Homebrew, Go install, Docker, and release tarballs
Consolidates dashboard search, PromQL, LogQL, Tempo, and OnCall queries behind one official server.
- Unifies multiple Grafana stack APIs in one MCP server
Official grafana/mcp-grafana repository maintained by Grafana Labs under Apache-2.0.
- Official Grafana Labs repository with active releases
Well-documented README and Grafana Cloud MCP docs detailing flags, transports, and tool categories.
- README and Grafana docs document all flags and environment variables
Security, Auth & Guardrails
Reads GRAFANA_URL and GRAFANA_SERVICE_ACCOUNT_TOKEN (or basic auth env vars) from process environment.
Apache-2.0 open-source binary; requires a self-hosted Grafana instance or Grafana Cloud account.
# Grafana MCP Server Agent Rules - Always pass `--disable-write` and scope `GRAFANA_SERVICE_ACCOUNT_TOKEN` to Viewer role for investigation tasks. - Use `--enabled-tools` to whitelist only required datasources and prevent prompt bloat.
Agent-Ready Command Recipes
Safe Read-Only Queries
mcp-grafana in read-only stdio mode GRAFANA_URL=https://grafana.example.com GRAFANA_SERVICE_ACCOUNT_TOKEN=$TOKEN mcp-grafana --disable-write
Starts the MCP server over stdio while disabling all mutating dashboard, alert, and incident tools.
mcp-grafana -t streamable-http --address 127.0.0.1:8000 --endpoint-path /mcp --enabled-tools search,prometheus,loki
Restricts exposed MCP tools to search, Prometheus, and Loki queries on a loopback HTTP endpoint.
Controlled Writes & Previews
mcp-grafana with debug logging enabled mcp-grafana -t stdio --debug --log-level debug
Enables all configured Grafana tools including write actions with verbose HTTP diagnostics for controlled troubleshooting.
Strengths for Agents
- +
--disable-writeand--enabled-toolslet operators enforce read-only, minimal-context agent sessions. - + Supports
stdio,sse, andstreamable-httptransports in a single Go binary. - + Covers dashboards, Prometheus, Loki, Tempo, and alerts without writing custom REST wrappers.
Caveats & Pitfalls
- !
--debuglogs detailed HTTP payloads that may expose sensitive headers in shared CI logs. - ! Passing
--enabled-toolsoverrides defaults, so omitted tool groups must be listed explicitly.