mcps / grafana
MCPExplorer Verified

Grafana MCP server

Query dashboards, metrics, and incidents from your agent.

Observabilityby Grafanadestructive capableService account tokenFree · open source

01What it is

Grafana's official MCP server gives an agent query access to your Grafana stack: search and update dashboards, run Prometheus and Loki queries, explore datasources, and manage incidents, alerts, and on-call schedules — grounding the agent in real observability data instead of guesswork.

Who it’s for: SRE and platform teams who want an agent that investigates from live dashboards, metrics, and logs.


02Highlights
Dashboards & panels
Search dashboards, fetch panel config, and run the queries behind them.
Metrics & logs
Query Prometheus and Loki directly, with datasource and metadata exploration.
Incidents & on-call
Create and manage incidents, alert rules, and OnCall schedules from the loop.

03Add it to your agent

Local MCP server — runs on your machine via the command below.

claude mcp add grafana -e GRAFANA_URL=https://your.grafana.net -e GRAFANA_SERVICE_ACCOUNT_TOKEN=glsa_xxx -- uvx mcp-grafana
{ "mcpServers": { "grafana": { "command": "uvx", "args": ["mcp-grafana"] } } }

05What it can do · 65 tools

The real tool surface, each labeled by risk. Full trust breakdown on the server page · safety review: Is Grafana MCP safe?.

