Labsco
MCP SERVER

Simple Loki MCP Server

by ghrud92

Run LogQL against Grafana Loki from the assistant, and discover the labels first if you do not know them.

Observability, Monitoring & Incident ResponseVerified
Summary
The discovery calls are what make a LogQL query writable, not just runnable.

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.

What it is

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.

What you get
  • 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
Requirements

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.

Setup effort

One command — npx -y @smithery/cli install @ghrud92/simple-loki-mcp --client claude