Grafana

Grafana

MCP server for Grafana.

10K+

15

41 Tools

Signed
Built by Docker
Requires Secrets
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

Use cases

About

Grafana MCP Server

MCP server for Grafana.

What is an MCP Server?

Characteristics

AttributeDetails
Docker Imagemcp/grafana
Authorgrafana
Repositoryhttps://github.com/grafana/mcp-grafana
Dockerfilehttps://github.com/grafana/mcp-grafana/blob/main/Dockerfile
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/grafana --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceApache License 2.0

Available Tools (41)

Tools provided by this ServerShort Description
add_activity_to_incidentAdd activity to incident
create_incidentCreate incident
fetch_pyroscope_profileFetch Pyroscope profile
find_error_pattern_logsFind error patterns in logs
find_slow_requestsFind slow requests
generate_deeplinkGenerate navigation deeplink
get_alert_rule_by_uidGet alert rule details
get_assertionsGet assertions summary
get_current_oncall_usersGet current on-call users
get_dashboard_by_uidGet dashboard details
get_dashboard_panel_queriesGet dashboard panel queries
get_datasource_by_nameGet datasource by name
get_datasource_by_uidGet datasource by UID
get_incidentGet incident details
get_oncall_shiftGet OnCall shift
get_sift_analysisGet Sift analysis
get_sift_investigationGet Sift investigation
list_alert_rulesList alert rules
list_contact_pointsList notification contact points
list_datasourcesList datasources
list_incidentsList incidents
list_loki_label_namesList Loki label names
list_loki_label_valuesList Loki label values
list_oncall_schedulesList OnCall schedules
list_oncall_teamsList OnCall teams
list_oncall_usersList OnCall users
list_prometheus_label_namesList Prometheus label names
list_prometheus_label_valuesList Prometheus label values
list_prometheus_metric_metadataList Prometheus metric metadata
list_prometheus_metric_namesList Prometheus metric names
list_pyroscope_label_namesList Pyroscope label names
list_pyroscope_label_valuesList Pyroscope label values
list_pyroscope_profile_typesList Pyroscope profile types
list_sift_investigationsList Sift investigations
list_teamsSearch for Grafana teams by a query string.
list_users_by_orgList users by organization.
query_loki_logsQuery Loki logs
query_loki_statsGet Loki log statistics
query_prometheusQuery Prometheus metrics
search_dashboardsSearch dashboards
update_dashboardCreate or update dashboard

Tools Details

Tool: add_activity_to_incident

Add a note (userNote activity) to an existing incident's timeline using its ID. The note body can include URLs which will be attached as context. Use this to add context to an incident.

ParametersTypeDescription
bodystringoptionalThe body of the activity. URLs will be parsed and attached as context
eventTimestringoptionalThe time that the activity occurred. If not provided, the current time will be used
incidentIdstringoptionalThe ID of the incident to add the activity to

Tool: create_incident

Create a new Grafana incident. Requires title, severity, and room prefix. Allows setting status and labels. This tool should be used judiciously and sparingly, and only after confirmation from the user, as it may notify or alarm lots of people.

ParametersTypeDescription
attachCaptionstringoptionalThe caption of the attachment
attachUrlstringoptionalThe URL of the attachment
isDrillbooleanoptionalWhether the incident is a drill incident
labelsarrayoptionalThe labels to add to the incident
roomPrefixstringoptionalThe prefix of the room to create the incident in
severitystringoptionalThe severity of the incident
statusstringoptionalThe status of the incident
titlestringoptionalThe title of the incident

Tool: fetch_pyroscope_profile

Fetches a profile from a Pyroscope data source for a given time range. By default, the time range is tha past 1 hour. The profile type is required, available profile types can be fetched via the list_pyroscope_profile_types tool. Not all profile types are available for every service. Expect some queries to return empty result sets, this indicates the profile type does not exist for that query. In such a case, consider trying a related profile type or giving up. Matchers are not required, but highly recommended, they are generally used to select an application by the service_name label (e.g. {service_name="foo"}). Use the list_pyroscope_label_names tool to fetch available label names, and the list_pyroscope_label_values tool to fetch available label values. The returned profile is in DOT format.

ParametersTypeDescription
data_source_uidstringThe UID of the datasource to query
profile_typestringType profile type, use the list_pyroscope_profile_types tool to fetch available profile types
end_rfc_3339stringoptionalOptionally, the end time of the query in RFC3339 format (defaults to now)
matchersstringoptionalOptionally, Prometheus style matchers used to filter the result set (defaults to: {})
max_node_depthintegeroptionalOptionally, the maximum depth of nodes in the resulting profile. Less depth results in smaller profiles that execute faster, more depth result in larger profiles that have more detail. A value of -1 indicates to use an unbounded node depth (default: 100). Reducing max node depth from the default will negatively impact the accuracy of the profile
start_rfc_3339stringoptionalOptionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)

