gr

grafana/mcp-grafana

๐ŸŽ–๏ธ ๐Ÿ ๐Ÿ  โ˜๏ธ Search dashboards, investigate incidents and query datasources in your Grafana instance

#Grafana#monitoring#data visualization
Publishergrafana/mcp-grafana
Submitted date4/19/2025

Grafana MCP Server Overview

Title

Grafana MCP Server โ€“ A Model Context Protocol (MCP) server for Grafana, providing access to dashboards, datasources, alerts, and Grafana ecosystem tools.

How to Use

  1. Set Up a Service Account:
    • Create a Grafana service account with necessary permissions and generate an API token.
  2. Install the Server:
    • Download the latest release or build from source using Go.
  3. Configure the Client:
    • Add the server configuration to your MCP client (e.g., Claude Desktop) with environment variables (GRAFANA_URL, GRAFANA_API_KEY).
  4. Optional Debug Mode:
    • Enable -debug flag for detailed HTTP request/response logging.

Key Features

  • Dashboard Management:
    • Search dashboards, fetch by UID.
  • Datasource Integration:
    • List and query datasources (Prometheus, Loki, partial Tempo/Pyroscope support).
  • Metadata Queries:
    • Prometheus/Loki label names, values, and metric metadata.
  • Incident Management:
    • Search, create, update, and resolve Grafana Incident cases.
  • Alerting & OnCall:
    • List alert rules, contact points, and manage Grafana OnCall schedules/users.
  • Configurable Tools:
    • Disable unused tool categories (e.g., --disable-oncall) to optimize performance.

Use Cases

  • Monitoring & Troubleshooting: Query Prometheus/Loki logs/metrics directly via MCP.
  • Incident Response: Create and manage Grafana Incident cases programmatically.
  • OnCall Coordination: Retrieve current on-call users and shift details.
  • Dashboard Automation: Fetch and analyze dashboards without manual UI interaction.

Development

  • Contribute via GitHub issues/pull requests.
  • Run tests (unit, integration, cloud) or use Docker for local testing.

For details, see the full documentation.

Visit More

View All