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.
Bring your own
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.
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.
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.
Typical tools an AI model can call. Exact names vary by version.
Taken from the official Grafana documentation — see Grafana MCP server — official documentation for the full reference.
Environment variables
GRAFANA_URLrequiredBase URL of your Grafana instance, for example https://myorg.grafana.net.
GRAFANA_SERVICE_ACCOUNT_TOKENrequiredService 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"
}
}
}
}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.
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.
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 evalsOpen MCP Agent Studio with the connection pre-filled. Add your token, pick any of 60+ models, and start chatting — no install required.
Open Agent StudioCommon questions about connecting, scoping and using it safely.
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.
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.
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.
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.
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.
Sentry
Triage issues, stack traces and releases from chat without opening ten browser tabs.
Kubernetes
Inspect and operate a cluster through the Kubernetes API, not kubectl.
Elasticsearch
Search indices, read mappings and run query DSL with an AI agent.
ClickHouse
Run analytical SQL over billions of rows in natural language.