This tool is read-only. It does not modify its environment.


Tool: find_error_pattern_logs

Searches Loki logs for elevated error patterns compared to the last day's average, waits for the analysis to complete, and returns the results including any patterns found.

ParametersTypeDescription
labelsobjectLabels to scope the analysis
namestringThe name of the investigation
endstringoptionalEnd time for the investigation. Defaults to now if not specified.
startstringoptionalStart time for the investigation. Defaults to 30 minutes ago if not specified.

This tool is read-only. It does not modify its environment.


Tool: find_slow_requests

Searches relevant Tempo datasources for slow requests, waits for the analysis to complete, and returns the results.

ParametersTypeDescription
labelsobjectLabels to scope the analysis
namestringThe name of the investigation
endstringoptionalEnd time for the investigation. Defaults to now if not specified.
startstringoptionalStart time for the investigation. Defaults to 30 minutes ago if not specified.

This tool is read-only. It does not modify its environment.


Tool: generate_deeplink

Generate deeplink URLs for Grafana resources. Supports dashboards (requires dashboardUid), panels (requires dashboardUid and panelId), and Explore queries (requires datasourceUid). Optionally accepts time range and additional query parameters.

ParametersTypeDescription
resourceTypestringType of resource: dashboard, panel, or explore
dashboardUidstringoptionalDashboard UID (required for dashboard and panel types)
datasourceUidstringoptionalDatasource UID (required for explore type)
panelIdintegeroptionalPanel ID (required for panel type)
queryParamsobjectoptionalAdditional query parameters
timeRangeobjectoptionalTime range for the link

This tool is read-only. It does not modify its environment.


Tool: get_alert_rule_by_uid

Retrieves the full configuration and detailed status of a specific Grafana alert rule identified by its unique ID (UID). The response includes fields like title, condition, query data, folder UID, rule group, state settings (no data, error), evaluation interval, annotations, and labels.

ParametersTypeDescription
uidstringThe uid of the alert rule

This tool is read-only. It does not modify its environment.


Tool: get_assertions

Get assertion summary for a given entity with its type, name, env, site, namespace, and a time range

ParametersTypeDescription
endTimestringThe end time in RFC3339 format
startTimestringThe start time in RFC3339 format
entityNamestringoptionalThe name of the entity to list
entityTypestringoptionalThe type of the entity to list (e.g. Service, Node, Pod, etc.)
envstringoptionalThe env of the entity to list
namespacestringoptionalThe namespace of the entity to list
sitestringoptionalThe site of the entity to list

This tool is read-only. It does not modify its environment.


Tool: get_current_oncall_users

Get the list of users currently on-call for a specific Grafana OnCall schedule ID. Returns the schedule ID, name, and a list of detailed user objects for those currently on call.

ParametersTypeDescription
scheduleIdstringThe ID of the schedule to get current on-call users for

This tool is read-only. It does not modify its environment.


Tool: get_dashboard_by_uid

Retrieves the complete dashboard, including panels, variables, and settings, for a specific dashboard identified by its UID.

ParametersTypeDescription
uidstringThe UID of the dashboard

This tool is read-only. It does not modify its environment.


Tool: get_dashboard_panel_queries

Get the title, query string, and datasource information for each panel in a dashboard. The datasource is an object with fields uid (which may be a concrete UID or a template variable like "$datasource") and type. If the datasource UID is a template variable, it won't be usable directly for queries. Returns an array of objects, each representing a panel, with fields: title, query, and datasource (an object with uid and type).

ParametersTypeDescription
uidstringThe UID of the dashboard

This tool is read-only. It does not modify its environment.


Tool: get_datasource_by_name

Retrieves detailed information about a specific datasource using its name. Returns the full datasource model, including UID, type, URL, access settings, JSON data, and secure JSON field status.

ParametersTypeDescription
namestringThe name of the datasource

This tool is read-only. It does not modify its environment.


Tool: get_datasource_by_uid

Retrieves detailed information about a specific datasource using its UID. Returns the full datasource model, including name, type, URL, access settings, JSON data, and secure JSON field status.

ParametersTypeDescription
uidstringThe uid of the datasource

This tool is read-only. It does not modify its environment.


Tool: get_incident

Get a single incident by ID. Returns the full incident details including title, status, severity, labels, timestamps, and other metadata.

