← Back to directory
G

Grafana MCP Server

Official
Query and manage Grafana dashboards, alerts, and observability data via MCP
GitHub source repository ↗
★ 3.3k Stars Category · Other Very popular
72FMRS · B
Reliability
11/20
Security and permissions
14/20
Maintenance
16/20
Documentation
18/20
Setup experience
13/20

mcp-grafana is officially maintained by Grafana Labs and offers broad coverage of the Grafana ecosystem — dashboards, alerting, many datasource types, incident management, OnCall, annotations, snapshots, and rendering — with fine-grained per-category tool toggles and a read-only mode. The main risks center on credential handling and scoping write access appropriately: configure least-privilege RBAC for the service account, avoid enabling write tools unless needed, and selectively enable only the datasource/tool categories actually in use to limit context usage and attack surface.

Read the FMRS scoring method →

mcp-grafana is the official Model Context Protocol server maintained by Grafana Labs, giving AI assistants access to a Grafana instance and its surrounding ecosystem. It covers dashboard search and editing, querying across many datasource types (Prometheus, Loki, InfluxDB, ClickHouse, CloudWatch, Elasticsearch/OpenSearch, Athena, Snowflake, Graphite, Quickwit, Pyroscope), alert rule and notification routing management, Grafana Incident management, Sift root-cause investigations, OnCall scheduling, annotations, snapshots, panel/dashboard image rendering, Agent Observability, Grafana Assistant, and provisioning-repository validation. Tools are grouped into categories that can be enabled or disabled via CLI flags, and the server can run in read-only mode with --disable-write.

Tools

