Gene Library Courses Download Pricing Contact Sign in
grafana logo
analytics Official Website

Grafana MCP Server – Dashboards and Observability

Grafana's official MCP server gives AI agents structured access to a Grafana instance and its surrounding observability ecosystem. Use it to query metrics and logs, inspect or manage dashboards and alerts, investigate incidents, and generate links to Grafana resources.

#observability#dashboards#monitoring

Overview

Grafana's official MCP server connects compatible AI assistants and coding
agents to Grafana. It exposes structured tools that map to Grafana actions, so
an agent can work with live dashboards, data sources, telemetry, alerts, and
incident context rather than relying only on screenshots or manually pasted
query results.

What the MCP server enables

Depending on the enabled tool categories, Grafana version, installed products,
and service-account permissions, an AI agent can:

  • Search, summarize, create, update, and patch dashboards.
  • Inspect dashboard panels, queries, variables, and data-source metadata.
  • Query Prometheus metrics and Loki logs through configured data sources.
  • Work with supported ClickHouse, CloudWatch, Elasticsearch, OpenSearch,
    Snowflake, Athena, Graphite, and InfluxDB data sources.
  • Search and manage alert rules where the authenticated identity has access.
  • Work with Grafana Incident, OnCall, and Sift capabilities when available.
  • Generate deep links to Grafana resources for human review.
  • Retrieve panel images when Grafana Image Renderer is installed.

When to use it

Use Grafana MCP when an agent needs current observability context or must make
an authorized Grafana change. Typical workflows include investigating a
production regression, summarizing dashboard health, running PromQL or LogQL
queries, reviewing alert configuration, preparing an incident update, patching
a dashboard, and linking engineers directly to the relevant Grafana view.

Connection and authentication

Grafana recommends running the official server with uvx mcp-grafana for a
low-setup local stdio connection. The server reads the Grafana instance URL
from GRAFANA_URL and a service account token from
GRAFANA_SERVICE_ACCOUNT_TOKEN.

The server can also run over SSE or Streamable HTTP for network-accessible
deployments. The default documented local address uses port 8000, with /sse
for SSE and /mcp for Streamable HTTP. These transports expose the MCP server;
authentication from the server to Grafana still uses the configured Grafana
credentials.

Key considerations

Grafana 9.0 or later is required for full functionality. Each tool needs
matching Grafana RBAC permissions and scopes, so create a dedicated service
account with the least access required. Use --disable-write for read-only
deployments and enable optional tool categories only when needed. Large
dashboard JSON can consume substantial model context; prefer dashboard
summaries, property queries, and patch operations for targeted work. Protect
network transports with TLS and access controls, and require human approval for
writes, alert changes, incident actions, and production queries.

Supported Transports

stdio

Command: uvx

Args:

  • mcp-grafana

streamable_http

URL: http://localhost:8000/mcp

sse

URL: http://localhost:8000/sse

Frequently Asked Questions

When should an AI agent use the Grafana MCP server?
Use it when a workflow needs live Grafana observability context, such as investigating metrics or logs, reviewing dashboards, analyzing alerts, supporting incident response, or making approved dashboard and alerting changes.
What does the Grafana MCP server add to an AI agent's capabilities?
It gives the agent structured access to current Grafana data and actions, allowing it to query telemetry, inspect resources, and perform permitted Grafana operations instead of relying only on static model knowledge or manually copied dashboard information.
What can an AI agent access or manage through Grafana MCP?
Depending on enabled tools and RBAC permissions, the agent can work with dashboards, panels, data sources, Prometheus metrics, Loki logs, alert rules, incidents, OnCall, Sift, supported external data sources, panel images, and deep links to Grafana resources.
How is authentication configured for the Grafana MCP server?
Configure the Grafana instance URL and authenticate with a dedicated service account token through GRAFANA_SERVICE_ACCOUNT_TOKEN. Grafana also supports username and password authentication, but service accounts are better suited to least-privilege automation. Never store real credentials directly in the YAML.
Which transport should be used for the Grafana MCP server?
Use stdio with uvx for direct local integration with an AI client. Use Streamable HTTP for a network-accessible deployment and SSE only when a client specifically requires it. Secure HTTP-based deployments with TLS and access controls.