mcp-grafana

v0.4.1
io.github.dockndevai/mcp-grafana Checked 14 hours ago Published 8 days ago

Search & edit Grafana dashboards, query datasources (PromQL/LogQL/SQL), inspect alerts.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_health Grafana health

Check the Grafana instance is reachable and return its version and database status.

list_dashboards List dashboards

List dashboards (optionally filtered by tag). Shorthand for search with type=dash-db.

ParameterTypeDescription
limitinteger
tagstringRestrict to a tag.

get_dashboard Get dashboard

Return the full dashboard JSON model (panels, targets, templating, time) plus meta (folder, version, url) for a dashboard UID. This is the model you edit and pass back to create_or_update_dashboard.

ParameterTypeDescription
uid *stringDashboard UID (from search).

list_folders List folders

List dashboard folders with their UIDs and titles.

get_folder Get folder

Return a folder's details by UID.

ParameterTypeDescription
uid *string

list_datasources List datasources

List configured datasources (uid, name, type, url). Secrets (secureJsonData, passwords, tokens) are never returned. Use the uid with query_datasource.

get_datasource Get datasource

Return a single datasource by UID (secrets redacted).

ParameterTypeDescription
uid *string

query_datasource Query a datasource

Run a query against a datasource through Grafana's unified query API and return the result frames. For Prometheus/Loki set `expr` (PromQL / LogQL); for SQL datasources set `rawSql`. Reading data only — this never mutates anything. Use a bounded time range and a small maxDataPoints to keep results manageable.

ParameterTypeDescription
datasourceUid *stringDatasource UID (from list_datasources).
exprstringPromQL or LogQL expression, e.g. 'up' or 'rate(http_requests_total[5m])'.
fromstringRange start, e.g. 'now-1h' or an epoch ms string. Default now-1h.
maxDataPointsintegerCap on returned points. Default 100.
rawSqlstringSQL for SQL datasources (a single read-only SELECT).
tostringRange end, e.g. 'now'. Default now.

list_alert_rules List alert rules

List Grafana-managed alert rules (via the provisioning API): title, condition, folder, state.

list_annotations List annotations

List annotations (events overlaid on graphs), optionally within a time range or by tag.

ParameterTypeDescription
fromintegerRange start, epoch ms.
limitinteger
tagsarrayRestrict to annotations with these tags.
tointegerRange end, epoch ms.