# Grafana MCP

> Grafana MCP lets your AI agent search, inspect, and manage all system monitoring data directly through natural conversation. You can find specific dashboards by tag or title, pull exact PromQL/LogQL queries from panels, audit connected data sources (Prometheus, Loki), and check the status of firing alerts—all without logging into the Grafana UI.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** dashboards, metrics, logs, traces, alerting, data-visualization

## Description

Monitoring complex systems used to mean clicking through tabs and manually copying IDs. Now, you can connect your observability stack directly to your agent. This MCP gives you full control over dashboard inspections and alerting workflows using only conversation. You tell your AI client what's wrong—maybe latency spiked or an alert fired—and it handles the deep dive. It searches for relevant dashboards by title or tag right in the chat window, pulling back metadata instantly. Need to know *why* the metric failed? The agent can retrieve the full configuration of any dashboard, giving you precise PromQL, LogQL, or SQL queries and panel layouts. Plus, it lists every data source connected—whether that's Prometheus or CloudWatch—so you always know where your metrics are coming from. When you connect this MCP via Vinkius, your agent doesn't just read dashboards; it becomes a full SRE command center right in your chat interface.

## Tools

### search_dashboards
Searches Grafana for dashboards by a title or tag, returning their basic metadata and unique ID.

### get_dashboard
Retrieves the complete configuration of a specific dashboard, including all panel details and query strings.

### list_datasources
Lists every configured data source available in your Grafana instance for auditing purposes.

### firing_alerts
Retrieves a list of all alert rules that are currently active and reporting an issue.

## Prompt Examples

**Prompt:** 
```
Search for dashboards tagged with 'production'
```

**Response:** 
```
Searching dashboards... I found 3 matching dashboards: 'K8s Cluster Overview' (UID: abc-123), 'HTTP Response Metrics' (UID: def-456), and 'Database Performance'. Which one would you like me to inspect for panels?
```

**Prompt:** 
```
Show me the queries for dashboard 'abc-123'
```

**Response:** 
```
Retrieving dashboard 'abc-123'... I found 5 panels. Highlights: 'CPU Usage' uses PromQL `sum(rate(node_cpu_seconds_total...))`, and 'Request Latency' uses `histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket...)))`. Would you like the full JSON or more queries?
```

**Prompt:** 
```
Are there any firing alerts right now?
```

**Response:** 
```
Checking alert rules... Yes, I found 1 firing alert: 'High Error Rate' on service 'API-v1'. It has been firing for 15 minutes. All other 12 alert rules are currently in 'Normal' state.
```

## Capabilities

### Discover dashboards by tag or title
Find the unique IDs and basic info for monitoring dashboards without browsing the Grafana UI.

### Get full dashboard configurations
Retrieve a dashboard's entire setup, including every panel's specific query string (PromQL, LogQL, or SQL).

### List connected data sources
Audit all the types of databases and services—like Loki, Prometheus, or CloudWatch—that your Grafana instance uses.

### Check for active alerts
View a list of alert rules that are currently in 'firing' state to understand immediate system health issues.

## Use Cases

### Investigating a recent spike in request latency
A developer sees high latency metrics. They ask their agent to check for active alerts using `firing_alerts`. The agent finds an alert on the API service, which points them toward Dashboard ABC-123. They then use `get_dashboard` to pull the exact PromQL query for that panel and share it with the backend team.

### Onboarding a new cloud architect
A new architect needs to understand all data inputs. Instead of reading documentation, they ask their agent to use `list_datasources`. The agent responds with a clear list of every connected source—Prometheus, SQL, and more—allowing the architect to map out the entire data landscape.

### Debugging performance regressions
The team notices dashboard metrics are suddenly wrong. They use `search_dashboards` first to confirm the correct ID for the affected view. Then, they pass that UID to `get_dashboard` and pull all underlying queries, quickly identifying if a query syntax changed.

### Preparing for a major deployment
Before launch, the DevOps team needs to verify which dashboards exist in the staging environment. They ask their agent to search by 'staging' tag using `search_dashboards`, getting a manifest of all monitoring views that need testing.

## Benefits

- Find relevant monitoring data instantly. Use `search_dashboards` to locate dashboards by tag or title, getting the unique ID needed for deeper inspection without manual searching.
- Extract raw queries on demand. The `get_dashboard` tool pulls the full configuration of any panel, giving you exact PromQL, LogQL, or SQL query strings immediately.
- Audit infrastructure connectivity easily. Use `list_datasources` to get a definitive list of every database (like Prometheus or CloudWatch) connected to your Grafana instance for security checks.
- Know what's broken right now. The `firing_alerts` tool checks current alert rules and tells you exactly which services are experiencing active issues.
- Reduce troubleshooting time dramatically. Instead of opening the UI, running multiple searches, and copy-pasting IDs, your agent does it all in one chat session.

## How It Works

The bottom line is you manage complex observability data conversationally, bypassing multiple manual UI steps.

1. Subscribe to this MCP on Vinkius.
2. Enter your Grafana Instance URL and the Service Account Token into your AI client.
3. Ask your agent anything—like 'Show me all dashboards tagged 'production'' or 'What is the query for dashboard abc-123?'

## Frequently Asked Questions

**How does the Grafana MCP handle different query languages?**
It handles PromQL, LogQL, and SQL queries. When you use `get_dashboard`, the agent extracts the exact language used for each specific panel's data source.

**Can I check alert status with Grafana MCP if I don't know the service name?**
Yes, the MCP checks active alerts using `firing_alerts` and reports on all currently firing rules. You don't need to specify a service; it just lists what's going off.

**Does Grafana MCP let me edit dashboards?**
No, this MCP is for reading and inspecting data only. It provides the details needed (like queries or UIDs) but cannot modify any settings in your Grafana instance.

**What if I need to find a dashboard that uses an old data source?**
Run `list_datasources` first. This shows all configured sources, helping you identify the right connection type before searching for dashboards using that data.