ParametersTypeDescription
idstringoptionalThe ID of the incident to retrieve

This tool is read-only. It does not modify its environment.


Tool: get_oncall_shift

Get detailed information for a specific Grafana OnCall shift using its ID. A shift represents a designated time period within a schedule when users are actively on-call. Returns the full shift details.

ParametersTypeDescription
shiftIdstringThe ID of the shift to get details for

This tool is read-only. It does not modify its environment.


Tool: get_sift_analysis

Retrieves a specific analysis from an investigation by its UUID. The investigation ID and analysis ID should be provided as strings in UUID format.

ParametersTypeDescription
analysisIdstringThe UUID of the specific analysis to retrieve
investigationIdstringThe UUID of the investigation as a string (e.g. '02adab7c-bf5b-45f2-9459-d71a2c29e11b')

This tool is read-only. It does not modify its environment.


Tool: get_sift_investigation

Retrieves an existing Sift investigation by its UUID. The ID should be provided as a string in UUID format (e.g. '02adab7c-bf5b-45f2-9459-d71a2c29e11b').

ParametersTypeDescription
idstringThe UUID of the investigation as a string (e.g. '02adab7c-bf5b-45f2-9459-d71a2c29e11b')

This tool is read-only. It does not modify its environment.


Tool: list_alert_rules

Lists Grafana alert rules, returning a summary including UID, title, current state (e.g., 'pending', 'firing', 'inactive'), and labels. Supports filtering by labels using selectors and pagination. Example label selector: [{'name': 'severity', 'type': '=', 'value': 'critical'}]. Inactive state means the alert state is normal, not firing

ParametersTypeDescription
label_selectorsarrayoptionalOptionally, a list of matchers to filter alert rules by labels
limitintegeroptionalThe maximum number of results to return. Default is 100.
pageintegeroptionalThe page number to return.

This tool is read-only. It does not modify its environment.


Tool: list_contact_points

Lists Grafana notification contact points, returning a summary including UID, name, and type for each. Supports filtering by name - exact match - and limiting the number of results.

ParametersTypeDescription
limitintegeroptionalThe maximum number of results to return. Default is 100.
namestringoptionalFilter contact points by name

This tool is read-only. It does not modify its environment.


Tool: list_datasources

List available Grafana datasources. Optionally filter by datasource type (e.g., 'prometheus', 'loki'). Returns a summary list including ID, UID, name, type, and default status.

ParametersTypeDescription
typestringoptionalThe type of datasources to search for. For example, 'prometheus', 'loki', 'tempo', etc...

This tool is read-only. It does not modify its environment.


Tool: list_incidents

List Grafana incidents. Allows filtering by status ('active', 'resolved') and optionally including drill incidents. Returns a preview list with basic details.

ParametersTypeDescription
drillbooleanoptionalWhether to include drill incidents
limitintegeroptionalThe maximum number of incidents to return
statusstringoptionalThe status of the incidents to include. Valid values: 'active', 'resolved'

This tool is read-only. It does not modify its environment.


Tool: list_loki_label_names

Lists all available label names (keys) found in logs within a specified Loki datasource and time range. Returns a list of unique label strings (e.g., ["app", "env", "pod"]). If the time range is not provided, it defaults to the last hour.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
endRfc3339stringoptionalOptionally, the end time of the query in RFC3339 format (defaults to now)
startRfc3339stringoptionalOptionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)

This tool is read-only. It does not modify its environment.


Tool: list_loki_label_values

Retrieves all unique values associated with a specific labelName within a Loki datasource and time range. Returns a list of string values (e.g., for labelName="env", might return ["prod", "staging", "dev"]). Useful for discovering filter options. Defaults to the last hour if the time range is omitted.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
labelNamestringThe name of the label to retrieve values for (e.g. 'app', 'env', 'pod')
endRfc3339stringoptionalOptionally, the end time of the query in RFC3339 format (defaults to now)
startRfc3339stringoptionalOptionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)

This tool is read-only. It does not modify its environment.


Tool: list_oncall_schedules

List Grafana OnCall schedules, optionally filtering by team ID. If a specific schedule ID is provided, retrieves details for only that schedule. Returns a list of schedule summaries including ID, name, team ID, timezone, and shift IDs. Supports pagination.

ParametersTypeDescription
pageintegeroptionalThe page number to return (1-based)
scheduleIdstringoptionalThe ID of the schedule to get details for. If provided, returns only that schedule's details
teamIdstringoptionalThe ID of the team to list schedules for

This tool is read-only. It does not modify its environment.


