# Grafana MCP for AI Agents AI Agent Connect

> Grafana MCP lets your AI agent manage your observability stack. You can search for dashboards, inspect specific queries, audit your data sources, and check active alerts without leaving your chat interface. It bridges the gap between your monitoring data and your agent's reasoning.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_GY4fnTT6ubjB2NS0Nlt9HtI8gm9rlHDIhOeLcpat/ai-agent-connect
- **Tags:** dashboards, metrics, logs, traces, alerting, data-visualization

## Description

When an incident hits at 3 a.m., the last thing you want to do is hunt through a messy list of dashboards to find the right set of metrics. This Connector changes that by giving your AI agent direct eyes on your Grafana instance. Instead of clicking through menus to find a specific PromQL query or checking if a Loki log is actually firing, you just ask your agent to find it for you. It pulls the actual configuration of your panels so you can see exactly what's being measured. You can also use it to audit your data sources to make sure your Prometheus or SQL connections are actually healthy. It's a way to turn your observability stack into a searchable knowledge base. By using this on the Vinkius marketplace, you get a reliable way to connect your monitoring data to your daily workflow. You'll stop wasting time on manual navigation and start getting answers about your system health in seconds. You can quickly pull out PromQL strings to use in your own scripts or check the status of every active alert rule without refreshing your browser. It makes the entire observability stack feel like a conversation rather than a series of tabs.

## Tools

### search_dashboards
Find specific dashboards using titles or tags. It returns the unique IDs you need for deeper inspection.

### get_dashboard
Pull the full configuration of a dashboard using its UID. This lets you see every panel and query in the set.

### list_datasources
See every data source connected to your Grafana instance. It's the fastest way to verify your connectivity boundaries.

### firing_alerts
Get a list of alerts that are currently in a firing state. You can see labels and annotations for active incidents.

## Prompt Examples

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

**Response:** 
```
Checking your alert rules... 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.
```

**Prompt:** 
```
Find the production billing dashboard and show me the queries.
```

**Response:** 
```
I found the **Production Billing** dashboard (UID: `bill-99`). It contains 4 panels. The **Success Rate** panel uses this PromQL:

`sum(rate(http_requests_total{status=~"2..3"}[5m])) / sum(rate(http_requests_total[5m]))`.
```

**Prompt:** 
```
List all our data sources.
```

**Response:** 
```
Your Grafana instance is connected to the following 5 data sources:

- **Prometheus** (Primary Metrics)
- **Loki** (Logs)
- **CloudWatch** (AWS Metrics)
- **PostgreSQL** (User Data)
- **InfluxDB** (IoT Sensors)
```

## Capabilities

### Find dashboards by title or tag
Search your Grafana instance to find the exact dashboard you need without manual browsing.

### Pull full panel configurations
Retrieve the complete layout and query details for any dashboard using its unique ID.

### List all active data sources
Get a complete list of all connected data sources like Prometheus, Loki, and SQL.

### Check currently firing alerts
See a real-time list of alerts that are currently in a firing state with all relevant labels.

### Extract PromQL and SQL queries
Get the exact query strings from your panels to use in your own debugging or scripts.

### Audit monitoring variables
Analyze localized variables and structural constraints across your monitoring environment.

## Use Cases

### Rapid Incident Response
An alert goes off and you ask your agent to find the 'Production API' dashboard and check if any other alerts are firing to see the full scope of the issue.

### Query Extraction for Devs
A developer needs a specific PromQL query from a dashboard. They ask the agent to pull the dashboard config and copy the query for use in a script.

### Infrastructure Audit
A cloud architect needs to know every data source in the Grafana instance. They ask the agent to list them all to verify security boundaries.

### Dashboard Discovery
A new team member needs to find all dashboards tagged with 'billing'. They ask the agent to list them by tag to get oriented quickly.

## Benefits

- Stop manual dashboard hunting by using search_dashboards to find the exact metrics you need in seconds.
- Get precise PromQL and SQL queries instantly with get_dashboard so you don't have to dig through the UI.
- Verify your entire stack's health by using list_datasources to audit Prometheus, Loki, and SQL connections.
- Reduce incident response time by using firing_alerts to see exactly what's broken without refreshing the browser.
- Simplify your development workflow by letting your agent extract panel layouts and variables directly from your environment.

## How It Works

The bottom line is you get instant access to your monitoring data through natural language.

1. Subscribe to the Connector and grab your Service Account Token from your Grafana settings.
2. Provide your Grafana URL and token to your AI client.
3. Ask your agent to find dashboards, pull queries, or check alert statuses.

## Frequently Asked Questions

**Can the Grafana MCP help me during a production outage?**
Yes, it lets your agent check firing alerts instantly so you can see what's broken without hunting through the UI.

**Can I use the Grafana MCP to see my PromQL queries?**
Yes, it can pull the full configuration of any dashboard, including all the underlying queries for every panel.

**Does the Grafana MCP support Loki or SQL databases?**
Yes, it can list all configured data sources, which includes Loki, SQL, and Prometheus.

**How does the Grafana MCP find specific dashboards?**
You can ask your agent to search by title or tag, and it will find the right one for you automatically.

**Can I use this to audit my monitoring setup?**
Yes, it's great for listing all data sources and checking alert rules to ensure everything is configured correctly.

**Is the Grafana MCP good for developers?**
It's excellent for devs who need to quickly grab metrics or log queries from existing production dashboards.

**Can my agent search for specific dashboards in my Grafana instance?**
Yes. Use the 'search_dashboards' tool. You can provide an optional query string to match titles or tags. The agent will return basic info including the unique UID required for deeper inspection.

**How do I extract the PromQL or SQL queries from a dashboard panel via chat?**
Use the 'get_dashboard' tool with the dashboard UID. Your agent will retrieve the full JSON configuration, including all panels and their underlying data queries, enabling you to review the exact metrics logic natively.

**Can I see firing alerts through the agent?**
Absolutely. Use the 'list_alerts' tool. The agent retrieves all configured alert rules and their current statuses, allowing you to identify which monitors are currently in a firing state synchronousy.