An assistant that cannot see your label schema writes LogQL that returns nothing, and no error explains why — get_labels and get_label_values close that gap. The fallback from the command-line client to the HTTP API means the server works in a container where that client was never installed, without a second configuration path to maintain.
An MCP server over Grafana Loki. It shells out to the Loki command-line client when that is available and falls back to Loki's HTTP API when it is not, using the same connection settings either way.
- query_loki — a LogQL query with a time range, a result limit, a batch size, an output format and chronological ordering
- get_labels — every label the Loki instance exposes
- get_label_values — every value for one label, so a query can be built from what actually exists
- Results formatted the same way whether the command-line client or the HTTP API served them
Node, and access to a Loki instance whose address you configure. The Loki command-line client is optional. Basic auth, bearer tokens, tenant and organisation IDs and client TLS certificates are all supported, through your client config or a config file the Loki client already reads.
One command — npx -y @smithery/cli install @ghrud92/simple-loki-mcp --client claude
