mcp-grafana  by grafana

MCP server for Grafana

Created 8 months ago
1,483 stars

Top 27.8% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides a Model Context Protocol (MCP) server for Grafana, enabling programmatic access to Grafana dashboards, datasources, incidents, and alerting features. It targets developers and users who need to integrate Grafana's observability data and controls into other applications or workflows, such as AI assistants or custom automation scripts.

How It Works

The MCP server acts as a bridge, translating requests from an MCP client into API calls to a Grafana instance. It supports a configurable set of "tools" that map to specific Grafana functionalities, including searching dashboards, querying Prometheus and Loki, managing incidents, and interacting with Grafana OnCall. This modular design allows users to tailor the server's capabilities to their specific needs and context window limitations.

Quick Start & Requirements

  • Install:
    • Docker: docker pull mcp/grafana
    • Binary: Download from releases and add to $PATH.
    • Source: GOBIN="$HOME/go/bin" go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest
  • Prerequisites: Grafana instance, Grafana service account token.
  • Configuration: Requires setting GRAFANA_URL and GRAFANA_API_KEY environment variables.
  • Docs: Grafana documentation for service account token creation.

Highlighted Details

  • Supports querying Prometheus metadata (names, labels, values) and Loki metadata (label names, values).
  • Integrates with Grafana Incident for creating, updating, and resolving incidents.
  • Includes Sift integration for finding error patterns in logs and slow requests.
  • Configurable toolset to manage context window usage.

Maintenance & Community

  • Contributions are welcome via issues and pull requests.
  • Written in Go.
  • Development can be initiated with make run.
  • Testing includes unit, integration, and cloud tests.

Licensing & Compatibility

  • Licensed under the Apache License, Version 2.0.
  • Permissive license suitable for commercial use and integration with closed-source applications.

Limitations & Caveats

  • Some features like querying Tempo, Pyroscope, creating/changing alert rules, and managing contact points are not yet implemented.
  • A disclaimer warns about potential context window issues when updating dashboards.
Health Check
Last Commit

4 days ago

Responsiveness

1 day

Pull Requests (30d)
19
Issues (30d)
28
Star History
173 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.