Tool: list_oncall_teams

List teams configured in Grafana OnCall. Returns a list of team objects with their details. Supports pagination.

ParametersTypeDescription
pageintegeroptionalThe page number to return

This tool is read-only. It does not modify its environment.


Tool: list_oncall_users

List users from Grafana OnCall. Can retrieve all users, a specific user by ID, or filter by username. Returns a list of user objects with their details. Supports pagination.

ParametersTypeDescription
pageintegeroptionalThe page number to return
userIdstringoptionalThe ID of the user to get details for. If provided, returns only that user's details
usernamestringoptionalThe username to filter users by. If provided, returns only the user matching this username

This tool is read-only. It does not modify its environment.


Tool: list_prometheus_label_names

List label names in a Prometheus datasource. Allows filtering by series selectors and time range.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
endRfc3339stringoptionalOptionally, the end time of the time range to filter the results by
limitintegeroptionalOptionally, the maximum number of results to return
matchesarrayoptionalOptionally, a list of label matchers to filter the results by
startRfc3339stringoptionalOptionally, the start time of the time range to filter the results by

This tool is read-only. It does not modify its environment.


Tool: list_prometheus_label_values

Get the values for a specific label name in Prometheus. Allows filtering by series selectors and time range.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
labelNamestringThe name of the label to query
endRfc3339stringoptionalOptionally, the end time of the query
limitintegeroptionalOptionally, the maximum number of results to return
matchesarrayoptionalOptionally, a list of selectors to filter the results by
startRfc3339stringoptionalOptionally, the start time of the query

This tool is read-only. It does not modify its environment.


Tool: list_prometheus_metric_metadata

List Prometheus metric metadata. Returns metadata about metrics currently scraped from targets. Note: This endpoint is experimental.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
limitintegeroptionalThe maximum number of metrics to return
limitPerMetricintegeroptionalThe maximum number of metrics to return per metric
metricstringoptionalThe metric to query

This tool is read-only. It does not modify its environment.


Tool: list_prometheus_metric_names

List metric names in a Prometheus datasource. Retrieves all metric names and then filters them locally using the provided regex. Supports pagination.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
limitintegeroptionalThe maximum number of results to return
pageintegeroptionalThe page number to return
regexstringoptionalThe regex to match against the metric names

This tool is read-only. It does not modify its environment.


Tool: list_pyroscope_label_names

Lists all available label names (keys) found in profiles within a specified Pyroscope datasource, time range, and optional label matchers. Label matchers are typically used to qualify a service name ({service_name="foo"}). Returns a list of unique label strings (e.g., ["app", "env", "pod"]). Label names with double underscores (e.g. name) are internal and rarely useful to users. If the time range is not provided, it defaults to the last hour.

ParametersTypeDescription
data_source_uidstringThe UID of the datasource to query
end_rfc_3339stringoptionalOptionally, the end time of the query in RFC3339 format (defaults to now)
matchersstringoptional
start_rfc_3339stringoptionalOptionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)

This tool is read-only. It does not modify its environment.


Tool: list_pyroscope_label_values

Lists all available label values for a particular label name found in profiles within a specified Pyroscope datasource, time range, and optional label matchers. Label matchers are typically used to qualify a service name ({service_name="foo"}). Returns a list of unique label strings (e.g. for label name "env": ["dev", "staging", "prod"]). If the time range is not provided, it defaults to the last hour.

ParametersTypeDescription
data_source_uidstringThe UID of the datasource to query
namestringA label name
end_rfc_3339stringoptionalOptionally, the end time of the query in RFC3339 format (defaults to now)
matchersstringoptionalOptionally, Prometheus style matchers used to filter the result set (defaults to: {})
start_rfc_3339stringoptionalOptionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)

This tool is read-only. It does not modify its environment.


Tool: list_pyroscope_profile_types

Lists all available profile types available in a specified Pyroscope datasource and time range. Returns a list of all available profile types (example profile type: "process_cpu:cpu:nanoseconds:cpu:nanoseconds"). A profile type has the following structure: ::::. Not all profile types are available for every service. If the time range is not provided, it defaults to the last hour.

ParametersTypeDescription
data_source_uidstringThe UID of the datasource to query
end_rfc_3339stringoptionalOptionally, the end time of the query in RFC3339 format (defaults to now)
start_rfc_3339stringoptionalOptionally, the start time of the query in RFC3339 format (defaults to 1 hour ago)

This tool is read-only. It does not modify its environment.


Tool: list_sift_investigations

Retrieves a list of Sift investigations with an optional limit. If no limit is specified, defaults to 10 investigations.

