Grafana MCP Server
Connect AI agents to Grafana dashboards, metrics, logs, and alerts over MCP.
Updated
What is Grafana MCP?
The Grafana MCP server is a Model Context Protocol server that gives AI assistants and agents access to your Grafana observability data — dashboards, metrics, logs, traces, alerts, and incidents.
There are two flavors. Grafana ships an open-source server (grafana/mcp-grafana, Apache-2.0) that you run yourself and point at any Grafana instance using a service account token. Grafana Cloud also offers a fully hosted remote server at https://mcp.grafana.com/mcp (Streamable HTTP transport), which uses an OAuth 2.1 authorization flow so you don't manage tokens by hand — you authorize through a browser consent page on first connection.
Both expose the same broad tool surface: searching and managing dashboards and folders, listing datasources, running PromQL and Loki queries, exploring traces and profiles, managing alert rules and notification policies, and working with Grafana Incident, Sift, and OnCall. The hosted server optionally takes an X-Grafana-URL header pointing at your Grafana Cloud instance.
Tools the Grafana MCP server exposes
| Tool | What it does |
|---|---|
| search_dashboards | Find dashboards by title or query across your Grafana instance. |
| get_dashboard_summary | Retrieve a dashboard's panels, queries, and structure. |
| update_dashboard | Create or update a dashboard, including patching individual panels. |
| list_datasources | List configured datasources (Prometheus, Loki, ClickHouse, CloudWatch, and more). |
| query_prometheus | Run PromQL range or instant queries and fetch metric metadata. |
| query_loki_logs | Query Loki logs and metrics, explore labels, and inspect patterns. |
| list_alert_rules | List and inspect Grafana alert rules and their state. |
| list_contact_points | View alerting notification policies and contact points. |
| create_incident | Create and manage incidents via Grafana Incident. |
| generate_deeplink | Generate deeplinks to dashboards, panels, and Explore views. |
Connect the Grafana MCP server
Claude Code (hosted Grafana Cloud MCP)
- 1
Add the remote server
Run: claude mcp add --transport http grafana https://mcp.grafana.com/mcp
- 2
Authorize via OAuth
On first use, Claude Code opens a browser consent page; sign in to Grafana Cloud and approve access. Tokens are handled by the OAuth 2.1 flow.
- 3
Point at your instance (optional)
If needed, set the X-Grafana-URL header to your Grafana Cloud instance URL so queries target the right stack.
- 4
Verify
Run /mcp in Claude Code and confirm the grafana server is connected, then ask it to search your dashboards.
Cursor (hosted Grafana Cloud MCP)
- 1
Open MCP settings
In Cursor, go to Settings - MCP and add a new server.
- 2
Configure the remote endpoint
Add a server entry with URL https://mcp.grafana.com/mcp using the Streamable HTTP transport, optionally with an X-Grafana-URL header for your Grafana Cloud instance.
- 3
Complete OAuth
Save the config; Cursor triggers the OAuth 2.1 browser flow. Approve access to your Grafana Cloud data.
- 4
Use it
Confirm the server shows as connected, then ask Cursor to query metrics or pull a dashboard.
Sample use cases
Daily observability digest
A scheduled agent queries metrics and logs, summarizes anomalies, and posts a report with dashboard deeplinks.
Incident enrichment
On a new alert, an agent pulls related dashboards, alert rules, and recent logs to add context to the incident.
Conversational querying
Engineers ask an assistant for PromQL/Loki results in plain language without opening Grafana.
Security & permissions
The hosted Grafana Cloud server at mcp.grafana.com uses an OAuth 2.1 authorization flow with dynamic client registration — you authorize through a browser consent page and Grafana issues scoped, revocable access rather than a long-lived static token. Access is governed by your Grafana Cloud role and the Assistant Cloud MCP permission, so the agent inherits the data and actions your authorized identity is allowed to see (dashboards, metrics, logs, alerts, incidents).
The self-hosted open-source server authenticates with a Grafana service account token (GRAFANA_SERVICE_ACCOUNT_TOKEN); scope it to the minimum RBAC permissions the agent needs, and note that administrative tools (team/user/role management) are disabled by default. In all cases, grant the narrowest access required and treat the connection as having read/write reach into your observability data.
Using Grafana MCP with Gamut
In Gamut, you connect Grafana once and then let an agent use it as a tool inside event- or schedule-triggered workflows — Gamut manages the underlying MCP connection and OAuth authorization. For example, a scheduled agent can query Prometheus and Loki each morning to summarize error rates and latency, post a digest to chat, and link back to the relevant dashboards via deeplinks; or an incident-triggered agent can pull recent alert rules and dashboard context to enrich a ticket. The agent only performs the Grafana actions its authorized scope permits.
Frequently asked questions
What is the Grafana MCP server?
It is a Model Context Protocol server that lets AI assistants and agents access your Grafana data — dashboards, metrics, logs, traces, alerts, and incidents. Grafana offers an open-source server you self-host and a hosted Grafana Cloud server at https://mcp.grafana.com/mcp.
Is the Grafana MCP server free?
The open-source server (grafana/mcp-grafana, Apache-2.0) is free to run against any Grafana instance with a service account token. The hosted Grafana Cloud MCP server is part of Grafana Assistant and counts connected users toward your Grafana Cloud monthly-active-user billing, with access gated by your Grafana Cloud role.
How do I connect the Grafana MCP server to Claude or Cursor?
For the hosted server, add https://mcp.grafana.com/mcp as a Streamable HTTP MCP server. In Claude Code run 'claude mcp add --transport http grafana https://mcp.grafana.com/mcp'; in Cursor add the same URL under Settings - MCP. Both then run the OAuth 2.1 browser flow to authorize access.
Is the Grafana MCP server hosted or self-hosted?
Both. The open-source server is self-hosted and connects to any local or Grafana Cloud instance using a service account token. Grafana Cloud also provides a fully hosted remote server at mcp.grafana.com that requires no local install and uses OAuth 2.1.