Grafana MCP Server avatar

Grafana MCP Server

Pricing

Pay per usage

Go to Apify Store
Grafana MCP Server

Grafana MCP Server

Connect AI agents to Grafana via MCP. Search dashboards, query Prometheus/Loki, manage alerts, create dashboards, and monitor data sources. 25+ tools for complete Grafana control through natural language.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

CQ

CQ

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Share

Connect AI agents to your Grafana instance via the Model Context Protocol (MCP). Search and manage dashboards, query data sources, inspect alerts, organize folders, and create annotations through a standardized MCP interface.

This Actor is an MCP server. Its primary output is MCP tool/resource/prompt responses returned to a connected MCP client, not a scraped dataset. The Actor also writes a small operational log to its default dataset (see Output).

Features

  • Dashboard Management: Search, view, create, and delete dashboards
  • Data Source Operations: List, get, test, create, delete, and query data sources (Prometheus, Loki, InfluxDB, PostgreSQL, MySQL, MSSQL, Elasticsearch)
  • Alert Monitoring: List alert rules, get a rule by UID, list alert instances, and pause/unpause an alert
  • Folder Organization: List, get, create, and delete folders
  • Annotations: List, create, and delete annotations for events and deployments
  • User & Org Info: Get the current user, list organization users, and get the current organization

Input Configuration

FieldTypeRequiredDescription
grafanaUrlstringRequired to connectYour Grafana instance URL, e.g. https://mycompany.grafana.net (Grafana Cloud) or http://localhost:3000 (self-hosted). Must start with http:// or https://.
grafanaApiTokenstring (secret)Required to connectService account token used as a Bearer token. Recommended role: Editor or Admin (Admin is needed for data source / user / org operations).
grafanaOrgIdintegerNoOrganization ID for multi-organization setups. Sent as the X-Grafana-Org-Id header when provided. Leave empty for single-org instances.

Note: The input schema marks no field as strictly required. If you start the Actor without grafanaUrl and grafanaApiToken, it does not error — it publishes its server capabilities (tool names, resources, setup hint) to the dataset and exits cleanly. Provide both values to actually connect and serve tool calls.

Authentication

The server authenticates to Grafana with the service account token as an HTTP Bearer token (Authorization: Bearer <token>). No username/password is used. When grafanaOrgId is set, the X-Grafana-Org-Id header is added to each request. A trailing slash on grafanaUrl is stripped automatically.

Getting a Grafana API Token

  1. In Grafana, go to Administration > Service Accounts
  2. Click Add service account
  3. Give it a name and select Editor or Admin role
  4. Click Add service account token and copy the generated token

Available Tools

Health & Status

  • grafana_health - Check instance health, version, and database status

Dashboards

  • grafana_search_dashboards - Search dashboards by query, tag, type, or folder IDs
  • grafana_get_dashboard - Get full dashboard configuration by UID
  • grafana_create_dashboard - Create a new dashboard with panels
  • grafana_delete_dashboard - Delete a dashboard by UID

Data Sources

  • grafana_list_datasources - List all configured data sources
  • grafana_get_datasource - Get data source details by UID or name
  • grafana_test_datasource - Test data source connectivity (health check)
  • grafana_create_datasource - Add a new data source
  • grafana_delete_datasource - Delete a data source by UID
  • grafana_query_datasource - Execute a query (PromQL, LogQL, or SQL) against a data source

Alerts

  • grafana_list_alert_rules - List all alert rules
  • grafana_get_alert_rule - Get alert rule details by UID
  • grafana_list_alert_instances - View current alert states
  • grafana_pause_alert - Pause or unpause an alert by ID

Folders

  • grafana_list_folders - List all folders
  • grafana_get_folder - Get folder details by UID
  • grafana_create_folder - Create a new folder
  • grafana_delete_folder - Delete a folder by UID

Annotations

  • grafana_list_annotations - List annotations with optional filters
  • grafana_create_annotation - Create an annotation
  • grafana_delete_annotation - Delete an annotation by ID

Users & Organization

  • grafana_get_current_user - Get the authenticated user's info
  • grafana_list_org_users - List members of the current organization
  • grafana_get_current_org - Get current organization details

Resources

The server exposes these MCP resources (read-only JSON):

  • grafana://dashboards - All dashboards
  • grafana://datasources - All data sources
  • grafana://folders - All folders
  • grafana://alerts - Current alert instances
  • grafana://health - Instance health

Prompts

Pre-built MCP prompts for common tasks:

  • dashboard-overview - Get an overview of all dashboards
  • alert-status - Check current alert status
  • datasource-health - Verify data source connectivity
  • create-dashboard-template - Template for a new monitoring dashboard (arguments: service_name, datasource)

Example Usage

Query Prometheus Metrics

{
"tool": "grafana_query_datasource",
"arguments": {
"datasourceUid": "prometheus-uid",
"query": "rate(http_requests_total[5m])",
"from": 1703980800000,
"to": 1704067200000
}
}

Create a Dashboard

{
"tool": "grafana_create_dashboard",
"arguments": {
"title": "Service Monitoring",
"tags": ["production", "api"],
"panels": [
{
"title": "Request Rate",
"type": "timeseries",
"datasource": "Prometheus",
"targets": [{"expr": "rate(http_requests_total[5m])"}]
}
]
}
}

Check Alert Status

{
"tool": "grafana_list_alert_instances",
"arguments": {}
}

Output

Being an MCP server, the substantive output is the MCP responses returned to the connected client. In addition, the Actor writes an operational log to its default dataset:

  • Tool-call records: timestamp, tool, success, duration (ms), and error (present only on failure)
  • Connection record: a connection_verified entry with grafanaVersion and database on successful connect
  • Capabilities record: a server_info entry (tool names, resources, setup hint) when the Actor is started with no credentials

Pricing

This Actor uses Apify's pay-per-event pricing model — you are billed per billable event (e.g. per tool call) rather than by compute time. See the Actor's page in the Apify Store for the current per-event rates.

Limitations

  • Requires a reachable Grafana instance and a valid service account token. If the health check fails on start (unreachable URL, bad token, network issue), the run is stopped with a descriptive error.
  • Grafana version / API: Targets the Grafana HTTP API. Alert operations use the unified alerting endpoints (/api/ruler/..., /api/v1/provisioning/..., /api/alerts), so a modern Grafana with unified alerting is expected. grafana_pause_alert uses the legacy /api/alerts/{id}/pause endpoint and may not apply to Grafana-managed unified alert rules.
  • Permissions scope: Read operations work with an Editor token, but data source creation/deletion, user/org listing, and some admin endpoints require an Admin-scoped service account token. Insufficient permissions surface as Grafana API errors in the tool response.
  • No pagination / rate-limit handling: Listing tools (dashboards, folders, annotations, org users) returns whatever the Grafana API returns in a single request; there is no automatic pagination or retry/backoff.
  • Transport: The server communicates over stdio (standard MCP transport). It does not implement authentication or multi-tenant isolation of its own — access control is delegated entirely to the supplied Grafana token.
  • Scope: This Actor does not render or export dashboard images, manage Grafana users/teams beyond listing, or configure notification/contact points.

Requirements

  • Grafana instance (Cloud or self-hosted) reachable over the network
  • Service account token with appropriate permissions (Editor or Admin)