ParametersTypeDescription
limitintegeroptionalMaximum number of investigations to return. Defaults to 10 if not specified.

This tool is read-only. It does not modify its environment.


Tool: list_teams

Search for Grafana teams by a query string. Returns a list of matching teams with details like name, ID, and URL.

ParametersTypeDescription
querystringoptionalThe query to search for teams. Can be left empty to fetch all teams

Tool: list_users_by_org

List users by organization. Returns a list of users with details like userid, email, role etc.

Tool: query_loki_logs

Executes a LogQL query against a Loki datasource to retrieve log entries or metric values. Returns a list of results, each containing a timestamp, labels, and either a log line (line) or a numeric metric value (value). Defaults to the last hour, a limit of 10 entries, and 'backward' direction (newest first). Supports full LogQL syntax for log and metric queries (e.g., {app="foo"} |= "error", rate({app="bar"}[1m])). Prefer using query_loki_stats first to check stream size and list_loki_label_names and list_loki_label_values to verify labels exist.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
logqlstringThe LogQL query to execute against Loki. This can be a simple label matcher or a complex query with filters, parsers, and expressions. Supports full LogQL syntax including label matchers, filter operators, pattern expressions, and pipeline operations.
directionstringoptionalOptionally, the direction of the query: 'forward' (oldest first) or 'backward' (newest first, default)
endRfc3339stringoptionalOptionally, the end time of the query in RFC3339 format
limitintegeroptionalOptionally, the maximum number of log lines to return (default: 10, max: 100)
startRfc3339stringoptionalOptionally, the start time of the query in RFC3339 format

This tool is read-only. It does not modify its environment.


Tool: query_loki_stats

Retrieves statistics about log streams matching a given LogQL selector within a Loki datasource and time range. Returns an object containing the count of streams, chunks, entries, and total bytes (e.g., {"streams": 5, "chunks": 50, "entries": 10000, "bytes": 512000}). The logql parameter must be a simple label selector (e.g., {app="nginx", env="prod"}) and does not support line filters, parsers, or aggregations. Defaults to the last hour if the time range is omitted.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
logqlstringThe LogQL matcher expression to execute. This parameter only accepts label matcher expressions and does not support full LogQL queries. Line filters, pattern operations, and metric aggregations are not supported by the stats API endpoint. Only simple label selectors can be used here.
endRfc3339stringoptionalOptionally, the end time of the query in RFC3339 format
startRfc3339stringoptionalOptionally, the start time of the query in RFC3339 format

This tool is read-only. It does not modify its environment.


Tool: query_prometheus

Query Prometheus using a PromQL expression. Supports both instant queries (at a single point in time) and range queries (over a time range). Time can be specified either in RFC3339 format or as relative time expressions like 'now', 'now-1h', 'now-30m', etc.

ParametersTypeDescription
datasourceUidstringThe UID of the datasource to query
exprstringThe PromQL expression to query
startTimestringThe start time. Supported formats are RFC3339 or relative to now (e.g. 'now', 'now-1.5h', 'now-2h45m'). Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h', 'd'.
endTimestringoptionalThe end time. Required if queryType is 'range', ignored if queryType is 'instant' Supported formats are RFC3339 or relative to now (e.g. 'now', 'now-1.5h', 'now-2h45m'). Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h', 'd'.
queryTypestringoptionalThe type of query to use. Either 'range' or 'instant'
stepSecondsintegeroptionalThe time series step size in seconds. Required if queryType is 'range', ignored if queryType is 'instant'

This tool is read-only. It does not modify its environment.


Tool: search_dashboards

Search for Grafana dashboards by a query string. Returns a list of matching dashboards with details like title, UID, folder, tags, and URL.

ParametersTypeDescription
querystringoptionalThe query to search for

This tool is read-only. It does not modify its environment.


Tool: update_dashboard

Create or update a dashboard

ParametersTypeDescription
dashboardobjectThe full dashboard JSON
folderUidstringoptionalThe UID of the dashboard's folder
messagestringoptionalSet a commit message for the version history
overwritebooleanoptionalOverwrite the dashboard if it exists. Otherwise create one
userIdintegeroptional

This tool may perform destructive updates.


Use this MCP Server

{
  "mcpServers": {
    "grafana": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GRAFANA_URL",
        "-e",
        "GRAFANA_API_KEY",
        "mcp/grafana",
        "--transport=stdio"
      ],
      "env": {
        "GRAFANA_URL": "http://localhost:3000",
        "GRAFANA_API_KEY": "<your service account token>"
      }
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Manual installation

You can install the MCP server using:

Installation for

Related servers