grafana-mcp — Claude Code plugin: Grafana and installation
Connect Claude Code to a live Grafana instance through MCP to inspect dashboards, run queries, and work with alerts or incidents. Requires Docker and a service account token.
/plugin install grafana-mcp@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-officialWhat grafana-mcp does
This plugin connects Claude Code to Grafana’s official MCP server. The agent can search and inspect dashboards, look up data sources, run PromQL and LogQL queries, and manage alert rules and incidents. Other tools cover annotations, OnCall, and links to dashboards or panels.
You need Docker installed and running, plus a Grafana service account token with at least the Viewer role. Write operations require Editor access. When enabled, Claude Code asks for the Grafana instance URL and token; the token is stored in the system keychain. This setup targets self-hosted Grafana or token-based access. For Grafana Cloud, the README points to a separate plugin or connector. The server adds more than 40 tools to the context, so enable it when you need to work with a live Grafana instance.
What it helps with
- find a dashboard and retrieve its summary
- run a PromQL or LogQL query
- inspect Grafana data sources
- create or update an alert rule
- find an incident and add an activity entry
Example prompts for the agent
- Find the dashboard for the payments service and show its summary.
- Run a PromQL query for the error metric and explain the result.
- Find the active incident and add an update about the check.
How to install grafana-mcp
Plugin marketplace
/plugin install grafana-mcp@claude-plugins-official/plugin marketplace add anthropics/claude-plugins-officialStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about grafana-mcp
How do I install grafana-mcp in Claude Code?
Run these commands in order: /plugin marketplace add anthropics/claude-plugins-official, then /plugin install grafana-mcp@claude-plugins-official.
What does grafana-mcp do?
It connects Claude Code to Grafana over MCP. The agent can work with dashboards, PromQL and LogQL queries, alerting, and incidents.
What does grafana-mcp need to run?
Docker must be installed and running, and Grafana needs a service account token with at least Viewer access. Write operations require the Editor role.
Source text
grafana-mcp · Apache-2.0
# Grafana MCP Cursor plugin that exposes the official [Grafana MCP server](https://github.com/grafana/mcp-grafana) for AI-assisted observability workflows. **Using Grafana Cloud?** Use the [grafana-cloud-mcp](../grafana-cloud-mcp/) plugin or the Grafana Cloud connector instead — no Docker or service-account token needed. This plugin is for self-hosted Grafana or token-based setups. **Note:** This plugin adds 40+ MCP tools to your context window. Only enable it when you need to interact with a live Grafana instance. For skills and rules around Grafana Assistant development, install the **grafana-assistant** plugin instead. ## Prerequisites 1. [Docker](https://docs.docker.com/get-docker/) must be installed and running. 2. Create a [service account](https://grafana.com/docs/grafana/latest/administration/service-accounts/) in Grafana with at least **Viewer** role (or **Editor** for write operations). Generate a token. ## Setup ### Claude Code When you enable the plugin, Claude Code prompts you for: - **Grafana instance URL** — e.g. `http://localhost:3000` for local, or `https://<stack>.grafana.net` for Grafana Cloud - **Service account token** — stored in your system keychain No shell environment variables required. ### Cursor Export the environment variables before launching Cursor: ```bash export GRAFANA_URL="http://localhost:3000" export GRAFANA_SERVICE_ACCOUNT_TOKEN="<your token>" ``` For Grafana Cloud, use your instance URL instead (e.g. `https://myinstance.grafana.net`). ## Available tools The MCP server provides 40+ tools across these categories: | Category | Examples | |---|---| | Dashboards | search, get summary, get property, patch | | Datasources | list, get by UID or name | | Prometheus | PromQL queries, metric metadata, label names/values | | Loki | LogQL log/metric queries, label metadata, patterns | | Alerting | list/create/update/delete alert rules, contact points | | Incidents | search, create, add activity | | OnCall | schedules, shifts, on-call users, alert groups | | Navigation | generate deeplinks to dashboards, panels, Explore | | Annotations | get, create, update, patch, list tags | See the [mcp-grafana README](https://github.com/grafana/mcp-grafana) for the full tool reference and RBAC requirements.
© Grafana · Apache-2.0 · grafana/ai-marketplace