MCP ServerSTDIO

Grafana MCP Server

Grafana ships an official MCP server that puts your whole observability stack behind a chat interface. An agent can write and run PromQL against Prometheus, query Loki logs, search and edit dashboards, read alert rules, and kick off Sift investigations for error patterns and slow requests.

Hosted URL

Bring your own

Suggested model

Claude Sonnet 4.5

Chat with 60+ AI models on the same workflow — switch to a different model mid-conversation and re-run the same prompt, or use Compare mode to put several side-by-side and balance quality vs. cost.

Auth

A Grafana service account token with only the permissions you want the agent to have. Viewer is enough unless you intend it to edit dashboards.

What the Grafana MCP server does

How models use it and what it is built for.

The Grafana MCP server connects through your Grafana instance rather than to each datasource separately, which means one credential and one endpoint covers everything Grafana already knows how to reach. On the metrics side an agent can list datasources, discover metric names and label values, and run instant or range PromQL queries. On the logs side it can query Loki with LogQL, list label names and values, and fetch log statistics. It can search dashboards by title, fetch a dashboard by UID to read its panels, and update or create dashboards. Incident response is covered too: list and create incidents, read alert rules and their current state, and run Sift investigations that look for error patterns or slow requests automatically. A generate_deeplink tool returns a real Grafana URL so a human can pick up where the agent left off. Tools are grouped into categories you can disable individually, which keeps the tool list manageable.

Tools the Grafana MCP server exposes

Typical tools an AI model can call. Exact names vary by version.

  • query_prometheus — run instant or range PromQL queries against a datasource
  • list_prometheus_metric_names / label values — discover what is actually being recorded
  • query_loki_logs / query_loki_stats — LogQL queries and log volume statistics
  • search_dashboards / get_dashboard_by_uid / update_dashboard — read and edit dashboards
  • list_datasources / get_datasource_by_uid — enumerate what the instance can query
  • list_alert_rules / get_alert_rule_by_uid — alert definitions and current state
  • list_incidents / create_incident — Grafana Incident workflows
  • find_error_pattern_logs / find_slow_requests — Sift investigations
  • generate_deeplink — hand a human a real Grafana URL for the view being discussed

Connecting to Grafana

Taken from the official Grafana documentation — see Grafana MCP server — official documentation for the full reference.

Environment variables

  • GRAFANA_URLrequired

    Base URL of your Grafana instance, for example https://myorg.grafana.net.

  • GRAFANA_SERVICE_ACCOUNT_TOKENrequired

    Service account token. Create a dedicated account with the Viewer role for read-only agent access.

Client configuration

uvx (recommended)

Runs the published server without a separate install step.

{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": ["mcp-grafana"],
      "env": {
        "GRAFANA_URL": "https://myorg.grafana.net",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "glsa_YOUR_TOKEN"
      }
    }
  }
}

Docker in stdio mode

The image defaults to SSE, so pass -t stdio explicitly for desktop clients.

{
  "mcpServers": {
    "grafana": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "GRAFANA_URL", "-e", "GRAFANA_SERVICE_ACCOUNT_TOKEN",
        "mcp/grafana", "-t", "stdio"
      ],
      "env": {
        "GRAFANA_URL": "https://myorg.grafana.net",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "glsa_YOUR_TOKEN"
      }
    }
  }
}

Example prompts to try

Copy any of these into MCP Agent Studio after connecting.

  • What was p99 latency on the checkout service over the last six hours?

  • Find the error pattern in the payments logs since the deploy at 14:00.

  • Which alert rules are currently firing, and which dashboards cover those services?

  • Show me request rate by pod for the last hour and flag anything anomalous.

Models on MCP Playground

This is not a single-model product: you get the same MCP connection with 60+ models (Claude, GPT, Gemini, DeepSeek, open-weight, and more), you can switch mid-conversation, and you can open Compare mode to run the same prompt against multiple models at once. The card above is a suggested starting point for this server — not the only choice.

Default pick for Grafana

Claude Sonnet 4.5

PromQL and LogQL are easy to write and easy to write wrong. Sonnet 4.5 constructs correct queries and interprets the returned series rather than restating them.

Check an AI agent can actually use the Grafana MCP server

Listing tools proves the server is reachable, not that a model can work with it. Evals go further: they read every tool on the server, write a test suite from its real schemas, and run it — code decides pass/fail on the responses (schema conformance, error codes, pagination, result caps) while a scoring model grades plain-English tasks driven through the tools.

Get a pass/fail report per tool with the evidence behind each verdict — and replay the same suite after every schema change. Destructive tools are excluded from the run.

Run evals

Try the Grafana MCP server in your browser

Open MCP Agent Studio with the connection pre-filled. Add your token, pick any of 60+ models, and start chatting — no install required.

Open Agent Studio

Grafana MCP server — FAQ

Common questions about connecting, scoping and using it safely.

What is the Grafana MCP server?

It is the official MCP server from Grafana Labs, published as grafana/mcp-grafana. It gives an AI assistant access to your Grafana instance — Prometheus and Loki queries, dashboards, datasources, alert rules, incidents and Sift investigations.

Do I need to connect Prometheus separately?

No. The server queries through Grafana, so any datasource Grafana can already reach is available with the same single token. That is the main practical advantage over pointing an agent at Prometheus directly.

What permissions should the service account have?

Viewer covers metrics, logs, dashboards and alert reads, which is what most people want. Grant Editor only if you genuinely intend the agent to create or update dashboards, and consider a separate account for that.

Which Grafana versions are supported?

Grafana 9.0 or later for full functionality. Sift investigations, Incident and OnCall tools additionally require those features to be enabled on the instance, and are absent on a plain OSS install.

Can I limit which tools the agent sees?

Yes. Tools are grouped into categories — dashboards, datasources, Prometheus, Loki, alerting, incident, Sift, OnCall, admin — and each group can be disabled at startup. Trimming to the groups you need keeps the tool list short, which measurably improves tool selection.

Other MCP servers

More on MCP Playground

Grafana MCP Server — Query Metrics, Logs and Dashboards with AI