Open
Description
It would be extremely helpful if mcp-grafana could query an InfluxDB datasource—whether it’s a self-hosted node on EC2 or an InfluxDB Cloud bucket. Right now we have to write extra glue code just to perform a simple aggregation like min, max, and mean temperature across multiple sensors over the last 30 days.
Proposed approach
- New tool:
query_influxdb
- Inputs
datasource_uid
– Grafana UID of the InfluxDB datasourcequery
– raw query textstart
,end
– RFC 3339 or epoch timestamps; omit both for an instant querydialect
– one ofsql
(default),flux
, orinfluxql
- Behaviour
- Build a payload for Grafana’s
/api/ds/query
, mappingquery
intorawSql
,queryText
, or the InfluxQL field according todialect
. - Forward the request unchanged.
- Return the response JSON exactly as received (same pattern as
query_prometheus
andquery_loki_logs
).
- Build a payload for Grafana’s
- Inputs
Motivation
- Removes boilerplate for both self-hosted and cloud InfluxDB users.
- Keeps the tool signature consistent with existing datasource helpers.
- Supports all three InfluxDB query languages without breaking older setups.
Please let me know if this aligns with the roadmap. I'll be happy to contribute.
Metadata
Metadata
Assignees
Labels
No labels