# Grafana

> Grafana is an open-source MCP server for analytics and data. Query Grafana dashboards, metrics, logs and alerts from an AI assistant. It can run locally on your machine or as a hosted remote server.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, self-hosted
- **Website:** https://grafana.com/docs/grafana/latest/developer-resources/mcp/
- **Repository:** https://github.com/grafana/mcp-grafana
- **MCP Registry name:** io.github.grafana/mcp-grafana
- **Categories:** analytics and data, developer tools, cloud and infrastructure
- **Listing updated:** 2026-11-14

## About

Setup is a single `uvx mcp-grafana` entry in the client config, with `GRAFANA_URL` and a service account token passed as environment variables. It also ships as a Docker image and over streamable HTTP, and Grafana Labs documents binary and Helm installs. Optional settings cover an organisation ID for multi-org setups and extra or forwarded HTTP headers.

The server reaches beyond dashboards: it can query datasources such as Prometheus and Loki, manage alert rules, work with Grafana Incident and OnCall, and build deeplinks to Grafana resources. Dashboard tools are written with context size in mind, so an assistant can fetch a summary or a JSONPath-selected slice of a dashboard, or patch one, instead of loading the full JSON.

Grafana 9.0 or later is needed for full functionality, and datasource operations may fail on older versions. Running panel queries is off by default and has to be enabled through the `--enabled-tools` flag.

## Features

- **Dashboard search and edit:** Find dashboards by title, folder, tag or starred status, then create, update or patch them.
- **Context-saving reads:** Summaries and JSONPath property lookups keep large dashboards from filling the model's context window.
- **Datasource queries:** Query metrics and logs from datasources such as Prometheus and Loki.
- **Alerting and incidents:** Manage alert rules and work with Grafana Incident and OnCall.
- **Panel query runner:** Run a panel's query with custom time ranges and variable overrides once enabled.
- **Flexible transports:** Run over stdio or streamable HTTP via uvx, Docker, a binary or Helm.

## Good for

- Ask an assistant what a dashboard shows without opening Grafana
- Pull recent logs or metrics into a chat while triaging an incident
- Review or adjust alert rules from an editor
- Patch one panel of a large dashboard without resending its JSON
- Generate links to Grafana resources to paste into tickets

## Install

### Claude Code (Terminal)

```sh
claude mcp add --transport http mcp-grafana https://mcp.grafana.com/mcp
```

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://mcp.grafana.com/mcp
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-grafana": {
      "url": "https://mcp.grafana.com/mcp"
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-grafana": {
      "type": "http",
      "url": "https://mcp.grafana.com/mcp"
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-grafana": {
      "serverUrl": "https://mcp.grafana.com/mcp"
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-grafana": {
      "type": "http",
      "url": "https://mcp.grafana.com/mcp"
    }
  }
}
```

## Tools

- `get_dashboard_summary`: Compact overview of a dashboard: title, panel count, panel types and variables.
- `get_dashboard_property`: Extract parts of a dashboard with a JSONPath expression.

## FAQ

### Which Grafana versions work?

Grafana 9.0 or later is required for full functionality; datasource features may not work on earlier versions.

### How does it authenticate?

The open source server uses a Grafana service account token, with optional username and password variables. Grafana's hosted Cloud MCP server uses OAuth 2.1 instead.

### Is it open source?

Yes, it is licensed under Apache 2.0.

### Does it work with Grafana Cloud?

Yes. Set GRAFANA_URL to your instance address, for example https://myinstance.grafana.net.

### Is Grafana free?

Yes. Grafana is open source, so you can use and self-host it for free.

### How do I add Grafana to Claude Code?

Run this command in your terminal: claude mcp add --transport http mcp-grafana https://mcp.grafana.com/mcp

### What are the best alternatives to Grafana?

The closest alternatives to Grafana are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.

---
Source: https://ai-powered.com/mcp/grafana
