Enable your LLMs to query, visualize, and reason with real-time Grafana data.

Published: 2/July/2025 Views: 214

What is Grafana MCP server?

The Grafana MCP Server bridges Grafana’s rich observability dashboards with LLM applications through the Model Context Protocol. This server acts as an intelligent interface between your LLM and Grafana Cloud, enabling automated access to dashboards, metrics, annotations, and alerts—without requiring manual querying or frontend interaction.

Whether you’re building an AI assistant for DevOps, a chatbot for infrastructure insights, or an agent for observability workflows, this MCP server provides structured access to Grafana’s powerful API and data model using standard function calling.

Grafana Key Features

  • LLM-Ready Integration: Connects to OpenAI-compatible agents using MCP standard.
  • Query Grafana Dashboards: Let your AI ask for specific panels, time series, or dashboard data.
  • Time-Filtered Metrics: Query metrics over time ranges like “last 2 hours” or “yesterday”.
  • Annotations & Alerts: Access relevant annotations and triggered alerts programmatically.
  • Auto-Generated Functions: Offers function specs that LLMs can call directly—no custom tooling needed.
  • Compatible with Hosted & OSS Grafana: Works with Grafana Cloud and self-hosted instances.

Installation

git clone https://github.com/grafana/mcp-grafana
cd mcp-grafana
pip install -r requirements.txt
# Set up your environment variables for Grafana API
python server.py

Note: Requires API key from Grafana with appropriate access permissions.

Use Cases

  • AI dashboards assistants that explain charts in natural language
  • LLMs that investigate anomalies using real metric data
  • Automated DevOps copilots that monitor and react to Grafana alerts
  • Context-aware chatbots for NOC or SRE teams