Grafana MCP server

OfficialGrafana Labs3,083Config last verified Jun 1, 2026

Grafana Labs' official MCP server: query dashboards, Prometheus, Loki, incidents, alerts, and OnCall from your agent.

The Grafana MCP server (mcp-grafana) is Grafana Labs' official integration that connects a coding or operations agent to a Grafana instance and the observability stack behind it. It can search and read dashboards, list and inspect datasources, run PromQL queries against Prometheus and LogQL queries against Loki, pull Pyroscope profiles, and render panels as PNG images. On the incident-response side it manages Grafana Incident, Grafana OnCall schedules and shifts, alert rules and routing, Sift investigations for automated root-cause analysis, Asserts assertions, and annotations.

The canonical install is the official Docker image grafana/mcp-grafana run with the -t stdio flag (the image defaults to SSE, so the flag is required for stdio clients). It authenticates with a Grafana service account token passed via GRAFANA_SERVICE_ACCOUNT_TOKEN, alongside GRAFANA_URL pointing at your instance, and works with both self-managed Grafana 9.0+ and Grafana Cloud. The server has a large tool surface organized into categories, with several advanced or write-capable toolsets (admin, query execution, ClickHouse, CloudWatch, and others) disabled by default so you opt in only to what an agent needs.

Quick install

Copy-paste configs are provided for all 8 supported clients. Pick your client below.

Add to ~/.claude.json

~/.claude.json
json
{
  "mcpServers": {
    "grafana": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "GRAFANA_URL",
        "-e",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN",
        "grafana/mcp-grafana",
        "-t",
        "stdio"
      ],
      "env": {
        "GRAFANA_URL": "<GRAFANA_URL>",
        "GRAFANA_SERVICE_ACCOUNT_TOKEN": "<GRAFANA_SERVICE_ACCOUNT_TOKEN>"
      }
    }
  }
}
Or via CLI
bash
claude mcp add grafana -- docker run --rm -i -e GRAFANA_URL -e GRAFANA_SERVICE_ACCOUNT_TOKEN grafana/mcp-grafana -t stdio

Available tools