ToolRisk
create_folder
Create a Grafana folder. Provide a title and optional UID. Returns the created folder.
write
alerting_manage_rules
Manage Grafana alert rules with full CRUD capabilities and filtering. When to use: - Understanding why an alert is or isn't firing - Auditing alert rule configuration (queries, conditions, labels, notification settings) - Finding alert rules by state, folder, group, or name - Creating, updating, or deleting alert rules - Comparing rule versions to see what changed When NOT to use: - Checking how alerts are routed to receivers (use alerting_manage_routing)
unknown
check_datasources_health
Check datasource health. Filter by type or UIDs; omit both to check all.
read
get_snapshot
Get a Grafana snapshot by key, including snapshot metadata and dashboard payload.
read
list_oncall_teams
List teams configured in Grafana OnCall. Returns a list of team objects with their details. Supports pagination.
read
search_folders
Search for Grafana folders by a query string. Returns matching folders with details like title, UID, and URL.
read
get_annotation_tags
Returns annotation tags with optional filtering by tag name. Only the provided filters are applied.
read
generate_deeplink
Generate deeplink URLs for Grafana resources. Supports dashboards (requires dashboardUid or provisioningPreview), panels (requires dashboardUid or provisioningPreview, plus panelId), and Explore queries (requires datasourceUid and optionally queries). For dashboard and panel links, provisioningPreview points at a dashboard staged on a provisioning repository branch (e.g. a git-sync PR preview). For explore links, the time range and queries are embedded inside the Grafana explore state. Set shorten=true to also attempt a /goto/<uid> short URL; if shortening fails, the full deeplink is returned.
unknown
create_datasource
Create a datasource. If type is ambiguous, call search_plugin_information first; install the plugin if needed. IMPORTANT: always call this tool twice. First call: provide only the type — the tool returns a field schema. After receiving the schema, you MUST ask the user for every required field value explicitly; do not infer or use defaults without user confirmation. Second call: provide the type, the display name in the top-level name argument, schemaReviewed=true, and the fields map populated with values confirmed by the user. Never handle credentials — remind the user to rotate any detected. Returns UID, health check, and a config page link.
write
get_dashboard_summary
Get a compact summary of a dashboard including title\, panel count\, panel types\, variables\, and other metadata without the full JSON. Use this for dashboard overview and planning modifications without consuming large context windows.
read
list_prometheus_metric_metadata
List Prometheus metric metadata. Returns metadata about metrics currently scraped from targets. Note: This endpoint is experimental.
read
list_alert_groups
List alert groups from Grafana OnCall with filtering options. Supports filtering by alert group ID, route ID, integration ID, state (new, acknowledged, resolved, silenced), team ID, time range, labels, and name. For time ranges, use format '{start}_{end}' ISO 8601 timestamp range (e.g., '2025-01-19T00:00:00_2025-01-19T23:59:59' for a specific day). For labels, use format 'key:value' (e.g., ['env:prod', 'severity:high']). Returns a list of alert group objects with their details. Supports pagination.
read
list_datasources
List all configured datasources in Grafana. Use this to discover available datasources and their UIDs. Supports filtering by type and pagination.
read
search_plugin_information
Search the Grafana plugin catalog by keyword to discover available plugins before installing or getting plugin details on a specific instance. Returns results sorted by trust: official Grafana Labs plugins first, then commercial partner plugins, then community plugins. Use this tool when a user describes a plugin by purpose or partial name (e.g. 'azure monitoring', 'loki', 'database') — it returns the exact pluginId to pass to get_plugin or install_plugin. Results include warnings for enterprise-only or Angular-based plugins.
read
suggest_loki_alloy_label_config
Generates an Alloy loki.process snippet enforcing an approved label set via stage.label_keep, with optional log-level normalisation and soft-enforcement placeholders.
unknown
update_datasource
Update non-secret datasource fields by UID. Omitted fields are preserved. IMPORTANT: always call this tool twice. First call: provide only the uid — the tool returns the datasource's field schema. After receiving the schema, ask the user which fields they want to change and confirm each new value; do not infer or reset fields the user did not mention. Second call: provide the uid, schemaReviewed=true, and the changed values in the fields map. Returns an update message and a health check. For secrets, direct the user to the Grafana UI.
write
install_plugin
Install a Grafana plugin by its plugin ID. If the version is not already confirmed with the user, omit it — the tool will look up the latest version and return it for confirmation before installing.
unknown
get_plugin
Check whether a Grafana plugin is installed and retrieve its details (name, version, type, enabled status). Returns installed=false when the plugin is not found. Use install_plugin when a plugin is not installed to install plugin after confirming this action with the user.
read
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.
read
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: <name>:<sample type>:<sample unit>:<period type>:<period unit>. Not all profile types are available for every service. If the time range is not provided, it defaults to the last hour.
read
update_dashboard
Create or update a dashboard. Two modes: (1) Full JSON — provide 'dashboard' for new dashboards or complete replacements. (2) Patch — provide 'uid' + 'operations' to make targeted changes to an existing dashboard. One of these two modes is required; 'folderUid'\, 'message'\, and 'overwrite' are supplementary and do nothing on their own. Dashboard authoring guidance: if a saved query must support one\, many\, or All values from a multi-select variable inside a regex expression or matcher\, save '${var:regex}' rather than plain '$var'. Saved dashboard annotation queries/definitions must be written into dashboard JSON under 'annotations.list'; the create_annotation tool creates annotation events and does not add a reusable dashboard annotation query/definition to the saved dashboard. For stat panels over the current dashboard range\, make the query return the range-level result the stat should display; panel-side reduction only reduces returned series and does not compute peak-over-range or ratio-of-peaks semantics for you. Patch operations support JSONPaths like '$.panels[0].targets[0].expr'\, '$.panels[1].title'\, '$.panels[2].targets[0].datasource'\, '$.templating.list/-'\, and '$.annotations.list/-'. Append to arrays with '/- ' syntax: '$.panels/- '. Remove by index: {"op": "remove"\, "path": "$.panels[2]"}. Multiple removes on the same array are automatically reordered to avoid index-shifting issues. Note: only numeric array indices are supported in patch paths; filter expressions like [?(@.id==2)] and wildcards like [*] are not supported. v2 dashboards (check 'isV2' from get_dashboard_by_uid) use a different shape: patch '$.elements.<name>.spec.title' or '$.elements.<name>.spec.data.spec.queries[0].spec' and edit '$.variables'/'$.layout' rather than '$.panels'/'$.templating.list'. Full-JSON saves containing top-level 'elements'/'layout' are written as v2 and require a Kubernetes-capable Grafana. After creating or updating a dashboard\, verify that panel queries return data by using `run_panel_query` or the appropriate query tool (`query_prometheus`\, `query_loki_logs`\, etc.) to validate expressions before considering the task complete.
write
get_assertions
Get assertion summary for a given entity with its type, name, env, site, namespace, and a time range
read
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').
read
get_dashboard_by_uid
Retrieves the complete dashboard, including panels, variables, and settings, for a specific dashboard identified by its UID. The response includes 'apiVersion' and 'isV2': when 'isV2' is true the dashboard uses the v2 schema (panels live under 'elements' keyed by name, arranged by 'layout'; variables under 'variables'), otherwise it is classic v1 ('panels[]' with 'templating.list'). WARNING: Large dashboards can consume significant context window space. Consider using get_dashboard_summary for overview or get_dashboard_property for specific data instead.
read
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.
read
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.
read
list_loki_label_names
Lists all available label/field names (keys) found in logs within a specified Loki or VictoriaLogs 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.
read
list_incidents
List Grafana incidents. Allows filtering by status ('active', 'resolved') and optionally including drill incidents. Returns a preview list with basic details.
read
list_oncall_users
List users from Grafana OnCall. These are OnCall users (separate from Grafana users). Can retrieve all users in the OnCall directory, a specific user by ID, or filter by username. Returns a list of user objects with their details. Supports pagination.
read
list_snapshots
List Grafana dashboard snapshots with optional query and result limit filters.
read
validate_provisioning_file
Validate a file in a provisioning repository at a given branch or commit by dry-run applying it. Returns whether the file would be accepted (valid)\, what resource action would result (create/update)\, the target resource type\, and any structured validation errors. Use to confirm a draft dashboard or other resource will be accepted before merging or applying a PR — this is the same validation surface that Grafana's PR commenter reports.
read
list_sift_investigations
Retrieves a list of Sift investigations with an optional limit. If no limit is specified, defaults to 10 investigations.
read
update_annotation
Updates the provided properties of an annotation by ID. Only fields included in the request are modified; omitted fields are left unchanged.
write
delete_snapshot
Delete a Grafana snapshot by snapshot key.
destructive
get_alert_group
Get a specific alert group from Grafana OnCall by its ID. Returns the full alert group details.
read
get_datasource
Retrieves detailed information about a specific datasource by UID or name. Returns the full datasource model, including name, type, URL, access settings, JSON data, and secure JSON field status. Provide either uid or name; uid takes priority if both are given.
read
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.
read
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.
write
alerting_manage_routing
Manage Grafana alerting routing configuration, including notification policies, contact points and time intervals. Notification policies define how alerts are grouped, routed, and which contact points receive them. Time intervals define active/mute periods for alert notifications. When to use: - Understanding how alerts are routed to contact points/receivers - Debugging why an alert went to a specific receiver - Checking grouping, timing, or mute interval settings When NOT to use: - Checking alert rule configuration or state (use alerting_manage_rules)
unknown
create_annotation
Create a new annotation on a dashboard or panel. Set format to 'graphite' and provide 'what' for Graphite-format annotations.
write
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.
write
get_dashboard_panel_queries
Retrieve panel queries from a Grafana dashboard. Supports all datasource types (Prometheus, Loki, CloudWatch, SQL, etc.) and row-nested panels. Optionally filter to a specific panel by ID with `panelId`. Optionally provide `variables` for template variable substitution, which populates `processedQuery` and `requiredVariables` fields. Returns an array of objects with fields: title, query (raw expression), datasource (object with uid and type), and optionally processedQuery, refId, and requiredVariables.
read
list_prometheus_metric_names
DISCOVERY: Call this first to find available metrics before querying. Lists metric names in a PromQL-compatible datasource (Prometheus, Thanos, Mimir, Cloud Monitoring, etc.). Retrieves all metric names and filters them using the provided regex. Supports pagination and an optional time range to restrict results to metrics active within that window.
read
get_panel_image
Render a Grafana dashboard panel or full dashboard as a PNG image. Returns the image as base64 encoded data. Requires the Grafana Image Renderer service to be installed. Either dashboardUid (for stored dashboards) or provisioningPreview (for dashboards staged on a provisioning repository branch, e.g. a git-sync PR) must be supplied. Use this for generating visual snapshots of dashboards for reports, alerts, or presentations.
read
grafana_api_request
Make an authenticated HTTP request to the Grafana API. Similar to 'gh api' for GitHub. Supports any Grafana API endpoint with optional jq-style response filtering. Use this for API endpoints that don't have a dedicated tool.
unknown
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.
read
list_prometheus_label_values
Use after list_prometheus_metric_names to find label values for filtering queries. Gets the values for a specific label name in a PromQL-compatible datasource (Prometheus, Thanos, Mimir, Cloud Monitoring, etc.). Allows filtering by series selectors and time range.
read
list_prometheus_label_names
List label names in a PromQL-compatible datasource (Prometheus, Thanos, Mimir, Cloud Monitoring, etc.). Allows filtering by series selectors and time range.
read
query_loki_stats
Retrieves index-level statistics about log streams matching a given selector within a Loki or VictoriaLogs 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}`). **Important**: the `entries` count reflects storage-level index entries (chunk metadata), NOT the number of individual log lines matching the selector. To count actual matching log lines, use `query_loki_logs` with a `count_over_time()` metric query instead. On VictoriaLogs only `entries` is populated; the other fields remain zero. 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.
read
query_loki_logs
Executes a log query against a Loki or VictoriaLogs datasource and returns matching log entries (or metric samples on Loki). Defaults to the last hour, a limit of 10 entries, and 'backward' direction (newest first). The `logql` parameter takes LogQL on Loki and LogsQL on VictoriaLogs (e.g., Loki: `{app="foo"} |= "error"`; VictoriaLogs: `{app="foo"} "error"`). To count matching log lines precisely, use a `count_over_time()` metric query with queryType='instant'. Prefer using `query_loki_stats` first to cheaply check whether a stream contains data (avoiding expensive queries against empty streams) and `list_loki_label_names` / `list_loki_label_values` to verify labels exist before querying. Note: `query_loki_stats` returns approximate storage-level counts, not exact log line counts.
read
query_prometheus
WORKFLOW: list_prometheus_metric_names -> list_prometheus_label_values -> query_prometheus. Query a PromQL-compatible datasource (Prometheus, Thanos, Mimir, Cloud Monitoring, etc.) using a PromQL expression. Supports instant queries (single point) and range queries (time range). Time: RFC3339 or relative expressions like 'now'\, 'now-1h'.
read
query_prometheus_histogram
Query Prometheus histogram percentiles. DISCOVER FIRST: Use list_prometheus_metric_names with regex='.*_bucket$' to find histograms. Generates histogram_quantile PromQL. Example: metric='http_duration', percentile=95, labels='job="api"' Time formats: 'now-1h', '2026-02-02T19:00:00Z', '1738519200000' (Unix ms)
read
query_pyroscope
Unified Pyroscope query tool for fetching profiles or metrics from Pyroscope. Profile data shows WHICH functions consume resources; metrics data shows WHEN consumption spiked. Use query_type="both" for complete analysis in one call. query_type options (extends Grafana's PyroscopeQueryType): - "profile": returns profile data (shape controlled by format) - "metrics": returns time-series data points - "both" (default): returns both profile and metrics in one response format options (shape of the profile data): - "table" (default): per-function table with flat (self) and cumulative values, ranked by flat - "dot": call graph in Graphviz DOT format; nodes are per source line, so one function may span several nodes
read
get_annotations
Fetch Grafana annotations using filters such as dashboard UID, time range and tags.
read
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.
read
get_incident
Get a single incident by ID. Returns the full incident details including title, status, severity, labels, timestamps, and other metadata.
read
create_snapshot
Create a Grafana snapshot from a full dashboard payload. Supports optional expiration and external snapshot fields.
write
list_loki_label_values
Retrieves all unique values associated with a specific `labelName` within a Loki or VictoriaLogs 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.
read
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.
read
find_slow_requests
Searches relevant Tempo datasources for slow requests, waits for the analysis to complete, and returns the results.
read
get_dashboard_property
Get specific parts of a dashboard using JSONPath expressions to minimize context window usage. JSONPath targets the dashboard's native schema. Classic v1 paths: '$.title' (title)\, '$.panels[*].title' (all panel titles)\, '$.panels[0]' (first panel)\, '$.templating.list' (variables)\, '$.annotations.list' (saved dashboard annotation queries/definitions)\, '$.tags' (tags)\, '$.panels[*].targets[*].expr' (all queries). v2 dashboards (see isV2 from get_dashboard_by_uid) use different paths: '$.title'\, '$.elements' (panels\, keyed by name)\, '$.variables' (variables)\, '$.annotations'. Use this instead of get_dashboard_by_uid when you only need specific dashboard properties.
read
list_provisioning_repositories
List provisioning repositories (e.g. git-sync sources) configured for this Grafana instance. Returns each repository's slug along with its source URL, branch, path, sync state, and health. Use the returned `name` as the `repo` argument when rendering a not-yet-applied dashboard preview via get_panel_image's provisioningPreview parameter.
read
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.
read
query_loki_patterns
Retrieves detected log patterns from a Loki datasource for a given stream selector and time range. Returns a list of patterns, each containing a pattern string and a total count of occurrences. Patterns help identify common log structures and anomalies. The `logql` parameter must be a stream selector (e.g., `{job="nginx"}`) and does not support line filters or aggregations. Defaults to the last hour if the time range is omitted. **Not supported on VictoriaLogs** datasources - use a `| stats` pipeline instead.
read
analyze_loki_labels
Audits a Loki label strategy and optionally diagnoses query performance. Returns per-label verdicts, missing base labels, normalisation issues, and a recommended set. Pass datasourceUid for live cardinality or labels for static scoring; both may be combined.
read

06Access

The write/destructive access this server can exercise, from its verified tools.

Manage cloud infra · writeMonitoring & logs · destructiveRead & write files · writeMonitoring & logs · writeManage GitHub · writeManage cloud infra · destructiveVersion control (git) · write

07FAQ
What is Grafana MCP?

Grafana's official MCP server gives an agent query access to your Grafana stack: search and update dashboards, run Prometheus and Loki queries, explore datasources, and manage incidents, alerts, and on-call schedules — grounding the agent in real observability data instead of guesswork.

Who is Grafana for?

SRE and platform teams who want an agent that investigates from live dashboards, metrics, and logs.

What tools does Grafana expose?

Grafana exposes 65 verified tools, including create_folder, alerting_manage_rules, check_datasources_health, get_snapshot, list_oncall_teams, search_folders. Each is labeled by read / write / destructive risk on this page.

How do I connect Grafana to my agent?

Grafana runs locally over stdio. Add it to your MCP client config: claude mcp add grafana -e GRAFANA_URL=https://your.grafana.net -e GRAFANA_SERVICE_ACCOUNT_TOKEN=glsa_xxx -- uvx mcp-grafana.

Does Grafana require authentication?

Yes — Grafana authenticates with Service account token. You connect your own account, and it acts only within the scopes you grant.

How much does Grafana cost?

Free · open source.

Is Grafana verified on MCPExplorer?

Yes — Grafana is hand-checked and featured on MCPExplorer. We pull its real tool surface, required scopes, and risk labels from the live index so you can see exactly what it does before connecting.


08Similar MCPs

Other MCP servers worth a look.

ChatSEO
SEO & content
An AI SEO agent inside your MCP client.
Apex
LinkedIn & outbound
Governed LinkedIn hands for your AI agent.
FullEnrich
Sales & enrichment
B2B contact enrichment for your agent.
CompanyEnrich
Company data
Real-time company & people intelligence.

09Badge

Grafana is featured on MCPExplorer. Add this badge to Grafana’s site or README — it links back to this page.

Grafana MCP — as seen on mcpexplorer.com

HTML — for your website

<a href="https://mcpexplorer.com/mcps/grafana" target="_blank" rel="noopener"><img src="https://mcpexplorer.com/badge/grafana.svg" alt="Grafana MCP — as seen on mcpexplorer.com" height="20" /></a>

Markdown — for a README

[![Grafana MCP — as seen on mcpexplorer.com](https://mcpexplorer.com/badge/grafana.svg)](https://mcpexplorer.com/mcps/grafana)

Get started

Set up Grafana and put it to work — Free · open source. Or see its full verified profile.