list_teams
List all teams
list_users_by_org
List all users in an organization
list_all_roles
List all Grafana roles
get_role_details
Get details for a Grafana role
get_role_assignments
List assignments for a role
list_user_roles
List roles assigned to users
list_team_roles
List roles assigned to teams
get_resource_permissions
List permissions defined for a resource (dashboard, datasource, folder, etc.)
get_resource_description
Describe available permissions and assignment capabilities for a resource type
search_dashboards
Search for dashboards by title or other metadata
get_dashboard_by_uid
Retrieve full dashboard details using its unique identifier
update_dashboard
Update an existing dashboard or create a new one
get_dashboard_panel_queries
Get panel title, query, and datasource UID/type from every panel in a dashboard
run_panel_query
Execute one or more dashboard panel queries with custom time ranges and variable overrides (disabled by default)
get_dashboard_property
Extract specific parts of a dashboard using JSONPath expressions
get_dashboard_summary
Get a compact overview of a dashboard without the full JSON
list_datasources
List configured datasources
get_datasource
Get a datasource by UID or name
get_query_examples
Get example queries for a datasource type (disabled by default)
query_prometheus
Execute an instant or range PromQL query against a Prometheus datasource
list_prometheus_metric_metadata
List metric metadata
list_prometheus_metric_names
List available metric names
list_prometheus_label_names
List label names matching a selector
list_prometheus_label_values
List values for a specific label
query_prometheus_histogram
Calculate histogram percentile values (p50, p90, p95, p99)
list_incidents
List incidents in Grafana Incident
create_incident
Create an incident in Grafana Incident
add_activity_to_incident
Add an activity item to an incident
get_incident
Get a single incident by ID
query_loki_logs
Run log or metric queries using LogQL against Loki
list_loki_label_names
List all available label names in logs
list_loki_label_values
List values for a specific log label
query_loki_stats
Get statistics about log streams
query_loki_patterns
Query detected log patterns to identify common structures and anomalies
analyze_loki_labels
Audit a Loki label strategy (live or static) and optionally diagnose query performance
suggest_loki_alloy_label_config
Generate an Alloy loki.process snippet enforcing approved labels
query_influxdb
Query InfluxDB using InfluxQL (v1) or Flux (v2) (disabled by default)
list_clickhouse_tables
List tables in a ClickHouse database with row counts and sizes (disabled by default)
describe_clickhouse_table
Get column names, types, and metadata for a ClickHouse table (disabled by default)
query_clickhouse
Execute SQL queries with Grafana macro and variable substitution (disabled by default)
list_cloudwatch_namespaces
Discover available AWS CloudWatch namespaces (disabled by default)
list_cloudwatch_metrics
List metrics available in a namespace (disabled by default)
list_cloudwatch_dimensions
Get dimensions for filtering metric queries (disabled by default)
query_cloudwatch
Execute CloudWatch metric queries with time range support (disabled by default)
list_athena_catalogs
Discover available Athena data catalogs (disabled by default)
list_athena_databases
List databases in an Athena catalog (disabled by default)
list_athena_tables
List tables in an Athena database (disabled by default)
describe_athena_table
Get column names for an Athena table (disabled by default)
query_athena
Execute SQL queries against Athena with macro substitution and limit enforcement (disabled by default)
query_elasticsearch
Query Elasticsearch or OpenSearch using Lucene syntax or Query DSL (disabled by default)
query_quickwit
Query Quickwit using Lucene syntax or Elasticsearch-compatible Query DSL (disabled by default)
list_snowflake_tables
Discover Snowflake tables via INFORMATION_SCHEMA.TABLES, with optional database/schema filters (disabled by default)
describe_snowflake_table
Get column names, types, nullability, defaults, and comments for a Snowflake table (disabled by default)
query_snowflake
Execute SQL queries against Snowflake with macro and template variable substitution (disabled by default)
alerting_manage_rules
Manage alert rules (list, get, versions, create, update, delete)
alerting_manage_routing
Manage notification policies, contact points, and time intervals
list_oncall_schedules
List schedules from Grafana OnCall
get_oncall_shift
Get details for a specific OnCall shift
get_current_oncall_users
Get users currently on-call for a schedule
list_oncall_teams
List teams from Grafana OnCall
list_oncall_users
List users from Grafana OnCall
list_alert_groups
List and filter alert groups from Grafana OnCall
get_alert_group
Get a specific alert group from Grafana OnCall by its ID
get_sift_investigation
Retrieve an existing Sift investigation by its UUID
get_sift_analysis
Retrieve a specific analysis from a Sift investigation
list_sift_investigations
Retrieve a list of Sift investigations with an optional limit
find_error_pattern_logs
Detect elevated error patterns in Loki logs using Sift
find_slow_requests
Detect slow requests using Sift (Tempo)
list_pyroscope_label_names
List label names matching a selector
list_pyroscope_label_values
List label values matching a selector for a label name
list_pyroscope_profile_types
List available profile types
query_pyroscope
Query profiles, metrics, or both from Pyroscope
get_assertions
Get assertion summary for a given entity
agento11y_manage_conversations
List, search, and fetch LLM conversations from Grafana Agent Observability
agento11y_manage_generations
Fetch a single LLM generation and its evaluation scores
agento11y_manage_agents
Read the agent catalog: list agents, fetch a full agent version, view version history, and compare per-version score aggregates
agento11y_manage_evaluators
Manage evaluators, evaluator templates, and the judge catalog (list, get, upsert, fork, test, delete)
agento11y_manage_eval_rules
Manage eval rules that bind evaluators to production traffic, and inline guards (list, get, create, update, preview, delete)
agento11y_manage_eval_collections
Manage saved conversations and the collections that group them
ask_assistant
Send a natural-language prompt to Grafana Assistant and wait for the full text reply, with multi-turn support via contextId
generate_deeplink
Generate accurate deeplink URLs for Grafana dashboards, panels, and Explore views
get_annotations
Query annotations with filters (time range, dashboard UID, tags, match mode)
create_annotation
Create a new annotation, standard or Graphite format
update_annotation
Update specific fields of an existing annotation (partial update)
get_annotation_tags
List available annotation tags with optional filtering
list_snapshots
List dashboard snapshots with optional query and limit filters
get_snapshot
Retrieve snapshot metadata and dashboard payload by snapshot key
create_snapshot
Create a dashboard snapshot from a full dashboard payload
delete_snapshot
Delete a snapshot by snapshot key
get_panel_image
Render a stored dashboard/panel, or a provisioning preview from a repository branch, as a PNG image
list_provisioning_repositories
List provisioning repositories (e.g. git-sync sources) with source URL, branch, sync state, and health
validate_provisioning_file
Dry-run-apply a file from a provisioning repository and report admission validation errors

