Grafana MCP by usefulapi

v1.1.0
io.usefulapi/grafana Checked 7 hours ago Published 6 days ago

Search 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_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}.

ParameterTypeDescription
uid *stringThe 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.

ParameterTypeDescription
limitintegerMaximum number of results.
pageintegerPage number for pagination (default 1).
parent_uidstringList 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}.

ParameterTypeDescription
uid *stringThe 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.

ParameterTypeDescription
queries *arrayQuery objects. Each needs datasource: {uid}; add the type's query field, for example expr for Prometheus.
fromstringStart time: epoch ms or a relative time such as now-6h.
tostringEnd 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.

ParameterTypeDescription
limitintegerMaximum number of results.
querystringMatch 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.

ParameterTypeDescription
pageintegerPage number for pagination (default 1).
per_pageintegerResults per page (max 100).
querystringText 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.

ParameterTypeDescription
dashboard_uidstringOnly annotations of this dashboard uid.
fromintegerStart time, epoch ms.
limitintegerMaximum number of results.
tagsarrayOnly annotations with these tags.
tointegerEnd time, epoch ms.
typestringannotation = 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.

ParameterTypeDescription
text *stringThe annotation text.
dashboard_uidstringAttach to this dashboard uid.
panel_idintegerAttach to this panel id (needs dashboard_uid).
tagsarrayTags for the annotation.
timeintegerStart time, epoch ms (default: now).
time_endintegerEnd 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.