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
- Set Up a Service Account:
- Create a Grafana service account with necessary permissions and generate an API token.
- Install the Server:
- Download the latest release or build from source using Go.
- Configure the Client:
- Add the server configuration to your MCP client (e.g., Claude Desktop) with environment variables (
GRAFANA_URL
, GRAFANA_API_KEY
).
- 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.