Skip to content

grafana/grafana-mcp

v0.3.1Apache-2.0

For self-hosted Grafana, or any Grafana with a service-account token: dashboards, Prometheus, Loki, alerting, incidents, and OnCall via the Grafana MCP server, run locally in Docker.

Grafana (self-hosted)

Plugin that exposes the official Grafana MCP server for AI-assisted observability workflows.

Using Grafana Cloud? Use the Grafana Cloud 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 dozens of MCP tools to your context window. Only enable it when you need to interact with a live Grafana instance.

Prerequisites

  1. Docker must be installed and running.

  2. Create a service account 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:

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 dozens of tools across these categories:

CategoryExamples
Dashboardssearch, get summary, get property, patch
Datasourceslist, get by UID or name
PrometheusPromQL queries, metric metadata, label names/values
LokiLogQL log/metric queries, label metadata, patterns
Alertinglist/create/update/delete alert rules, contact points
Incidentssearch, create, add activity
OnCallschedules, shifts, on-call users, alert groups
Navigationgenerate deeplinks to dashboards, panels, Explore
Annotationsget, create, update, patch, list tags

See the mcp-grafana README for the full tool reference and RBAC requirements.