grafana

mcp-grafana: Connect AI Clients to Grafana

Grafana’s MCP server lets compatible AI clients access Grafana dashboards, data sources, alerts, incidents, and other stack features through the Model Context Protocol. It suits teams that want to bring Grafana context and selected operations into agent workflows.

Stars
3.5k
Forks
460
Stars, last 16 days
+62

Our take

Health score

79/100

How it is scored
Activity
86
Community
83
Issues
87
Pull requests
58

+62 stars in the last 16 days

  • Releases more often than 87% of the projects we track
  • Closes issues faster than 82% of the projects we track
  • Merges more pull requests than 82% of the projects we track

Overview

mcp-grafana is a Model Context Protocol server that connects MCP-compatible clients to a Grafana instance. It gives agents a structured way to retrieve observability data and interact with Grafana resources, rather than relying on manually copied dashboards or queries.

The project is most useful when a team wants AI-assisted investigation or Grafana operations within an existing stack. Tools can be selected by category, and many optional or write-capable categories are disabled by default, allowing deployments to limit what clients can access.

Key Features

  • Search dashboards and retrieve full dashboards, summaries, versions, or selected properties.
  • Query Prometheus, Loki, and other supported data sources, including SQL and cloud logging services.
  • Inspect and manage alert rules, incidents, annotations, snapshots, and OnCall information.
  • Access Grafana Agent Observability data, including conversations, evaluations, agents, and test suites.
  • Generate Grafana deep links and render dashboard or panel images.
  • Configure available tools, transports, Grafana credentials, and access controls.

Use Cases

  • An SRE can ask an MCP client to investigate an incident using dashboards, metrics, and logs in Grafana.
  • An observability team can let an agent search dashboards or retrieve focused dashboard details during troubleshooting.
  • A platform team can expose selected Grafana operations to internal assistants while disabling unused tool categories.
  • A team using Grafana Agent Observability can inspect conversations and evaluation results through an MCP client.

Getting Started

The README’s quick start uses uvx with an MCP client. Configure the Grafana URL and a service account token:

{
  "mcpServers": {
    "grafana": {
      "command": "uvx",
      "args": ["mcp-grafana"],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<your service account token>"
      }
    }
  }
}

See the README for Docker, binary, Helm, transport, tool selection, and permissions details.

Considerations

  • Grafana 9.0 or later is required for full functionality. Some datasource operations may not work with earlier versions.
  • A service account needs appropriate Grafana permissions and scopes for the tools enabled. Write operations require additional permissions.
  • Many tool categories, including SQL, CloudWatch, and Agent Observability, are disabled by default and require explicit enablement.
  • HTTP deployments need careful configuration of caller authentication, allowed hosts and origins, and URL overrides. The README documents security implications, including risks from unrestricted outbound URL selection.

Found this useful?

Share it with someone who would like mcp-grafana.