Grafana MCP by usefulapi
v1.1.0Search dashboards, query data sources, list alert rules; add annotations in Grafana.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
grafana_get_current_user Get the signed-in user
Return the user or service account behind the token: id, login, name, the current orgId and the Grafana admin flag. Use it to check which token is in use. Grafana API: GET /api/user.
grafana_get_current_org Get the current organization
Return the organization the token belongs to: id, name and address. Grafana API: GET /api/org.
grafana_search Search dashboards and folders
Search dashboards and folders by title, tag or folder. Each result has uid, title, type, url and folderUid. Good first call to find a dashboard uid. Grafana API: GET /api/search.
| Parameter | Type | Description |
|---|---|---|
folder_uids | array | Only items in these folder uids. |
limit | integer | Maximum number of results. |
page | integer | Page number for pagination (default 1). |
query | string | Text to match in the title. |
starred | boolean | true = only starred items. |
tag | array | Only items with all these tags. |
type | string | dash-db = dashboards, dash-folder = folders. |
grafana_get_dashboard Get a dashboard
Return one dashboard by uid: its JSON model (panels, queries, variables) and metadata (version, folder, updated). Large dashboards return a large result. Grafana API: GET /api/dashboards/uid/{uid}.
| Parameter | Type | Description |
|---|---|---|
uid * | string | The Grafana uid (from a search or list tool). |
grafana_list_folders List folders
List dashboard folders: uid, title and url. Use parent_uid to list nested folders. Grafana API: GET /api/folders.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of results. |
page | integer | Page number for pagination (default 1). |
parent_uid | string | List only the children of this folder uid. |
grafana_list_datasources List data sources
List the data sources of the stack: uid, name, type (for example prometheus or loki) and default flag. Use a uid with grafana_query_data. Grafana API: GET /api/datasources.
grafana_get_datasource Get a data source
Return one data source by uid: name, type, url and settings (secrets are not returned). Grafana API: GET /api/datasources/uid/{uid}.
| Parameter | Type | Description |
|---|---|---|
uid * | string | The Grafana uid (from a search or list tool). |
grafana_query_data Query data sources
Run one or more queries against data sources (metrics, logs, traces) and return the frames. Each query names its datasource uid and the query text for that type, for example {refId, datasource:{uid}, expr} for Prometheus. Grafana API: POST /api/ds/query.
| Parameter | Type | Description |
|---|---|---|
queries * | array | Query objects. Each needs datasource: {uid}; add the type's query field, for example expr for Prometheus. |
from | string | Start time: epoch ms or a relative time such as now-6h. |
to | string | End time: epoch ms or a relative time such as now. |
grafana_list_org_users List organization users
List users and their roles in the current organization. Filter by text with query. Grafana API: GET /api/org/users.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of results. |
query | string | Match on login, email or name. |
grafana_list_teams Search teams
Search teams by name: id, uid, name, memberCount and email. Grafana API: GET /api/teams/search.
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number for pagination (default 1). |
per_page | integer | Results per page (max 100). |
query | string | Text to match in the team name. |
grafana_list_annotations List annotations
List annotations (events on graphs) in a time range, optionally for one dashboard or tag. Times are epoch ms. Grafana API: GET /api/annotations.
| Parameter | Type | Description |
|---|---|---|
dashboard_uid | string | Only annotations of this dashboard uid. |
from | integer | Start time, epoch ms. |
limit | integer | Maximum number of results. |
tags | array | Only annotations with these tags. |
to | integer | End time, epoch ms. |
type | string | annotation = manual events, alert = alert state changes. |
grafana_create_annotation Create an annotation
Add an event to a dashboard or to the stack: text, time, optional end time, tags and an optional dashboard uid and panel id. Writes data. Grafana API: POST /api/annotations.
| Parameter | Type | Description |
|---|---|---|
text * | string | The annotation text. |
dashboard_uid | string | Attach to this dashboard uid. |
panel_id | integer | Attach to this panel id (needs dashboard_uid). |
tags | array | Tags for the annotation. |
time | integer | Start time, epoch ms (default: now). |
time_end | integer | End time, epoch ms (for a range). |
grafana_list_alert_rules List alert rules
List all alert rules of the stack with uid, title, folder, rule group, condition and labels. Grafana API: GET /api/v1/provisioning/alert-rules.