ToolDescription
search_dashboardsFinds dashboards by title or metadata.
get_dashboard_by_uidRetrieves the full details of a dashboard by UID.
get_dashboard_summaryGets a compact overview of a dashboard.
get_dashboard_propertyExtracts parts of a dashboard via a JSONPath expression.
get_dashboard_panel_queriesGets the queries and datasource info for a dashboard's panels.
update_dashboardModifies or creates a dashboard.
patch_dashboardApplies targeted changes to a dashboard without sending full JSON.
run_panel_queryExecutes a dashboard panel's query over a custom time range (disabled by default).
list_datasourcesLists all configured datasources.
get_datasourceGets a datasource by UID or name.
get_query_examplesRetrieves example queries for a datasource type (disabled by default).
query_prometheusExecutes a PromQL query against a Prometheus datasource.
query_prometheus_histogramCalculates histogram percentile values from Prometheus data.
list_prometheus_metric_metadataRetrieves metadata for Prometheus metrics.
list_prometheus_metric_namesLists available Prometheus metric names.
list_prometheus_label_namesLists Prometheus label names matching a selector.
list_prometheus_label_valuesLists the values for a specific Prometheus label.
query_loki_logsRuns a log or metric query using LogQL.
query_loki_statsGets statistics about Loki log streams.
query_loki_patternsQueries detected log patterns in Loki.
list_loki_label_namesLists available Loki label names.
list_loki_label_valuesLists the values for a Loki log label.
analyze_loki_labelsAudits Loki label strategy and query performance.
suggest_loki_alloy_label_configGenerates an Alloy config snippet for Loki labels.
query_influxdbQueries InfluxDB using InfluxQL or Flux (disabled by default).
list_clickhouse_tablesLists tables in a ClickHouse database (disabled by default).
describe_clickhouse_tableGets a ClickHouse table schema with column types (disabled by default).
query_clickhouseExecutes a ClickHouse SQL query with macro substitution (disabled by default).
list_cloudwatch_namespacesDiscovers available AWS CloudWatch namespaces (disabled by default).
list_cloudwatch_metricsLists CloudWatch metrics in a namespace (disabled by default).
list_cloudwatch_dimensionsGets dimensions for CloudWatch metric queries (disabled by default).
query_cloudwatchExecutes a CloudWatch metric query (disabled by default).
query_graphiteExecutes a Graphite render API query (disabled by default).
list_graphite_metricsBrowses and discovers Graphite metric paths (disabled by default).
list_graphite_tagsLists Graphite tags and tag values (disabled by default).
query_graphite_densityQueries Graphite metric density for a pattern (disabled by default).
list_athena_catalogsDiscovers Amazon Athena data catalogs (disabled by default).
list_athena_databasesLists databases in an Athena catalog (disabled by default).
list_athena_tablesLists tables in an Athena database (disabled by default).
describe_athena_tableGets the column names for an Athena table (disabled by default).
query_athenaExecutes an Athena SQL query with macro substitution (disabled by default).
list_snowflake_tablesDiscovers Snowflake tables with metadata (disabled by default).
describe_snowflake_tableGets a Snowflake table schema with column details (disabled by default).
query_snowflakeExecutes a Snowflake SQL query with macro/variable substitution (disabled by default).
query_elasticsearchExecutes an Elasticsearch/OpenSearch query using Lucene or Query DSL (disabled by default).
list_incidentsLists incidents in Grafana Incident.
get_incidentGets a single incident by ID.
create_incidentCreates an incident in Grafana Incident.
add_activity_to_incidentAdds an activity entry to an incident.
list_sift_investigationsRetrieves the list of Sift investigations.
get_sift_investigationRetrieves details of a specific Sift investigation.
get_sift_analysisRetrieves a specific analysis from a Sift investigation.
find_error_pattern_logsDetects elevated error patterns in Loki via Sift.
find_slow_requestsDetects slow requests via Tempo using Sift.
list_pyroscope_profile_typesLists the available Pyroscope profile types.
list_pyroscope_label_namesLists Pyroscope label names matching a selector.
list_pyroscope_label_valuesLists Pyroscope label values for a label name.
fetch_pyroscope_profileFetches a Pyroscope profile in DOT format.
alerting_manage_rulesLists, creates, updates, and deletes alert rules.
alerting_manage_routingManages notification policies, contact points, and mute timings.
list_oncall_schedulesLists Grafana OnCall schedules.
get_oncall_shiftGets details for a specific OnCall shift.
get_current_oncall_usersGets the users currently on call.
list_oncall_teamsLists Grafana OnCall teams.
list_oncall_usersLists Grafana OnCall users.
list_alert_groupsLists OnCall alert groups with filtering.
get_alert_groupGets a specific OnCall alert group by ID.
get_assertionsGets the assertion summary for an entity via Grafana Asserts.
get_annotationsQueries annotations with filters.
create_annotationCreates a standard or Graphite annotation.
update_annotationReplaces all fields of an annotation.
patch_annotationUpdates specific fields of an annotation.
get_annotation_tagsLists annotation tags.
generate_deeplinkCreates a deeplink URL for a Grafana dashboard, panel, or Explore query.
get_panel_imageRenders a dashboard panel or full dashboard as a PNG image.
list_teamsLists all configured teams (admin; disabled by default).
list_users_by_orgLists all users in an organization (admin; disabled by default).
list_all_rolesLists all Grafana roles (admin; disabled by default).
get_role_detailsGets details for a specific role (admin; disabled by default).
get_role_assignmentsLists assignments for a role (admin; disabled by default).
list_user_rolesLists roles assigned to a user (admin; disabled by default).
list_team_rolesLists roles assigned to a team (admin; disabled by default).
get_resource_permissionsLists permissions for a resource (admin; disabled by default).
get_resource_descriptionDescribes a Grafana resource type (admin; disabled by default).

Required configuration

  • GRAFANA_URLRequired

    URL of your Grafana instance, e.g. https://myinstance.grafana.net or http://localhost:3000.

  • GRAFANA_SERVICE_ACCOUNT_TOKENRequired

    Grafana service account token used to authenticate (Grafana 9.0+).

  • GRAFANA_API_KEYOptional

    Legacy API key auth. Deprecated and slated for removal; prefer a service account token.

What you can do with it

Investigate an alert from chat

The agent reads the firing alert, runs PromQL and LogQL queries against the relevant datasources, fetches a Pyroscope profile, and renders the dashboard panel as an image to confirm the regression.

Drive incident response

Create or update a Grafana Incident, check who is currently on call, kick off a Sift investigation to surface error patterns and slow requests, and annotate the timeline as the team works the issue.

FAQ

Is it free?
Yes. mcp-grafana is free and open source under the Apache 2.0 license. You provide your own Grafana instance (self-managed or Grafana Cloud), and usage is governed by your Grafana plan.
Does it support remote/OAuth?
The canonical install is a local Docker stdio server authenticated with a Grafana service account token rather than OAuth; the image can also run in SSE/HTTP mode. It is not distributed as a hosted OAuth endpoint.
← Browse all monitoring-observability servers