grafana/mcp-grafana

▲ 6 stars today★ 3,539⑂ 461

MCP server for Grafana

About grafana/mcp-grafana

grafana/mcp-grafana is an open-source project on GitHub, mainly written in Go. MCP server for Grafana It currently holds 3,539 stars and 461 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board, currently at rank #87 with 6 new stars today.

GitHub Repository Details

Repository grafana/mcp-grafana · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

Grafana MCP server

Unit Tests Integration Tests E2E Tests Go Reference MCP Catalog

A [Model Context Protocol][mcp] (MCP) server for Grafana.

This provides access to your Grafana instance and the surrounding ecosystem.

Quick Start

Requires uv. Add the following to your MCP client configuration (e.g. Claude Desktop, Cursor):

{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": ["mcp-grafana"],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": ""
      }
    }
  }
}

For Grafana Cloud, replace GRAFANA_URL with your instance URL (e.g. https://myinstance.grafana.net). See Usage for more installation options including Docker, binary, and Helm.

Requirements

Features

_The following features are currently available in MCP server. This list is for informational purposes only and does not represent a roadmap or commitment to future features._

Dashboards

Run Panel Query

Note: Run panel query tools are disabled by default. To enable them, add runpanelquery to your --enabled-tools flag.

Context Window Management

The dashboard tools now include several strategies to manage context window usage effectively (issue #101):

Datasources

Query Examples

Note: Query examples tools are disabled by default. To enable them, add examples to your --enabled-tools flag.

Prometheus Querying

Loki Querying

InfluxDB Querying

Note: InfluxDB tools are disabled by default. To enable them, add influxdb to your --enabled-tools flag.

SQL Datasource Querying

Note: SQL tools are disabled by default. To enable them, add sql to your --enabled-tools flag. Back-compat aliases clickhouse, snowflake, and athena also work.

Unified SQL tools support ClickHouse, Snowflake, Athena, MySQL, PostgreSQL, and MSSQL through a single set of tools. Queries go through Grafana's datasource plugins, so authentication is handled by datasource configuration — credentials are never seen by the MCP server.

CloudWatch Querying

Note: CloudWatch tools are disabled by default. To enable them, add cloudwatch to your --enabled-tools flag.

Google Cloud Logging Querying

Note: Google Cloud Logging tools are disabled by default. To enable them, add cloudlogging to your --enabled-tools flag. Requires the Google Cloud Logging datasource plugin (googlecloud-logging-datasource) version 1.8.0 or later, which needs Grafana 11.2+. Older plugin versions return a different response layout and query_cloud_logging reports an error asking for an upgrade.

Graphite Querying

Note: Graphite tools are disabled by default. To enable them, add graphite to your --enabled-tools flag.

Elasticsearch/OpenSearch Querying

Note: Elasticsearch/OpenSearch tools are disabled by default. To enable them, add elasticsearch to your --enabled-tools flag.

Quickwit Querying

Note: Quickwit tools are disabled by default. To enable them, add quickwit to your --enabled-tools flag.

Agent Observability

Note: Agent Observability tools are disabled by default and work only in Grafana Cloud. To enable them, add agento11y to your --enabled-tools flag.

Grafana Assistant

Note: Assistant tools are disabled by default and require the Grafana Assistant plugin (grafana-assistant-app) to be installed on the target Grafana instance. They are also write tools (the assistant may mutate stack state), so they are skipped when --disable-write is set. To enable them, add assistant to your --enabled-tools flag.

Incidents

Alerting

Grafana OnCall

Admin

Note: Admin tools are disabled by default. To enable them, include admin in your --enabled-tools flag.

User

Navigation

Annotations

Snapshots

Rendering

Provisioning

The list of tools is configurable, so you can choose which tools you want to make available to the MCP client. This is useful if you don't use certain functionality or if you don't want to take up too much of the context window. To disable a category of tools, use the --disable- flag when starting the server. For example, to disable the OnCall tools, use --disable-oncall, or to disable navigation deeplink generation, use --disable-navigation.

RBAC Permissions

Each tool requires specific RBAC permissions to function properly. When creating a service account for the MCP server, ensure it has the necessary permissions based on which tools you plan to use. The permissions listed are the minimum required actions - you may also need appropriate scopes (e.g., datasources:, dashboards:, folders:*) depending on your use case.

Tip: If you're not familiar with Grafana RBAC or you want a quicker, simpler setup instead of configuring many granular scopes, you can assign a built-in role such as Editor to the service account. The Editor role grants broad read/write access that will allow most MCP server operations; it is less granular (and therefore less restrictive) than manually-applied scopes, so use it only when convenience is more important than strict least-privilege access.

Note: OnCall and other plugin-backed tools are authorized by plugin actions such as grafana-irm-app.schedules:read. The basic Viewer role includes the read actions and Editor the write actions. Incident tools need only plugins.app:access; IRM authorizes incident actions by basic role.

Actions in group/resource:verb form, such as dashboard.grafana.app/dashboards:get, apply only to on-behalf-of access tokens. A service account needs only the other actions listed.

For more information about Grafana RBAC, see the official documentation.

RBAC Scopes

Scopes define the specific resources that permissions apply to. Each action requires both the appropriate permission and scope combination.

Common Scope Patterns:

Examples:
  datasources:* (datasources:read, datasources:query)
  dashboards:* (dashboards:read, dashboards:create, dashboards:write)
  folders:* (for dashboard creation and alert rules)
  teams:* (teams:read)
  global.users:* (users:read)
  
  datasources:uid:prometheus-prod (datasources:query)
  datasources:uid:loki-prod (datasources:query)
  
  dashboards:uid:monitoring-dashboard (dashboards:read)
  dashboards:uid:alerts-dashboard (dashboards:read)
  

Tools

| Tool | Category | Description | Required RBAC Permissions | Required Scopes | | ----------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------

GitHub Stars & Activity

3,539Stars
461Forks
0Open issues
GoLanguage

GitHub Popularity

GitHub stars3,539
Forks461
Open issues0
Primary languageGo
License-
Stars gained today6
Created-
Last pushed-

Trending History

Daily boardrank #87 · ▲ 6 stars

Related AI Projects

1

ollama / ollama

Go★ 182,519⑂ 18,177▲ 149 stars
→
2

infiniflow / ragflow

Go★ 91,912⑂ 10,933▲ 81 stars
→
3

multica-ai / multica

Go★ 52,294⑂ 6,810▲ 118 stars
→
4

QuantumNous / new-api

Go★ 49,528⑂ 11,908▲ 93 stars
→
5

alibaba / open-code-review

Go★ 45,059⑂ 3,258▲ 323 stars
→
6

Wei-Shaw / sub2api

Go★ 43,568⑂ 9,341▲ 90 stars
→
7

Tencent / WeKnora

Go★ 32,812⑂ 4,364▲ 220 stars
→
8

vxcontrol / pentagi

Go★ 25,395⑂ 3,267▲ 56 stars
→

More AI Rankings