Overview
What is Grafana MCP server?
A Model Context Protocol (MCP) server that provides AI agents with programmatic access to your Grafana instance and its surrounding ecosystem. It allows querying dashboards, datasources, alerting, incidents, and more.
How to use Grafana MCP server?
Install via uv and add the server to your MCP client configuration (e.g., Claude Desktop, Cursor) with the GRAFANA_URL and GRAFANA_SERVICE_ACCOUNT_TOKEN environment variables. Alternative installation methods include Docker, binary, and Helm.
Key features of Grafana MCP server
- Search, get, update, and patch dashboards
- Query Prometheus, Loki, ClickHouse, and other datasources
- Manage alert rules, notification policies, and contact points
- Create and update Grafana incidents
- View and manage Grafana OnCall schedules and alert groups
- List teams, users, and roles (admin tools, disabled by default)
Use cases of Grafana MCP server
- An AI assistant retrieves dashboard summaries and panel queries to answer monitoring questions
- Automatically create or update alert rules based on incident analysis
- Query Loki logs for error patterns and slow requests using Sift
- Review on-call schedules and current responders during an incident
- Execute PromQL or LogQL queries to gather metrics without manual dashboards
FAQ from Grafana MCP server
What Grafana version is required?
Grafana version 9.0 or later is required for full functionality. Earlier versions may not support datasource-related operations.
Why are some tools disabled by default?
Tools like Run Panel Query, Query Examples, and datasource-specific query tools (e.g., ClickHouse, Snowflake) are disabled by default. Enable them by adding the appropriate flag (e.g., --enabled-tools runpanelquery,examples,clickhouse) to the server configuration.
How can I reduce context window usage when working with dashboards?
Use get_dashboard_summary for an overview, get_dashboard_property with JSONPath to extract only needed fields, and avoid get_dashboard_by_uid unless you require the full dashboard JSON.
What authentication is required?
Provide a Grafana URL and a Grafana service account token via the GRAFANA_URL and GRAFANA_SERVICE_ACCOUNT_TOKEN environment variables. For Grafana Cloud, use the cloud instance URL.
Does the server support all Grafana datasources?
The server explicitly supports Prometheus, Loki, ClickHouse, CloudWatch, Elasticsearch/OpenSearch, Graphite, Athena, Snowflake, Quickwit, and InfluxDB. Other datasources are not covered.