Skip to content

MCP setupDevOps and cloud

Grafana MCP Server

Let your agent search Grafana dashboards, query Prometheus and Loki and read alert rules through Grafana's own MCP server, in read-only mode.

npx workspacetemplates add grafana-mcp --tool claude-code

Writes 1 file to your project root

.mcp.jsonmerge into your file15 lines · 287 BFile
{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": [
        "mcp-grafana",
        "--disable-write"
      ],
      "env": {
        "GRAFANA_URL": "${GRAFANA_URL}",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "${GRAFANA_SERVICE_ACCOUNT_TOKEN}"
      }
    }
  }
}

What it does

The Grafana MCP server connects an agent to a Grafana instance through a service account. It can find dashboards, run PromQL and LogQL queries against your datasources and list alert rules, so you can ask about a metric instead of hunting through panels.

This setup starts it with uvx and passes the --disable-write flag, which blocks every create, update and delete call. Remove the flag only if you want the agent to edit dashboards or alerts.

Example

you › Which alert rules in the payments folder are firing, and what does the p95 latency query for the checkout service return for the last 30 minutes?

agent › Two rules are firing: PaymentsQueueDepth and CheckoutErrorBudget. The p95 latency query shows 410 ms now, up from 180 ms at the start of the window, with the jump at 14:12.

Questions

Do I need to install Grafana tools first?
Only uv, which provides uvx. The server itself is fetched on first run.
Can the agent change my dashboards?
Not with this config. The --disable-write flag removes the tools that create, update or delete. The raw SQL tools are removed too.
Does it work with Grafana Cloud?
Yes. Set GRAFANA_URL to your .grafana.net address and use a service account token from that stack.
  • AWS Documentation MCP Server

    MCP setupDevOps and cloud

    Free
  • Azure MCP Server

    MCP setupDevOps and cloud

    Free
  • CircleCI MCP Server

    MCP setupDevOps and cloud

    Free
  • Cloudflare MCP Server

    MCP setupDevOps and cloud

    Free