Setup

  1. Install uv (which provides the uvx command). 2. In Grafana, create a service account and generate a token (or use the built-in Editor role for convenience, or configure minimal RBAC scopes for least-privilege access). 3. Add an mcpServers entry to your MCP client config (e.g. Claude Desktop, Cursor) with command 'uvx', args ['mcp-grafana'], and env vars GRAFANA_URL and GRAFANA_SERVICE_ACCOUNT_TOKEN (Grafana Cloud users replace GRAFANA_URL with their instance URL, e.g. https://<instance>.grafana.net). 4. Alternatively run the Docker image docker.io/grafana/mcp-grafana over stdio, or connect directly to the hosted remote endpoint https://mcp.grafana.com/mcp (streamable-http, with an optional X-Grafana-URL header to target a Grafana Cloud instance). 5. Use --enabled-tools or --disable-<category> flags to control which tool categories are exposed, and --disable-write to run in read-only mode.
claude_desktop_config.json
{"mcpServers":{"grafana":{"command":"uvx","args":["mcp-grafana"],"env":{"GRAFANA_URL":"http://localhost:3000","GRAFANA_SERVICE_ACCOUNT_TOKEN":"<your service account token>"}}}}

Fit and risk

Best for

  • Teams running a Grafana instance (self-hosted or Grafana Cloud) who want an AI assistant to help with observability workflows
  • DevOps/SRE engineers who want to automate querying alerts, logs, and metrics as part of incident response
  • Scenarios where monitoring data access needs to be exposed to an AI assistant safely in read-only mode

Not for

  • Teams with no Grafana ecosystem in place (no Prometheus/Loki/etc. datasources configured)
  • Fully offline or network-isolated environments (the remote endpoint and most datasource queries require network access)
  • Situations where write access must be tightly scoped but the team is unwilling to configure fine-grained RBAC (the built-in Editor role, while convenient, is broad)

Required permissions

  • GRAFANA_URL (required): the target Grafana instance address
  • GRAFANA_SERVICE_ACCOUNT_TOKEN or GRAFANA_USERNAME/GRAFANA_PASSWORD: authentication credentials (the service account token is sensitive)
  • Grafana RBAC permissions matching the enabled tool categories, e.g. dashboards:read/write, datasources:query, alert.rules:read/write, annotations:read/write, or the built-in Editor role as a simpler but broader alternative
  • Grafana Incident and Sift tools use basic roles (Viewer for reads, Editor for writes) rather than fine-grained RBAC
  • Optional GRAFANA_ORG_ID or X-Grafana-Org-Id header for multi-organization support
  • Optional GRAFANA_EXTRA_HEADERS and GRAFANA_FORWARD_HEADERS to add or forward HTTP headers (e.g. Cookie) to the Grafana API

Risks and side effects

  • Service account tokens, passwords, and other credentials are supplied via environment variables or headers and must be safeguarded from leakage
  • Write tools (update_dashboard, alerting_manage_rules, create_incident, create_annotation, create_snapshot, etc.) can directly modify or delete dashboards, alert rules, and incident data — misuse can damage production configuration
  • Using the built-in Editor role for convenience grants broad access beyond least-privilege
  • Fetching full dashboard JSON (get_dashboard_by_uid, update_dashboard) can consume significant context window space and may expose sensitive queries or variables embedded in the dashboard
  • GRAFANA_FORWARD_HEADERS forwarding of headers like Cookie, if misconfigured, risks leaking session information
  • The hosted remote endpoint https://mcp.grafana.com/mcp is a third-party managed service — using it to reach a Grafana Cloud instance routes requests through that service
  • SSE/streamable-http transport misconfiguration (e.g. --allowed-hosts or --allowed-origins set to * while exposed on an untrusted network) carries DNS-rebinding-style risk

Troubleshooting

  1. Verify GRAFANA_URL is correctly formatted and reachable; Grafana Cloud users should use https://<instance>.grafana.net
  2. If a tool call returns a permission error, check that the service account token's RBAC permissions and scopes cover the operation, or temporarily test with the Editor role to isolate a permissions issue
  3. For datasource-related failures, confirm the Grafana instance is version 9.0 or later
  4. If an expected tool is missing, check whether its category is disabled by default (e.g. admin, clickhouse, cloudwatch, snowflake) and add it via --enabled-tools
  5. A 403 on SSE/streamable-http requests usually means the Host or Origin header isn't covered by --allowed-hosts / --allowed-origins
  6. Use the --debug flag to enable detailed HTTP request/response logging when diagnosing connectivity issues
  7. If token rotation isn't taking effect in Kubernetes, confirm GRAFANA_SERVICE_ACCOUNT_TOKEN_FILE (not an inline token) is used and that the mounted Secret has actually updated
  8. If get_panel_image fails, confirm the Grafana Image Renderer service is installed and configured on the target instance

Use cases

AI-assisted incident triage: query Prometheus/Loki metrics and logs, run Sift root-cause analysis, and create a Grafana Incident
Natural-language dashboard discovery and lightweight editing without manually hunting through the Grafana UI
Unified querying and exploration across many datasource types (Prometheus, Loki, ClickHouse, CloudWatch, Athena, Snowflake, and more)
Automatically generating deeplinks to specific dashboards, panels, or Explore views for reports and tickets

Supported clients

Claude DesktopFull support
CursorFull support