Grafana MCP Server
Pricing
Pay per usage
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
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 days ago
Last modified
Categories
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
| Field | Type | Required | Description |
|---|---|---|---|
grafanaUrl | string | Required to connect | Your Grafana instance URL, e.g. https://mycompany.grafana.net (Grafana Cloud) or http://localhost:3000 (self-hosted). Must start with http:// or https://. |
grafanaApiToken | string (secret) | Required to connect | Service account token used as a Bearer token. Recommended role: Editor or Admin (Admin is needed for data source / user / org operations). |
grafanaOrgId | integer | No | Organization 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
grafanaUrlandgrafanaApiToken, 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
- In Grafana, go to Administration > Service Accounts
- Click Add service account
- Give it a name and select Editor or Admin role
- 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 IDsgrafana_get_dashboard- Get full dashboard configuration by UIDgrafana_create_dashboard- Create a new dashboard with panelsgrafana_delete_dashboard- Delete a dashboard by UID
Data Sources
grafana_list_datasources- List all configured data sourcesgrafana_get_datasource- Get data source details by UID or namegrafana_test_datasource- Test data source connectivity (health check)grafana_create_datasource- Add a new data sourcegrafana_delete_datasource- Delete a data source by UIDgrafana_query_datasource- Execute a query (PromQL, LogQL, or SQL) against a data source
Alerts
grafana_list_alert_rules- List all alert rulesgrafana_get_alert_rule- Get alert rule details by UIDgrafana_list_alert_instances- View current alert statesgrafana_pause_alert- Pause or unpause an alert by ID
Folders
grafana_list_folders- List all foldersgrafana_get_folder- Get folder details by UIDgrafana_create_folder- Create a new foldergrafana_delete_folder- Delete a folder by UID
Annotations
grafana_list_annotations- List annotations with optional filtersgrafana_create_annotation- Create an annotationgrafana_delete_annotation- Delete an annotation by ID
Users & Organization
grafana_get_current_user- Get the authenticated user's infografana_list_org_users- List members of the current organizationgrafana_get_current_org- Get current organization details
Resources
The server exposes these MCP resources (read-only JSON):
grafana://dashboards- All dashboardsgrafana://datasources- All data sourcesgrafana://folders- All foldersgrafana://alerts- Current alert instancesgrafana://health- Instance health
Prompts
Pre-built MCP prompts for common tasks:
dashboard-overview- Get an overview of all dashboardsalert-status- Check current alert statusdatasource-health- Verify data source connectivitycreate-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), anderror(present only on failure) - Connection record: a
connection_verifiedentry withgrafanaVersionanddatabaseon successful connect - Capabilities record: a
server_infoentry (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_alertuses the legacy/api/alerts/{id}/pauseendpoint 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)


